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: [unavailable regs/locals, 01/11] registers status upwards


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


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