This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: restore inferior missed in read_pc_pid()?
- From: Sergei Poselenov <sergei dot poselenov at auriga dot ru>
- To: Andrew Cagney <cagney at gnu dot org>
- Cc: gdb at sources dot redhat dot com
- Date: Sun, 04 Jan 2004 20:56:29 +0300
- Subject: Re: restore inferior missed in read_pc_pid()?
- References: <3FEC46AA.4000604@auriga.ru> <3FF31106.4050203@gnu.org>
Hi Andrew,
Sorry for long delay.
The original situation is:
[psl@bc-host9 gdb]$ ./gdb -n /tmp/linux-dp
GNU gdb 6.0
Copyright 2003 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) target remote localhost:1234
Remote debugging using localhost:1234
0x40000b30 in ?? ()
(gdb) b philosopher
Breakpoint 1 at 0x8048916: file /tmp/linux-dp.c, line 111.
(gdb) c
Continuing.
[New Thread 8192]
[New Thread 8194]
[Switching to Thread 8194]
Breakpoint 1, philosopher (data=0x8049f08) at /tmp/linux-dp.c:111
111 int n = * (int *) data;
(gdb) n
113 print_philosopher (n, '_', '_');
(gdb)
[New Thread 16387]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16387]
0x08048918 in philosopher (data=0x8049f) at /tmp/linux-dp.c:111
111 int n = * (int *) data;
(gdb)
The gdb/gdbserver under the test are the stock 6.0 with vCont remote
protocol
addition patch applied. All built and run locally on RH 8.0.
Thank you,
Sergei
Andrew Cagney wrote:
Hi all,
I'm looking at read_pc_pid() :
...
/* Else use per-frame method on get_current_frame. */
else if (PC_REGNUM >= 0)
{
CORE_ADDR raw_val = read_register_pid (PC_REGNUM, ptid);
CORE_ADDR pc_val = ADDR_BITS_REMOVE (raw_val);
return pc_val;
}
else
...
and can't understand why the inferior_ptid is not restored for this
case?
Error?
Can you expand a little on what the underlying problem is?
I suspect that GDB's thread global swapping code is, yet again,
shooting itself in the foot. But that's just a guess :-(
Andrew