[Lazarus] Printing BitMap on OSX crashes

Martin Frb lazarus at mfriebe.de
Sun Aug 2 22:05:26 CEST 2015


On 02/08/2015 20:20, Martin Grajcar wrote:
>
> Maybe you can help me with this: How can I get the debugger 
> (lazarus/gdb) show the C code? All I get for the innermost frames is 
> an address and assembler. No idea what to install (and Google really 
> didn't help).
>
I dont know if that is possible at all.  If it is, its gonna be tricky.

First of all:
The c code must be compiled with the same debug info (stabs or dwarf) as 
the pascal code.

I haven't followed the thread, so I do not know if the c code is in a 
library (dynamically loaded) or linked into the exe.
If linked then the debug info must have been included by the linker. If 
in an library it must be in such a way gdb can load it(gdb should be 
able to load debug info for libraries, but I do not know the state of 
this for each platform).
If in a library then "DisableLoadSymbolsForLibraries" MUST NOT (is not 
allowed to) be set.
( 
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#internal-error:_clear_dangling_display_expressions 
)

If all the above is given, then the IDE must know where the files are 
(probably need to add the to the project). Debug info does not include 
the source, it just has filename and line number.

-----------
you can watch gdb communications in the debug output window (view > 
debug windows). So you can see what gdb responds.

Also. if you open the disassembler and single step into the c code, I 
would *expect* (never tested) that the stack window shows filenames. If 
it does not, then the debug info is either not there, or not read by gdb.

--------
On top of that you can try to control gdb yourself. You can do this from 
the IDE.
** BUT ** This is not an official feature and never will be. This solely 
exists for developing/testing the debugger integration in the IDE (for 
Lazarus developers).
It exists as it is, no feature requests, no bug reports...

Also, it has no safeguards. It is easy to hang the entire IDE by using 
it (only when sending commands to gdb). So ensure everything is saved.

Compile the ide with   DBG_WITH_DEBUGGER_DEBUG  defined.

Restart the IDE, Open debug output window (view > debug windows). There 
is an edit field and a button (must press button, return does not work). 
You can send gdb commands.

Do not send any commands that perform run/step. This will loose the 
debug session.




More information about the Lazarus mailing list