From f01e1d0c17caca18b6d4723bf7579a20395cb6cc Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sun, 20 Feb 2022 00:18:58 -0800 Subject: [PATCH] Ports/gdb: Add descriptions to all gdb patches and remove dead code Before working on the gdb port some more, I wanted to get these patches cleaned up to have a good base to build upon. --- Meta/lint-ports.py | 1 - ...oc-for-alternate_signal_stack-for-s.patch} | 13 ++++++++ ...c-ptrace-based-native-target-for-Se.patch} | 30 ++++--------------- ...db-Add-build-support-for-SerenityOS.patch} | 14 +++++++++ ...iler-fpermissive-warnings-from-usin.patch} | 4 +-- Ports/gdb/patches/ReadMe.md | 22 ++++++++++++++ 6 files changed, 57 insertions(+), 27 deletions(-) rename Ports/gdb/patches/{alt-stack-no-malloc.patch => 0001-gdb-Disable-xmalloc-for-alternate_signal_stack-for-s.patch} (81%) rename Ports/gdb/patches/{basic-ptrace-i386-native-target.patch => 0002-serenity-Add-basic-ptrace-based-native-target-for-Se.patch} (94%) rename Ports/gdb/patches/{build-config.patch => 0003-gdb-Add-build-support-for-SerenityOS.patch} (80%) rename Ports/gdb/patches/{fix-fpermissive-warnings.patch => 0004-serenity-Fix-compiler-fpermissive-warnings-from-usin.patch} (92%) create mode 100644 Ports/gdb/patches/ReadMe.md diff --git a/Meta/lint-ports.py b/Meta/lint-ports.py index 979da6cee56..69fd5edbb4d 100755 --- a/Meta/lint-ports.py +++ b/Meta/lint-ports.py @@ -51,7 +51,6 @@ PORTS_MISSING_DESCRIPTIONS = { 'freetype', 'gawk', 'gcc', - 'gdb', 'genemu', 'gettext', 'git', diff --git a/Ports/gdb/patches/alt-stack-no-malloc.patch b/Ports/gdb/patches/0001-gdb-Disable-xmalloc-for-alternate_signal_stack-for-s.patch similarity index 81% rename from Ports/gdb/patches/alt-stack-no-malloc.patch rename to Ports/gdb/patches/0001-gdb-Disable-xmalloc-for-alternate_signal_stack-for-s.patch index 974d1db061a..62422957755 100644 --- a/Ports/gdb/patches/alt-stack-no-malloc.patch +++ b/Ports/gdb/patches/0001-gdb-Disable-xmalloc-for-alternate_signal_stack-for-s.patch @@ -1,3 +1,13 @@ +From 32bfc7a161e6bf10decbf29b31c7b547cf250d3a Mon Sep 17 00:00:00 2001 +From: Brian Gianforcaro +Date: Sat, 19 Feb 2022 19:46:06 -0800 +Subject: [PATCH 1/4] gdb: Disable xmalloc for alternate_signal_stack for + serenity + +--- + gdbsupport/alt-stack.h | 37 ++++++++++++++++++++++++++----------- + 1 file changed, 26 insertions(+), 11 deletions(-) + diff --git a/gdbsupport/alt-stack.h b/gdbsupport/alt-stack.h index 056ea41..b638533 100644 --- a/gdbsupport/alt-stack.h @@ -68,3 +78,6 @@ index 056ea41..b638533 100644 stack_t m_old_stack; #endif }; +-- +2.32.0 + diff --git a/Ports/gdb/patches/basic-ptrace-i386-native-target.patch b/Ports/gdb/patches/0002-serenity-Add-basic-ptrace-based-native-target-for-Se.patch similarity index 94% rename from Ports/gdb/patches/basic-ptrace-i386-native-target.patch rename to Ports/gdb/patches/0002-serenity-Add-basic-ptrace-based-native-target-for-Se.patch index b3dec2238c9..4809c8ac341 100644 --- a/Ports/gdb/patches/basic-ptrace-i386-native-target.patch +++ b/Ports/gdb/patches/0002-serenity-Add-basic-ptrace-based-native-target-for-Se.patch @@ -1,7 +1,7 @@ -From 581bbef892960b1533aa9d9918f5eeee4bff9cce Mon Sep 17 00:00:00 2001 +From 883a25f5ed8fd8f13b8e30aed3a25001839d892c Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Tue, 28 Dec 2021 04:35:47 -0800 -Subject: [PATCH 2/3] serenity: Add basic ptrace based native target for +Subject: [PATCH 2/4] serenity: Add basic ptrace based native target for SerenityOS/i386 --- @@ -14,10 +14,10 @@ Subject: [PATCH 2/3] serenity: Add basic ptrace based native target for gdb/osabi.c | 1 + gdb/osabi.h | 1 + gdb/serenity-nat.c | 13 +++++ - gdb/serenity-nat.h | 34 +++++++++++++ + gdb/serenity-nat.h | 16 +++++++ gdb/serenity-tdep.c | 28 +++++++++++ gdb/serenity-tdep.h | 24 ++++++++++ - 12 files changed, 271 insertions(+) + 12 files changed, 253 insertions(+) create mode 100644 gdb/i386-serenity-nat.c create mode 100644 gdb/i386-serenity-tdep.c create mode 100644 gdb/i386-serenity-tdep.h @@ -314,10 +314,10 @@ index 0000000..ff740d4 \ No newline at end of file diff --git a/gdb/serenity-nat.h b/gdb/serenity-nat.h new file mode 100644 -index 0000000..ac3cfaa +index 0000000..dcd24ce --- /dev/null +++ b/gdb/serenity-nat.h -@@ -0,0 +1,34 @@ +@@ -0,0 +1,16 @@ +/* Native-dependent code for SerenityOS. */ + +#ifndef SERENITYOS_NAT_H @@ -331,24 +331,6 @@ index 0000000..ac3cfaa + +class serenity_nat_target : public inf_ptrace_target +{ -+#if 0 -+ /* Override some methods to support threads. */ -+ std::string pid_to_str (ptid_t) override; -+ void update_thread_list () override; -+ ptid_t wait (ptid_t, struct target_waitstatus *, target_wait_flags) override; -+ -+#ifdef PT_GET_PROCESS_STATE -+ void follow_fork (bool, bool) override; -+ -+ int insert_fork_catchpoint (int) override; -+ -+ int remove_fork_catchpoint (int) override; -+ -+ void post_startup_inferior (ptid_t) override; -+ -+ void post_attach (int) override; -+#endif -+#endif +}; + +#endif /* serenity-nat.h */ diff --git a/Ports/gdb/patches/build-config.patch b/Ports/gdb/patches/0003-gdb-Add-build-support-for-SerenityOS.patch similarity index 80% rename from Ports/gdb/patches/build-config.patch rename to Ports/gdb/patches/0003-gdb-Add-build-support-for-SerenityOS.patch index 019cd279d4f..b553bdbdaac 100644 --- a/Ports/gdb/patches/build-config.patch +++ b/Ports/gdb/patches/0003-gdb-Add-build-support-for-SerenityOS.patch @@ -1,3 +1,14 @@ +From e87fd74df2c7fcb4b146eb09b5b710a45003999a Mon Sep 17 00:00:00 2001 +From: Brian Gianforcaro +Date: Sat, 19 Feb 2022 19:47:42 -0800 +Subject: [PATCH 3/4] gdb: Add build support for SerenityOS + +--- + bfd/config.bfd | 9 +++++++++ + gdbsupport/configure | 2 +- + libiberty/configure | 4 +++- + 3 files changed, 13 insertions(+), 2 deletions(-) + diff --git a/bfd/config.bfd b/bfd/config.bfd index 30087e3..11dc114 100644 --- a/bfd/config.bfd @@ -53,3 +64,6 @@ index fffb91d..defc239 100755 ;; esac +-- +2.32.0 + diff --git a/Ports/gdb/patches/fix-fpermissive-warnings.patch b/Ports/gdb/patches/0004-serenity-Fix-compiler-fpermissive-warnings-from-usin.patch similarity index 92% rename from Ports/gdb/patches/fix-fpermissive-warnings.patch rename to Ports/gdb/patches/0004-serenity-Fix-compiler-fpermissive-warnings-from-usin.patch index 708250edefe..af662036a7b 100644 --- a/Ports/gdb/patches/fix-fpermissive-warnings.patch +++ b/Ports/gdb/patches/0004-serenity-Fix-compiler-fpermissive-warnings-from-usin.patch @@ -1,7 +1,7 @@ -From 7eeba40e3e8e3be17c68164c44e5ccf76b732842 Mon Sep 17 00:00:00 2001 +From 7a5e11d2e9cbe98af96faa4835592686bf261a23 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Tue, 28 Dec 2021 04:39:25 -0800 -Subject: [PATCH] serenity: Fix compiler -fpermissive warnings from using +Subject: [PATCH 4/4] serenity: Fix compiler -fpermissive warnings from using latest GCC --- diff --git a/Ports/gdb/patches/ReadMe.md b/Ports/gdb/patches/ReadMe.md new file mode 100644 index 00000000000..4e954f14833 --- /dev/null +++ b/Ports/gdb/patches/ReadMe.md @@ -0,0 +1,22 @@ +# Patches for gdb on SerenityOS + +## `0001-gdb-Disable-xmalloc-for-alternate_signal_stack-for-s.patch` + +gdb: Disable xmalloc for alternate_signal_stack for serenity + + +## `0002-serenity-Add-basic-ptrace-based-native-target-for-Se.patch` + +serenity: Add basic ptrace based native target for SerenityOS/i386 + + +## `0003-gdb-Add-build-support-for-SerenityOS.patch` + +gdb: Add build support for SerenityOS + + +## `0004-serenity-Fix-compiler-fpermissive-warnings-from-usin.patch` + +serenity: Fix compiler -fpermissive warnings from using latest GCC + +