public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH 05/24] gdb: change regcache interface to use array_view
Date: Mon, 13 Nov 2023 11:47:06 -0500	[thread overview]
Message-ID: <57e29f9d-0b04-47da-b212-014189ac641e@polymtl.ca> (raw)
In-Reply-To: <875y25sqgl.fsf@redhat.com>

On 11/13/23 09:00, Andrew Burgess wrote:
>>> diff --git a/gdbsupport/common-regcache.h b/gdbsupport/common-regcache.h
>>> index 6d98ca8c92ed..75d209f7cbc0 100644
>>> --- a/gdbsupport/common-regcache.h
>>> +++ b/gdbsupport/common-regcache.h
>>> @@ -78,11 +78,44 @@ struct reg_buffer_common
>>>       buffer.  */
>>>    virtual register_status get_register_status (int regnum) const = 0;
>>>  
>>> -  /* Supply register REGNUM, whose contents are stored in BUF, to REGCACHE.  */
>>> -  virtual void raw_supply (int regnum, const void *buf) = 0;
>>> +  /* Supply register REGNUM, whose contents are stored in SRC, to this register
>>> +     buffer.  */
>>> +  virtual void raw_supply (int regnum, gdb::array_view<const gdb_byte> src,
>>> +			   float) = 0;
>>
>> The addition of the 'float' argument is pretty unexpected here.  It's
>> not mentioned in the commit message or the function comment, nor is it
>> actually used in any of the function implementations as far as I can
>> tell.  I'm assuming this is resolving some C++ overload problem.
>>
>> Sorry if I've missed something ... I've only looked at the diff so far.
>> I thought I'd reach out before I start playing with the code trying to
>> figure out what's going on.
> 
> As an initial experiment, I tried removing the float parameter after
> applying every patch up to and including this one, and GDB still rebuilt
> fine.
> 
> Then I applied every patch in the series, and removed the float
> parameter, and again GDB built fine.
> 
> Maybe I'm missing something though...
> 
> Thanks,
> Andrew

Haha, good catch, I added them during development as a temporary thing,
to make sure I inspected all call sites, but of course I totally forgot
to remove them.  I added them to differentiate the calls to the raw
pointer and array_view overloads of the functions, I don't recall my
logic exactly.  I remember I was worried about cases like these:

  gdb_byte buf[SOME_ARCH_MAX_REG_SIZE];
  cooked_read (regnum, buf);

We want this to pick up the raw pointer overload, because the size of
register regnum is possibly smaller than SOME_ARCH_MAX_REG_SIZE.  When I
remove the dummy float parameters, clangd tells me that these
cooked_read calls still pick up the raw pointer overload, so it seems
ok.  But I'll see in testing.

For now I did the changes locally, I wull send a v2 once I
fix the regressions identified by Luis.

Thanks,

