This is the mail archive of the
mailing list for the GDB project.
Re: [NEWS/RFA] Re: [gdbserver] x86 agent expression bytecode compiler (speed up conditional tracepoints)
Doug Evans <email@example.com> writes:
> This worked with the gcc4.4.0 variant I was using.
> Ian: Is there a Right way to do this?
I don't know about a right way, but since this code is both gcc and
x86 specific, I think I would just write something along the lines of
#define EMIT_ASM(NAME, INSNS) \
extern unsigned char start_ ## NAME, end_ ## NAME; \
add_insns (&start_ ## NAME, &end_ ## NAME - &start_ ## NAME); \
asm ("jmp end_" NAME "\; start_" NAME ":\;" INSNS "\; end_" NAME ":"); \
} while (0)