Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

D.4. General Query Packets

The following set and query packets have already been defined.

qC -- current thread

Return the current thread id.

Reply:

QCpid

Where pid is a HEX encoded 16 bit process id.

*

Any other reply implies the old pid.

qfThreadInfo - all thread ids

qsThreadInfo

Obtain a list of active thread ids from the target (OS). Since there may be too many active threads to fit into one reply packet, this query works iteratively: it may require more than one query/reply sequence to obtain the entire list of threads. The first query of the sequence will be the qfThreadInfo query; subsequent queries in the sequence will be the qsThreadInfo query.

NOTE: replaces the qL query (see below).

Reply:

mid

A single thread id

mid,id

a comma-separated list of thread ids

l

(lower case 'el') denotes end of list.

In response to each query, the target will reply with a list of one or more thread ids, in big-endian hex, separated by commas. gdb will respond to each reply with a request for more thread ids (using the qs form of the query), until the target responds with l (lower-case el, for 'last').

qThreadExtraInfo,id -- extra thread info

Where id is a thread-id in big-endian hex. Obtain a printable string description of a thread's attributes from the target OS. This string may contain anything that the target OS thinks is interesting for gdb to tell the user about the thread. The string is displayed in gdb's info threads display. Some examples of possible thread extra info strings are "Runnable", or "Blocked on Mutex".

Reply:

XX…

Where XX… is a hex encoding of ascii data, comprising the printable string containing the extra information about the thread's attributes.

qLstartflagthreadcountnextthread -- query LIST or threadLIST (deprecated)

Obtain thread information from RTOS. Where: startflag (one hex digit) is one to indicate the first query and zero to indicate a subsequent query; threadcount (two hex digits) is the maximum number of threads the response packet can contain; and nextthread (eight hex digits), for subsequent queries (startflag is zero), is returned in the response as argthread.

NOTE: this query is replaced by the qfThreadInfo query (see above).

Reply:

qMcountdoneargthreadthread…

Where: count (two hex digits) is the number of threads being returned; done (one hex digit) is zero to indicate more threads and one indicates no further threads; argthreadid (eight hex digits) is nextthread from the request packet; thread… is a sequence of thread IDs from the target. threadid (eight hex digits). See remote.c:parse_threadlist_response().

qCRC:addr,length -- compute CRC of memory block

Reply:

ENN

An error (such as memory fault)

CCRC32

A 32 bit cyclic redundancy check of the specified memory region.

qOffsets -- query sect offs

Get section offsets that the target used when re-locating the downloaded image. Note: while a Bss offset is included in the response, gdb ignores this and instead applies the Data offset to the Bss section.

Reply:

Text=xxx;Data=yyy;Bss=zzz

Text command.

qPmodethreadid -- thread info request

Returns information on threadid. Where: mode is a hex encoded 32 bit mode; threadid is a hex encoded 64 bit thread ID.

Reply:

*

* command

See remote.c:remote_unpack_thread_info_response().

qRcmd,command -- remote command

command (hex encoded) is passed to the local interpreter for execution. Invalid commands should be reported using the output string. Before the final result packet, the target may also respond with a number of intermediate Ooutput console output packets. Implementors should note that providing access to a stubs's interpreter may have security implications.

Reply:

OK

A command response with no output.

OUTPUT

A command response with the hex encoded output string OUTPUT.

ENN

Indicate a badly formed request.

When qRcmd is not recognized.

qSymbol:: -- symbol lookup

Notify the target that gdb is prepared to serve symbol lookup requests. Accept requests from the target for the values of symbols.

Reply:

OK

The target does not need to look up any (more) symbols.

qSymbol:sym_name

The target requests the value of symbol sym_name (hex encoded). gdb may provide the value by using the qSymbol:sym_value:sym_name message, described below.

qSymbol:sym_value:sym_name -- symbol value

Set the value of sym_name to sym_value.

sym_name (hex encoded) is the name of a symbol whose value the target has previously requested.

sym_value (hex) is the value for symbol sym_name. If gdb cannot supply a value for sym_name, then this field will be empty.

Reply:

OK

The target does not need to look up any (more) symbols.

qSymbol:sym_name

The target requests the value of a new symbol sym_name (hex encoded). gdb will continue to supply the values of symbols (if available), until the target ceases to request them.

 
 
  Published under the terms of the GNU General Public License Design by Interspire