Gdb without gcc

Is it possible to run GDB with a program built using asand related to ld? C gccadding a flag -gallows you to debug, but I get an error No symbol table is loaded. Use the "file" commandwhen I try to add breakpoints to a loaded program.

Thank!

EDIT Perhaps I should clearly indicate that I am learning and programming assembly. All I really need is a stack trace, but the ability to use GDB will be great.

Running permissionas -g does the trick.

Thanks to all who responded!!

+3
source share
4 answers

. , , ; , . GNU as as -g. gcc -g: .s, .

GDB : stabs, COFF, PE, DWARF, . ( , - , , , ELF.) gcc -g , , gcc -ggdb ( , , DWARF-3).

, , gdb . , file, gdb, .

. , break *0x89abcdef, , - .

+5

as -gdwarf-2 -g , ld -strip-debug makefile/install ,

+3

, , , . GDB , .

+2
source

Unless you have a character table, you cannot set breakpoints symbolically (by function name, line of code, etc.). You can still set a breakpoint for a specific address if you know the address you are trying to stop.

gdb>  b 0x12345678

Of course, this is only useful if you know you want to stop at 0x12345678

What does fileyour executable say ?

+1
source

Source: https://habr.com/ru/post/1729514/


All Articles