[Lazarus] Gdb and openocd via lazarus

Koenraad Lelong lazarus2 at de-brouwerij.be
Wed May 28 12:36:57 CEST 2014


op 21-05-14 20:17, Martin Schreiber schreef:

>
> In MSEide the procedure is as follows - I assume same as in Lazarus:
> In 'Start gdb server command run target' write the command or script which
> starts the OpenOCD gdb proxy server (I don't know the command).
> Set 'Wait before connect' to the GDB server startup time + some reserve.
> 'Target connection' = remote localhost:3333
>
> Activate 'gdb download' then MSEide will use the gdb "load" command for
> program download.
>
> I suggest to make first a minimal C-program with the gcc toolchain of your
> target. If that works the FPC adventure can start. ;-)
>
> Martin
>
Hi,

I tried to debug my arm-board with MSEide.
I manually started openocd (I need to be root). I configured MSEide 
debugger : Target connection : extended-remote localhost:3333.
I configured debug-target to the elf-file of my project. Is there a 
macro to add an extention to the "make-output-file" ?
I compiled the project and manually flashed it, and I left it in reset halt.
I then can attach to the target, I see gdb connecting to openocd. I get 
the proper source in the source window. I can start the project, but 
since there seems still a problem with the compile-fase (the resulting 
binary does not work properly) I tried to reset the board. There gdb 
drops the connection to the target.

When I set a breakpoint, the target halts, but MSEide does not indicate 
in the source where it stops. I can step, but again MSEide does not 
follow in the source.

I can "continue" the target and stop it. But when I stop it, no 
indication where in the source it stopped.

So progress, but not there yet. Or maybe I'm doing things wrong ?

I still need to find why the binary is not good. When I compile the 
project via cli, it's working. From within MSEide, it does not work, 
although the command-line is the same as my manual command-line. I will 
add -va again and compare the outputs.

Koenraad.




More information about the Lazarus mailing list