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

Yao Qi qiyaoltc@gmail.com
Mon Nov 23 11:00:00 GMT 2015


Simon Marchi <simon.marchi@ericsson.com> writes:

> 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?

Yes, I think the instruction decoding part in arm for instruction
relocation (for both fast tracepoint and displaced stepping) can be
shared.  The possibility of code sharing was considered at the beginning
of aarch64 work.  However, this possibility wasn't considered, AFICS,
when the arm displaced stepping was added, so I am afraid we need to
refactor, if not rewrite, the existing arm displaced stepping code a lot
for the purpose of sharing code.  It must take much effort.

On the other hand, GDBserver can't move threads out of jump pad without
hardware single step, which is a showstopper to ARM linux fast
tracepoint support.

In short, it is right to share code, but we need to figure out how to
move threads out of jump pad on ARM linux first.  Secondly, rewrite arm
displaced stepping code, and share decoding part with fast tracepoint
instruction relocation.  Unfortunately, the first one is still an open
question to me.

-- 
Yao (齐尧)



More information about the Gdb-patches mailing list