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)


>>>>> ">" == Hui Zhu <teawater@gmail.com> writes:

>> In dbct, I get the binary code like what you do in this patch.
>> define a functon, get binary code from this function, and use it for
>> other thing.

>> Because Gcc's optimization will compile the function that support the
>> code to some asm code that we don't want it to be.

In this case I think the code is only using GCC as a sort of glorified
assembler.  From what I can see it is not taking the qemu approach of
having GCC compile C, then memcpying around the resulting object code.
Instead it is just using inline assembler, like:

  EMIT_ASM32 (i386_prologue,
	    "push %ebp\n\t"
	    "mov %esp,%ebp");

This seems more reliable than the write-it-in-C approach.

Tom


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