Subject: Re: gdb seems to ignore threads
To: Nathan J. Williams <nathanw@wasabisystems.com>
From: John Gordon <mailing.lists@dial.pipex.com>
List: current-users
Date: 06/02/2003 17:17:21
This is a multi-part message in MIME format.
--------------000404070005060200040205
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hello,

OK, I think I have a patch for this issue. It does have one side effect 
that I think may be disabling something that was intended to be there 
though: the LWP lines in the thread info line do not appear anymore. 
Personally, that makes sense anyway as I asked for info on threads not 
LWPs. I notice that the Solaris version simply tags the thread line with 
the LWP ID if there is one.

I've attached the relatively simple patch that works for my previous 
test case. I can now step and continue correctly with Felix's threaded 
test case. You'll need to rebuild the gdb binary of course.

Rgds,
John...

--------------000404070005060200040205
Content-Type: text/plain;
 name="gdb-20030602.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="gdb-20030602.patch"

Index: nbsd-thread.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/toolchain/gdb/nbsd-thread.c,v
retrieving revision 1.5
diff -r1.5 nbsd-thread.c
307c307,309
<   if (rtnval == 0 && nbsd_thread_active)
---
> 
>   /* if (rtnval == 0 && nbsd_thread_active) */
>   if (nbsd_thread_active)
Index: infrun.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/toolchain/gdb/infrun.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 infrun.c
1801c1801,1804
< 	target_resume (-1, 0, TARGET_SIGNAL_0);
---
>         /*
> 	 * Use the 'trap_expected' flag to see if we should be stepping or not
> 	 */
> 	target_resume (-1, (trap_expected ? 1 : 0), TARGET_SIGNAL_0);

--------------000404070005060200040205--