

Debian bug report logs - #660 , boring messages

-----------------------------------------------------------------------

Message sent to debian-devel@pixar.com:


Subject: Bug#660: GDB gets address of structure member wrong in memory 
breakpoint
Reply-To: iwj10@cus.cam.ac.uk (Ian Jackson), debian-bugs@pixar.com
Resent-To: debian-devel@pixar.com
Resent-From: iwj10@cus.cam.ac.uk (Ian Jackson)
Resent-Sender: iwj10@cus.cam.ac.uk
Resent-Date: Mon, 27 Mar 1995 15:33:04 GMT
Resent-Message-ID: <debian-bugs-handler.660.03271520383803@pixar.com>
X-Debian-PR-Package: gdb
X-Debian-PR-Keywords: 
Received: via spool for debian-bugs; Mon, 27 Mar 1995 15:33:04 GMT
Received: with rfc822 via encapsulated-mail id 03271520383803;
          Mon, 27 Mar 1995 15:20:40 GMT
Received: from pixar.com by mongo.pixar.com with smtp
        (Smail3.1.28.1 #15) id m0rtGVT-0006USC; Mon, 27 Mar 95 07:15 PST
Received: from bootes.cus.cam.ac.uk by pixar.com with SMTP id AA14255
  (5.65c/IDA-1.4.4 for <debian-bugs@pixar.com>); Mon, 27 Mar 1995 
07:09:41 -0800
Received: by bootes.cus.cam.ac.uk
        (Smail-3.1.29.0 #30) id m0rtFaj-000BzvC; Mon, 27 Mar 95 15:16 
BST
Received: by chiark (Smail3.1.28.1 #3)
        id m0rtE8u-0002gOZ; Mon, 27 Mar 95 13:43 BST
Message-Id: <m0rtE8u-0002gOZ.ijackson@nyx.cs.du.edu>
Date: Mon, 27 Mar 95 13:43 BST
From: iwj10@cus.cam.ac.uk (Ian Jackson)
To: Debian bugs submission address <debian-bugs@pixar.com>

Package: gdb
Version: 4.12

As you can see below, when setting a memory breakpoint on a structure
member GDB uses the address of the start of the structure by mistake.
Applying *& to the member (to take its address and then dereference
it) gives correct results.

chiark:~/junk> cat t.c
struct foo { int a,b; };

void fong(struct foo *p, int x) { p->b=x; }

int main(int argc, char **argv) {
  struct foo f;
  f.a= 2;
  f.b= 3;
  fong(&f,4);
  f.b=5;
  fong(&f,6);
}
chiark:~/junk> gcc -g t.c
chiark:~/junk> /new/usr/bin/gdb a.out
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.12 (i486-debian-linux), Copyright 1994 Free Software Foundation, 
Inc...
(gdb) break main
Breakpoint 1 at 0x6f: file t.c, line 7.
(gdb) run
Starting program: /u/ian/junk/a.out

Breakpoint 1, main (argc=1, argv=0xbffff978) at t.c:7
7         f.a= 2;
(gdb) step
8         f.b= 3;
(gdb) step
9         fong(&f,4);
(gdb) print f
$1 = {a = 2, b = 3}
(gdb) abreak f.b
Memorypoint 2: f.b
(gdb) abreak f.a
Memorypoint 3: f.a
(gdb) abreak *&f.b
Memorypoint 4: *&f.b
(gdb) info memory
Num Type           Disp Enb Address    What
2   memorypoint    keep y   0xbffff95c  r/w  4   f.b
3   memorypoint    keep y   0xbffff95c  r/w  4   f.a
4   memorypoint    keep y   0xbffff960  r/w  4   *&f.b
(gdb) cont
Continuing.

Memory breakpoint 4 on *&f.b at 0xbffff960 with length 4: accessed.
3       void fong(struct foo *p, int x) { p->b=x; }
(gdb) disable 4
(gdb) cont
Continuing.

Memory breakpoint 2 on f.b at 0xbffff95c with length 4: accessed.
0x224   exit.c:38: No such file or directory.
(gdb) where
#0  0x224 in exit (status=-1073743524) at exit.c:38
(gdb) quit
The program is running.  Quit anyway (and kill it)? (y or n) y
chiark:~/junk> gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/2.5.8/specs
gcc version 2.5.8
chiark:~/junk> gcc -c -g t.c
chiark:~/junk> nm -a t.o
00000000 - 00 0003 SLINE
00000003 - 00 0003 SLINE
0000000c - 00 0003 SLINE
00000010 - 00 0005 SLINE
0000001b - 00 0006 SLINE
0000001b - 00 0007 SLINE
00000022 - 00 0008 SLINE
00000029 - 00 0009 SLINE
00000037 - 00 000a SLINE
0000003e - 00 000b SLINE
0000004c - 00 000c SLINE
0000004c - 00 000c SLINE
0000001b - 00 0000 LBRAC
0000004c - 00 0000 RBRAC
00000000 - 00 0000    SO /u/ian/junk/
00000000 t ___gnu_compiled_c
         U ___main
00000000 T _fong
00000010 T _main
00000008 - 00 0005  PSYM argc:p1
0000000c - 00 0005  PSYM argv:p22=*23=*2
00000000 - 00 0000  LSYM char:t2=r2;0;127;
00000000 - 00 0000  LSYM complex double:t17=r17;8;0;
00000000 - 00 0000  LSYM complex float:t16=r16;4;0;
00000000 - 00 0000  LSYM complex int:t15=s8real:1,0,32;imag:1,32,32;;
00000000 - 00 0000  LSYM complex long double:t18=r18;12;0;
00000000 - 00 0000  LSYM double:t13=r1;8;0;
fffffff8 - 00 0006  LSYM f:20
00000000 - 00 0000  LSYM float:t12=r1;4;0;
00000000 - 00 0003   FUN fong:F19
00000000 - 00 0000  LSYM foo:T20=s8a:1,0,32;b:1,32,32;;
00000000 t gcc2_compiled.
00000000 - 00 0000  LSYM int:t1=r1;-2147483648;2147483647;
00000000 - 00 0000  LSYM long double:t14=r1;12;0;
00000000 - 00 0000  LSYM long int:t3=r1;-2147483648;2147483647;
00000000 - 00 0000  LSYM long long 
int:t6=r1;01000000000000000000000;0777777777777777777777;
00000000 - 00 0000  LSYM long long unsigned 
int:t7=r1;0000000000000;01777777777777777777777;
00000000 - 00 0000  LSYM long unsigned int:t5=r1;0;-1;
00000010 - 00 0005   FUN main:F1
00000008 - 00 0003  PSYM p:p21=*20
00000000 - 00 0000  LSYM short int:t8=r1;-32768;32767;
00000000 - 00 0000  LSYM short unsigned int:t9=r1;0;65535;
00000000 - 00 0000  LSYM signed char:t10=r1;-128;127;
00000000 - 00 0000    SO t.c
00000000 - 00 0000  LSYM unsigned char:t11=r1;0;255;
00000000 - 00 0000  LSYM unsigned int:t4=r1;0;-1;
00000000 - 00 0000  LSYM void:t19=19
0000000c - 00 0003  PSYM x:p1
chiark:~/junk> gzip -9 <t.o | uuencode t.o
begin 664 t.o
M'XL(`$>Q=B\"`WV2/6S30!3'7YJD2=L@(75@8`$$`ZAM?.<D=FP%,1`F)#)0
MB059KO-1IXX=Y:/JB-0IJBK!R,:,Q`P30@(I(+&PL,#`0*4.$1-#!J3P[LYQ
MSE7!DOU^_K]/OW,F48<:+*X[2\)FP_?MT<E1-7NTG1O54J/)X_?X?CC)GI[,
M9K-Q=<J"Q]4_233MU'%U6CO]C([##UD4TTQ<YN)K(;+\2ZA>!;B00IL*>ZQ+
M?`/O>LA4XA+>3T)^)'%;XF<2OY3XH\2YQ()K$OL2/Y7XE<2?)/XF\2^),TL+
M+DC\0.(]B8\E?B[Q&^2T="YW(1GCI,0YM&\Q_GJHCI%?(+,S_!(RB_D:UKP8
MY:8Y?T<]$>NU#)<CSDB<A6L1K\#-B%=!BW@-;D><@_MG^">?4_2=\-G2?,[?
M(;,Y4TFVAV68XF^S@OP.-3;#*O(/M*S.&G++<:CE!)VNZS7J6V!95LL?1H+E
M0'Z8=VT_WQ[Z>WD8;#G@^@-C0"H]8FY24M`*NEHJZ&:$F@G.KMTS!K32HZ9B
M$HJ*%_BM*SQ1_5_BT.^[+;]1%Z$%%JJ8FR3,CWN+9[R+%B7N(<IYEZEHYUUR
MC7@;C1>+ER#_J-'?#7H#D:;SSU2I5M)-]HR\\>IE\1&E8E$M8H3PB/41A9<@
M5!<KC!)#-Q&IM(B)32^PV:%0IA50A7HPW/$:*/%]ZTSB'Q?I?+F$'1"PP_8:
M!V(B4JST]5[#]@RRH6RHU'0[=@M9I>QE$3QOR99=$CWGKJ@'VYTFFL]]\2'8
MEO1PBOW`K:-4KI`R-(/`>$@5G,2>C[$CS6`UL0JPAW$/H[M&EY+*+:K`@=$E
F8'5LUV<_,K?L@5%@]UH.\Z+=QWB*\2K>T#0P#^`OH--.$L,%``#*
`
end

-----------------------------------------------------------------------

Message sent:


From: iwj10@thor.cam.ac.uk (Ian Jackson)
To: iwj10@cus.cam.ac.uk (Ian Jackson)
Subject: Bug#660: Acknowledgement (was: GDB gets address of structure 
member wrong in memory breakpoint)
In-Reply-To: <m0rtE8u-0002gOZ.ijackson@nyx.cs.du.edu>
References: <m0rtE8u-0002gOZ.ijackson@nyx.cs.du.edu>

Thank you for the problem report you have sent regarding Debian 
GNU/Linux.
This is an automatically generated reply, to let you know your message 
has
been received.  It is being forwarded to the developers' mailing list 
for
their attention; they will reply in due course.

If you wish to submit further information on your problem, please send
it to debian-bugs@pixar.com, but please ensure that the Subject
line of your message starts with "Bug#660" or "Re: Bug#660" so that
we can identify it as relating to the same problem.

Please do not reply to the address at the top of this message,
unless you wish to report a problem with the bug-tracking system.

Ian Jackson
(maintainer, debian-bugs)

-----------------------------------------------------------------------
Ian Jackson / iwj10@thor.cam.ac.uk , with the debian-bugs tracking
mechanism
This page last modified 06:43:02 GMT Wed 21 Jun