This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH V3] read_pieced_value do big endian processing only in case of valid gdb_regnum
- From: Yao Qi <yao at codesourcery dot com>
- To: Victor Kamensky <victor dot kamensky at linaro dot org>
- Cc: <gdb-patches at sourceware dot org>, Andrew Pinski <pinskia at gmail dot com>
- Date: Thu, 23 Oct 2014 14:32:31 +0800
- Subject: Re: [PATCH V3] read_pieced_value do big endian processing only in case of valid gdb_regnum
- Authentication-results: sourceware.org; auth=none
- References: <1414042597-30986-1-git-send-email-victor dot kamensky at linaro dot org>
Victor Kamensky <victor.kamensky@linaro.org> writes:
> gdb/ChangeLog:
>
> 2014-10-21 Victor Kamensky <victor.kamensky@linaro.org>
>
> * dwarf2loc.c (read_pieced_value): Do BE processing only if
s/BE/big endian/
> @@ -1876,15 +1876,15 @@ write_pieced_value (struct value *to, struct value *from)
> {
> struct gdbarch *arch = get_frame_arch (frame);
> int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch, p->v.regno);
> - int reg_offset = dest_offset;
> -
> - if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG
> - && this_size <= register_size (arch, gdb_regnum))
> - /* Big-endian, and we want less than full size. */
> - reg_offset = register_size (arch, gdb_regnum) - this_size;
>
> if (gdb_regnum != -1)
> {
> + int reg_offset = dest_offset;
Add an empty line between local declaration and first statement. See
https://sourceware.org/gdb/wiki/JoelsCodingStyleCheatSheet
> + if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG
> + && this_size <= register_size (arch, gdb_regnum))
> + /* Big-endian, and we want less than full size. */
> + reg_offset = register_size (arch, gdb_regnum) - this_size;
> +
Could you please add braces to the if block, which has more than one
lines? (braces are not needed if the block only has one line.)
if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG
&& this_size <= register_size (arch, gdb_regnum))
{
/* Big-endian, and we want less than full size. */
reg_offset = register_size (arch, gdb_regnum) - this_size;
}
This patch is OK to me. If there is no comments from other people in
three days, you can push it in. I'd like this patch stay here for a
while, and another pair of eyes may have a chance to take a look.
--
Yao (éå)