This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [NEWS/RFA] Re: [gdbserver] x86 agent expression bytecode compiler (speed up conditional tracepoints)


Doug Evans <dje@google.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) \
  do \
   { \
     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)

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]