Forum > Debugger

Can I find the relevant code by address?

(1/2) > >>

jollytall:
I have a program running. It was compiled with optimization and no debugger help at all. After running for quite long, it crashed with an Excess Violation and giving a hex address.
Is there a way to find where it crashed? I am thinking to recompile again with debug and find the code then.
1. Would the address be the same, or because of the debug information added, it will have different (shifted) addresses, i.e. useless.
2. Even if it is shifted, I can try to compile with debug, run it again and "hope" that once it will crash at the same place. If that happens, how can I find the source line, based on the address?
3. Is there a better way?

howardpc:

--- Quote from: jollytall on January 20, 2022, 08:24:43 am ---1. Would the address be the same, or because of the debug information added, it will have different (shifted) addresses, i.e. useless.

--- End quote ---
You can compile with -Xg to ensure that debug information is written to an external debug symbols file.

bytebites:
Compile with optimization and line info.

Thaddy:

--- Quote from: bytebites on January 20, 2022, 09:56:57 am ---Compile with optimization and line info.

--- End quote ---
I guess you mean without optimization and with line nfo (-O- -glh)?

bytebites:

--- Quote from: Thaddy on January 20, 2022, 11:18:44 am ---
--- Quote from: bytebites on January 20, 2022, 09:56:57 am ---Compile with optimization and line info.

--- End quote ---
I guess you mean without optimization and with line nfo (-O- -glh)?
[/quote

-O3 -gl
--- End quote ---

Navigation

[0] Message Index

[#] Next page

Go to full version