Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org, Doug Evans <xdje42@gmail.com>
Subject: Re: [PATCH] guile/: Add enum casts
Date: Thu, 29 Oct 2015 13:00:00 -0000	[thread overview]
Message-ID: <563123AC.2080804@redhat.com> (raw)
In-Reply-To: <CAFXXi0mtDwZBXNF1LCe61yEgsU=AcaYz-kQSWiFe6ONpxne2=Q@mail.gmail.com>

On 10/28/2015 07:29 PM, Simon Marchi wrote:

> The status comes from gdbscm_disasm_read_memory returning TARGET_XFER_E_IO:
> 
>   return status != NULL ? TARGET_XFER_E_IO : 0;
> 
> Does it make sense that this function returns TARGET_XFER_E_IO, and
> not just -1 (or any other non-zero value) on error?  It's an
> all-or-nothing memory read function, unlike those of the xfer_partial
> interface.
> 
> I would have done a change similar to what you have done in
> target_read_memory&co: make gdbscm_disasm_read_memory return -1 on
> error, and change
>   memory_error (status, memaddr);
> to
>   memory_error (TARGET_XFER_E_IO, memaddr);
> 
> Would it make sense?

I had the same thoughts when I did the target_read_memory&co patch,
and went through all the memory_error callers.  In the end I left
it be because of the IWBN comment:

  /* TODO: IWBN to distinguish problems reading target memory versus problems
     with the port (e.g., EOF).
     We return TARGET_XFER_E_IO here as that's what memory_error looks for.  */
  return status != NULL ? TARGET_XFER_E_IO : 0;

Either way is fine with me.  Doug, what would you prefer?

Cast?
Hardcode TARGET_XFER_E_IO in the memory_error call?
Other?

Thanks,
Pedro Alves


  reply	other threads:[~2015-10-28 19:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 12:31 Pedro Alves
2015-10-29 12:43 ` Simon Marchi
2015-10-29 13:00   ` Pedro Alves [this message]
2015-10-29 13:02     ` Pedro Alves
2015-10-29 13:02       ` Pedro Alves
2015-11-17 13:47         ` Pedro Alves
2015-10-29 17:51 ` Pedro Alves

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=563123AC.2080804@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    --cc=xdje42@gmail.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