This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/RFC Prec] Add Linux AMD64 process record support second version, (instruction set support) 1/3
On Mon, Jul 20, 2009 at 01:39, Mark Kettenis<mark.kettenis@xs4all.nl> wrote:
>> From: Hui Zhu <teawater@gmail.com>
>> Date: Mon, 20 Jul 2009 01:16:10 +0800
>
>> ?/* Parse the current instruction and record the values of the registers and
>> ? ? memory that will be changed in current instruction to "record_arch_list".
>> ? ? Return -1 if something wrong. */
>>
>> +#define I386_RECORD_ARCH_LIST_ADD_REG(regnum) \
>> + ? ?do { \
>> + ? ? ? ? if (record_arch_list_add_reg (ir.regcache, ir.regmap[(regnum)])) \
>> + ? ? ? ? return -1; \
>> + ? ? ? } while (0)
>> +
>
> Hmm, I really disklike this macro. ?Having that return embedded in
> there is really bad.
>
> The current implementation of record_arch_list_add_reg() always
> returns 0, so I don't see why you need it.
>
> You should make record_arch_list_add_reg().
>
Thanks Mark,
I will change it to:
+#define I386_RECORD_ARCH_LIST_ADD_REG(regnum) \
+ record_arch_list_add_reg (ir.regcache, ir.regmap[(regnum)])
+
And about the the "record_arch_list_add_reg", I will post a special
patch to change it to void later.
Thanks,
Hui