This is the mail archive of the
mailing list for the GDB project.
Re: [RFA] Report the main thread.
A Sunday 27 April 2008 15:22:59, Mark Kettenis wrote:
> Seriously though, in GDB we've always only populated the threads list
> if a program actually has threads.
Would that be true if threads had been implemented in GDB from the
ground up, instead of being an afterthought?
> An MI client will have to deal
> with that fact. If it insists on providing a threaded view of the
> world, it needs to fake up a main thread. Since it already has to do
> that for non-threaded programs, why would having a false thread create
> event for the main thread help?
If a command is defined to take --thread=$gdb_thread_id as a parameter,
it is awkward for the frontend to have to do something different
on single-threaded apps. E.g., no --thread parameter means all
threads, or the main thread in ST apps?
A GDB thread id is also what can be made constant even though
the ptid of the main thread may change due to loading
(My secret xmas wish was for GDB to consider threads a first
class citizen, and get rid of the infrun.c context switching.)