Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [unavailable regs/locals, 01/11] registers status upwards
Date: Mon, 28 Feb 2011 15:53:00 -0000	[thread overview]
Message-ID: <20110228155325.GB7881@host1.dyn.jankratochvil.net> (raw)
In-Reply-To: <201102221327.51130.pedro@codesourcery.com>

On Tue, 22 Feb 2011 14:27:50 +0100, Pedro Alves wrote:
> Make the regcache_XXX_read_XXX functions return an indication
> of whether the register's value is valid, so that the
> frame module can mark frame registers as unavailable.

The basic question on my mind is why instead of REG_UNAVAILABLE it does not
throw NOT_AVAILABLE_ERROR?

And if not NOT_AVAILABLE_ERROR then there should be
__attribute__((warn_unused_result)) as if the caller is operating with
not-available value - it is the case this patchset exactly tries to fix.
In fact all the memsets (, 0, ) could be rather changed to debug-stub 0x55.

Just __attribute__((warn_unused_result)) errors on too many cases which
suggests more for the NOT_AVAILABLE_ERROR throw.

The mail:
	graceful unwind termination when we'd need unavailable/uncollect memory or registers to unwind further
is sure better but without this last mail it it printed:
(gdb) bt
#0  f () at 1.c:11
#1  0x0000000000000000 in ?? ()

and while I did not try I believe one could still find some case(s) where GDB
will print 0.

Currently even if one catches all the cases it is still fragile for future
changes as the developers are not well aware of the `availability'.


Thanks,
Jan


  reply	other threads:[~2011-02-28 15:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-22 13:28 Pedro Alves
2011-02-28 15:53 ` Jan Kratochvil [this message]
2011-03-16  1:40   ` Pedro Alves
2011-03-17 16:31     ` Jan Kratochvil
2011-03-17 16:48       ` Pedro Alves
2011-03-17 17:25         ` Jan Kratochvil
2011-03-17 19:15           ` Pedro Alves
2011-03-28 21:17       ` 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=20110228155325.GB7881@host1.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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