Simon

  reply	other threads:[~2023-11-13 16:47 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08  5:00 [PATCH 00/24] Fix reading and writing pseudo registers in non-current frames Simon Marchi
2023-11-08  5:00 ` [PATCH 01/24] gdb: don't handle i386 k registers as pseudo registers Simon Marchi
2023-11-11 19:29   ` John Baldwin
2023-11-08  5:00 ` [PATCH 02/24] gdb: use reg_buffer_common throughout gdbsupport/common-regcache.h Simon Marchi
2023-11-11 19:42   ` John Baldwin
2023-11-08  5:00 ` [PATCH 03/24] gdb: make store_integer take an array_view Simon Marchi
2023-11-08  5:00 ` [PATCH 04/24] gdb: simplify conditions in regcache::{read,write,raw_collect,raw_supply}_part Simon Marchi
2023-11-08  5:00 ` [PATCH 05/24] gdb: change regcache interface to use array_view Simon Marchi
2023-11-13 13:43   ` Andrew Burgess
2023-11-13 14:00     ` Andrew Burgess
2023-11-13 16:47       ` Simon Marchi [this message]
2023-11-08  5:00 ` [PATCH 06/24] gdb: fix bugs in {get,put}_frame_register_bytes Simon Marchi
2023-11-13 15:00   ` Andrew Burgess
2023-11-13 19:51     ` Simon Marchi
2023-11-08  5:00 ` [PATCH 07/24] gdb: make put_frame_register take an array_view Simon Marchi
2023-11-08  5:00 ` [PATCH 08/24] gdb: change value_of_register and value_of_register_lazy to take the next frame Simon Marchi
2023-11-08  5:00 ` [PATCH 09/24] gdb: remove frame_register Simon Marchi
2023-11-08  5:00 ` [PATCH 10/24] gdb: make put_frame_register take the next frame Simon Marchi
2023-11-08  5:00 ` [PATCH 11/24] gdb: make put_frame_register_bytes " Simon Marchi
2023-11-08  5:00 ` [PATCH 12/24] gdb: make get_frame_register_bytes " Simon Marchi
2023-11-08  5:00 ` [PATCH 13/24] gdb: add value::allocate_register Simon Marchi
2023-11-08  5:00 ` [PATCH 14/24] gdb: read pseudo register through frame Simon Marchi
2023-11-11 20:11   ` John Baldwin
2023-11-08  5:00 ` [PATCH 15/24] gdb: change parameter name in frame_unwind_register_unsigned declaration Simon Marchi
2023-11-08  5:01 ` [PATCH 16/24] gdb: rename gdbarch_pseudo_register_write to gdbarch_deprecated_pseudo_register_write Simon Marchi
2023-11-14 12:12   ` Andrew Burgess
2023-11-14 15:16     ` Simon Marchi
2023-11-08  5:01 ` [PATCH 17/24] gdb: add gdbarch_pseudo_register_write that takes a frame Simon Marchi
2023-11-14 12:20   ` Andrew Burgess
2023-11-14 15:20     ` Simon Marchi
2023-11-08  5:01 ` [PATCH 18/24] gdb: migrate i386 and amd64 to the new gdbarch_pseudo_register_write Simon Marchi
2023-11-11 20:16   ` John Baldwin
2023-11-13  2:59     ` Simon Marchi
2023-11-08  5:01 ` [PATCH 19/24] gdb: make aarch64_za_offsets_from_regnum return za_offsets Simon Marchi
2023-11-08  5:01 ` [PATCH 20/24] gdb: add missing raw register read in aarch64_sme_pseudo_register_write Simon Marchi
2023-11-08  5:01 ` [PATCH 21/24] gdb: migrate aarch64 to new gdbarch_pseudo_register_write Simon Marchi
2023-11-08  5:01 ` [PATCH 22/24] gdb: migrate arm to gdbarch_pseudo_register_read_value Simon Marchi
2023-11-08  5:01 ` [PATCH 23/24] gdb: migrate arm to new gdbarch_pseudo_register_write Simon Marchi
2023-11-08  5:01 ` [PATCH 24/24] gdb/testsuite: add tests for unwinding of pseudo registers Simon Marchi
2023-11-08  5:16 ` [PATCH 00/24] Fix reading and writing pseudo registers in non-current frames Simon Marchi
2023-11-09  3:05   ` Simon Marchi
2023-11-08 11:57 ` Luis Machado
2023-11-08 15:47   ` Simon Marchi
2023-11-08 17:08     ` Luis Machado
2023-11-08 19:34       ` Simon Marchi
2023-11-09 19:04         ` Simon Marchi
2023-11-13 13:10           ` Luis Machado
2023-11-13 15:08             ` Luis Machado
2023-11-11 20:26 ` John Baldwin
2023-11-13  3:03   ` Simon Marchi
2023-12-01 16:27 Simon Marchi
2023-12-01 16:27 ` [PATCH 05/24] gdb: change regcache interface to use array_view Simon Marchi

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=57e29f9d-0b04-47da-b212-014189ac641e@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    /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).