This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: restore inferior missed in read_pc_pid()?


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







Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]