This is the mail archive of the 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] New function value_has_address

On 10/28/2016 12:49 PM, Yao Qi wrote:
>> >
>> > Note that we call value_address on lval_computed values and that
>> > incorrectly returns "value->location.address + value->offset",
>> > which is completely bogus.  (Try running to main, and then doing
>> > p $_siginfo).
>> >
>> > The value printing routines want to pass around a value address,
>> > but since we actually pass the value pointer around nowadays too,
>> > I think that parameter could be eliminated, and the result is
>> > likely to be that value_address ends up called is much fewer
>> > places where it doesn't really make sense.
> value_address () return value is not always passed to val_print.
> We pass zero to val_print in some places in ada-valprint.c.
> I don't see how to eliminate tat parameter, if I understand you
> correctly.

That suggests that it's calling val_print on values that can't
even have an address.  Those cases would be adjusted to address,
as the others.  Then at the points that actually do need
a value's address somewhere inside val_print and callees, we'd get
the address from the struct value * pointer passed around
as well, maybe adjusted with the sliding embedded_offset
passed down too.  Currently, it's not easy to see which are
those places exactly because we always pass around some
address, even if bogus.

Pedro Alves

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