Re: [RFA/RFC Prec] Add Linux AMD64 process record support second version, (instruction set support) 1/3

Mark Kettenis
2009-07-19T17:39:14Z

> 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().