[PATCH 0/2] Add native GNU/Linux support for ARC in GDB

Shahab Vahedi shahab.vahedi@gmail.com
Thu Nov 12 13:48:09 GMT 2020


From: Shahab Vahedi <shahab@synopsys.com>

This patch series is mainly about adding a native GNU/Linux support for
ARC in GDB ("[PATCH 2/2] gdb: Add native support for ARC in GNU/Linux").

During the process of mulling over that change, I noticed that the ARC
target support could become more efficient in some of the target hooks
in "arc-linux-tdep.c"; namely the "arc_linux_supply_*()" and the
"arc_linux_collect_v2_regset()".  In those hooks, REGNUM is completely
ignored and every register is fetched/overwritten.  These hooks are
used by the "arc-linux-nat.c" (the second patch) and it relies on them:
Therefore, the first patch of this series: "[PATCH 1/2]: arc: Take into
account the REGNUM in supply/collect gdb hooks".

To summarize:
[PATCH 1/2] -> Respect REGNUM in hooks.
[PATCH 2/2] -> Add native ARC GNU/Linux support while using those hooks.

One last remark: The native GDB works correctly along with this
fix [1].  Therefore, if you want to give it a try, please also apply
that patch.

[1] [PATCH] arc: Write correct "eret" value during register collection
https://sourceware.org/pipermail/gdb-patches/2020-November/173202.html

How to build:
Get the "Linux/{glibc,uClibc} ARC HS" toolchain from:
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases
and extract it somewhere.

Update the PATHs so you can find "arc-linux-gcc":
$ export PATH=/extracted/dir/bin:$PATH
$ export LD_LIBRARY_PATH=/extracted/dir/lib:$LD_LIBRARY_PATH

$ cd /to/gdb/src
$ host=arc-snps-linux-gnu            # or arc-snps-linux-uclibc
$ configure --prefix=/usr            \
            --host=$host             \
            --disable-build-with-cxx \
            --disable-gas            \
            --disable-ld             \
            --disable-binutils
$ make -j $(nproc)
$ arc-linux-strip ./gdb/gdb

Anton Kolesov (1):
  gdb: Add native support for ARC in GNU/Linux

Shahab Vahedi (1):
  arc: Take into account the REGNUM in supply/collect gdb hooks

 gdb/Makefile.in      |   1 +
 gdb/arc-linux-nat.c  | 321 +++++++++++++++++++++++++++++++++++++++++++
 gdb/arc-linux-tdep.c |  41 ++++--
 gdb/configure.host   |   3 +
 gdb/configure.nat    |   4 +
 5 files changed, 361 insertions(+), 9 deletions(-)
 create mode 100644 gdb/arc-linux-nat.c

-- 
2.29.2



More information about the Gdb-patches mailing list