* 2.5.1 bug with local variables ??
@ 2002-08-31 6:08 Der Herr Hofrat
2002-08-31 7:40 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: Der Herr Hofrat @ 2002-08-31 6:08 UTC (permalink / raw)
To: gdb
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)
this happens to be the value from i1 in fun1 - should this not show up as
(gdb) info local
No locals.
(gdb) p /x i2
$2 = <value optimized out>
(relevant compil flags -O2 -gdwarf -g3 -ggdb3)
thx !
hofrat
---gdb.log---
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 conditions.
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 = 0xd0e68060
(gdb) modaddsym ../modules/rr\b \btl.o
add symbol table from file "../modules/rtl.o" at
.text_addr = 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 = 1;
20 pthread_setschedparam (pthread_self(), SCHED_FIFO, &p);
21
22 pthread_make_periodic_np (pthread_self(), gethrtime(), 500000000);
23
24 breakpoint();
25
26 for (i = 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
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=0x2a) at fun1.c:9
9 breakpoint();
(gdb) l
4 extern int g;
5
6 void fun1(void *arg)
7 {
8 int i1;
9 breakpoint();
10 i1=((int)arg*3)/2;
11 rtl_printf("The Value of i is fun1 is %d\n",i1);
12 g=i1;
13 return ;
(gdb) s
10 i1=((int)arg*3)/2;
(gdb) s
11 rtl_printf("The Value of i is fun1 is %d\n",i1);
(gdb) info local
i1 = 63
(gdb) p /x i1
$1 = 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
6 void fun2(void)
7 {
8 int i2;
9 breakpoint();
10 i2=1;
11 rtl_printf("The Value of i is fun2 is %d\n",i2);
12 g=i2;
13 return ;
(gdb) info local
No locals.
(gdb) p /x i2
$2 = 0x3f
(gdb) quit
The program is running. Exit anyway? (y or n)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: 2.5.1 bug with local variables ??
2002-08-31 6:08 2.5.1 bug with local variables ?? Der Herr Hofrat
@ 2002-08-31 7:40 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2002-08-31 7:40 UTC (permalink / raw)
To: Der Herr Hofrat; +Cc: gdb
On Sat, Aug 31, 2002 at 02:11:23PM +0200, Der Herr Hofrat wrote:
>
> 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)
> this happens to be the value from i1 in fun1 - should this not show up as
>
> (gdb) info local
> No locals.
> (gdb) p /x i2
> $2 = <value optimized out>
>
> (relevant compil flags -O2 -gdwarf -g3 -ggdb3)
Could you try something other than -gdwarf - -gdwarf-2 maybe?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-08-31 14:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-31 6:08 2.5.1 bug with local variables ?? Der Herr Hofrat
2002-08-31 7:40 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox