Using GDB to debug a program assembled with NASM
From: Joshua Davies (spamtrap_at_crayne.org)
Date: 11/01/04
- Next message: Robert Redelmeier: "Re: Using GDB to debug a program assembled with NASM"
- Previous message: Jim Leonard: "Woz range check code explanation?"
- Next in thread: Robert Redelmeier: "Re: Using GDB to debug a program assembled with NASM"
- Reply: Robert Redelmeier: "Re: Using GDB to debug a program assembled with NASM"
- Reply: Frank Kotler : "Re: Using GDB to debug a program assembled with NASM"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 1 Nov 2004 21:56:39 +0000 (UTC)
Hi, I'm new to assembler programming - NASM seems to be a natural
choice for assembler programming under Linux, but I'm having trouble
getting GDB to debug my apps. If I have the following file named
sample.asm:
section .text
global _start
_start:
mov eax, 1
add eax, 5
mov ebx, 0 ; return code
mov eax, 1 ; syscall 'exit'
int 0x80
and assemble it with:
$ nasm -f elf -g sample.asm
$ ld sample.o
I can run the resulting a.out just fine. I'd like to step through it
with a debugger, but when I load it with gdb, it won't let me
single-step:
$ gdb a.out
(gdb) break _start
Breakpoint 1 at 0x8048080: file sample.asm, line 6.
(gdb) set step-mode on
(gdb) r
Starting program: a.out
Program exited normally.
(gdb)
It seems to set the breakpoint (I don't get an error message), but it
doesn't stop - it just runs through the whole program. I've tried it
with step-mode on & off (the default) with no luck. Can anybody see
what I'm missing?
- Next message: Robert Redelmeier: "Re: Using GDB to debug a program assembled with NASM"
- Previous message: Jim Leonard: "Woz range check code explanation?"
- Next in thread: Robert Redelmeier: "Re: Using GDB to debug a program assembled with NASM"
- Reply: Robert Redelmeier: "Re: Using GDB to debug a program assembled with NASM"
- Reply: Frank Kotler : "Re: Using GDB to debug a program assembled with NASM"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|