From: Tom Tromey <tom@tromey.com>
To: Christina Schimpe via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/3] gdb: Make global feature array a per-remote target array
Date: Fri, 14 Jan 2022 12:30:12 -0700 [thread overview]
Message-ID: <875yqmglob.fsf@tromey.com> (raw)
In-Reply-To: <20220113152118.1465255-2-christina.schimpe@intel.com> (Christina Schimpe via Gdb-patches's message of "Thu, 13 Jan 2022 16:21:16 +0100")
>>>>> ">" == Christina Schimpe via Gdb-patches <gdb-patches@sourceware.org> writes:
>> This patch applies the appropriate FIXME notes described in commit
>> 5b6d1e4 "Multi-target support".
Thank you for the patch. I have a couple of small things, but nothing
too serious. On the whole, this approach makes sense to me.
>> + int remote_multi_process_p (remote_state *rs) const;
>> + int remote_fork_event_p (remote_state*) const;
>> + int remote_vfork_event_p (remote_state*) const;
>> + int remote_exec_event_p (remote_state*) const;
It seems like these methods don't actually need the 'remote_state *' parameter.
>> + void reset_all_packet_configs_support (void);
New code shouldn't use "(void)", just "()" is fine. Also, normally if
we touch a function definition or declaration, we'll also remove a
'void' if there is one.
>> +static void
>> +set_remote_protocol_packet_cmd (const char *args, int from_tty,
>> + cmd_list_element *c)
>> + for (int i = 0; i < PACKET_MAX; ++i)
>> + {
>> + if (c == remote_protocol_packets[i].set_cmd)
>> + {
The packet number can be passed in using the 'context' attached to the
command. See cmd_list_element::set_context and cmd_list_element::context.
This is simple to do and would remove the need for this loop.
It's mildly annoying that this only accepts a pointer and not a scalar,
but it can either be cast or you could pass the address the slot in
remote_protocol_packets and then do some pointer math to reconstruct the
index.
The same applies to the 'show' command.
thanks,
Tom
next prev parent reply other threads:[~2022-01-14 19:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-13 15:21 [PATCH 0/3] Apply fixme notes for multi-target support Christina Schimpe
2022-01-13 15:21 ` [PATCH 1/3] gdb: Make global feature array a per-remote target array Christina Schimpe
2022-01-14 19:30 ` Tom Tromey [this message]
2022-01-20 16:32 ` Schimpe, Christina
2022-01-18 11:30 ` Andrew Burgess
2022-01-20 17:24 ` Schimpe, Christina
2022-01-13 15:21 ` [PATCH 2/3] gdb: Add per-remote target variables for memory read and write config Christina Schimpe
2022-01-14 19:33 ` Tom Tromey
2022-01-18 11:39 ` Andrew Burgess
2022-01-24 15:06 ` Schimpe, Christina
2022-02-04 18:03 ` Andrew Burgess
2022-01-13 15:21 ` [PATCH 3/3] gdb: Remove workaround for the vCont packet Christina Schimpe
2022-01-14 19:42 ` Tom Tromey
2022-01-28 13:28 ` Schimpe, Christina
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=875yqmglob.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).