Lazarus

Using the Lazarus IDE => Debugger => Topic started by: scribly on June 09, 2018, 08:37:50 pm

Title: Instruction pointer to sourcecode
Post by: scribly on June 09, 2018, 08:37:50 pm
Some of my users has given me a dumpfile which a stacktrace and instruction pointers

my program was compiled with an external .DBG file. How can I convert these addresses into sourcecode filenames and their linenumber ?

Edit: I ended up using gdb and in there use
Code: [Select]
info line *ip
Title: Re: Instruction pointer to sourcecode
Post by: Martin_fr on June 09, 2018, 09:23:52 pm
You can also try to use "leaktrace". Its a package you install in the IDE (it is included in the installer, just need to add the package)

Open your project
Then in menu: Viev > Leaks and traces
Paste or load the stacktrace
Press resolve, and open the exe of your app (the same exe you shipped, but with the dbg file in the same folder)

I never tested it with dbg files. But if you keep an exe with debug info, and make a copy, strip the copy and release the stripped copy, then that works.

Title: Re: Instruction pointer to sourcecode
Post by: Thaddy on June 09, 2018, 10:54:55 pm
Although I see your problem, it is never a good idea if your customer is able to obtain a stack-trace unless you want them to.
Maybe just give them a full debug version - for testing , never production - and then analyze....
Martin's suggestion is also - somewhat - OK. I would not accept that, though. Crash is back to lab or to customer's location.
Title: Re: Instruction pointer to sourcecode
Post by: scribly on June 10, 2018, 09:31:51 am
He used the windows dump file it generates on crash.  And it was caused because he used an external application to 'nop' out some initialization code (Hoping that i'd put a check if nil on every single access to something I assume is never nil)

So yeah, that wasted some time