Discussion:
how to use gdb on a .bin file?
(too old to reply)
bilsch01
2019-09-19 16:56:32 UTC
Permalink
I stepped away from programming for about 2 years and don't recognize
things I did. Mostly I compiled .asm files into .bin files and load and
jump to them from the boot sector. I cant get gdb to handle a .bin file
- it says it's not executable format.
Jens Kallup
2019-09-19 17:19:14 UTC
Permalink
Hello,

You can inject your bin file in a common .o
file by reading the .bin file byte to byte into .c file.
Then you can compile the .c file: gcc -o -g foo.o foo.c
And then, you can debug it with: gdb foo.o

Cheers
Jens
bilsch01
2019-09-19 18:17:34 UTC
Permalink
Post by Jens Kallup
Hello,
You can inject your bin file in a common .o
file by reading the .bin file byte to byte into .c file.
Then you can compile the .c file: gcc -o -g foo.o foo.c
And then, you can debug it with: gdb foo.o
Cheers
Jens
maybe gdb is the wrong tool. What is the debugger I should use? My os
is ubuntu with gnome. I'm using nasm.

Loading...