Bug 8533

Summary: next in threaded programs
Product: [Retired] Red Hat Linux Reporter: André Johansen <andrejoh>
Component: gdbAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-01-18 18:39:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description André Johansen 2000-01-17 13:32:04 UTC
When debugging multi-threaded programs, gdb sometimes doesn't handle the `next'
command correctly. It seems if one of the other threads (i.e. not the one being stepped)
is run, the debugger doesn't stop the thread being debugged again, the next acts as
a `continue', which is quite bothersome...

I've tried both gdb-4.18-4 and versions from ftp://ftp.valinux.com/pub/support/hjl/gdb/

Output from gdb:
(gdb) next
[Switching to Thread 22370]
[Switching to Thread 22309]

Breakpoint 4, BuildingGenerator_t::FindPossibleRooms (this=0x810f0c8, cSelection=@0xbf5ff848, eConnectionType=e_RoomConnection_Office, nConX=0, nConY=4, eSide=e_RoomSide_Right, cMap=@0x813ed78, cPossible=@0xbf5ff780) at acg/buildinggenerator.cpp:868
(gdb) next
[Switching to Thread 22307]
[Switching to Thread 22370]

Comment 1 Jim Kingdon 2000-01-18 18:39:59 UTC
I'd try gdb-4.18-6 which should be in rawhide, and/or gdb from
CVS at http://sourceware.cygnus.com/gdb/
And especially if that doesn't help, I'd try the mailing lists
at that site.  Not that I know of any fixes but those are the
people who would know.

Comment 2 André Johansen 2000-02-10 14:47:59 UTC
Just a follow-up comment:
The GDB CVS at 20000117 has fixed this problem. Unfortunately, that version has several bugs
(step into doesn't work correctly etc.)

Comment 3 Jim Kingdon 2000-02-10 15:29:59 UTC
I just tried GDB from CVS and I sure didn't see any problems with
stepping into functions.  No idea whether there were any bugfixes
since 20000117 but I'd suggest reporting the bug which you are seeing.

Comment 4 André Johansen 2000-02-10 16:06:59 UTC
The program being debugged is mostly in shared libraries, and is multithreaded.
That might make a difference.