Assembly debugging in dbx

Takis Mercouris tm at pitstop.UUCP
Fri Feb 3 04:47:15 AEST 1989


In article <836 at infmx.UUCP> dror at infmx.UUCP (Dror Matalon) writes:
>
>	How does one specify the last  assembly level location displayed in 
>dbx ?
>
> .....stuff deleted....
>
>In dbx the following prints the 10 instructions from the current location:
>(*(&$pc))/10i
>but I don't know of a way to display an additional 10 instructions.
>
>    According to the dbx Man pages:
>
>     address / [count ] [ mode ]
>            Display the contents of memory starting at the  first
>            (or  current)  address  up  to the second address, or
>            until count items have been  displayed.  If no address is
>	    specified, the address following the one displayed most 
>	    recently is used.
>
>so it seems like /10i should do it. Unfortunatly dbx interprets / as the 
>search command and looks for the string "10i".
>	

I have included a sample dbx session to show how I display assembly
instructions starting from an address other than the current one.

-takis
tm at sunbird.Sun.COM

-------

Script started on Thu Feb  2 12:40:23 1989
dbx foo
Reading symbolic information...
Read 51 symbols
(dbx) stop in main
(1) stop in main
(dbx) run
Running: foo 
stopped in main at line 11 in file "foo.c"
   11       i=10;
(dbx) (*(&$pc))/8i
main+0xe:               movl    #0xa,a6@(-4)
main+0x16:              movl    #0x14,a6@(-4)
main+0x1e:              movl    #0x1e,a6@(-4)
main+0x26:              movl    #0x28,a6@(-4)
main+0x2e:              movl    #0x32,a6@(-4)
main+0x36:              movl    #0x3c,a6@(-4)
main+0x3e:              movl    #0x46,a6@(-4)
main+0x46:              movl    #0x50,a6@(-4)
(dbx) &main+0x2e/8i
main+0x2e:              movl    #0x32,a6@(-4)
main+0x36:              movl    #0x3c,a6@(-4)
main+0x3e:              movl    #0x46,a6@(-4)
main+0x46:              movl    #0x50,a6@(-4)
main+0x4e:              movl    #0x5a,a6@(-4)
main+0x56:              moveq   #0x0,d0
main+0x58:              unlk    a6
main+0x5a:              rts
(dbx) quit
CNTRL-D
script done on Thu Feb  2 12:41:50 1989
-------
-- 

--------------------
Takis Mercouris
tm at sunbird.Sun.COM



More information about the Comp.unix.wizards mailing list