From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Tom Tromey <tromey@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Use CORE_ADDR as return type from x86_dr_low_get_addr
Date: Fri, 3 Sep 2021 13:17:48 -0400 [thread overview]
Message-ID: <6ca2366b-f033-4dcd-c1e1-13a86c6d2205@polymtl.ca> (raw)
In-Reply-To: <875yvhlhkv.fsf@tromey.com>
On 2021-09-03 1:00 p.m., Tom Tromey wrote:
> Tom> It just seemed to me that, most of the time, the value really is a
> Tom> CORE_ADDR, and that anyway a CORE_ADDR would definitely be large enough.
>
> Thinking about this a bit more -- it seems wrong to me to use uintptr_t
> (a host type) to represent a register value (a target type). So from
> this perspective, CORE_ADDR is more correct. Now, it's not completely
> correct in the sense that not every DR register holds an address. But,
> it's at least harmless in those cases.
This is in windows-nat.c, where host == target, so I think uintptr_t is
somewhat correct given the uses cases we want to support (GDB 32
debugging inferior 32, GDB 64 debugging inferior 32 and GDB 64 debugging
inferior 64). If it were in windows-tdep.c, it would definitely be
wrong.
But uintptr_t isn't any more correct than CORE_ADDR, so I'm not against
the change either.
Simon
next prev parent reply other threads:[~2021-09-03 17:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-03 16:32 Tom Tromey
2021-09-03 16:43 ` Simon Marchi via Gdb-patches
2021-09-03 16:48 ` Tom Tromey
2021-09-03 17:00 ` Tom Tromey
2021-09-03 17:17 ` Simon Marchi via Gdb-patches [this message]
2021-09-03 17:29 ` Tom Tromey
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=6ca2366b-f033-4dcd-c1e1-13a86c6d2205@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
--cc=tromey@adacore.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