Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Der Herr Hofrat <der.herr@mail.hofr.at>
To: gdb@sources.redhat.com
Subject: 2.5.1 bug with local variables ??
Date: Sat, 31 Aug 2002 06:08:00 -0000	[thread overview]
Message-ID: <200208311211.g7VCBNk16923@hofr.at> (raw)


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) 


             reply	other threads:[~2002-08-31 13:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-31  6:08 Der Herr Hofrat [this message]
2002-08-31  7:40 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200208311211.g7VCBNk16923@hofr.at \
    --to=der.herr@mail.hofr.at \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox