[misc.legal] Assembly debugging in dbx

dror@infmx.UUCP (Dror Matalon) (02/02/89)

	How does one specify the last  assembly level location displayed in 
dbx ?
    In adb the dot - "." does it. When I want to dissassemble 10 instructions
from the last location  displayed I do:
.,10?ia

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".

    Any pointers will be apreciated,

	Dror

	

tm@pitstop.UUCP (Takis Mercouris) (02/03/89)

In article <836@infmx.UUCP> dror@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@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@sunbird.Sun.COM