Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org, Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH v2] gdb/corelow: mark bytes unavailable when reading from unavailable mapping
Date: Mon, 9 Mar 2026 14:37:20 -0400	[thread overview]
Message-ID: <bc2035dc-632a-4a6c-80cd-670950adb2fa@polymtl.ca> (raw)
In-Reply-To: <87ms0npn5b.fsf@tromey.com>

On 3/4/26 11:36 AM, Tom Tromey wrote:
>>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:
> 
> Simon> The main motivation for this change is to nicely support "lightweight"
> Simon> core files on ROCm (more on this below), but I think that the change
> Simon> also makes sense for regular core files.
> 
> FWIW this all makes sense to me.
> 
> Simon> diff --git a/gdb/corelow.c b/gdb/corelow.c
> Simon> index a28a707c293a..57d05504fa3c 100644
> Simon> --- a/gdb/corelow.c
> Simon> +++ b/gdb/corelow.c
> Simon> @@ -1470,7 +1470,8 @@ core_target::xfer_partial (enum target_object object, const char *annex,
> Simon>  		if (xfer_status == TARGET_XFER_OK)
> Simon>  		  return TARGET_XFER_OK;
>  
> Simon> -		return TARGET_XFER_E_IO;
> Simon> +		*xfered_len = len;
> Simon> +		return TARGET_XFER_UNAVAILABLE;
> Simon>  	      }
> Simon>  	  }
>  
> Just before this is a comment ending with
> 
> 	   If that fails, but the access is within an unavailable region,
> 	   then the access itself should fail.  */
> 
> but perhaps this could be reworded to not say "fail" but something about
> unavailability.
> 
> Though honestly this is kind of a nit since the code speaks for itself.

It's an easy enough fix and it's good to be precise.  Changed it to:

	   If that fails, but the access is within an unavailable region,
	   then report the bytes as unavailable.  */

> Anyway I think this is good.
> Approved-By: Tom Tromey <tom@tromey.com>

Thanks, pushed.

Simon

      reply	other threads:[~2026-03-09 18:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-28  2:20 [PATCH] " Simon Marchi
2026-03-02  3:23 ` [PATCH v2] " simon.marchi
2026-03-02 13:00   ` Eli Zaretskii
2026-03-02 15:49     ` Aktemur, Tankut Baris
2026-03-02 20:01       ` Simon Marchi
2026-03-02 19:54     ` Simon Marchi
2026-03-04 16:38     ` Tom Tromey
2026-03-04 16:36   ` Tom Tromey
2026-03-09 18:37     ` Simon Marchi [this message]

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=bc2035dc-632a-4a6c-80cd-670950adb2fa@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    --cc=tom@tromey.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