summaryrefslogtreecommitdiff
path: root/devel/gdb/files/commit-8399425f5f
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2019-06-01 00:44:08 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2019-06-01 00:44:08 +0000
commit8113892617de0ababfc7c5773c7d147f807243d3 (patch)
tree215f908414b55511ecbc05cc9435c5638fcd39b6 /devel/gdb/files/commit-8399425f5f
parent- Update to 20190601 (diff)
Update port to GDB 8.3.
New features in GDB 8.3 include support for DWARF index caches and styling (colors) in the CLI and TUI. Source code styling is also available via the new SOURCE_HIGHLIGHT option (enabled by default). GDB 8.3 also adds support for FreeBSD/riscv64. In addition, kgdb has been updated for changes in 8.3 along with support for FreeBSD/riscv64 kernels. The libc++ helpers have been updated to a newer version which adds support for std::list<> and std::forward_list<>. The helpers now also support Python 3. Finally, a few post-8.3 patches have been backported which add suport for TLS (Thread Local Storage) variables on FreeBSD amd64, i386, powerpc, and riscv architectures. Note that amd64 and i386 do not support examining TLS variables in core dumps currently. This support along with support for additional architectures require kernel changes and will be added in the future once the kernel has been updated. Reviewed by: pizzamig (maintainer) Differential Revision: https://reviews.freebsd.org/D20403
Notes
Notes: svn path=/head/; revision=503200
Diffstat (limited to 'devel/gdb/files/commit-8399425f5f')
-rw-r--r--devel/gdb/files/commit-8399425f5f69
1 files changed, 69 insertions, 0 deletions
diff --git a/devel/gdb/files/commit-8399425f5f b/devel/gdb/files/commit-8399425f5f
new file mode 100644
index 000000000000..6545579f01a9
--- /dev/null
+++ b/devel/gdb/files/commit-8399425f5f
@@ -0,0 +1,69 @@
+commit 8399425f5f472ad8e630bb30ad2dbefeddbb68b7
+Author: John Baldwin <jhb@FreeBSD.org>
+Date: Tue Mar 12 13:39:02 2019 -0700
+
+ Support TLS variables on FreeBSD/powerpc.
+
+ Derive the pointer to the DTV array from the %r2 register on 32-bit
+ powerpc and %r13 on 64-bit powerpc.
+
+ gdb/ChangeLog:
+
+ * ppc-fbsd-tdep.c (ppcfbsd_get_thread_local_address): New.
+ (ppcfbsd_init_abi): Install gdbarch
+ "fetch_tls_load_module_address" and "get_thread_local_address"
+ methods.
+
+diff --git gdb/ppc-fbsd-tdep.c gdb/ppc-fbsd-tdep.c
+index c21a52c898..290bd1fd88 100644
+--- gdb/ppc-fbsd-tdep.c
++++ gdb/ppc-fbsd-tdep.c
+@@ -279,6 +279,39 @@ ppcfbsd_return_value (struct gdbarch *gdbarch, struct value *function,
+ regcache, readbuf, writebuf);
+ }
+
++/* Implement the "get_thread_local_address" gdbarch method. */
++
++static CORE_ADDR
++ppcfbsd_get_thread_local_address (struct gdbarch *gdbarch, ptid_t ptid,
++ CORE_ADDR lm_addr, CORE_ADDR offset)
++{
++ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
++ struct regcache *regcache;
++ int tp_offset, tp_regnum;
++
++ regcache = get_thread_arch_regcache (ptid, gdbarch);
++
++ if (tdep->wordsize == 4)
++ {
++ tp_offset = 0x7008;
++ tp_regnum = PPC_R0_REGNUM + 2;
++ }
++ else
++ {
++ tp_offset = 0x7010;
++ tp_regnum = PPC_R0_REGNUM + 13;
++ }
++ target_fetch_registers (regcache, tp_regnum);
++
++ ULONGEST tp;
++ if (regcache->cooked_read (tp_regnum, &tp) != REG_VALID)
++ error (_("Unable to fetch tcb pointer"));
++
++ /* tp points to the end of the TCB block. The first member of the
++ TCB is the pointer to the DTV array. */
++ CORE_ADDR dtv_addr = tp - tp_offset;
++ return fbsd_get_thread_local_address (gdbarch, dtv_addr, lm_addr, offset);
++}
+
+ static void
+ ppcfbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+@@ -322,6 +355,8 @@ ppcfbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+
+ set_gdbarch_fetch_tls_load_module_address (gdbarch,
+ svr4_fetch_objfile_link_map);
++ set_gdbarch_get_thread_local_address (gdbarch,
++ ppcfbsd_get_thread_local_address);
+ }
+
+ void