This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: assembly editing in GDB
- From: Carlos O'Donell <carlos at baldric dot uwo dot ca>
- To: Vinayak P Risbud <vinayak at multitech dot co dot in>
- Cc: gdb <gdb at sources dot redhat dot com>
- Date: Tue, 6 Aug 2002 09:26:59 -0400
- Subject: Re: assembly editing in GDB
- References: <3D4F6B35.A5D0AA07@multitech.co.in>
On Tue, Aug 06, 2002 at 11:52:46AM +0530, Vinayak P Risbud wrote:
> Can I run and debug, an assembly program in GDB ?
> If yes, how can I edit and write the assembly program
> in GDB ?
GDB is a debugger not an editor :}
Assembly programs can definately be debug'd in gdb.
Just start it up as you would with any other program,
and start putting break points at addresses instead of
source lines.
# gdb hello
> break main
> r
...
> disassemble
And if you want to _edit_ it while running you need to
use 'set write on' (before loading) and then 'file hello'.
Check out all the variations of break, since you will have
to feed it addresses for code that doesn't have debug info.
I really really really recommend reading all the material
at: http://sources.redhat.com/gdb/documentation/
c.