Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-02

Post-Mortem Debugging

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

I've just forced a core dump of a misbehaving multithreaded program and am looking at it using gdb to good effect.

Can Lazarus be used as a post-mortem debugger, reminiscent of products from Logitech et al?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Martin Frb
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 6 lines
I've just forced a core dump of a misbehaving multithreaded program and am looking at it using gdb to good effect. Can Lazarus be used as a post-mortem debugger, reminiscent of products from Logitech et al?

probably not without changes.

I havent used gdb for this either, so I am not aware which commands you can send to gdb.

I guess that the code used for "attach" can be copied/modified to load a core dump.

then you might be able do use the stack, and watches. but I do not know

Reply by email

Mark Morgan Lloyd
to Martin Frb
Martin Frb wrote 16 lines
On 26/02/15 19:52, Mark Morgan Lloyd wrote: > I've just forced a core dump of a misbehaving multithreaded program > and am looking at it using gdb to good effect. > > Can Lazarus be used as a post-mortem debugger, reminiscent of products > from Logitech et al? > probably not without changes. I havent used gdb for this either, so I am not aware which commands you can send to gdb. I guess that the code used for "attach" can be copied/modified to load a core dump. then you might be able do use the stack, and watches. but I do not know

In this case all I did was (before running program) ulimit -Hc unlimited followed by (while looking at stuck program) gcore <pid> and then gdb <binary> core.<pid> after which I could use bt etc. In principle, something similar should work for a program which had failed with a bus error or segment violation.

I'm converting somebody else's code from single- to multithreaded. If run in the context of Lazarus's own debugging it's fine, but if running "unattended" it locks up with a race condition about 75% of the time. So being able to look at a snapshot is really extremely useful, even if I can't take full control.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email