|
Some gdbserver targets generate their target description based on the
gdb/regformats/*.dat files. These .dat files are generated from a
matching xml file in gdb/features/.
Lets consider a concrete example:
Take gdb/features/or1k-linux.xml, this file is processed by
gdb/features/Makefile to create gdb/regformats/or1k-linux.dat.
When gdbserver is built for the or1k target the file
or1k-linux-generated.cc is generated using the
gdb/regformats/regdat.sh script. This .cc file is then compiled and
linked into gdbserver.
The or1k-linux-generated.cc file contains the function
init_registers_or1k_linux which is called from within gdbserver, this
function creates a target_desc object and sets its xmltarget field to
a fixed string. This fixed string is the xml filename that was
originally used to generate the xml file, in this case or1k-linux.xml.
Additionally, as part of the gdbserver build the file or1k-linux.xml
is converted to a string and placed in the file
xml-builtin-generated.cc which is then built into gdbserver.
Now when GDB asks gdbserver for the target description, gdbserver
returns the fixed xmltarget string, which is the name of an xml file.
GDB will then ask gdbserver for that file and gdbserver will return
the contents of that file thanks to the xml-builtin-generated.cc
file's contents.
This is all rather complicated, but it does work. So what's the
problem that I'm fixing?
Well or1k-linux.xml does contain the osabi information, so this will
be returned from gdbserver to GDB. That's good.
However, the target_desc object created in init_registers_or1k_linux
will not have its osabi set correctly.
Now this doesn't really matter too much except
init_registers_or1k_linux includes a call to init_target_desc.
In the next commit I want to extend init_target_desc to require an
osabi to be passed in. The motivation for this will be explained in
the next commit, but if we accept for a moment that this is something
that should be done, then the question is what osabi should we use in
init_registers_or1k_linux?
Ideally we'd use the osabi which is set in or1k-linux.xml. If we do
that then everything will remain consistent, which is a good thing.
And so, to get the osabi from or1k-linux.xml into
init_registers_or1k_linux, we first need to get the osabi information
into or1k-linux.dat file, and this is what this commit does.
I've added a new xsl script print-osabi.xsl and updated
gdb/features/Makefile to make use of this script. Then I regenerated
all of the .dat files. Now every .dat file contains either:
osabi:GNU/Linux
osabi:unknown
The first is for xml files containing <osabi>GNU/Linux</osabi> and the
second is for xml files that don't contain an osabi element.
This commit doesn't attempt to make use of the osabi information in
the .dat files, that will come in the next commit. There should be no
user visible changes after this commit.
Approved-By: Kevin Buettner <kevinb@redhat.com>
|
|
2013-09-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
* NEWS: Mention TDB support.
* features/s390-tdb.xml: New file.
* features/s390-te-linux64.xml: New file.
* features/s390x-te-linux64.xml: New file.
* features/Makefile (WHICH): Add new tdescs above.
(s390-te-linux64-expedite): Set.
(s390x-te-linux64-expedite): Set.
* features/s390-te-linux64.c: New file (generated).
* features/s390x-te-linux64.c: New file (generated).
* regformats/s390-te-linux64.dat: New file (generated).
* regformats/s390x-te-linux64.dat: New file (generated).
* s390-tdep.h (HWCAP_S390_HIGH_GPRS): Define.
(HWCAP_S390_TE): Likewise.
(S390_TDB_DWORD0_REGNUM): Likewise.
(S390_TDB_DWORD0_REGNUM): Likewise.
(S390_TDB_ABORT_CODE_REGNUM): Likewise.
(S390_TDB_CONFLICT_TOKEN_REGNUM): Likewise.
(S390_TDB_ATIA_REGNUM): Likewise.
(S390_TDB_R0_REGNUM): Likewise.
(S390_TDB_R1_REGNUM): Likewise.
(S390_TDB_R2_REGNUM): Likewise.
(S390_TDB_R3_REGNUM): Likewise.
(S390_TDB_R4_REGNUM): Likewise.
(S390_TDB_R5_REGNUM): Likewise.
(S390_TDB_R6_REGNUM): Likewise.
(S390_TDB_R7_REGNUM): Likewise.
(S390_TDB_R8_REGNUM): Likewise.
(S390_TDB_R9_REGNUM): Likewise.
(S390_TDB_R10_REGNUM): Likewise.
(S390_TDB_R11_REGNUM): Likewise.
(S390_TDB_R12_REGNUM): Likewise.
(S390_TDB_R13_REGNUM): Likewise.
(S390_TDB_R14_REGNUM): Likewise.
(S390_TDB_R15_REGNUM): Likewise.
(S390_NUM_REGS): Increase.
(S390_IS_TDBREGSET_REGNUM): New macro.
(s390_regmap_tdb): Declare.
(s390_sizeof_tdbregset): Define.
(tdesc_s390_te_linux64): Declare.
(tdesc_s390x_te_linux64): Likewise.
* s390-tdep.c: Add includes for "auxv.h", <elf.h>,
"features/s390-te-linux64.c", and "features/s390x-te-linux64.c".
(s390_regmap_tdb): New regmap.
(s390_supply_tdb_regset): New function.
(s390_tdb_regset): New regset.
(s390_linux64v2_regset_sections): Add TDB regset to list.
(s390x_linux64v2_regset_sections): Likewise.
(s390_regset_from_core_section): Recognize TDB core note section.
(s390_core_read_description): If HWCAP indicates TE support,
select tdesc_s390_te_linux64 or tdesc_s390_s390x_te_linux64.
(s390_gdbarch_init): Handle TDB regset.
(_initialize_s390_tdep): Initialize new tdescs.
* s390-nat.c (HWCAP_S390_HIGH_GPRS): Remove define.
(have_regset_tdb): New variable.
(s390_native_supply): Support register invalidation.
(fetch_regset): Invalidate registers if ptrace yields ENODATA.
(check_regset): Treat ENODATA as "regset exists".
(s390_linux_fetch_inferior_registers): Add TDB.
(s390_read_description): Check for TDB existence and select
appropriate tdesc.
* gdbserver/Makefile.in (clean): Add removal of new makefile
targets.
(s390-te-linux64.c): New makefile target.
(s390x-te-linux64.c): Likewise.
* gdbserver/configure.srv (srv_regobj): Append new objects
s390-te-linux64.o and s390x-te-linux64.o.
(srv_xmlfiles): Append new files s390-te-linux64.xml,
s390x-te-linux64.xml, and s390-tdb.xml.
* gdbserver/linux-s390-low.c (init_registers_s390_te_linux64): New
declaration.
(tdesc_s390_te_linux64): Likewise.
(init_registers_s390x_te_linux64): Likewise.
(tdesc_s390x_te_linux64): Likewise.
(s390_check_regset): Treat ENODATA as "regset exists".
(s390_arch_setup): Add TDB regset support.
(initialize_low_arch): Initialize registers for new tdescs.
gdb/doc/ChangeLog:
2013-09-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
* gdb.texinfo (Decimal Floating Point format): Mention S/390.
(Standard Target Features): Add new node to menu.
(S/390 and System z Features): New node.
gdb/testsuite/ChangeLog:
2013-09-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
* gdb.arch/s390-tdbregs.c: New file.
* gdb.arch/s390-tdbregs.exp: New file.
|