This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Clear upper bits during sign extension
- From: Yao Qi <yao at codesourcery dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Tue, 30 Dec 2014 21:46:58 +0800
- Subject: Re: [PATCH] Clear upper bits during sign extension
- Authentication-results: sourceware.org; auth=none
- References: <1419815569-21854-1-git-send-email-yao at codesourcery dot com> <54A13184 dot 1070902 at redhat dot com> <874msdwl39 dot fsf at codesourcery dot com> <54A29886 dot 8030603 at redhat dot com>
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 (éå)