* assembly editing in GDB
@ 2002-08-05 23:23 Vinayak P Risbud
2002-08-06 6:11 ` Daniel Jacobowitz
2002-08-06 6:28 ` Carlos O'Donell
0 siblings, 2 replies; 4+ messages in thread
From: Vinayak P Risbud @ 2002-08-05 23:23 UTC (permalink / raw)
To: gdb
Can I run and debug, an assembly program in GDB ?
If yes, how can I edit and write the assembly program
in GDB ?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: assembly editing in GDB
2002-08-05 23:23 assembly editing in GDB Vinayak P Risbud
@ 2002-08-06 6:11 ` Daniel Jacobowitz
2002-08-06 7:01 ` William A. Gatliff
2002-08-06 6:28 ` Carlos O'Donell
1 sibling, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2002-08-06 6:11 UTC (permalink / raw)
To: Vinayak P Risbud; +Cc: 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 ?
Sure.
> If yes, how can I edit and write the assembly program
> in GDB ?
You can't. GDB does not have any support for editing or assembling
code. You compile the assembly as normal; if you're using the GNU
tools you can use "gcc -g" and it will generally arrange to put
line-number information in the object module.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: assembly editing in GDB
2002-08-05 23:23 assembly editing in GDB Vinayak P Risbud
2002-08-06 6:11 ` Daniel Jacobowitz
@ 2002-08-06 6:28 ` Carlos O'Donell
1 sibling, 0 replies; 4+ messages in thread
From: Carlos O'Donell @ 2002-08-06 6:28 UTC (permalink / raw)
To: Vinayak P Risbud; +Cc: 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: assembly editing in GDB
2002-08-06 6:11 ` Daniel Jacobowitz
@ 2002-08-06 7:01 ` William A. Gatliff
0 siblings, 0 replies; 4+ messages in thread
From: William A. Gatliff @ 2002-08-06 7:01 UTC (permalink / raw)
To: Vinayak P Risbud, gdb
One other thing: if you do this:
(gdb) display/i $pc
then gdb will actually show the asm instruction it's about to run. :^)
b.g.
As On Tue, Aug 06, 2002 at 09:11:01AM -0400, Daniel Jacobowitz wrote:
> On Tue, Aug 06, 2002 at 11:52:46AM +0530, Vinayak P Risbud wrote:
> > Can I run and debug, an assembly program in GDB ?
>
> Sure.
>
> > If yes, how can I edit and write the assembly program
> > in GDB ?
>
> You can't. GDB does not have any support for editing or assembling
> code. You compile the assembly as normal; if you're using the GNU
> tools you can use "gcc -g" and it will generally arrange to put
> line-number information in the object module.
>
> --
> Daniel Jacobowitz Carnegie Mellon University
> MontaVista Software Debian GNU/Linux Developer
--
Bill Gatliff
bgat@billgatliff.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-08-06 14:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-05 23:23 assembly editing in GDB Vinayak P Risbud
2002-08-06 6:11 ` Daniel Jacobowitz
2002-08-06 7:01 ` William A. Gatliff
2002-08-06 6:28 ` Carlos O'Donell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox