Re: [PATCH] Clear upper bits during sign extension

Yao Qi
2014-12-30T13:47:16Z

Pedro Alves <palves@redhat.com> writes:

> So I think we should either explicitly always clear bits above TYPE_LENGTH
> after value_as_address, with a comment mentioning that we don't want
> any magic bits that gdbarch_pointer_to_address would give us,
> or, given we know the value is really an offset, simply extract the value
> that way. Like in the patch below:

The latter is fine to me.

> + byte_order = gdbarch_byte_order (get_type_arch (type));

How about getting gdbarch via get_frame_arch (frame)? How about
removing gdb_sign_extend as it is no longer used?

I'll post a full version on top of yours.

--
Yao (齐尧)