From owner-FreeBSD-users-jp@jp.freebsd.org  Fri Oct 17 20:04:52 1997
Received: by jaz.jp.freebsd.org (8.8.7+2.7Wbeta7/8.7.3) id UAA13237
	Fri, 17 Oct 1997 20:04:52 +0900 (JST)
Received: by jaz.jp.freebsd.org (8.8.7+2.7Wbeta7/8.7.3) with SMTP id UAA13227
	for <freebsd-users-jp@jp.freebsd.org>; Fri, 17 Oct 1997 20:04:49 +0900 (JST)
Received: by vcgate3.mei.co.jp (8.6.10h/5.9:4.9:vcgate01:971002)
	id UAA14541; Fri, 17 Oct 1997 20:03:35 +0900
Received: by vcmei.vanc.mei.co.jp (8.8.7/5.9:4.9:vcmei:971009)
	id UAA22239; Fri, 17 Oct 1997 20:03:43 +0900 (JST)
Received: from srdserv.srd.mci.mei.co.jp by postman.mci.mei.co.jp (8.8.7+2.7Wb7/3.6Wb7:mcihub1:97100818)
	id UAA20750; Fri, 17 Oct 1997 20:03:30 +0900 (JST)
Received: from srdss5-8.srd.mci.mei.co.jp (root@srdss5-8 [133.185.160.214]) by srdserv.srd.mci.mei.co.jp (8.8.5/3.4W97022809) with SMTP id UAA02561 for <freebsd-users-jp@jp.freebsd.org>; Fri, 17 Oct 1997 20:02:19 +0900 (JST)
Received: by srdss5-8.srd.mci.mei.co.jp (4.1/5.5:4.6:srd-mci-mei-co-jp:950222)
	id AA03072; Fri, 17 Oct 97 20:02:21 JST
Message-Id: <9710171102.AA03072@srdss5-8.srd.mci.mei.co.jp>
To: FreeBSD-users-jp@jp.freebsd.org
From: =?ISO-2022-JP?B?GyRCQG5CPDc9O0obKEI=?=  Keiji KAWAMURA <kawamura@srd.mci.mei.co.jp>
In-Reply-To: Your message of "Fri, 17 Oct 1997 19:49:13 +0900"
References: <199710171049.TAA03305@kumando.lp.nm.fujitsu.co.jp>
X-Mailer: Mew version 1.01 on Emacs 19.28.1, Mule 2.3
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-2022-jp
Date: Fri, 17 Oct 1997 20:02:20 +0900
Reply-To: FreeBSD-users-jp@jp.freebsd.org
Precedence: bulk
X-Distribute: distribute [version 2.1 (Alpha) patchlevel=20]
X-Sequence: FreeBSD-users-jp 19430
Subject: [FreeBSD-users-jp 19430] Re: gdb, disas command
Errors-To: owner-FreeBSD-users-jp@jp.freebsd.org
Sender: owner-FreeBSD-users-jp@jp.freebsd.org

$B$+$o$`$i$G$9(B.

>>>>> ">" == TANAKA Keishiro <ksr@lp.nm.fujitsu.co.jp> writes:
 >> $B$?$J$+$G$9!#(B

 >> cc -g$B$J$7$G%3%s%Q%$%k$7$?<B9T%U%!%$%k$K$D$$$F!"(B
 >> $B%$%s%9%H%i%/%7%g%s%l%Y%k$G$N%G%P%C%0$r$7$?$$$N$G$9$,!"(B
 >> disas$B%3%^%s%I$,8z$-$^$;$s!#(B

 >> (gdb) disas
 >> No function contains program counter for selected frame.

 >> $B$H$J$j$^$9!#2?$+$&$^$$2sHrJ}K!$O$"$j$^$9$+!#(B

$B!t0zMQ$NA4$/$J$$(B reply $B$O$b$H$b$H$N<ALd$,$J$s$@$C$?$+$o$+$i$J$/$J$j$^$9$h$M(B.

 >> gdb$B$N(Bdisas$B%3%^%s%I$K$O!"(Bdisas $B%"%I%l%9(B $B%l%s%8$H$$$&J8K!$b$"$k$h$&$J$N(B
 >> $B$G$3$l$b;n$7$F$_$^$7$?$,!"(B

 >> (gdb) disas main 100
 >> Dump of assembler code from 0x1580 to 0x64.
 >> End of assembler dump.
 >> (gdb) quit

 >> $B$H$$$&$0$"$$$G$9!#(B

$B$G(B,$B$$$C$?$$$I$&$7$?$$$N$+$h$/$o$+$j$^$;$s$,(B, gdb $B$N(B info $B$K$h$k$H(B

-----------------------------------------------------------------------------
`disassemble'
     This specialized command dumps a range of memory as machine
     instructions.  The default memory range is the function
     surrounding the program counter of the selected frame.  A single
     argument to this command is a program counter value; GDB dumps the
     function surrounding this value.  Two arguments specify a range of
     addresses (first inclusive, second exclusive) to dump.

   We can use `disassemble' to inspect the object code range shown in
the last `info line' example (the example shows SPARC machine
instructions):

     (gdb) disas 0x63e4 0x6404
     Dump of assembler code from 0x63e4 to 0x6404:
     0x63e4 <builtin_init+5340>:     ble 0x63f8 <builtin_init+5360>
     0x63e8 <builtin_init+5344>:     sethi %hi(0x4c00), %o0
     0x63ec <builtin_init+5348>:     ld [%i1+4], %o0
     0x63f0 <builtin_init+5352>:     b 0x63fc <builtin_init+5364>
     0x63f4 <builtin_init+5356>:     ld [%o0+4], %o0
     0x63f8 <builtin_init+5360>:     or %o0, 0x1a4, %o0
     0x63fc <builtin_init+5364>:     call 0x9288 <path_search>
     0x6400 <builtin_init+5368>:     nop
     End of assembler dump.
-----------------------------------------------------------------------------

$B$H$$$&$3$H$G$9$+$i(B,

 (gdb) disas main main+100

$B$G$&$^$/$$$-$^$;$s$+(B?.

/* @(#) ($B3t(B) $B>>2<DL?.@gBf8&5f=j(B                *
 *                 $B3+H/(B4$B2](B 2G   $B@nB<(B $B7=;J(B      *
 *    E-mail: kawamura@srd.mci.mei.co.jp       *
 *            BYN01025@niftyserve.or.jp        */
