[RFC][PATCH 09/15] gdb: Add relocate instruction helpers

Simon Marchi simon.marchi@ericsson.com
Fri Nov 20 18:06:00 GMT 2015


On 15-10-27 07:20 AM, Yao Qi wrote:
> henrik.wallin@windriver.com writes:
> 
>> The functions are used both when validating an instruction
>> when the users sets a fast tracepoint and when relocating
>> an instruction when gdbserver/ipa installs the jump pad.
>>
>> Currently all PC relative instructions are considered
>> not relocatable.
>>
>> Futher improvements can be made by rewriting some of those
>> instructions with alternative instructions.
>>
>> gdb/ChangeLog:
>>
>> 	* arm-tdep.c : Add relocate functionality to be used by fast
>> 	tracepoint support.
> 
> You are relocating instructions in GDB side, which uses qRelocInsn
> packet.  Why don't you relocate them in GDBserver side?  Search 
> aarch64_relocate_instruction in gdbserver/linux-aarch64-low.c, and you
> may have some clues from it.
> 

Hi Yao,

It seems like the code that Henrik adds in this patch (for relocating an
instruction) is very similar to the code currently in arm-tdep.c for
displaced stepping.  I think we can extract it and place it in arch/,
then use it both for displaced stepping and fast tracepoints.  That's
what aarch64 does currently, is that right?  Do you think it's the
right way to go for arm as well?

Simon



More information about the Gdb-patches mailing list