[RFA] Report the main thread.

Vladimir Prus vladimir@codesourcery.com
Sun May 11 21:10:00 GMT 2008


Joel Brobecker wrote:

>> > I just want threads other than the main thread to be reported, as
>> > used to be the case.
> [...]
>> > That way I can create a threads buffer and display the thread
>> > number when there is more than one thread.
>> 
>> Cannot you just suppress display of thread list if there's just one
>> thread reported, on UI side?
> 
> I think it is important to be consistent between interpreters.
> If we have the annotation for MI, we should have it in the annotate
> mode as well.
> 
> There has been a discussion earlier about the merits and drawbacks
> of adding the main "thread" to the list of threads when debugging
> an application that doesn't use threads.  We only considered the
> perspective of the user, but there is indeed the case of front-ends.
> Assuming that the decision still stands, I think it is reasonable
> to ask the front-ends to check that there is more than one thread
> before going into "thread" mode.  I understand that this is making
> things a little more complicated, but it shouldn't be that hard.
> 
> On the other hand, if there is a way to detect that the new "thread"
> is from an unthreaded program, we could decide to not emit the
> notification. 

I think we're just trading different complexities here. Using "single-threaded 
program has a single thread" notion simplifies for frontend the task of
building the the internal representation of program. On the other hand, if
the frontend wishes to display just frames, and no any thread items, for
the case where the program has just a single thread, it requires some extra
logic -- presumably, just using different object as the root of some treeview
widget. 

And in my opinion, helping build accurate representation of a program
is what MI is about. Representation issues is what GUI toolkits are good
about.

> But I would like things to be consistent - it should 
> be the same for both CLI, MI and annotations.

Should CLI and MI be 100% consistent? They have different target audience.

- Volodya




More information about the Gdb-patches mailing list