gdb: revert "gdb: unify parts of the Linux and FreeBSD core dumping code"
authorAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 9 Feb 2021 21:41:30 +0000 (21:41 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 9 Feb 2021 21:46:12 +0000 (21:46 +0000)
commit03642b7189bc0bfdf61354a6d9a3f3e46d82709c
tree4c18b49e25fceaab1b1a658fc868b55d61d4387f
parentb61f78118a850a28a41a461fdaea4026ddc17658
gdb: revert "gdb: unify parts of the Linux and FreeBSD core dumping code"

This reverts commit 82a1fd3a4935fe665cf08bc6820942c4a091184c.

It was pointed out:

  https://sourceware.org/pipermail/gdb-patches/2021-February/175750.html

that commit 82a1fd3a4935 caused GDB to have an unconditional
dependency on ELF specific parts of BFD.  What this means is that if
GDB and BFD are built for a non-elf target then there will be
undefined symbol references within GDB.

The right solution isn't immediately obvious.  So rather than rush a
fix in I'm reverting this commit for now, and will bring it back once
I have a good solution.

gdb/ChangeLog:

* gcore.c (struct gcore_collect_regset_section_cb_data): Delete.
(gcore_collect_regset_section_cb): Delete.
(gcore_collect_thread_registers): Delete.
(gcore_build_thread_register_notes): Delete.
(gcore_find_signalled_thread): Delete.
* gcore.h: Remove 'gdbsupport/gdb_signals.h' include and delete
'gdbarch' and 'thread_info' declarations.
(gcore_build_thread_register_notes): Delete declaration.
(gcore_find_signalled_thread): Likewise.
* fbsd-tdep.c: Remove 'gcore.h' include.
(struct fbsd_collect_regset_section_cb_data): New struct.
(fbsd_collect_regset_section_cb): New function.
(fbsd_collect_thread_registers): New function.
(struct fbsd_corefile_thread_data): New struct.
(fbsd_corefile_thread): New function.
(fbsd_make_corefile_notes): Call FreeBSD specific code.
* linux-tdep.c: Remove 'gcore.h' include.
(struct linux_collect_regset_section_cb_data): New struct.
(linux_collect_regset_section_cb): New function.
(linux_collect_thread_registers): New function.
(linux_corefile_thread): Call Linux specific code.
(find_signalled_thread): New function.
(linux_make_corefile_notes): Call find_signalled_thread.
gdb/ChangeLog
gdb/fbsd-tdep.c
gdb/gcore.c
gdb/gcore.h
gdb/linux-tdep.c