From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21690 invoked by alias); 31 Aug 2002 13:08:02 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 21679 invoked from network); 31 Aug 2002 13:07:59 -0000 Received: from unknown (HELO hofr.at) (80.120.128.82) by sources.redhat.com with SMTP; 31 Aug 2002 13:07:59 -0000 Received: (from root@localhost) by hofr.at (8.10.2/8.9.3/SuSE Linux 8.9.3-0.1) id g7VCBNk16923 for gdb@sources.redhat.com; Sat, 31 Aug 2002 14:11:23 +0200 From: Der Herr Hofrat Message-Id: <200208311211.g7VCBNk16923@hofr.at> Subject: 2.5.1 bug with local variables ?? To: gdb@sources.redhat.com Date: Sat, 31 Aug 2002 06:08:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-SW-Source: 2002-08/txt/msg00413.txt.bz2 Hi ! In the below gdb.log there are no local variables in fun2 (as reported by info local) but p /x i2 still reports a value of 0x3f (see end of gdb.log)= =20 this happens to be the value from i1 in fun1 - should this not show up as= =20 (gdb) info local No locals. (gdb) p /x i2 $2 =3D =20 (relevant compil flags -O2 -gdwarf -g3 -ggdb3)=20 thx ! hofrat ---gdb.log---=20 GNU gdb 5.2.1 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain condition= s. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"... (gdb) modaddsym ../modules/rtl_sched.o add symbol table from file "../modules/rtl_sched.o" at .text_addr =3D 0xd0e68060 (gdb) modaddsym ../modules/rr=08 =08tl.o add symbol table from file "../modules/rtl.o" at .text_addr =3D 0xd0e57060 (gdb) target remote /dev/rtf10 Remote debugging using /dev/rtf10 [New Thread -850526208] [Switching to Thread -850526208] 0xd0e8409d in cleanup_module () at hello_core.c:24 24 breakpoint(); (gdb) l 19 p . sched_priority =3D 1; 20 pthread_setschedparam (pthread_self(), SCHED_FIFO, &p); 21=09 22 pthread_make_periodic_np (pthread_self(), gethrtime(), 500000000); 23=09 24 breakpoint(); 25=09 26 for (i =3D 0; i < 20; i ++) { 27 pthread_wait_np (); 28 rtl_printf("I'm here; my arg is %x\n", (unsigned) arg); (gdb) l 29 fun1((void *)42); 30 fun2(); 31 } 32 return 0; 33 } 34=09 35 int init_module(void) 36 { 37 pthread_create (&thread, NULL, thread_routine, NULL); 38 return 0; (gdb) break fun1 Breakpoint 1 at 0xd0e84127: file fun1.c, line 9. (gdb) break fun2 Breakpoint 2 at 0xd0e84170: file fun2.c, line 11. (gdb) c Continuing. Breakpoint 1, fun1 (arg=3D0x2a) at fun1.c:9 9 breakpoint(); (gdb) l 4 extern int g; 5=09 6 void fun1(void *arg) 7 { 8 int i1; 9 breakpoint(); 10 i1=3D((int)arg*3)/2; 11 rtl_printf("The Value of i is fun1 is %d\n",i1); 12 g=3Di1; 13 return ;=09 (gdb) s 10 i1=3D((int)arg*3)/2; (gdb) s 11 rtl_printf("The Value of i is fun1 is %d\n",i1); (gdb) info local i1 =3D 63 (gdb) p /x i1 $1 =3D 0x3f (gdb) c Continuing. Program received signal SIGTRAP, Trace/breakpoint trap. 0xd0e8416d in fun2 () at fun2.c:9 9 breakpoint(); (gdb) l 4 extern int g; 5=09 6 void fun2(void) 7 { 8 int i2; 9 breakpoint(); 10 i2=3D1; 11 rtl_printf("The Value of i is fun2 is %d\n",i2); 12 g=3Di2; 13 return ;=09 (gdb) info local No locals. (gdb) p /x i2 $2 =3D 0x3f (gdb) quit The program is running. Exit anyway? (y or n)=20