[lldb-dev] Question about qC gdb request.

Greg Clayton gclayton at apple.com
Thu Dec 1 16:47:34 PST 2011


On Dec 1, 2011, at 2:55 PM, Jean-Daniel Dupas wrote:

> 
> Le 1 déc. 2011 à 19:52, Greg Clayton a écrit :
> 
>> It was this way after misinterpreting what the GPLv2 version of GDB does (our darwin version) with the response. So it has been wrong for a while and does need to be fixed.

Part of the reason we did this too was the GDB remote specification docs:


current thread	qC	Return the current thread id.
reply QCpid	Where pid is a HEX encoded 16 bit process id.
reply *	Any other reply implies the old pid.

It says "process id" is returned, not thread id...

>> We need to add a new packet that gets information about the process (something like "qProcessInfo") that is being debugging in the case where we attach by name and need to know the process ID of what we attached to.
> 
> Isn't what qGetPid already does ? 

Not sure. Is there a home for the one true GDB remote specification? I don't see this packet in this:

http://sourceware.org/gdb/onlinedocs/gdb/General-Query-Packets.html#General-Query-Packets
http://sources.redhat.com/gdb/current/onlinedocs/gdb.html#General-Query-Packets

Where are you seeing this packet? We don't look at any GPLv3 GDB sources at Apple, so we can't look there.

Also, we want more than just the PID, we want architecture, pointer size, and vendor, OS, and other key value pairs, and thus we will soon implement the qProcessInfo packet.

> 
> 
>> On Dec 1, 2011, at 8:51 AM, Jean-Daniel Dupas wrote:
>> 
>>> Hello,
>>> 
>>> I'm actually studying the debugserver, and I have a qestion about implementation of the qC (get current thread ID) handler.
>>> 
>>> Why does it returned the current process ID, and not GetCurrentThread() ? 
>>> 
>>> 
>>> -- Jean-Daniel
>>> 
>>> 
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> lldb-dev mailing list
>>> lldb-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>> 
> 
> -- Jean-Daniel
> 
> 
> 
> 





More information about the lldb-dev mailing list