Re: Adding architecture-specific commands in GDB

Matthieu Longo via Gdb <[email protected]> Fri, 26 Jun 2026 09:52:53 +0100
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
On 24/06/2026 17:13, Andrew Burgess wrote:
> Matthieu Longo via Gdb <[email protected]> writes:
> 
>> Hi all,
>>
>> Today, GDB seems to support architecture-specific commands for show/set [1]. However, it is not
>> clear to me whether any commands beyond the scope of show/set can/should be easily added.
>>
>> My usecase consists in adding AArch64-specific commands to dump some tables and permissions set up
>> by the Linux kernel.
>>
>> # Constraints:
>> 1. The tables are AArch64 specific and don't fit into an existing command.
>> 2. The permissions/capability views require to fetch information in different tables and procfs
>> files to be computed, so the computation of such permissions/capabilities is very tied to the
>> architecture specificities.
>>
>> Since I don't see how I could add those features to existing commands, I was thinking about adding
>> them under an "aarch64" namespace, and following the semantic of existing generic commands as much
>> as possible.
>>
>> # Examples
>>
>> ## Dumping the tables
>>
>>   show aarch64 <feature>-tables [TABLE_NAME]*
>>
>> NB: those tables should only be set by the kernel, only read access is required. The content is tied
>> to the architecture.
> 
> Maybe I'm wrong, in which case I'd love to see some counter examples,
> but the set/show command are usually for settings that are set by the
> user of GDB, and the show reads back the setting.
> 
> Viewing kernel data would normally be an 'info' command.
> 

What would the opposite of 'info' be ?
If for instance, I wanted to change a value in one of those tables ?

Matthieu