Re: [PATCH 2/4] Use the target architecture when encoding tracepoint actions

Marcin Kościelnicki
2016-02-06T20:58:32Z

On 07/01/16 18:44, Antoine Tremblay wrote:
> This patch uses the target architecture rather then the objfile
> architecture when encoding tracepoint actions.
>
> The target architecture may contain additional registers. E.g. ARM VFP
> registers. This information is needed to allow their collection. Since we
> can never know whether the registers numbers in the target match the
> binary's we have to use tdesc here.
>
> One note about combined debuggers / multi-inferior from Pedro Alves:
>
> In the combined debugger case taking Cell as the practical example that
> gdb supports currently:
>
> In that case, the main target_gdbarch() will be powerpc, but you may have set a
> tracepoint on _spu_ code, which has a different gdbarch. so for that case,
> target_gdbarch would be wrong. I think that in that case, we'd need to
> find __the_ target/tdesc gdbarch that is (bfd) compatible with the
> objfile's gdbarch.
>
> I think cell/spu gdbserver doesn't support tracepoints, so we can ignore
> this for now.
>
> The multi-inferior/process case is somewhat related, but its simpler.
> each inferior has its own gdbarch.
>
> That is, target_gdbarch depends on the current inferior selected.
> In fact, that just returns inferior->gdbarch nowaways.
>
> No regressions, tested on ubuntu 14.04 ARMv7 and x86.
> With gdbserver-{native,extended} / { -marm -mthumb }
>
> gdb/ChangeLog:
>
> * tracepoint.c (encode_actions_1): Use target_gdbarch () rather
> than loc->gdbarch.
> [...]

Hey, could we get that one pushed soon? I've made a patchset that adds
tdesc information to tfile format, making it work properly for
multiple-tdesc architectures
(https://sourceware.org/ml/gdb-patches/2016-02/msg00161.html), and made
x86_64 work with collecting AVX registers
(https://sourceware.org/ml/gdb-patches/2016-02/msg00167.html), so that
patch could do a lot of good already.

Marcin KoÅ›cielnicki