When using Lazarus IDE, it sometimes fails with various exceptions. In order to debug, or at least identify the source of the problems I need additional info, such as stack trace.
Is there an easy method to get that on Windows?
The way I like best is to expand exception dialog with additional "Get stack dump" button,
but maybe something like that is already implemented?
Mailing lists / lazarus / 2008-10
IDE exceptions: how to get stack trace on Windows?
6 messages · 2 people ·
- AAlexander Klenin 3
- BBogusław Brandys 3
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Alexander Klenin pisze:
Show quoted text 8 lines
Use command line switch like :
lazarus.exe --debug-log=debug.log (or other filename)
or rebuild lazarus IDe with console window enabled
or E:\projekty\flamenco\program\bin\flamenco.exe --debug-log=debug.log
Plenty of options.
Additionally (guessing here ) there is possibility to add TApplication.OnException handler into lazarus IDE lpr and catch most of exceptions here.Nice idea.
Boguslaw
Bogus?aw Brandys pisze:
Show quoted text 16 lines
Sorry.Incorrect paste.Should be :
http://wiki.lazarus.freepascal.org/Creating_a_Backtrace_with_GDB
Show quoted text 12 lines
Alexander Klenin pisze: Use command line switch like : lazarus.exe --debug-log=debug.log …
Bogus?aw Brandys wroteUse command line switch like : lazarus.exe --debug-log=debug.log (or other filename)
Already tried that. Unfortunately, backtrace is not written into the log file.
Plenty of options.
Tried using GDB too, that of course works, but is very inconvenient. I ended up with running
gdb --command=C:\lazarus\run.gdb C:\lazarus\lazarus.exe where run.gdb contains:
cd c:\lazarus
break fpc_raiseexception
commands
bt
cont
end
set logging on
run
So when I get exception in lazarus, it does not freeze, but displays usual exception dialog, while backtrace gets written silently to C:\lazarus\gdb.txt file. Still I think integrated feature would be better.
TApplication.OnException handler into lazarus IDE lpr and catch most of exceptions here.Nice idea.
Yes, I was hoping there is already some hidden option for that ;-)
Alexander Klenin wroteTried using GDB too, that of course works, but is very inconvenient.
For example, pressing F12 to show form designer leads to a SIGTRAP when lazarus is run under the gdb.
Does anyone know why it does so and how to avoid it?
Alexander Klenin pisze:
Show quoted text 8 lines
Well,what gdb version are you using ? I hope not based on cygwin ? Anyway using --debug-log or just --debug command line switch or rebuild with win32 console enabled is better choice.However gdb is very good in resolving strange but narrow described problems IMHO. Running IDE under gdb may be unstable because gdb does not know all Object pascal structures.
Regards
Boguslaw
