From: Andrew Burgess <aburgess@redhat.com>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/3] gdb: make use of set_tdesc_osabi overload in features/ files
Date: Wed, 09 Oct 2024 12:08:31 +0100 [thread overview]
Message-ID: <87jzehbkk0.fsf@redhat.com> (raw)
In-Reply-To: <f8653f46-4e6f-46f1-8698-1830c11503c8@simark.ca>
Simon Marchi <simark@simark.ca> writes:
> On 2024-10-06 14:37, Andrew Burgess wrote:
>> There are two versions of the set_tdesc_osabi function in GDB:
>>
>> void
>> set_tdesc_osabi (struct target_desc *target_desc, const char *name)
>> {
>> set_tdesc_osabi (target_desc, osabi_from_tdesc_string (name));
>> }
>>
>> void
>> set_tdesc_osabi (struct target_desc *target_desc, enum gdb_osabi osabi)
>> {
>> target_desc->osabi = osabi;
>> }
>>
>> In the gdb/features/ files we call the second of these functions, like
>> this:
>>
>> set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("GNU/Linux"));
>>
>> This can be replaced with a call to the first set_tdesc_osabi
>> function, so lets do that. I think that this makes the features/ code
>> slightly simpler and easier to understand.
>>
>> There should be no user visible changes after this commit.
>
> Just a nit but... while at it, couldn't we change them to use the
> enumerator directly, to save lookups at runtime?
>
> set_tdesc_osabi (result.get (), GDB_OSABI_LINUX);
>
> I guess we would need a enum -> string (GDB_OSABI_LINUX ->
> "GDB_OSABI_LINUX") function, which we have for other enums. We just
> don't have it for this enum yet. Another case for adding a "magic enum"
> library :).
This was Luis' request. See v2 my attempt at this.
Thanks,
Andrew
next prev parent reply other threads:[~2024-10-09 11:08 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-06 18:37 [PATCH 0/3] Set osabi in remote target descriptions Andrew Burgess
2024-10-06 18:37 ` [PATCH 1/3] gdbserver: make arch and osabi names gdb::unique_xmalloc_ptr<char> Andrew Burgess
2024-10-07 17:00 ` Tom Tromey
2024-10-08 19:02 ` Simon Marchi
2024-10-09 11:07 ` Andrew Burgess
2024-10-09 11:45 ` Simon Marchi
2024-10-09 12:17 ` Andrew Burgess
2024-10-09 15:35 ` Simon Marchi
2024-10-09 15:50 ` Andrew Burgess
2024-10-06 18:37 ` [PATCH 2/3] gdb: make use of set_tdesc_osabi overload in features/ files Andrew Burgess
2024-10-07 17:00 ` Tom Tromey
2024-10-08 19:12 ` Simon Marchi
2024-10-09 11:08 ` Andrew Burgess [this message]
2024-10-09 11:48 ` Simon Marchi
2024-10-09 12:04 ` Andrew Burgess
2024-10-06 18:37 ` [PATCH 3/3] gdbserver: pass osabi to GDB in target description Andrew Burgess
2024-10-07 9:38 ` Luis Machado
2024-10-07 17:00 ` Tom Tromey
2024-10-08 17:11 ` [PATCH 0/5] Set osabi in remote target descriptions Andrew Burgess
2024-10-08 17:11 ` [PATCH 1/5] gdbserver: make arch and osabi names gdb::unique_xmalloc_ptr<char> Andrew Burgess
2024-10-10 13:37 ` Simon Marchi
2024-10-10 15:31 ` Andrew Burgess
2024-10-08 17:11 ` [PATCH 2/5] gdb: make use of set_tdesc_osabi overload in features/ files Andrew Burgess
2024-10-08 17:11 ` [PATCH 3/5] gdb: split osabi support between gdb/ and gdbsupport/ directories Andrew Burgess
2024-10-09 7:12 ` Luis Machado
2024-10-10 13:47 ` Simon Marchi
2024-10-08 17:11 ` [PATCH 4/5] gdb/gdbserver: change shared set_tdesc_osabi to take gdb_osabi Andrew Burgess
2024-10-09 7:12 ` Luis Machado
2024-10-10 15:23 ` Simon Marchi
2024-10-08 17:11 ` [PATCH 5/5] gdbserver: pass osabi to GDB in target description Andrew Burgess
2024-10-09 7:14 ` Luis Machado
2024-10-10 15:56 ` Simon Marchi
2024-10-10 20:19 ` Mark Wielaard
2024-10-11 8:31 ` Andrew Burgess
2024-10-10 15:57 ` [PATCH 0/5] Set osabi in remote target descriptions Simon Marchi
2024-10-10 16:41 ` Andrew Burgess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87jzehbkk0.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox