Make linux native always have at least one thread

Pedro Alves pedro@codesourcery.com
Mon Mar 24 20:54:00 GMT 2008


The non-stop mode requires gdb to always have a thread in
the thread list, so we can use the new non-stop MI options
on it.  In ST programs, the main thread should be listed as
the single thread in the thread list.  Currently, when
debugging a single-threaded application in native linux,
"info threads" comes out empty.

Ideally, every platform should do this, so we can get rid
of a lot of weird ugly code to work around that fact
(state is stored and swapped between plain old global
variables, and struct thread_info, struct execution_control_state,
and struct inferior_status depending on what gdb is doing).

Daniel recently made this fix very simple, by removing
the tid component of a thread_db thread off of the
ptid of each thread.

So, this patch closes the issue for linux native.

Tested on x86_64-unknown-linux-gnu.

OK?

-- 
Pedro Alves
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux_always_have_a_thread.diff
Type: text/x-diff
Size: 1970 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080324/5846ea6f/attachment.bin>


More information about the Gdb-patches mailing list