This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: assembly editing in GDB


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]