This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR gdb/15871: Unavailable entry value is not shown correctly


> Date: Wed, 21 Aug 2013 16:32:21 +0100
> From: Pedro Alves <palves@redhat.com>
> 
> On 08/21/2013 03:47 PM, Mark Kettenis wrote:
> >> Date: Wed, 21 Aug 2013 15:35:40 +0100
> >> From: Pedro Alves <palves@redhat.com>
> >>
> >> On 08/13/2013 08:39 AM, Yao Qi wrote:
> >>> However, when I run this test, I find j@entry is something like,
> >>> j@entry=<error reading variable: Cannot access memory at address 0x8049788>
> >>> instead of unavailable.
> >>>
> >>> I don't emit a fail for it because I am not very sure it is expected
> >>> to be "unavailable".  I am fine to kfail it.
> >>>
> >>> I looked into a little, and looks reading entry value doesn't use
> >>> value availability-aware API.  It is not an easy fix to me.
> >>
> >> I looked into this.  Here's a patch.  Let me know what you think.
> > 
> > I think you should simply define the return codes as negative numbers.
> 
> I think that's really a matter of taste.  But maybe my taste is
> broken...  It's quite common to return "-errno" as error indication.
> The Linux kernel uses that convention for example.

Yeah.  I was tempted to add that you've been exposed to too much Linux
kernel programming ;).

Anyway, I'd argue it's more than a matter of taste.  Even in the
little bit of code you used the enum values both with and without a
minus sign.  That's confusing.  Thanks for fixing this.  Diff looks
reasonable to me.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]