Re: [RFA/RFT PATCH 0/3] Add TDB regset support

Pedro Alves
2013-06-07T16:44:55Z

On 06/07/2013 04:59 PM, Andreas Arnez wrote:
> Pedro Alves <palves@redhat.com> writes:
>
>> Why isn't this exposed as a new target description that includes the
>> new register set?
>
> It would require extracting the hardware capabilities from the core
> file's auxiliary vector in order to distinguish between platforms with
> and without the transactional-execution facility. I guess it could be
> done, but I didn't consider it that important.

You might not need to look at the auxv. Return the right tdesc
depending on presence of bfd sections. See ppc_linux_core_read_description.

> Do you see any problems with the current approach?

> --- gdb.orig/gdb/regformats/s390-linux64v2.dat
> +++ gdb/gdb/regformats/s390-linux64v2.dat
> @@ -72,3 +72,23 @@ expedite:r14l,r15l,pswa
> 32:orig_r2
> 32:last_break
> 32:system_call
> +64:tdb0
> +64:tac
> +64:tct
> +64:atia
> +64:tr0
> +64:tr1
> +64:tr2
> +64:tr3
> +64:tr4
> +64:tr5
> +64:tr6
> +64:tr7
> +64:tr8
> +64:tr9
> +64:tr10
> +64:tr11
> +64:tr12
> +64:tr13
> +64:tr14
> +64:tr15

If you connect a 7.6 GDB without this patch to a new GDBserver that
sends this extended regdat, I believe GDB will complain with
"Remote 'g' packet reply is too long", even if the target actually
doesn't support TDB. You should really add support for TDB to
GDBserver too, before calling all this done.

You're extending the remote register buffer with an optional feature,
and in future when another alternative register set comes along that
replaces this one, we're in trouble, as we won't be able to tell
which is which (without ugly hacks).

See how Ulrich handled this last time:

http://sourceware.org/ml/gdb-patches/2011-12/msg00005.html

--
Pedro Alves