Date: Mon, 12 Jan 98 12:49:23 EST From: luoqi@watermarkgroup.com (Luoqi Chen) To: current@freebsd.org Subject: gdb addressing off by 0x20 Message-ID: <9801121749.AA19967@watermarkgroup.com>
next in thread | raw e-mail | index | archive | help
Did anyone else notice this? When I debug a program with gdb, I have to specify
x+0x20 if I want to get data at address x. For example
% gdb /bin/sh
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i386-unknown-freebsd),
Copyright 1996 Free Software Foundation, Inc...(no debugging symbols found)...
(gdb) info target
Symbols from "/bin/sh".
Local exec file:
`/bin/sh', file type a.out-i386-freebsd.
Entry point: 0x1020
0x00001020 - 0x0004a020 is .text
0x0004b000 - 0x0004e000 is .data
0x0004e000 - 0x000565d0 is .bss
Did anyone else notice this? When I debug a program with gdb, I have to specify
x+0x20 if I want to get data at address x. For example,
% gdb /bin/sh
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i386-unknown-freebsd),
Copyright 1996 Free Software Foundation, Inc...(no debugging symbols found)...
(gdb) info target
Symbols from "/bin/sh".
Local exec file:
`/bin/sh', file type a.out-i386-freebsd.
Entry point: 0x1020
0x00001020 - 0x0004a020 is .text
0x0004b000 - 0x0004e000 is .data
Copyright 1996 Free Software Foundation, Inc...(no debugging symbols found)...
(gdb) info target
Symbols from "/bin/sh".
Local exec file:
`/bin/sh', file type a.out-i386-freebsd.
Entry point: 0x1020
0x1029: xorb %al,(%eax)
0x102b: addb %dl,%al
0x102d: testl %eax,(%eax)
0x102f: addb %al,(%eax)
0x1031: addb %al,(%eax)
0x1033: addb %ah,(%eax)
0x1035: adcb %al,(%eax)
(gdb) x/10i 0x1040
0x1040: pushl %ebp
0x1041: movl %esp,%ebp
0x1043: pushl %esi
0x1044: pushl %ebx
0x1045: leal 0x4(%ebp),%ebx
0x1048: leal 0x4(%ebx),%ecx
0x104b: leal 0x8(%ebx),%edx
0x104e: cmpl $0x0,0x4(%ebx)
0x1052: je 0x105d
0x1054: movl (%edx),%eax
I am running world cvsupped on Sat(1/10) morning. Actually, I noticed the
problem earlier, I suspected it might be caused by inconsistent header
files. So I did a clean make world, but the problem didn't go away.
-lq
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9801121749.AA19967>
