1

i'm tryin to debug (actually i just want to understand the program on assembly level) a program. Usin gdb is ok but in tui mode it would be just great, unfortunately i get an error when i'm debuggin in tui while displaying the assembly and source code (-g option in gcc) mode sayin: error while reading shared library symbols

I can run the program if i do not show the assembly code but that is not what i want, i really want to step through every assembly line to fully understand the program. Also, when i try this with si sometimes i get an error for example in printf but that's another story

so any tips? Note:this is not a bug of my program, i tried this with other programs

1 Answer 1

2

Your shared libraries were not compiled with symbols enabled. You need to look for, usually, "debug" versions of gcc libraries (or your other libraries that you are linking against). If you have custom libraries that you are building, add the -g option to the gcc commands that are being run to compile them.

Sign up to request clarification or add additional context in comments.

7 Comments

And what if i only want the shared libraries at assembly level? Do is still need the debug versions? Thanks
You CAN, but it gets really ugly; you would need to break inside of main() and then use "si" command to step through the instructions you will need to use disass ALOT once you get into the shared libraries though.
Got a problem with si when in fopen for example. In the third instruction (jmp 0x80483dc) si fails. What am i doin wrong?
disass command first or what?I get: No function contains program counter for selected frame: Error when i use si on jmp 0x80483dc
Disass just shows the current execution stack. I'm not fully aware of why jmp would fail with si execution.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.