command qSupported

Format: ‘qSupported [:gdbfeature [;gdbfeature]… ]’

Meaning: Tell the remote stub about features supported by GDB, and query the stub for features it supports. This packet allows GDB and the remote stub to take advantage of each others’ features. ‘qSupported’ also consolidates multiple feature probes at startup, to improve GDB performance—a single larger packet performs better than multiple smaller probe packets on high-latency links. Some features may enable behavior which must not be on by default, e.g. because it would confuse older clients or stubs. Other features may describe packets which could be automatically probed for, but are not. These features must be reported before GDB will use them. This “default unsupported” behavior is not appropriate for all packets, but it helps to keep the initial connection time under control with new versions of GDB which support increasing numbers of packets.

The allowed forms for each feature (either a gdbfeature in the ‘qSupported’ packet, or a stubfeature in the response) are:

Whenever the stub receives a ‘qSupported’ request, the supplied set of GDB features should override any previous request. This allows GDB to put the stub in a known state, even if the stub had previously been communicating with a different version of GDB.

The following values of gdbfeature (for the packet sent by GDB) are defined:

Stubs should ignore any unknown values for gdbfeature. Any GDB which sends a ‘qSupported’ packet supports receiving packets of unlimited length (earlier versions of GDB may reject overly long responses). Additional values for gdbfeature may be defined in the future to let the stub take advantage of new features in GDB, e.g. incompatible improvements in the remote protocol—the ‘multiprocess’ feature is an example of such a feature. The stub’s reply should be independent of the gdbfeature entries sent by GDB; first GDB describes all the features it supports, and then the stub replies with all the features it supports.

Similarly, GDB will silently ignore unrecognized stub feature responses, as long as each response uses one of the standard forms.

Some features are flags. A stub which supports a flag feature should respond with a ‘+’ form response. Other features require values, and the stub should respond with an ‘=’ form response.

Each feature has a default value, which GDB will use if ‘qSupported’ is not available or if the feature is not mentioned in the ‘qSupported’ response. The default values are fixed; a stub is free to omit any feature responses that match the defaults.

Not all features can be probed, but for those which can, the probing mechanism is useful: in some cases, a stub’s internal architecture may not allow the protocol layer to know some information about the underlying target in advance. This is especially common in stubs which may be configured for multiple targets.

These are the currently defined stub features and their properties:

Feature Name Value Required Default Probe Allowed
‘PacketSize’ Yes ‘-’ No
‘qXfer:auxv:read’ No ‘-’ Yes
‘qXfer:btrace:read’ No ‘-’ Yes
‘qXfer:btrace-conf:read’ No ‘-’ Yes
‘qXfer:exec-file:read’ No ‘-’ Yes
‘qXfer:features:read’ No ‘-’ Yes
‘qXfer:libraries:read’ No ‘-’ Yes
‘qXfer:libraries-svr4:read’ No ‘-’ Yes
‘augmented-libraries-svr4-read’ No ‘-’ No
‘qXfer:memory-map:read’ No ‘-’ Yes
‘qXfer:sdata:read’ No ‘-’ Yes
‘qXfer:siginfo:read’ No ‘-’ Yes
‘qXfer:siginfo:write’ No ‘-’ Yes
‘qXfer:threads:read’ No ‘-’ Yes
‘qXfer:traceframe-info:read’ No ‘-’ Yes
‘qXfer:uib:read’ No ‘-’ Yes
‘qXfer:fdpic:read’ No ‘-’ Yes
‘Qbtrace:off’ Yes ‘-’ Yes
‘Qbtrace:bts’ Yes ‘-’ Yes
‘Qbtrace:pt’ Yes ‘-’ Yes
‘Qbtrace-conf:bts:size’ Yes ‘-’ Yes
‘Qbtrace-conf:pt:size’ Yes ‘-’ Yes
‘Qbtrace-conf:pt:ptwrite’ Yes ‘-’ Yes
‘Qbtrace-conf:pt:event-tracing’ Yes ‘-’ Yes
‘QNonStop’ No ‘-’ Yes
‘QCatchSyscalls’ No ‘-’ Yes
‘QPassSignals’ No ‘-’ Yes
‘QStartNoAckMode’ No ‘-’ Yes
‘multiprocess’ No ‘-’ No
‘ConditionalBreakpoints’ No ‘-’ No
‘ConditionalTracepoints’ No ‘-’ No
‘ReverseContinue’ No ‘-’ No
‘ReverseStep’ No ‘-’ No
‘TracepointSource’ No ‘-’ No
‘QAgent’ No ‘-’ No
‘QAllow’ No ‘-’ No
‘QDisableRandomization’ No ‘-’ No
‘EnableDisableTracepoints’ No ‘-’ No
‘QTBuffer:size’ No ‘-’ No
‘tracenz’ No ‘-’ No
‘BreakpointCommands’ No ‘-’ No
‘swbreak’ No ‘-’ No
‘hwbreak’ No ‘-’ No
‘fork-events’ No ‘-’ No
‘vfork-events’ No ‘-’ No
‘exec-events’ No ‘-’ No
‘QThreadEvents’ No ‘-’ No
‘QThreadOptions’ Yes ‘-’ No
‘no-resumed’ No ‘-’ No
‘memory-tagging’ No ‘-’ No
‘error-message’ No ‘+’ No
‘binary-upload’ No ‘-’ No

These are the currently defined stub features, in more detail:

Reply:

stubfeature [;stubfeature]…

The stub supports or does not support each returned stubfeature, depending on the form of each stubfeature.