This is the mail archive of the
mailing list for the GDB project.
RE: [PATCH] 32 bit-ism in lm32-tdep.c (and some sloppy macros)
- From: "Jon Beniston" <jon at beniston dot com>
- To: "'Tom Tromey'" <tromey at redhat dot com>, "'Werner Almesberger'" <werner at almesberger dot net>
- Cc: <gdb-patches at sourceware dot org>
- Date: Mon, 14 Nov 2011 15:54:35 -0000
- Subject: RE: [PATCH] 32 bit-ism in lm32-tdep.c (and some sloppy macros)
- References: <20111111233808.GA10815@ws> <firstname.lastname@example.org>
> Werner> -#define LM32_IMM16(insn) ((((long)insn & 0xffff) << 16) >>
> Werner> +#define LM32_IMM16(insn) ((long) (int16_t) (insn))
> I was a little surprised to find out we already use int16_t in gdb.
> Anyway, it seems that the macro would be more obvious as:
> #define LM32_IMM16(insn) ((long) ((insn) & 0xffff))
I'm not sure that sign-extends?