All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/5] GDB updates
@ 2021-10-09 19:16 Thomas Petazzoni
  2021-10-09 19:16 ` [Buildroot] [PATCH 1/5] package/gdb: append to dependencies in conditional Thomas Petazzoni
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2021-10-09 19:16 UTC (permalink / raw)
  To: Buildroot List
  Cc: Michael Fischer, Romain Naour, Yann E. MORIN, Thomas Petazzoni

Hello,

The starting point for this series was the patch from Michael Fischer
adding support for gdb 11.x. Michael's patch was not fully correct as
such, and required a few adaptations.

But while doing it, I discovered a bug in the current gdb package,
fixed by PATCH 1 in this series.

Then, after adding support for gdb 11.x in PATCH 2, we do the usual
dance of bumping the gdb version to 10.x in PATCH 3, and dropping
support for the oldest gdb version supported in PATCH 4.

We have a lot of different situations with gdb: building host-gdb
only, building target gdbserver only, building target full gdb only,
building both host-gdb and target gdb, the special ARC architecture
situation that requires additional dependencies (host-flex,
host-bison), the fact that GDB 11.x now needs gmp, etc. So I went
ahead and implement a series of test cases. They don't do much in
terms of runtime testing: they just run gdb --version (host or target)
or gdbserver --version, but at least they allow to make sure that the
different combinations continue to build.

And it does work, because it is by writing this series of tests that I
discovered the bug fixed in PATCH 1.

Best regards,

Thomas Petazzoni

Michael Fischer (1):
  package/gdb: add support for gdb 11.x

Thomas Petazzoni (4):
  package/gdb: append to dependencies in conditional
  package/gdb: switch to gdb 10.x as the default
  package/gdb: drop support for version 8.3.x
  support/testing: add suite of tests for gdb

 Config.in.legacy                              |   6 +
 ...e-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch |  46 ++--
 ...-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch |  16 +-
 .../0003-use-asm-sgidefs.h.patch              |   6 +-
 .../0004-gdbserver-fix-build-for-m68k.patch   |  19 +-
 ...fork-inferior-include-linux-ptrace.h.patch |  12 +-
 ...e-of-is-operator-for-comparison-in-p.patch |  42 ----
 ...x-Python3.9-related-runtime-problems.patch | 193 ----------------
 package/gdb/Config.in                         |   1 +
 package/gdb/Config.in.host                    |  19 +-
 package/gdb/gdb.hash                          |   2 +-
 package/gdb/gdb.mk                            |  16 +-
 support/testing/tests/package/test_gdb.py     | 215 ++++++++++++++++++
 13 files changed, 297 insertions(+), 296 deletions(-)
 rename package/gdb/{8.3.1 => 11.1}/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch (74%)
 rename package/gdb/{8.3.1 => 11.1}/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch (71%)
 rename package/gdb/{8.3.1 => 11.1}/0003-use-asm-sgidefs.h.patch (90%)
 rename package/gdb/{8.3.1 => 11.1}/0004-gdbserver-fix-build-for-m68k.patch (78%)
 rename package/gdb/{8.3.1 => 11.1}/0005-nat-fork-inferior-include-linux-ptrace.h.patch (87%)
 delete mode 100644 package/gdb/8.3.1/0006-Fix-incorrect-use-of-is-operator-for-comparison-in-p.patch
 delete mode 100644 package/gdb/8.3.1/0007-Fix-Python3.9-related-runtime-problems.patch
 create mode 100644 support/testing/tests/package/test_gdb.py

-- 
2.31.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/5] package/gdb: append to dependencies in conditional
  2021-10-09 19:16 [Buildroot] [PATCH 0/5] GDB updates Thomas Petazzoni
@ 2021-10-09 19:16 ` Thomas Petazzoni
  2021-10-10  8:49   ` Yann E. MORIN
  2021-10-09 19:16 ` [Buildroot] [PATCH 2/5] package/gdb: add support for gdb 11.x Thomas Petazzoni
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2021-10-09 19:16 UTC (permalink / raw)
  To: Buildroot List
  Cc: Michael Fischer, Romain Naour, Yann E. MORIN, Thomas Petazzoni

Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
conditional is the root of all evil."

Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
conditional is the root of all evil."

Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
conditional is the root of all evil."

Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
conditional is the root of all evil."

Enough? :-)

Due to this mistake, any other GDB_DEPENDENCIES defined before this
assignment were lost. For example, the host-flex host-bison added
inside the GDB_FROM_GIT==y condition were ignored if
BR2_PACKAGE_GDB_DEBUGGER.

Fixes the build of all ARC configurations that have
BR2_PACKAGE_GDB_DEBUGGER enabled.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/gdb/gdb.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index f9010019f5..4ead75289e 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -147,7 +147,7 @@ ifeq ($(BR2_PACKAGE_GDB_DEBUGGER),y)
 GDB_CONF_OPTS += \
 	--enable-gdb \
 	--with-curses
-GDB_DEPENDENCIES = ncurses \
+GDB_DEPENDENCIES += ncurses \
 	$(if $(BR2_PACKAGE_LIBICONV),libiconv)
 else
 GDB_CONF_OPTS += \
-- 
2.31.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 2/5] package/gdb: add support for gdb 11.x
  2021-10-09 19:16 [Buildroot] [PATCH 0/5] GDB updates Thomas Petazzoni
  2021-10-09 19:16 ` [Buildroot] [PATCH 1/5] package/gdb: append to dependencies in conditional Thomas Petazzoni
@ 2021-10-09 19:16 ` Thomas Petazzoni
  2021-10-10  9:10   ` Yann E. MORIN
  2021-10-09 19:16 ` [Buildroot] [PATCH 3/5] package/gdb: switch to gdb 10.x as the default Thomas Petazzoni
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2021-10-09 19:16 UTC (permalink / raw)
  To: Buildroot List
  Cc: Michael Fischer, Romain Naour, Yann E. MORIN, Thomas Petazzoni

From: Michael Fischer <mf@go-sys.de>

All patch from gdb 10.2 are kept.

Starting from version 11.x, gdb needs the gmp library.

Signed-off-by: Michael Fischer <mf@go-sys.de>
[Thomas:
 - fix how the gmp dependency is handled
 - set BR2_PACKAGE_GDB_TOPLEVEL to y for gdb 11.x
 - fix how BR2_GDB_VERSION is set for gdb 11.x]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 ...e-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch | 55 ++++++++++++++++
 ...-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch | 43 +++++++++++++
 package/gdb/11.1/0003-use-asm-sgidefs.h.patch | 40 ++++++++++++
 .../0004-gdbserver-fix-build-for-m68k.patch   | 63 +++++++++++++++++++
 ...fork-inferior-include-linux-ptrace.h.patch | 53 ++++++++++++++++
 package/gdb/Config.in                         |  1 +
 package/gdb/Config.in.host                    |  5 ++
 package/gdb/gdb.hash                          |  1 +
 package/gdb/gdb.mk                            | 14 +++++
 9 files changed, 275 insertions(+)
 create mode 100644 package/gdb/11.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
 create mode 100644 package/gdb/11.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
 create mode 100644 package/gdb/11.1/0003-use-asm-sgidefs.h.patch
 create mode 100644 package/gdb/11.1/0004-gdbserver-fix-build-for-m68k.patch
 create mode 100644 package/gdb/11.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch

diff --git a/package/gdb/11.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/package/gdb/11.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
new file mode 100644
index 0000000000..9369a14d2c
--- /dev/null
+++ b/package/gdb/11.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
@@ -0,0 +1,55 @@
+From 64b8ab56118d2fea027adfb7ebbc01668b29528e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 6 Aug 2016 17:32:50 -0700
+Subject: [PATCH] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC systems
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+[Rebase on gdb 8.3]
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ gdb/nat/ppc-linux.h        | 6 ++++++
+ gdbserver/linux-ppc-low.cc | 6 ++++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
+index d937a65b69c..1fd54b4a0e0 100644
+--- a/gdb/nat/ppc-linux.h
++++ b/gdb/nat/ppc-linux.h
+@@ -18,7 +18,13 @@
+ #ifndef NAT_PPC_LINUX_H
+ #define NAT_PPC_LINUX_H
+ 
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+ #include <asm/cputable.h>
+ 
+ /* This sometimes isn't defined.  */
+diff --git a/gdbserver/linux-ppc-low.cc b/gdbserver/linux-ppc-low.cc
+index 337d555aee7..5d518f37268 100644
+--- a/gdbserver/linux-ppc-low.cc
++++ b/gdbserver/linux-ppc-low.cc
+@@ -23,7 +23,13 @@
+ #include "elf/common.h"
+ #include <sys/uio.h>
+ #include <elf.h>
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+ 
+ #include "arch/ppc-linux-common.h"
+ #include "arch/ppc-linux-tdesc.h"
+-- 
+2.29.2
+
diff --git a/package/gdb/11.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch b/package/gdb/11.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
new file mode 100644
index 0000000000..2f96d29820
--- /dev/null
+++ b/package/gdb/11.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
@@ -0,0 +1,43 @@
+From d205f398e1e36f9673f50f368a3f29fd1dfaa794 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sat, 3 Jun 2017 21:23:52 +0200
+Subject: [PATCH] sh/ptrace: Define pt_{dsp,}regs uapi_pt_{dsp,}regs on !GLIBC
+ systems
+
+Fixes a pt_{dsp,}regs redefinition when building with the musl C library
+on SuperH.
+
+Inspired by
+http://git.yoctoproject.org/clean/cgit.cgi/poky/plain/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch,
+adapted for SuperH.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+[Rebase	on gdb 8.0]
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ gdbserver/linux-sh-low.cc | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/gdbserver/linux-sh-low.cc b/gdbserver/linux-sh-low.cc
+index a6d3fc60047..b83cce6b9fe 100644
+--- a/gdbserver/linux-sh-low.cc
++++ b/gdbserver/linux-sh-low.cc
+@@ -76,7 +76,15 @@ extern const struct target_desc *tdesc_sh;
+ #include <sys/reg.h>
+ #endif
+ 
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++# define pt_dspregs uapi_pt_dspregs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++# undef pt_dspregs
++#endif
+ 
+ #define sh_num_regs 41
+ 
+-- 
+2.29.2
+
diff --git a/package/gdb/11.1/0003-use-asm-sgidefs.h.patch b/package/gdb/11.1/0003-use-asm-sgidefs.h.patch
new file mode 100644
index 0000000000..e04ebd1dd5
--- /dev/null
+++ b/package/gdb/11.1/0003-use-asm-sgidefs.h.patch
@@ -0,0 +1,40 @@
+From 65acc8800dba7e10da882871d4648241805c47ce Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <amccurdy@gmail.com>
+Date: Sat, 30 Apr 2016 15:29:06 -0700
+Subject: [PATCH] use <asm/sgidefs.h>
+
+Build fix for MIPS with musl libc
+
+The MIPS specific header <sgidefs.h> is provided by glibc and uclibc
+but not by musl. Regardless of the libc, the kernel headers provide
+<asm/sgidefs.h> which provides the same definitions, so use that
+instead.
+
+Upstream-Status: Pending
+
+[Vincent:
+Taken from: https://sourceware.org/bugzilla/show_bug.cgi?id=21070]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
+---
+ gdb/mips-linux-nat.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
+index 38ff461a35b..b6cf194b2bf 100644
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
+-- 
+2.29.2
+
diff --git a/package/gdb/11.1/0004-gdbserver-fix-build-for-m68k.patch b/package/gdb/11.1/0004-gdbserver-fix-build-for-m68k.patch
new file mode 100644
index 0000000000..846f7ed293
--- /dev/null
+++ b/package/gdb/11.1/0004-gdbserver-fix-build-for-m68k.patch
@@ -0,0 +1,63 @@
+From 90ebe548922538b854de52e8b687384f44360984 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@gmail.com>
+Date: Fri, 22 Jun 2018 22:40:26 +0200
+Subject: [PATCH] gdbserver: fix build for m68k
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+As for strace [1], when <sys/reg.h> is included after <linux/ptrace.h>,
+the build fails on m68k with the following diagnostics:
+
+In file included from ./../nat/linux-ptrace.h:28:0,
+                 from linux-low.h:27,
+                 from linux-m68k-low.c:20:
+[...]/usr/include/sys/reg.h:26:3: error: expected identifier before numeric constant
+   PT_D1 = 0,
+   ^
+[...]usr/include/sys/reg.h:26:3: error: expected « } » before numeric constant
+[...]usr/include/sys/reg.h:26:3: error: expected unqualified-id before numeric constant
+In file included from linux-m68k-low.c:27:0:
+[...]usr/include/sys/reg.h:99:1: error: expected declaration before « } » token
+ };
+ ^
+
+Fix this by moving <sys/reg.h> on top of "linux-low.h".
+
+[1] https://github.com/strace/strace/commit/6ebf6c4f9e5ebca123a5b5f24afe67cf0473cf92
+
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ gdbserver/linux-m68k-low.cc | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/gdbserver/linux-m68k-low.cc b/gdbserver/linux-m68k-low.cc
+index 838ba353b0b..36679682b9a 100644
+--- a/gdbserver/linux-m68k-low.cc
++++ b/gdbserver/linux-m68k-low.cc
+@@ -17,6 +17,11 @@
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+ 
+ #include "server.h"
++
++#ifdef HAVE_SYS_REG_H
++#include <sys/reg.h>
++#endif
++
+ #include "linux-low.h"
+ 
+ /* Linux target op definitions for the m68k architecture.  */
+@@ -80,10 +85,6 @@ m68k_target::low_decr_pc_after_break ()
+ void init_registers_m68k (void);
+ extern const struct target_desc *tdesc_m68k;
+ 
+-#ifdef HAVE_SYS_REG_H
+-#include <sys/reg.h>
+-#endif
+-
+ #define m68k_num_regs 29
+ #define m68k_num_gregs 18
+ 
+-- 
+2.29.2
+
diff --git a/package/gdb/11.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch b/package/gdb/11.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch
new file mode 100644
index 0000000000..33dce4d940
--- /dev/null
+++ b/package/gdb/11.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch
@@ -0,0 +1,53 @@
+From c8454711eca2e79437e17ed1e1e68b48b4c8d927 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+Date: Sun, 24 Jun 2018 23:33:55 +0200
+Subject: [PATCH] nat/fork-inferior: include linux-ptrace.h
+
+To decide whether fork() or vfork() should be used, fork-inferior.c
+uses the following test:
+
+  #if !(defined(__UCLIBC__) && defined(HAS_NOMMU))
+
+However, HAS_NOMMU is never defined, because it gets defined in
+linux-ptrace.h, which is not included by fork-inferior.c. Due to this,
+gdbserver fails to build on noMMU architectures. This commit fixes
+that by simply including linux-ptrace.h.
+
+This bug was introduced by commit
+2090129c36c7e582943b7d300968d19b46160d84 ("Share fork_inferior et al
+with gdbserver"). Indeed, the same fork()/vfork() selection was done,
+but in another file where linux-ptrace.h was included.
+
+Fixes the following build issue:
+
+../nat/fork-inferior.c: In function 'pid_t fork_inferior(const char*, const string&, char**, void (*)(), void (*)(int), void (*)(), const char*, void (*)(const char*, char* const*, char* const*))':
+../nat/fork-inferior.c:376:11: error: 'fork' was not declared in this scope
+     pid = fork ();
+           ^~~~
+../nat/fork-inferior.c:376:11: note: suggested alternative: 'vfork'
+     pid = fork ();
+           ^~~~
+           vfork
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+[Romain: rebase on gdb 8.3]
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ gdb/nat/fork-inferior.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gdb/nat/fork-inferior.c b/gdb/nat/fork-inferior.c
+index 7ba0126871d..53e1ec72f09 100644
+--- a/gdb/nat/fork-inferior.c
++++ b/gdb/nat/fork-inferior.c
+@@ -27,6 +27,7 @@
+ #include "gdbsupport/pathstuff.h"
+ #include "gdbsupport/signals-state-save-restore.h"
+ #include "gdbsupport/gdb_tilde_expand.h"
++#include "linux-ptrace.h"
+ #include <vector>
+ 
+ extern char **environ;
+-- 
+2.29.2
+
diff --git a/package/gdb/Config.in b/package/gdb/Config.in
index 246748131e..d5ec5406fb 100644
--- a/package/gdb/Config.in
+++ b/package/gdb/Config.in
@@ -54,6 +54,7 @@ config BR2_PACKAGE_GDB_DEBUGGER
 	depends on BR2_USE_WCHAR
 	depends on !BR2_sh
 	depends on !BR2_csky
+	select BR2_PACKAGE_GMP
 	select BR2_PACKAGE_NCURSES
 
 comment "full gdb on target needs a toolchain w/ wchar"
diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
index 142bf1458a..2f9790f6e1 100644
--- a/package/gdb/Config.in.host
+++ b/package/gdb/Config.in.host
@@ -80,6 +80,9 @@ config BR2_GDB_VERSION_9_2
 config BR2_GDB_VERSION_10
 	bool "gdb 10.x"
 
+config BR2_GDB_VERSION_11
+	bool "gdb 11.x"
+
 endchoice
 
 endif
@@ -92,6 +95,7 @@ config BR2_GDB_VERSION
 	default "8.3.1"    if BR2_GDB_VERSION_8_3
 	default "9.2"      if BR2_GDB_VERSION_9_2 || (!BR2_PACKAGE_HOST_GDB && !BR2_riscv)
 	default "10.2"	   if BR2_GDB_VERSION_10 || (!BR2_PACKAGE_HOST_GDB && BR2_riscv)
+	default "11.1"     if BR2_GDB_VERSION_11
 	depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
 
 # recent gdb versions (>= 10) have gdbserver moved at the top-level,
@@ -100,5 +104,6 @@ config BR2_PACKAGE_GDB_TOPLEVEL
 	bool
 	default y if BR2_arc
 	default y if BR2_GDB_VERSION_10
+	default y if BR2_GDB_VERSION_11
 	default y if !BR2_PACKAGE_HOST_GDB && BR2_riscv
 	depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
diff --git a/package/gdb/gdb.hash b/package/gdb/gdb.hash
index c45ee7329f..e3b867b042 100644
--- a/package/gdb/gdb.hash
+++ b/package/gdb/gdb.hash
@@ -2,6 +2,7 @@
 sha512  9053a2dc6b9eb921907afbc4cecc75d635aa76df5e8c4f0e5824ccf57cb206b299c19b127fff000b65c334826ff8304a54ff6098428365a8e997cca886c39e9a  gdb-8.3.1.tar.xz
 sha512  73635f00f343117aa5e2436f1e1597099e2bfb31ef7bb162b273fa1ea282c3fa9b0f52762e70bfc7ad0334addb8d159e9ac7cbe5998ca4f755ea8cf90714d274  gdb-9.2.tar.xz
 sha512  3653762ac008e065c37cd641653184c9ff7ce51ee2222ade1122bec9d6cc64dffd4fb74888ef11ac1942064a08910e96b7865112ad37f4602eb0a16bed074caa  gdb-10.2.tar.xz
+sha512  c40bf970e2f7c2107b29c5aa6a7150daa709d75ddadb73ac20742419d4637d158e3063a4c6ff6e47fae8ca8e1d36253973f85ea15445d004be6d5d7a2dd9bd46  gdb-11.1.tar.xz
 
 # Locally calculated (fetched from Github)
 sha512  5a2acf2fd33ab2ff589e1037ca40abda54328997dcff26b2b49b874bd3be980be5a63342962254f3c3bda98e32ce7a33af704d37353352833dee193135600458  gdb-arc-2020.09-release-gdb.tar.gz
diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index 4ead75289e..15515d6d33 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -71,6 +71,20 @@ GDB_DEPENDENCIES += host-flex host-bison
 HOST_GDB_DEPENDENCIES += host-flex host-bison
 endif
 
+# When BR2_GDB_VERSION_11=y, we're going to build gdb 11.x for the
+# host (if enabled), so we add the necessary gmp dependency.
+ifeq ($(BR2_GDB_VERSION_11),y)
+HOST_GDB_DEPENDENCIES += host-gmp
+endif
+
+# When BR2_GDB_VERSION_11=y (because it's enabled for the host) and
+# we're building the full gdb for the target, we need gmp as a
+# dependency. For now the default gdb version in Buildroot doesn't
+# require gmp.
+ifeq ($(BR2_GDB_VERSION_11)$(BR2_PACKAGE_GDB_DEBUGGER),yy)
+GDB_DEPENDENCIES += gmp
+endif
+
 # When gdb sources are fetched from the binutils-gdb repository, they
 # also contain the binutils sources, but binutils shouldn't be built,
 # so we disable it (additionally the option --disable-install-libbfd
-- 
2.31.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 3/5] package/gdb: switch to gdb 10.x as the default
  2021-10-09 19:16 [Buildroot] [PATCH 0/5] GDB updates Thomas Petazzoni
  2021-10-09 19:16 ` [Buildroot] [PATCH 1/5] package/gdb: append to dependencies in conditional Thomas Petazzoni
  2021-10-09 19:16 ` [Buildroot] [PATCH 2/5] package/gdb: add support for gdb 11.x Thomas Petazzoni
@ 2021-10-09 19:16 ` Thomas Petazzoni
  2021-10-10 17:42   ` Yann E. MORIN
  2021-10-09 19:16 ` [Buildroot] [PATCH 4/5] package/gdb: drop support for version 8.3.x Thomas Petazzoni
  2021-10-09 19:16 ` [Buildroot] [PATCH 5/5] support/testing: add suite of tests for gdb Thomas Petazzoni
  4 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2021-10-09 19:16 UTC (permalink / raw)
  To: Buildroot List
  Cc: Michael Fischer, Romain Naour, Yann E. MORIN, Thomas Petazzoni

When doing this, we can simplify the RISC-V related logic. Indeed, as
there was no support for RISC-V in gdb 9.x, which was the current
default, we had some trickery in the Config.in file to ensure gdb 10.x
was used by default on RISC-V. However now that 10.x is the default
for everybody, this trickery is no longer needed.

Also, we now needs to enable BR2_PACKAGE_GDB_TOPLEVEL when host-gdb is
not built, as the default target gdb version is 10.x, and threfore
requires BR2_PACKAGE_GDB_TOPLEVEL=y.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/gdb/Config.in.host | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
index 2f9790f6e1..fd739f3969 100644
--- a/package/gdb/Config.in.host
+++ b/package/gdb/Config.in.host
@@ -61,7 +61,7 @@ config BR2_PACKAGE_HOST_GDB_SIM
 
 choice
 	prompt "GDB debugger Version"
-	default BR2_GDB_VERSION_9_2
+	default BR2_GDB_VERSION_10
 	depends on !BR2_arc
 	depends on !BR2_csky
 	help
@@ -93,8 +93,8 @@ config BR2_GDB_VERSION
 	default "arc-2020.09-release-gdb" if BR2_arc
 	default "4ecb98fbc2f94dbe01b69384afbc515107de73df" if BR2_csky
 	default "8.3.1"    if BR2_GDB_VERSION_8_3
-	default "9.2"      if BR2_GDB_VERSION_9_2 || (!BR2_PACKAGE_HOST_GDB && !BR2_riscv)
-	default "10.2"	   if BR2_GDB_VERSION_10 || (!BR2_PACKAGE_HOST_GDB && BR2_riscv)
+	default "9.2"      if BR2_GDB_VERSION_9_2
+	default "10.2"	   if BR2_GDB_VERSION_10 || !BR2_PACKAGE_HOST_GDB
 	default "11.1"     if BR2_GDB_VERSION_11
 	depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
 
@@ -105,5 +105,5 @@ config BR2_PACKAGE_GDB_TOPLEVEL
 	default y if BR2_arc
 	default y if BR2_GDB_VERSION_10
 	default y if BR2_GDB_VERSION_11
-	default y if !BR2_PACKAGE_HOST_GDB && BR2_riscv
+	default y if !BR2_PACKAGE_HOST_GDB
 	depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
-- 
2.31.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 4/5] package/gdb: drop support for version 8.3.x
  2021-10-09 19:16 [Buildroot] [PATCH 0/5] GDB updates Thomas Petazzoni
                   ` (2 preceding siblings ...)
  2021-10-09 19:16 ` [Buildroot] [PATCH 3/5] package/gdb: switch to gdb 10.x as the default Thomas Petazzoni
@ 2021-10-09 19:16 ` Thomas Petazzoni
  2021-10-10 17:42   ` Yann E. MORIN
  2021-10-09 19:16 ` [Buildroot] [PATCH 5/5] support/testing: add suite of tests for gdb Thomas Petazzoni
  4 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2021-10-09 19:16 UTC (permalink / raw)
  To: Buildroot List
  Cc: Michael Fischer, Romain Naour, Yann E. MORIN, Thomas Petazzoni

Now that gdb 11.x has been added, that 10.x is the default, we can
drop version 8.3.x.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 Config.in.legacy                              |   6 +
 ...e-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch |  55 -----
 ...-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch |  43 ----
 .../gdb/8.3.1/0003-use-asm-sgidefs.h.patch    |  40 ----
 .../0004-gdbserver-fix-build-for-m68k.patch   |  62 ------
 ...fork-inferior-include-linux-ptrace.h.patch |  53 -----
 ...e-of-is-operator-for-comparison-in-p.patch |  42 ----
 ...x-Python3.9-related-runtime-problems.patch | 193 ------------------
 package/gdb/Config.in.host                    |   6 -
 package/gdb/gdb.hash                          |   1 -
 10 files changed, 6 insertions(+), 495 deletions(-)
 delete mode 100644 package/gdb/8.3.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
 delete mode 100644 package/gdb/8.3.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
 delete mode 100644 package/gdb/8.3.1/0003-use-asm-sgidefs.h.patch
 delete mode 100644 package/gdb/8.3.1/0004-gdbserver-fix-build-for-m68k.patch
 delete mode 100644 package/gdb/8.3.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch
 delete mode 100644 package/gdb/8.3.1/0006-Fix-incorrect-use-of-is-operator-for-comparison-in-p.patch
 delete mode 100644 package/gdb/8.3.1/0007-Fix-Python3.9-related-runtime-problems.patch

diff --git a/Config.in.legacy b/Config.in.legacy
index 06bd962d9b..3ec48edb87 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -146,6 +146,12 @@ endif
 
 comment "Legacy options removed in 2021.11"
 
+config BR2_GDB_VERSION_8_3
+	bool "gdb version 8.3.x removed"
+	select BR2_LEGACY
+	help
+	  gdb 8.3.x has been removed, use a newer version instead.
+
 config BR2_PACKAGE_PYTHON_MELD3
 	bool "python-meld3 package removed"
 	select BR2_LEGACY
diff --git a/package/gdb/8.3.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/package/gdb/8.3.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
deleted file mode 100644
index ab8dc626f0..0000000000
--- a/package/gdb/8.3.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 72ee19f54fd35595465b2e35eccf1f3d65fe21c6 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 6 Aug 2016 17:32:50 -0700
-Subject: [PATCH] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC systems
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-[Rebase on gdb 8.3]
-Signed-off-by: Romain Naour <romain.naour@gmail.com>
----
- gdb/gdbserver/linux-ppc-low.c | 6 ++++++
- gdb/nat/ppc-linux.h           | 6 ++++++
- 2 files changed, 12 insertions(+)
-
-diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
-index 1b695e53fe9..1978347c02c 100644
---- a/gdb/gdbserver/linux-ppc-low.c
-+++ b/gdb/gdbserver/linux-ppc-low.c
-@@ -23,7 +23,13 @@
- #include "elf/common.h"
- #include <sys/uio.h>
- #include <elf.h>
-+#if !defined(__GLIBC__)
-+# define pt_regs uapi_pt_regs
-+#endif
- #include <asm/ptrace.h>
-+#if !defined(__GLIBC__)
-+# undef pt_regs
-+#endif
- 
- #include "arch/ppc-linux-common.h"
- #include "arch/ppc-linux-tdesc.h"
-diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
-index f1561b3b357..40399361c09 100644
---- a/gdb/nat/ppc-linux.h
-+++ b/gdb/nat/ppc-linux.h
-@@ -18,7 +18,13 @@
- #ifndef NAT_PPC_LINUX_H
- #define NAT_PPC_LINUX_H
- 
-+#if !defined(__GLIBC__)
-+# define pt_regs uapi_pt_regs
-+#endif
- #include <asm/ptrace.h>
-+#if !defined(__GLIBC__)
-+# undef pt_regs
-+#endif
- #include <asm/cputable.h>
- 
- /* This sometimes isn't defined.  */
--- 
-2.21.0
-
diff --git a/package/gdb/8.3.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch b/package/gdb/8.3.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
deleted file mode 100644
index 9d508fbf1e..0000000000
--- a/package/gdb/8.3.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From ef630288fdc2d4d22651702672f9d5c9cd767e5b Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-Date: Sat, 3 Jun 2017 21:23:52 +0200
-Subject: [PATCH] sh/ptrace: Define pt_{dsp,}regs uapi_pt_{dsp,}regs on !GLIBC
- systems
-
-Fixes a pt_{dsp,}regs redefinition when building with the musl C library
-on SuperH.
-
-Inspired by
-http://git.yoctoproject.org/clean/cgit.cgi/poky/plain/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch,
-adapted for SuperH.
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-[Rebase	on gdb 8.0]
-Signed-off-by: Romain Naour <romain.naour@gmail.com>
----
- gdb/gdbserver/linux-sh-low.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/gdb/gdbserver/linux-sh-low.c b/gdb/gdbserver/linux-sh-low.c
-index 0953721a190..c331c1382f7 100644
---- a/gdb/gdbserver/linux-sh-low.c
-+++ b/gdb/gdbserver/linux-sh-low.c
-@@ -27,7 +27,15 @@ extern const struct target_desc *tdesc_sh;
- #include <sys/reg.h>
- #endif
- 
-+#if !defined(__GLIBC__)
-+# define pt_regs uapi_pt_regs
-+# define pt_dspregs uapi_pt_dspregs
-+#endif
- #include <asm/ptrace.h>
-+#if !defined(__GLIBC__)
-+# undef pt_regs
-+# undef pt_dspregs
-+#endif
- 
- #define sh_num_regs 41
- 
--- 
-2.21.0
-
diff --git a/package/gdb/8.3.1/0003-use-asm-sgidefs.h.patch b/package/gdb/8.3.1/0003-use-asm-sgidefs.h.patch
deleted file mode 100644
index 2909f62c68..0000000000
--- a/package/gdb/8.3.1/0003-use-asm-sgidefs.h.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 19a0f664809b6858e69aa98188eb739415de044c Mon Sep 17 00:00:00 2001
-From: Andre McCurdy <amccurdy@gmail.com>
-Date: Sat, 30 Apr 2016 15:29:06 -0700
-Subject: [PATCH] use <asm/sgidefs.h>
-
-Build fix for MIPS with musl libc
-
-The MIPS specific header <sgidefs.h> is provided by glibc and uclibc
-but not by musl. Regardless of the libc, the kernel headers provide
-<asm/sgidefs.h> which provides the same definitions, so use that
-instead.
-
-Upstream-Status: Pending
-
-[Vincent:
-Taken from: https://sourceware.org/bugzilla/show_bug.cgi?id=21070]
-
-Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
----
- gdb/mips-linux-nat.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
-index e68ed1e4da9..bc42aa59685 100644
---- a/gdb/mips-linux-nat.c
-+++ b/gdb/mips-linux-nat.c
-@@ -31,7 +31,7 @@
- #include "gdb_proc_service.h"
- #include "gregset.h"
- 
--#include <sgidefs.h>
-+#include <asm/sgidefs.h>
- #include "nat/gdb_ptrace.h"
- #include <asm/ptrace.h>
- #include "inf-ptrace.h"
--- 
-2.21.0
-
diff --git a/package/gdb/8.3.1/0004-gdbserver-fix-build-for-m68k.patch b/package/gdb/8.3.1/0004-gdbserver-fix-build-for-m68k.patch
deleted file mode 100644
index d718293899..0000000000
--- a/package/gdb/8.3.1/0004-gdbserver-fix-build-for-m68k.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 448e481aab86c823d908530038e20a14213db0a2 Mon Sep 17 00:00:00 2001
-From: Romain Naour <romain.naour@gmail.com>
-Date: Fri, 22 Jun 2018 22:40:26 +0200
-Subject: [PATCH] gdbserver: fix build for m68k
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-As for strace [1], when <sys/reg.h> is included after <linux/ptrace.h>,
-the build fails on m68k with the following diagnostics:
-
-In file included from ./../nat/linux-ptrace.h:28:0,
-                 from linux-low.h:27,
-                 from linux-m68k-low.c:20:
-[...]/usr/include/sys/reg.h:26:3: error: expected identifier before numeric constant
-   PT_D1 = 0,
-   ^
-[...]usr/include/sys/reg.h:26:3: error: expected « } » before numeric constant
-[...]usr/include/sys/reg.h:26:3: error: expected unqualified-id before numeric constant
-In file included from linux-m68k-low.c:27:0:
-[...]usr/include/sys/reg.h:99:1: error: expected declaration before « } » token
- };
- ^
-
-Fix this by moving <sys/reg.h> on top of "linux-low.h".
-
-[1] https://github.com/strace/strace/commit/6ebf6c4f9e5ebca123a5b5f24afe67cf0473cf92
-
-Signed-off-by: Romain Naour <romain.naour@gmail.com>
----
- gdb/gdbserver/linux-m68k-low.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/gdb/gdbserver/linux-m68k-low.c b/gdb/gdbserver/linux-m68k-low.c
-index 16f639d02fc..969d9973737 100644
---- a/gdb/gdbserver/linux-m68k-low.c
-+++ b/gdb/gdbserver/linux-m68k-low.c
-@@ -17,16 +17,17 @@
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
- 
- #include "server.h"
-+
-+#ifdef HAVE_SYS_REG_H
-+#include <sys/reg.h>
-+#endif
-+
- #include "linux-low.h"
- 
- /* Defined in auto-generated file reg-m68k.c.  */
- void init_registers_m68k (void);
- extern const struct target_desc *tdesc_m68k;
- 
--#ifdef HAVE_SYS_REG_H
--#include <sys/reg.h>
--#endif
--
- #define m68k_num_regs 29
- #define m68k_num_gregs 18
- 
--- 
-2.21.0
-
diff --git a/package/gdb/8.3.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch b/package/gdb/8.3.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch
deleted file mode 100644
index 394e7a2c2a..0000000000
--- a/package/gdb/8.3.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From d84ecfa3a8c8fbade89229ac66c09f2a97ab00fb Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
-Date: Sun, 24 Jun 2018 23:33:55 +0200
-Subject: [PATCH] nat/fork-inferior: include linux-ptrace.h
-
-To decide whether fork() or vfork() should be used, fork-inferior.c
-uses the following test:
-
-  #if !(defined(__UCLIBC__) && defined(HAS_NOMMU))
-
-However, HAS_NOMMU is never defined, because it gets defined in
-linux-ptrace.h, which is not included by fork-inferior.c. Due to this,
-gdbserver fails to build on noMMU architectures. This commit fixes
-that by simply including linux-ptrace.h.
-
-This bug was introduced by commit
-2090129c36c7e582943b7d300968d19b46160d84 ("Share fork_inferior et al
-with gdbserver"). Indeed, the same fork()/vfork() selection was done,
-but in another file where linux-ptrace.h was included.
-
-Fixes the following build issue:
-
-../nat/fork-inferior.c: In function 'pid_t fork_inferior(const char*, const string&, char**, void (*)(), void (*)(int), void (*)(), const char*, void (*)(const char*, char* const*, char* const*))':
-../nat/fork-inferior.c:376:11: error: 'fork' was not declared in this scope
-     pid = fork ();
-           ^~~~
-../nat/fork-inferior.c:376:11: note: suggested alternative: 'vfork'
-     pid = fork ();
-           ^~~~
-           vfork
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
-[Romain: rebase on gdb 8.3]
-Signed-off-by: Romain Naour <romain.naour@gmail.com>
----
- gdb/nat/fork-inferior.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/gdb/nat/fork-inferior.c b/gdb/nat/fork-inferior.c
-index fe9360a5039..626fe7c1fbf 100644
---- a/gdb/nat/fork-inferior.c
-+++ b/gdb/nat/fork-inferior.c
-@@ -27,6 +27,7 @@
- #include "common/pathstuff.h"
- #include "common/signals-state-save-restore.h"
- #include "common/gdb_tilde_expand.h"
-+#include "linux-ptrace.h"
- #include <vector>
- 
- extern char **environ;
--- 
-2.21.0
-
diff --git a/package/gdb/8.3.1/0006-Fix-incorrect-use-of-is-operator-for-comparison-in-p.patch b/package/gdb/8.3.1/0006-Fix-incorrect-use-of-is-operator-for-comparison-in-p.patch
deleted file mode 100644
index 989a5b1347..0000000000
--- a/package/gdb/8.3.1/0006-Fix-incorrect-use-of-is-operator-for-comparison-in-p.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From e00c211d51bec301cf04719b77076a8783ef44b5 Mon Sep 17 00:00:00 2001
-From: Raul Tambre <raul@tambre.ee>
-Date: Sat, 4 May 2019 15:48:17 -0400
-Subject: [PATCH] Fix incorrect use of 'is' operator for comparison in
- python/lib/gdb/command/prompt.py
-
-The 'is' operator is not meant to be used for comparisons. It currently working
-is an implementation detail of CPython.  CPython 3.8 has added a SyntaxWarning
-for this.
-
-(cherry picked from commit b6484282f85bf7f11451b2441599c241d302ad9d)
-[Romain: backport to gdb 8.x]
-Signed-off-by: Romain Naour <romain.naour@gmail.com>
----
- gdb/python/lib/gdb/command/prompt.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/gdb/python/lib/gdb/command/prompt.py b/gdb/python/lib/gdb/command/prompt.py
-index 3d662a7d3f..04b9e49c22 100644
---- a/gdb/python/lib/gdb/command/prompt.py
-+++ b/gdb/python/lib/gdb/command/prompt.py
-@@ -45,7 +45,7 @@ The currently defined substitutions are:
-         self.hook_set = False
- 
-     def get_show_string (self, pvalue):
--        if self.value is not '':
-+        if self.value:
-            return "The extended prompt is: " + self.value
-         else:
-            return "The extended prompt is not set."
-@@ -57,7 +57,7 @@ The currently defined substitutions are:
-         return ""
- 
-     def before_prompt_hook(self, current):
--        if self.value is not '':
-+        if self.value:
-             return gdb.prompt.substitute_prompt(self.value)
-         else:
-             return None
--- 
-2.25.4
-
diff --git a/package/gdb/8.3.1/0007-Fix-Python3.9-related-runtime-problems.patch b/package/gdb/8.3.1/0007-Fix-Python3.9-related-runtime-problems.patch
deleted file mode 100644
index 63cfa1bd3e..0000000000
--- a/package/gdb/8.3.1/0007-Fix-Python3.9-related-runtime-problems.patch
+++ /dev/null
@@ -1,193 +0,0 @@
-From 51ef4f6ec819259d4a57fa4155ee78700918f8ff Mon Sep 17 00:00:00 2001
-From: Kevin Buettner <kevinb@redhat.com>
-Date: Wed, 27 May 2020 20:05:40 -0700
-Subject: [PATCH] Fix Python3.9 related runtime problems
-
-Python3.9b1 is now available on Rawhide.  GDB w/ Python 3.9 support
-can be built using the configure switch -with-python=/usr/bin/python3.9.
-
-Attempting to run gdb/Python3.9 segfaults on startup:
-
-    #0  0x00007ffff7b0582c in PyEval_ReleaseLock () from /lib64/libpython3.9.so.1.0
-    #1  0x000000000069ccbf in do_start_initialization ()
-	at worktree-test1/gdb/python/python.c:1789
-    #2  _initialize_python ()
-	at worktree-test1/gdb/python/python.c:1877
-    #3  0x00000000007afb0a in initialize_all_files () at init.c:237
-    ...
-
-Consulting the the documentation...
-
-https://docs.python.org/3/c-api/init.html
-
-...we find that PyEval_ReleaseLock() has been deprecated since version
-3.2.  It recommends using PyEval_SaveThread or PyEval_ReleaseThread()
-instead.  In do_start_initialization, in gdb/python/python.c, we
-can replace the calls to PyThreadState_Swap() and PyEval_ReleaseLock()
-with a single call to PyEval_SaveThread.   (Thanks to Keith Seitz
-for working this out.)
-
-With that in place, GDB gets a little bit further.  It still dies
-on startup, but the backtrace is different:
-
-    #0  0x00007ffff7b04306 in PyOS_InterruptOccurred ()
-       from /lib64/libpython3.9.so.1.0
-    #1  0x0000000000576e86 in check_quit_flag ()
-	at worktree-test1/gdb/extension.c:776
-    #2  0x0000000000576f8a in set_active_ext_lang (now_active=now_active@entry=0x983c00 <extension_language_python>)
-	at worktree-test1/gdb/extension.c:705
-    #3  0x000000000069d399 in gdbpy_enter::gdbpy_enter (this=0x7fffffffd2d0,
-	gdbarch=0x0, language=0x0)
-	at worktree-test1/gdb/python/python.c:211
-    #4  0x0000000000686e00 in python_new_inferior (inf=0xddeb10)
-	at worktree-test1/gdb/python/py-inferior.c:251
-    #5  0x00000000005d9fb9 in std::function<void (inferior*)>::operator()(inferior*) const (__args#0=<optimized out>, this=0xccad20)
-	at /usr/include/c++/10/bits/std_function.h:617
-    #6  gdb::observers::observable<inferior*>::notify (args#0=0xddeb10,
-	this=<optimized out>)
-	at worktree-test1/gdb/../gdbsupport/observable.h:106
-    #7  add_inferior_silent (pid=0)
-	at worktree-test1/gdb/inferior.c:113
-    #8  0x00000000005dbcb8 in initialize_inferiors ()
-	at worktree-test1/gdb/inferior.c:947
-    ...
-
-We checked with some Python Developers and were told that we should
-acquire the GIL prior to calling any Python C API function.  We
-definitely don't have the GIL for calls of PyOS_InterruptOccurred().
-
-I moved class_gdbpy_gil earlier in the file and use it in
-gdbpy_check_quit_flag() to acquire (and automatically release) the
-GIL.
-
-With those changes in place, I was able to run to a GDB prompt.  But,
-when trying to quit, it segfaulted again due to due to some other
-problems with gdbpy_check_quit_flag():
-
-    Thread 1 "gdb" received signal SIGSEGV, Segmentation fault.
-    0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0
-    (top-gdb) bt 8
-    #0  0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0
-    #1  0x00007ffff7afa5ea in PyGILState_Ensure.cold ()
-       from /lib64/libpython3.9.so.1.0
-    #2  0x000000000069b58c in gdbpy_gil::gdbpy_gil (this=<synthetic pointer>)
-	at worktree-test1/gdb/python/python.c:278
-    #3  gdbpy_check_quit_flag (extlang=<optimized out>)
-	at worktree-test1/gdb/python/python.c:278
-    #4  0x0000000000576e96 in check_quit_flag ()
-	at worktree-test1/gdb/extension.c:776
-    #5  0x000000000057700c in restore_active_ext_lang (previous=0xe9c050)
-	at worktree-test1/gdb/extension.c:729
-    #6  0x000000000088913a in do_my_cleanups (
-	pmy_chain=0xc31870 <final_cleanup_chain>,
-	old_chain=0xae5720 <sentinel_cleanup>)
-	at worktree-test1/gdbsupport/cleanups.cc:131
-    #7  do_final_cleanups ()
-	at worktree-test1/gdbsupport/cleanups.cc:143
-
-In this case, we're trying to call a Python C API function after
-Py_Finalize() has been called from finalize_python().  I made
-finalize_python set gdb_python_initialized to false and then cause
-check_quit_flag() to return early when it's false.
-
-With these changes in place, GDB seems to be working again with
-Python3.9b1.  I think it likely that there are other problems lurking.
-I wouldn't be surprised to find that there are other calls into Python
-where we don't first make sure that we have the GIL.  Further changes
-may well be needed.
-
-I see no regressions testing on Rawhide using a GDB built with the
-default Python version (3.8.3) versus one built using Python 3.9b1.
-
-I've also tested on Fedora 28, 29, 30, 31, and 32 (all x86_64) using
-the default (though updated) system installed versions of Python on
-those OSes.  This means that I've tested against Python versions
-2.7.15, 2.7.17, 2.7.18, 3.7.7, 3.8.2, and 3.8.3.  In each case GDB
-still builds without problem and shows no regressions after applying
-this patch.
-
-gdb/ChangeLog:
-
-2020-MM-DD  Kevin Buettner  <kevinb@redhat.com>
-	    Keith Seitz  <keiths@redhat.com>
-
-	* python/python.c (do_start_initialization): For Python 3.9 and
-	later, call PyEval_SaveThread instead of PyEval_ReleaseLock.
-	(class gdbpy_gil): Move to earlier in file.
-	(finalize_python): Set gdb_python_initialized.
-	(gdbpy_check_quit_flag): Acquire GIL via gdbpy_gil.  Return early
-	when not initialized.
-
-[import into Buildroot, removing ChangeLog change to avoid conflict]
-Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
----
- gdb/python/python.c | 32 ++++++++++++++++++++++++++++++--
- 1 file changed, 30 insertions(+), 2 deletions(-)
-
-diff --git a/gdb/python/python.c b/gdb/python/python.c
-index c23db2c1261..0b77354630e 100644
---- a/gdb/python/python.c
-+++ b/gdb/python/python.c
-@@ -235,6 +235,30 @@ gdbpy_enter::~gdbpy_enter ()
-   restore_active_ext_lang (m_previous_active);
- }
- 
-+/* A helper class to save and restore the GIL, but without touching
-+   the other globals that are handled by gdbpy_enter.  */
-+
-+class gdbpy_gil
-+{
-+public:
-+
-+  gdbpy_gil ()
-+    : m_state (PyGILState_Ensure ())
-+  {
-+  }
-+
-+  ~gdbpy_gil ()
-+  {
-+    PyGILState_Release (m_state);
-+  }
-+
-+  DISABLE_COPY_AND_ASSIGN (gdbpy_gil);
-+
-+private:
-+
-+  PyGILState_STATE m_state;
-+};
-+
- /* Set the quit flag.  */
- 
- static void
-@@ -248,6 +272,10 @@ gdbpy_set_quit_flag (const struct extension_language_defn *extlang)
- static int
- gdbpy_check_quit_flag (const struct extension_language_defn *extlang)
- {
-+  if (!gdb_python_initialized)
-+    return 0;
-+
-+  gdbpy_gil gil;
-   return PyOS_InterruptOccurred ();
- }
- 
-@@ -1573,6 +1601,7 @@ finalize_python (void *ignore)
- 
-   Py_Finalize ();
- 
-+  gdb_python_initialized = false;
-   restore_active_ext_lang (previous_active);
- }
- 
-@@ -1736,8 +1765,7 @@ do_start_initialization ()
-     return false;
- 
-   /* Release the GIL while gdb runs.  */
--  PyThreadState_Swap (NULL);
--  PyEval_ReleaseLock ();
-+  PyEval_SaveThread ();
- 
-   make_final_cleanup (finalize_python, NULL);
- 
--- 
-2.31.1
-
diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
index fd739f3969..a6e1d7f53c 100644
--- a/package/gdb/Config.in.host
+++ b/package/gdb/Config.in.host
@@ -67,11 +67,6 @@ choice
 	help
 	  Select the version of gdb you wish to use.
 
-config BR2_GDB_VERSION_8_3
-	bool "gdb 8.3.x"
-	# gdbserver support missing
-	depends on !BR2_riscv
-
 config BR2_GDB_VERSION_9_2
 	bool "gdb 9.2.x"
 	# gdbserver support missing
@@ -92,7 +87,6 @@ config BR2_GDB_VERSION
 	string
 	default "arc-2020.09-release-gdb" if BR2_arc
 	default "4ecb98fbc2f94dbe01b69384afbc515107de73df" if BR2_csky
-	default "8.3.1"    if BR2_GDB_VERSION_8_3
 	default "9.2"      if BR2_GDB_VERSION_9_2
 	default "10.2"	   if BR2_GDB_VERSION_10 || !BR2_PACKAGE_HOST_GDB
 	default "11.1"     if BR2_GDB_VERSION_11
diff --git a/package/gdb/gdb.hash b/package/gdb/gdb.hash
index e3b867b042..d3e83af0b9 100644
--- a/package/gdb/gdb.hash
+++ b/package/gdb/gdb.hash
@@ -1,5 +1,4 @@
 # From ftp://gcc.gnu.org/pub/gdb/releases/sha512.sum
-sha512  9053a2dc6b9eb921907afbc4cecc75d635aa76df5e8c4f0e5824ccf57cb206b299c19b127fff000b65c334826ff8304a54ff6098428365a8e997cca886c39e9a  gdb-8.3.1.tar.xz
 sha512  73635f00f343117aa5e2436f1e1597099e2bfb31ef7bb162b273fa1ea282c3fa9b0f52762e70bfc7ad0334addb8d159e9ac7cbe5998ca4f755ea8cf90714d274  gdb-9.2.tar.xz
 sha512  3653762ac008e065c37cd641653184c9ff7ce51ee2222ade1122bec9d6cc64dffd4fb74888ef11ac1942064a08910e96b7865112ad37f4602eb0a16bed074caa  gdb-10.2.tar.xz
 sha512  c40bf970e2f7c2107b29c5aa6a7150daa709d75ddadb73ac20742419d4637d158e3063a4c6ff6e47fae8ca8e1d36253973f85ea15445d004be6d5d7a2dd9bd46  gdb-11.1.tar.xz
-- 
2.31.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 5/5] support/testing: add suite of tests for gdb
  2021-10-09 19:16 [Buildroot] [PATCH 0/5] GDB updates Thomas Petazzoni
                   ` (3 preceding siblings ...)
  2021-10-09 19:16 ` [Buildroot] [PATCH 4/5] package/gdb: drop support for version 8.3.x Thomas Petazzoni
@ 2021-10-09 19:16 ` Thomas Petazzoni
  2021-10-10 17:43   ` Yann E. MORIN
  4 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2021-10-09 19:16 UTC (permalink / raw)
  To: Buildroot List
  Cc: Michael Fischer, Romain Naour, Yann E. MORIN, Thomas Petazzoni

The list of tests is as follows:

TestGdbHostOnlyDefault: build just minimal host-gdb, default version

TestGdbHostOnlyAllFeatures: build host-gdb, default version, with all
features enabled (TUI, Python, simulator)

TestGdbserverOnly: build just target gdbserver, default version

TestGdbFullTarget: build just target gdb, default version

TestGdbHostOnly9x: build minimal host-gdb, 9.x version

TestGdbHostGdbserver9x: build minimal host-gdb 9.x + gdbserver

TestGdbHostGdbTarget9x: build minimal host-gdb 9.x + full gdb

TestGdbHostOnly11x: build minimal host-gdb, 11.x version

TestGdbHostGdbserver11x: build minimal host-gdb 11.x + gdbserver

TestGdbHostGdbTarget11x: build minimal host-gdb 11.x + gdb

TestGdbArc: build minimal host-gdb + gdb + gdbserver, for the special
ARC architecture version

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 support/testing/tests/package/test_gdb.py | 215 ++++++++++++++++++++++
 1 file changed, 215 insertions(+)
 create mode 100644 support/testing/tests/package/test_gdb.py

diff --git a/support/testing/tests/package/test_gdb.py b/support/testing/tests/package/test_gdb.py
new file mode 100644
index 0000000000..a7b0870644
--- /dev/null
+++ b/support/testing/tests/package/test_gdb.py
@@ -0,0 +1,215 @@
+import os
+import infra.basetest
+
+
+class BaseGdb(infra.basetest.BRTest):
+    def verify_host_gdb(self, prefix="arm-linux"):
+        cmd = ["host/bin/%s-gdb" % prefix, "--version"]
+        # We don't check the return value, as it automatically raises
+        # an exception if the command returns with a non-zero value
+        infra.run_cmd_on_host(self.builddir, cmd)
+
+    def boot(self):
+        img = os.path.join(self.builddir, "images", "rootfs.cpio")
+        self.emulator.boot(arch="armv5",
+                           kernel="builtin",
+                           options=["-initrd", img,
+                                    "-net", "nic",
+                                    "-net", "user"])
+        self.emulator.login()
+
+    def verify_gdbserver(self):
+        cmd = "gdbserver --version"
+        self.assertRunOk(cmd)
+
+    def verify_gdb(self):
+        cmd = "gdb --version"
+        self.assertRunOk(cmd)
+
+
+class TestGdbHostOnlyDefault(BaseGdb):
+    config = \
+        infra.basetest.MINIMAL_CONFIG + \
+        """
+        BR2_arm=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_PACKAGE_HOST_GDB=y
+        """
+
+    def test_run(self):
+        self.verify_host_gdb()
+
+
+class TestGdbHostOnlyAllFeatures(BaseGdb):
+    config = \
+        infra.basetest.MINIMAL_CONFIG + \
+        """
+        BR2_arm=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_PACKAGE_HOST_GDB=y
+        BR2_PACKAGE_HOST_GDB_TUI=y
+        BR2_PACKAGE_HOST_GDB_PYTHON3=y
+        BR2_PACKAGE_HOST_GDB_SIM=y
+        """
+
+    def test_run(self):
+        self.verify_host_gdb()
+
+
+class TestGdbserverOnly(BaseGdb):
+    config = \
+        """
+        BR2_arm=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_PACKAGE_GDB=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+
+    def test_run(self):
+        self.boot()
+        self.verify_gdbserver()
+
+
+class TestGdbFullTarget(BaseGdb):
+    config = \
+        """
+        BR2_arm=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_PACKAGE_GDB=y
+        BR2_PACKAGE_GDB_DEBUGGER=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+
+    def test_run(self):
+        self.boot()
+        self.verify_gdb()
+
+
+class TestGdbHostOnly9x(BaseGdb):
+    config = \
+        infra.basetest.MINIMAL_CONFIG + \
+        """
+        BR2_arm=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_PACKAGE_HOST_GDB=y
+        BR2_GDB_VERSION_9_2=y
+        """
+
+    def test_run(self):
+        self.verify_host_gdb()
+
+
+class TestGdbHostGdbserver9x(BaseGdb):
+    config = \
+        """
+        BR2_arm=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_PACKAGE_HOST_GDB=y
+        BR2_GDB_VERSION_9_2=y
+        BR2_PACKAGE_GDB=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+
+    def test_run(self):
+        self.verify_host_gdb()
+        self.boot()
+        self.verify_gdbserver()
+
+
+class TestGdbHostGdbTarget9x(BaseGdb):
+    config = \
+        """
+        BR2_arm=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_PACKAGE_HOST_GDB=y
+        BR2_GDB_VERSION_9_2=y
+        BR2_PACKAGE_GDB=y
+        BR2_PACKAGE_GDB_DEBUGGER=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+
+    def test_run(self):
+        self.verify_host_gdb()
+        self.boot()
+        self.verify_gdb()
+
+
+class TestGdbHostOnly11x(BaseGdb):
+    config = \
+        infra.basetest.MINIMAL_CONFIG + \
+        """
+        BR2_arm=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_PACKAGE_HOST_GDB=y
+        BR2_GDB_VERSION_11=y
+        """
+
+    def test_run(self):
+        self.verify_host_gdb()
+
+
+class TestGdbHostGdbserver11x(BaseGdb):
+    config = \
+        """
+        BR2_arm=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_PACKAGE_HOST_GDB=y
+        BR2_GDB_VERSION_11=y
+        BR2_PACKAGE_GDB=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+
+    def test_run(self):
+        self.verify_host_gdb()
+        self.boot()
+        self.verify_gdbserver()
+
+
+class TestGdbHostGdbTarget11x(BaseGdb):
+    config = \
+        """
+        BR2_arm=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_PACKAGE_HOST_GDB=y
+        BR2_GDB_VERSION_11=y
+        BR2_PACKAGE_GDB=y
+        BR2_PACKAGE_GDB_DEBUGGER=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+
+    def test_run(self):
+        self.verify_host_gdb()
+        self.boot()
+        self.verify_gdb()
+
+
+class TestGdbArc(BaseGdb):
+    config = \
+        """
+        BR2_arcle=y
+        BR2_archs4x_rel31=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_PACKAGE_HOST_GDB=y
+        BR2_PACKAGE_GDB=y
+        BR2_PACKAGE_GDB_SERVER=y
+        BR2_PACKAGE_GDB_DEBUGGER=y
+        """
+
+    def test_run(self):
+        self.verify_host_gdb("arc-linux")
-- 
2.31.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [Buildroot] [PATCH 1/5] package/gdb: append to dependencies in conditional
  2021-10-09 19:16 ` [Buildroot] [PATCH 1/5] package/gdb: append to dependencies in conditional Thomas Petazzoni
@ 2021-10-10  8:49   ` Yann E. MORIN
  2021-10-10 10:05     ` Peter Korsgaard
  2021-10-10 13:57     ` Thomas Petazzoni
  0 siblings, 2 replies; 15+ messages in thread
From: Yann E. MORIN @ 2021-10-10  8:49 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Michael Fischer, Romain Naour, Buildroot List

Thomas, All,

On 2021-10-09 21:16 +0200, Thomas Petazzoni spake thusly:
> Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
> conditional is the root of all evil."
> 
> Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
> conditional is the root of all evil."
> 
> Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
> conditional is the root of all evil."
> 
> Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
> conditional is the root of all evil."

Forcing the value of <pkg>_DEPENDENCIES inside a conditional is the root
of all evil.

> Enough? :-)

I guess so, yes! Next time you send a patch that forces the value of
<pkg>_DEPENDENCIES in a conditional, I'll try not to apply it! ;-)

> Due to this mistake, any other GDB_DEPENDENCIES defined before this
> assignment were lost. For example, the host-flex host-bison added
> inside the GDB_FROM_GIT==y condition were ignored if
> BR2_PACKAGE_GDB_DEBUGGER.
> 
> Fixes the build of all ARC configurations that have
> BR2_PACKAGE_GDB_DEBUGGER enabled.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  package/gdb/gdb.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
> index f9010019f5..4ead75289e 100644
> --- a/package/gdb/gdb.mk
> +++ b/package/gdb/gdb.mk
> @@ -147,7 +147,7 @@ ifeq ($(BR2_PACKAGE_GDB_DEBUGGER),y)
>  GDB_CONF_OPTS += \
>  	--enable-gdb \
>  	--with-curses
> -GDB_DEPENDENCIES = ncurses \
> +GDB_DEPENDENCIES += ncurses \
>  	$(if $(BR2_PACKAGE_LIBICONV),libiconv)
>  else
>  GDB_CONF_OPTS += \
> -- 
> 2.31.1
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Buildroot] [PATCH 2/5] package/gdb: add support for gdb 11.x
  2021-10-09 19:16 ` [Buildroot] [PATCH 2/5] package/gdb: add support for gdb 11.x Thomas Petazzoni
@ 2021-10-10  9:10   ` Yann E. MORIN
  2021-10-10 13:57     ` Thomas Petazzoni
  0 siblings, 1 reply; 15+ messages in thread
From: Yann E. MORIN @ 2021-10-10  9:10 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Michael Fischer, Romain Naour, Buildroot List

Thomas, All,

On 2021-10-09 21:16 +0200, Thomas Petazzoni spake thusly:
> From: Michael Fischer <mf@go-sys.de>
> Starting from version 11.x, gdb needs the gmp library.
[--SNIP--]
> diff --git a/package/gdb/Config.in b/package/gdb/Config.in
> index 246748131e..d5ec5406fb 100644
> --- a/package/gdb/Config.in
> +++ b/package/gdb/Config.in
> @@ -54,6 +54,7 @@ config BR2_PACKAGE_GDB_DEBUGGER
>  	depends on BR2_USE_WCHAR
>  	depends on !BR2_sh
>  	depends on !BR2_csky
> +	select BR2_PACKAGE_GMP

This one looks a bit dubious...

If the host gdb is enabled, then the target gdb is the same version as
the host version. So, this configuration:

    BR2_PACKAGE_HOST_GDB=y
    BR2_PACKAGE_GDB=y
    BR2_GDB_VERSION_10=y

will yield a configuration that will force the target gmp, even though
the target gdb will not use it.

Or did I miss something?

I can fix that when applying:

    select BR2_PACKAGE_GMP if BR2_GDB_VERSION_11

The reasoning is that, BR2_GDB_VERSION_11 can only be set when the host
gdb is enabled.

So, if BR2_GDB_VERSION_11 is not set, either:

  - the host gdb is not enabled, in which case the default for the
    target gdb is 9.x (with next patch, 10.x), or

  - the host gdb is enabled, and another version is selected.

Thoughts?

Of course, that will need some refinments when we introduce gdb 12.x (if
it still needs gmp). But for now, introducing either
BR2_PACKAGE_GDB_NEEDS_GMP of BR2_PACKAGE_GDB_11_X_or_later seemed a bit
heavy-handed...

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Buildroot] [PATCH 1/5] package/gdb: append to dependencies in conditional
  2021-10-10  8:49   ` Yann E. MORIN
@ 2021-10-10 10:05     ` Peter Korsgaard
  2021-10-10 13:57     ` Thomas Petazzoni
  1 sibling, 0 replies; 15+ messages in thread
From: Peter Korsgaard @ 2021-10-10 10:05 UTC (permalink / raw)
  To: Yann E. MORIN
  Cc: Michael Fischer, Romain Naour, Thomas Petazzoni, Buildroot List

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Thomas, All,
 > On 2021-10-09 21:16 +0200, Thomas Petazzoni spake thusly:
 >> Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
 >> conditional is the root of all evil."
 >> 
 >> Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
 >> conditional is the root of all evil."
 >> 
 >> Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
 >> conditional is the root of all evil."
 >> 
 >> Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
 >> conditional is the root of all evil."

 > Forcing the value of <pkg>_DEPENDENCIES inside a conditional is the root
 > of all evil.

;)

Committed to 2021.02.x, 2021.05.x and 2021.08.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Buildroot] [PATCH 2/5] package/gdb: add support for gdb 11.x
  2021-10-10  9:10   ` Yann E. MORIN
@ 2021-10-10 13:57     ` Thomas Petazzoni
  2021-10-10 17:42       ` Yann E. MORIN
  0 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2021-10-10 13:57 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: Michael Fischer, Romain Naour, Buildroot List

On Sun, 10 Oct 2021 11:10:59 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> This one looks a bit dubious...
> 
> If the host gdb is enabled, then the target gdb is the same version as
> the host version. So, this configuration:
> 
>     BR2_PACKAGE_HOST_GDB=y
>     BR2_PACKAGE_GDB=y
>     BR2_GDB_VERSION_10=y
> 
> will yield a configuration that will force the target gmp, even though
> the target gdb will not use it.
> 
> Or did I miss something?
> 
> I can fix that when applying:
> 
>     select BR2_PACKAGE_GMP if BR2_GDB_VERSION_11

Gah, of course, you're completely right. I thought about this when
starting this work, but then go drowned into all the implications
(adding test cases, changing generate-gitlab-ci-yml, etc.) and forgot
to get back to this.

Do you want me to resend, or will you fix this up when applying?

Thanks for the careful review!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Buildroot] [PATCH 1/5] package/gdb: append to dependencies in conditional
  2021-10-10  8:49   ` Yann E. MORIN
  2021-10-10 10:05     ` Peter Korsgaard
@ 2021-10-10 13:57     ` Thomas Petazzoni
  1 sibling, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2021-10-10 13:57 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: Michael Fischer, Romain Naour, Buildroot List

On Sun, 10 Oct 2021 10:49:23 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> On 2021-10-09 21:16 +0200, Thomas Petazzoni spake thusly:
> > Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
> > conditional is the root of all evil."
> > 
> > Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
> > conditional is the root of all evil."
> > 
> > Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
> > conditional is the root of all evil."
> > 
> > Repeat after me: "Forcing the value of <pkg>_DEPENDENCIES inside a
> > conditional is the root of all evil."  
> 
> Forcing the value of <pkg>_DEPENDENCIES inside a conditional is the root
> of all evil.
> 
> > Enough? :-)  
> 
> I guess so, yes! Next time you send a patch that forces the value of
> <pkg>_DEPENDENCIES in a conditional, I'll try not to apply it! ;-)

	 :-)

Thanks for having taken care of the patch!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Buildroot] [PATCH 2/5] package/gdb: add support for gdb 11.x
  2021-10-10 13:57     ` Thomas Petazzoni
@ 2021-10-10 17:42       ` Yann E. MORIN
  0 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2021-10-10 17:42 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Michael Fischer, Romain Naour, Buildroot List

Thomas, All,

On 2021-10-10 15:57 +0200, Thomas Petazzoni spake thusly:
> On Sun, 10 Oct 2021 11:10:59 +0200
> "Yann E. MORIN" <yann.morin.1998@free.fr> wrote:
> > I can fix that when applying:
> >     select BR2_PACKAGE_GMP if BR2_GDB_VERSION_11
> Gah, of course, you're completely right. I thought about this when
> starting this work, but then go drowned into all the implications
> (adding test cases, changing generate-gitlab-ci-yml, etc.) and forgot
> to get back to this.
> 
> Do you want me to resend, or will you fix this up when applying?

Fixed, and applied to master, thanks.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Buildroot] [PATCH 3/5] package/gdb: switch to gdb 10.x as the default
  2021-10-09 19:16 ` [Buildroot] [PATCH 3/5] package/gdb: switch to gdb 10.x as the default Thomas Petazzoni
@ 2021-10-10 17:42   ` Yann E. MORIN
  0 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2021-10-10 17:42 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Michael Fischer, Romain Naour, Buildroot List

Thomas, All,

On 2021-10-09 21:16 +0200, Thomas Petazzoni spake thusly:
> When doing this, we can simplify the RISC-V related logic. Indeed, as
> there was no support for RISC-V in gdb 9.x, which was the current
> default, we had some trickery in the Config.in file to ensure gdb 10.x
> was used by default on RISC-V. However now that 10.x is the default
> for everybody, this trickery is no longer needed.
> 
> Also, we now needs to enable BR2_PACKAGE_GDB_TOPLEVEL when host-gdb is
> not built, as the default target gdb version is 10.x, and threfore
> requires BR2_PACKAGE_GDB_TOPLEVEL=y.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  package/gdb/Config.in.host | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
> index 2f9790f6e1..fd739f3969 100644
> --- a/package/gdb/Config.in.host
> +++ b/package/gdb/Config.in.host
> @@ -61,7 +61,7 @@ config BR2_PACKAGE_HOST_GDB_SIM
>  
>  choice
>  	prompt "GDB debugger Version"
> -	default BR2_GDB_VERSION_9_2
> +	default BR2_GDB_VERSION_10
>  	depends on !BR2_arc
>  	depends on !BR2_csky
>  	help
> @@ -93,8 +93,8 @@ config BR2_GDB_VERSION
>  	default "arc-2020.09-release-gdb" if BR2_arc
>  	default "4ecb98fbc2f94dbe01b69384afbc515107de73df" if BR2_csky
>  	default "8.3.1"    if BR2_GDB_VERSION_8_3
> -	default "9.2"      if BR2_GDB_VERSION_9_2 || (!BR2_PACKAGE_HOST_GDB && !BR2_riscv)
> -	default "10.2"	   if BR2_GDB_VERSION_10 || (!BR2_PACKAGE_HOST_GDB && BR2_riscv)
> +	default "9.2"      if BR2_GDB_VERSION_9_2
> +	default "10.2"	   if BR2_GDB_VERSION_10 || !BR2_PACKAGE_HOST_GDB
>  	default "11.1"     if BR2_GDB_VERSION_11
>  	depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
>  
> @@ -105,5 +105,5 @@ config BR2_PACKAGE_GDB_TOPLEVEL
>  	default y if BR2_arc
>  	default y if BR2_GDB_VERSION_10
>  	default y if BR2_GDB_VERSION_11
> -	default y if !BR2_PACKAGE_HOST_GDB && BR2_riscv
> +	default y if !BR2_PACKAGE_HOST_GDB
>  	depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
> -- 
> 2.31.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Buildroot] [PATCH 4/5] package/gdb: drop support for version 8.3.x
  2021-10-09 19:16 ` [Buildroot] [PATCH 4/5] package/gdb: drop support for version 8.3.x Thomas Petazzoni
@ 2021-10-10 17:42   ` Yann E. MORIN
  0 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2021-10-10 17:42 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Michael Fischer, Romain Naour, Buildroot List

Thomas, All,

On 2021-10-09 21:16 +0200, Thomas Petazzoni spake thusly:
> Now that gdb 11.x has been added, that 10.x is the default, we can
> drop version 8.3.x.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  Config.in.legacy                              |   6 +
>  ...e-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch |  55 -----
>  ...-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch |  43 ----
>  .../gdb/8.3.1/0003-use-asm-sgidefs.h.patch    |  40 ----
>  .../0004-gdbserver-fix-build-for-m68k.patch   |  62 ------
>  ...fork-inferior-include-linux-ptrace.h.patch |  53 -----
>  ...e-of-is-operator-for-comparison-in-p.patch |  42 ----
>  ...x-Python3.9-related-runtime-problems.patch | 193 ------------------
>  package/gdb/Config.in.host                    |   6 -
>  package/gdb/gdb.hash                          |   1 -
>  10 files changed, 6 insertions(+), 495 deletions(-)
>  delete mode 100644 package/gdb/8.3.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
>  delete mode 100644 package/gdb/8.3.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
>  delete mode 100644 package/gdb/8.3.1/0003-use-asm-sgidefs.h.patch
>  delete mode 100644 package/gdb/8.3.1/0004-gdbserver-fix-build-for-m68k.patch
>  delete mode 100644 package/gdb/8.3.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch
>  delete mode 100644 package/gdb/8.3.1/0006-Fix-incorrect-use-of-is-operator-for-comparison-in-p.patch
>  delete mode 100644 package/gdb/8.3.1/0007-Fix-Python3.9-related-runtime-problems.patch
> 
> diff --git a/Config.in.legacy b/Config.in.legacy
> index 06bd962d9b..3ec48edb87 100644
> --- a/Config.in.legacy
> +++ b/Config.in.legacy
> @@ -146,6 +146,12 @@ endif
>  
>  comment "Legacy options removed in 2021.11"
>  
> +config BR2_GDB_VERSION_8_3
> +	bool "gdb version 8.3.x removed"
> +	select BR2_LEGACY
> +	help
> +	  gdb 8.3.x has been removed, use a newer version instead.
> +
>  config BR2_PACKAGE_PYTHON_MELD3
>  	bool "python-meld3 package removed"
>  	select BR2_LEGACY
> diff --git a/package/gdb/8.3.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/package/gdb/8.3.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
> deleted file mode 100644
> index ab8dc626f0..0000000000
> --- a/package/gdb/8.3.1/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
> +++ /dev/null
> @@ -1,55 +0,0 @@
> -From 72ee19f54fd35595465b2e35eccf1f3d65fe21c6 Mon Sep 17 00:00:00 2001
> -From: Khem Raj <raj.khem@gmail.com>
> -Date: Sat, 6 Aug 2016 17:32:50 -0700
> -Subject: [PATCH] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC systems
> -
> -Upstream-Status: Pending
> -
> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> -Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> -[Rebase on gdb 8.3]
> -Signed-off-by: Romain Naour <romain.naour@gmail.com>
> ----
> - gdb/gdbserver/linux-ppc-low.c | 6 ++++++
> - gdb/nat/ppc-linux.h           | 6 ++++++
> - 2 files changed, 12 insertions(+)
> -
> -diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
> -index 1b695e53fe9..1978347c02c 100644
> ---- a/gdb/gdbserver/linux-ppc-low.c
> -+++ b/gdb/gdbserver/linux-ppc-low.c
> -@@ -23,7 +23,13 @@
> - #include "elf/common.h"
> - #include <sys/uio.h>
> - #include <elf.h>
> -+#if !defined(__GLIBC__)
> -+# define pt_regs uapi_pt_regs
> -+#endif
> - #include <asm/ptrace.h>
> -+#if !defined(__GLIBC__)
> -+# undef pt_regs
> -+#endif
> - 
> - #include "arch/ppc-linux-common.h"
> - #include "arch/ppc-linux-tdesc.h"
> -diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
> -index f1561b3b357..40399361c09 100644
> ---- a/gdb/nat/ppc-linux.h
> -+++ b/gdb/nat/ppc-linux.h
> -@@ -18,7 +18,13 @@
> - #ifndef NAT_PPC_LINUX_H
> - #define NAT_PPC_LINUX_H
> - 
> -+#if !defined(__GLIBC__)
> -+# define pt_regs uapi_pt_regs
> -+#endif
> - #include <asm/ptrace.h>
> -+#if !defined(__GLIBC__)
> -+# undef pt_regs
> -+#endif
> - #include <asm/cputable.h>
> - 
> - /* This sometimes isn't defined.  */
> --- 
> -2.21.0
> -
> diff --git a/package/gdb/8.3.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch b/package/gdb/8.3.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
> deleted file mode 100644
> index 9d508fbf1e..0000000000
> --- a/package/gdb/8.3.1/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
> +++ /dev/null
> @@ -1,43 +0,0 @@
> -From ef630288fdc2d4d22651702672f9d5c9cd767e5b Mon Sep 17 00:00:00 2001
> -From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> -Date: Sat, 3 Jun 2017 21:23:52 +0200
> -Subject: [PATCH] sh/ptrace: Define pt_{dsp,}regs uapi_pt_{dsp,}regs on !GLIBC
> - systems
> -
> -Fixes a pt_{dsp,}regs redefinition when building with the musl C library
> -on SuperH.
> -
> -Inspired by
> -http://git.yoctoproject.org/clean/cgit.cgi/poky/plain/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch,
> -adapted for SuperH.
> -
> -Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> -[Rebase	on gdb 8.0]
> -Signed-off-by: Romain Naour <romain.naour@gmail.com>
> ----
> - gdb/gdbserver/linux-sh-low.c | 8 ++++++++
> - 1 file changed, 8 insertions(+)
> -
> -diff --git a/gdb/gdbserver/linux-sh-low.c b/gdb/gdbserver/linux-sh-low.c
> -index 0953721a190..c331c1382f7 100644
> ---- a/gdb/gdbserver/linux-sh-low.c
> -+++ b/gdb/gdbserver/linux-sh-low.c
> -@@ -27,7 +27,15 @@ extern const struct target_desc *tdesc_sh;
> - #include <sys/reg.h>
> - #endif
> - 
> -+#if !defined(__GLIBC__)
> -+# define pt_regs uapi_pt_regs
> -+# define pt_dspregs uapi_pt_dspregs
> -+#endif
> - #include <asm/ptrace.h>
> -+#if !defined(__GLIBC__)
> -+# undef pt_regs
> -+# undef pt_dspregs
> -+#endif
> - 
> - #define sh_num_regs 41
> - 
> --- 
> -2.21.0
> -
> diff --git a/package/gdb/8.3.1/0003-use-asm-sgidefs.h.patch b/package/gdb/8.3.1/0003-use-asm-sgidefs.h.patch
> deleted file mode 100644
> index 2909f62c68..0000000000
> --- a/package/gdb/8.3.1/0003-use-asm-sgidefs.h.patch
> +++ /dev/null
> @@ -1,40 +0,0 @@
> -From 19a0f664809b6858e69aa98188eb739415de044c Mon Sep 17 00:00:00 2001
> -From: Andre McCurdy <amccurdy@gmail.com>
> -Date: Sat, 30 Apr 2016 15:29:06 -0700
> -Subject: [PATCH] use <asm/sgidefs.h>
> -
> -Build fix for MIPS with musl libc
> -
> -The MIPS specific header <sgidefs.h> is provided by glibc and uclibc
> -but not by musl. Regardless of the libc, the kernel headers provide
> -<asm/sgidefs.h> which provides the same definitions, so use that
> -instead.
> -
> -Upstream-Status: Pending
> -
> -[Vincent:
> -Taken from: https://sourceware.org/bugzilla/show_bug.cgi?id=21070]
> -
> -Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> -Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
> ----
> - gdb/mips-linux-nat.c | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
> -index e68ed1e4da9..bc42aa59685 100644
> ---- a/gdb/mips-linux-nat.c
> -+++ b/gdb/mips-linux-nat.c
> -@@ -31,7 +31,7 @@
> - #include "gdb_proc_service.h"
> - #include "gregset.h"
> - 
> --#include <sgidefs.h>
> -+#include <asm/sgidefs.h>
> - #include "nat/gdb_ptrace.h"
> - #include <asm/ptrace.h>
> - #include "inf-ptrace.h"
> --- 
> -2.21.0
> -
> diff --git a/package/gdb/8.3.1/0004-gdbserver-fix-build-for-m68k.patch b/package/gdb/8.3.1/0004-gdbserver-fix-build-for-m68k.patch
> deleted file mode 100644
> index d718293899..0000000000
> --- a/package/gdb/8.3.1/0004-gdbserver-fix-build-for-m68k.patch
> +++ /dev/null
> @@ -1,62 +0,0 @@
> -From 448e481aab86c823d908530038e20a14213db0a2 Mon Sep 17 00:00:00 2001
> -From: Romain Naour <romain.naour@gmail.com>
> -Date: Fri, 22 Jun 2018 22:40:26 +0200
> -Subject: [PATCH] gdbserver: fix build for m68k
> -MIME-Version: 1.0
> -Content-Type: text/plain; charset=UTF-8
> -Content-Transfer-Encoding: 8bit
> -
> -As for strace [1], when <sys/reg.h> is included after <linux/ptrace.h>,
> -the build fails on m68k with the following diagnostics:
> -
> -In file included from ./../nat/linux-ptrace.h:28:0,
> -                 from linux-low.h:27,
> -                 from linux-m68k-low.c:20:
> -[...]/usr/include/sys/reg.h:26:3: error: expected identifier before numeric constant
> -   PT_D1 = 0,
> -   ^
> -[...]usr/include/sys/reg.h:26:3: error: expected « } » before numeric constant
> -[...]usr/include/sys/reg.h:26:3: error: expected unqualified-id before numeric constant
> -In file included from linux-m68k-low.c:27:0:
> -[...]usr/include/sys/reg.h:99:1: error: expected declaration before « } » token
> - };
> - ^
> -
> -Fix this by moving <sys/reg.h> on top of "linux-low.h".
> -
> -[1] https://github.com/strace/strace/commit/6ebf6c4f9e5ebca123a5b5f24afe67cf0473cf92
> -
> -Signed-off-by: Romain Naour <romain.naour@gmail.com>
> ----
> - gdb/gdbserver/linux-m68k-low.c | 9 +++++----
> - 1 file changed, 5 insertions(+), 4 deletions(-)
> -
> -diff --git a/gdb/gdbserver/linux-m68k-low.c b/gdb/gdbserver/linux-m68k-low.c
> -index 16f639d02fc..969d9973737 100644
> ---- a/gdb/gdbserver/linux-m68k-low.c
> -+++ b/gdb/gdbserver/linux-m68k-low.c
> -@@ -17,16 +17,17 @@
> -    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
> - 
> - #include "server.h"
> -+
> -+#ifdef HAVE_SYS_REG_H
> -+#include <sys/reg.h>
> -+#endif
> -+
> - #include "linux-low.h"
> - 
> - /* Defined in auto-generated file reg-m68k.c.  */
> - void init_registers_m68k (void);
> - extern const struct target_desc *tdesc_m68k;
> - 
> --#ifdef HAVE_SYS_REG_H
> --#include <sys/reg.h>
> --#endif
> --
> - #define m68k_num_regs 29
> - #define m68k_num_gregs 18
> - 
> --- 
> -2.21.0
> -
> diff --git a/package/gdb/8.3.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch b/package/gdb/8.3.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch
> deleted file mode 100644
> index 394e7a2c2a..0000000000
> --- a/package/gdb/8.3.1/0005-nat-fork-inferior-include-linux-ptrace.h.patch
> +++ /dev/null
> @@ -1,53 +0,0 @@
> -From d84ecfa3a8c8fbade89229ac66c09f2a97ab00fb Mon Sep 17 00:00:00 2001
> -From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> -Date: Sun, 24 Jun 2018 23:33:55 +0200
> -Subject: [PATCH] nat/fork-inferior: include linux-ptrace.h
> -
> -To decide whether fork() or vfork() should be used, fork-inferior.c
> -uses the following test:
> -
> -  #if !(defined(__UCLIBC__) && defined(HAS_NOMMU))
> -
> -However, HAS_NOMMU is never defined, because it gets defined in
> -linux-ptrace.h, which is not included by fork-inferior.c. Due to this,
> -gdbserver fails to build on noMMU architectures. This commit fixes
> -that by simply including linux-ptrace.h.
> -
> -This bug was introduced by commit
> -2090129c36c7e582943b7d300968d19b46160d84 ("Share fork_inferior et al
> -with gdbserver"). Indeed, the same fork()/vfork() selection was done,
> -but in another file where linux-ptrace.h was included.
> -
> -Fixes the following build issue:
> -
> -../nat/fork-inferior.c: In function 'pid_t fork_inferior(const char*, const string&, char**, void (*)(), void (*)(int), void (*)(), const char*, void (*)(const char*, char* const*, char* const*))':
> -../nat/fork-inferior.c:376:11: error: 'fork' was not declared in this scope
> -     pid = fork ();
> -           ^~~~
> -../nat/fork-inferior.c:376:11: note: suggested alternative: 'vfork'
> -     pid = fork ();
> -           ^~~~
> -           vfork
> -
> -Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> -[Romain: rebase on gdb 8.3]
> -Signed-off-by: Romain Naour <romain.naour@gmail.com>
> ----
> - gdb/nat/fork-inferior.c | 1 +
> - 1 file changed, 1 insertion(+)
> -
> -diff --git a/gdb/nat/fork-inferior.c b/gdb/nat/fork-inferior.c
> -index fe9360a5039..626fe7c1fbf 100644
> ---- a/gdb/nat/fork-inferior.c
> -+++ b/gdb/nat/fork-inferior.c
> -@@ -27,6 +27,7 @@
> - #include "common/pathstuff.h"
> - #include "common/signals-state-save-restore.h"
> - #include "common/gdb_tilde_expand.h"
> -+#include "linux-ptrace.h"
> - #include <vector>
> - 
> - extern char **environ;
> --- 
> -2.21.0
> -
> diff --git a/package/gdb/8.3.1/0006-Fix-incorrect-use-of-is-operator-for-comparison-in-p.patch b/package/gdb/8.3.1/0006-Fix-incorrect-use-of-is-operator-for-comparison-in-p.patch
> deleted file mode 100644
> index 989a5b1347..0000000000
> --- a/package/gdb/8.3.1/0006-Fix-incorrect-use-of-is-operator-for-comparison-in-p.patch
> +++ /dev/null
> @@ -1,42 +0,0 @@
> -From e00c211d51bec301cf04719b77076a8783ef44b5 Mon Sep 17 00:00:00 2001
> -From: Raul Tambre <raul@tambre.ee>
> -Date: Sat, 4 May 2019 15:48:17 -0400
> -Subject: [PATCH] Fix incorrect use of 'is' operator for comparison in
> - python/lib/gdb/command/prompt.py
> -
> -The 'is' operator is not meant to be used for comparisons. It currently working
> -is an implementation detail of CPython.  CPython 3.8 has added a SyntaxWarning
> -for this.
> -
> -(cherry picked from commit b6484282f85bf7f11451b2441599c241d302ad9d)
> -[Romain: backport to gdb 8.x]
> -Signed-off-by: Romain Naour <romain.naour@gmail.com>
> ----
> - gdb/python/lib/gdb/command/prompt.py | 4 ++--
> - 1 file changed, 2 insertions(+), 2 deletions(-)
> -
> -diff --git a/gdb/python/lib/gdb/command/prompt.py b/gdb/python/lib/gdb/command/prompt.py
> -index 3d662a7d3f..04b9e49c22 100644
> ---- a/gdb/python/lib/gdb/command/prompt.py
> -+++ b/gdb/python/lib/gdb/command/prompt.py
> -@@ -45,7 +45,7 @@ The currently defined substitutions are:
> -         self.hook_set = False
> - 
> -     def get_show_string (self, pvalue):
> --        if self.value is not '':
> -+        if self.value:
> -            return "The extended prompt is: " + self.value
> -         else:
> -            return "The extended prompt is not set."
> -@@ -57,7 +57,7 @@ The currently defined substitutions are:
> -         return ""
> - 
> -     def before_prompt_hook(self, current):
> --        if self.value is not '':
> -+        if self.value:
> -             return gdb.prompt.substitute_prompt(self.value)
> -         else:
> -             return None
> --- 
> -2.25.4
> -
> diff --git a/package/gdb/8.3.1/0007-Fix-Python3.9-related-runtime-problems.patch b/package/gdb/8.3.1/0007-Fix-Python3.9-related-runtime-problems.patch
> deleted file mode 100644
> index 63cfa1bd3e..0000000000
> --- a/package/gdb/8.3.1/0007-Fix-Python3.9-related-runtime-problems.patch
> +++ /dev/null
> @@ -1,193 +0,0 @@
> -From 51ef4f6ec819259d4a57fa4155ee78700918f8ff Mon Sep 17 00:00:00 2001
> -From: Kevin Buettner <kevinb@redhat.com>
> -Date: Wed, 27 May 2020 20:05:40 -0700
> -Subject: [PATCH] Fix Python3.9 related runtime problems
> -
> -Python3.9b1 is now available on Rawhide.  GDB w/ Python 3.9 support
> -can be built using the configure switch -with-python=/usr/bin/python3.9.
> -
> -Attempting to run gdb/Python3.9 segfaults on startup:
> -
> -    #0  0x00007ffff7b0582c in PyEval_ReleaseLock () from /lib64/libpython3.9.so.1.0
> -    #1  0x000000000069ccbf in do_start_initialization ()
> -	at worktree-test1/gdb/python/python.c:1789
> -    #2  _initialize_python ()
> -	at worktree-test1/gdb/python/python.c:1877
> -    #3  0x00000000007afb0a in initialize_all_files () at init.c:237
> -    ...
> -
> -Consulting the the documentation...
> -
> -https://docs.python.org/3/c-api/init.html
> -
> -...we find that PyEval_ReleaseLock() has been deprecated since version
> -3.2.  It recommends using PyEval_SaveThread or PyEval_ReleaseThread()
> -instead.  In do_start_initialization, in gdb/python/python.c, we
> -can replace the calls to PyThreadState_Swap() and PyEval_ReleaseLock()
> -with a single call to PyEval_SaveThread.   (Thanks to Keith Seitz
> -for working this out.)
> -
> -With that in place, GDB gets a little bit further.  It still dies
> -on startup, but the backtrace is different:
> -
> -    #0  0x00007ffff7b04306 in PyOS_InterruptOccurred ()
> -       from /lib64/libpython3.9.so.1.0
> -    #1  0x0000000000576e86 in check_quit_flag ()
> -	at worktree-test1/gdb/extension.c:776
> -    #2  0x0000000000576f8a in set_active_ext_lang (now_active=now_active@entry=0x983c00 <extension_language_python>)
> -	at worktree-test1/gdb/extension.c:705
> -    #3  0x000000000069d399 in gdbpy_enter::gdbpy_enter (this=0x7fffffffd2d0,
> -	gdbarch=0x0, language=0x0)
> -	at worktree-test1/gdb/python/python.c:211
> -    #4  0x0000000000686e00 in python_new_inferior (inf=0xddeb10)
> -	at worktree-test1/gdb/python/py-inferior.c:251
> -    #5  0x00000000005d9fb9 in std::function<void (inferior*)>::operator()(inferior*) const (__args#0=<optimized out>, this=0xccad20)
> -	at /usr/include/c++/10/bits/std_function.h:617
> -    #6  gdb::observers::observable<inferior*>::notify (args#0=0xddeb10,
> -	this=<optimized out>)
> -	at worktree-test1/gdb/../gdbsupport/observable.h:106
> -    #7  add_inferior_silent (pid=0)
> -	at worktree-test1/gdb/inferior.c:113
> -    #8  0x00000000005dbcb8 in initialize_inferiors ()
> -	at worktree-test1/gdb/inferior.c:947
> -    ...
> -
> -We checked with some Python Developers and were told that we should
> -acquire the GIL prior to calling any Python C API function.  We
> -definitely don't have the GIL for calls of PyOS_InterruptOccurred().
> -
> -I moved class_gdbpy_gil earlier in the file and use it in
> -gdbpy_check_quit_flag() to acquire (and automatically release) the
> -GIL.
> -
> -With those changes in place, I was able to run to a GDB prompt.  But,
> -when trying to quit, it segfaulted again due to due to some other
> -problems with gdbpy_check_quit_flag():
> -
> -    Thread 1 "gdb" received signal SIGSEGV, Segmentation fault.
> -    0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0
> -    (top-gdb) bt 8
> -    #0  0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0
> -    #1  0x00007ffff7afa5ea in PyGILState_Ensure.cold ()
> -       from /lib64/libpython3.9.so.1.0
> -    #2  0x000000000069b58c in gdbpy_gil::gdbpy_gil (this=<synthetic pointer>)
> -	at worktree-test1/gdb/python/python.c:278
> -    #3  gdbpy_check_quit_flag (extlang=<optimized out>)
> -	at worktree-test1/gdb/python/python.c:278
> -    #4  0x0000000000576e96 in check_quit_flag ()
> -	at worktree-test1/gdb/extension.c:776
> -    #5  0x000000000057700c in restore_active_ext_lang (previous=0xe9c050)
> -	at worktree-test1/gdb/extension.c:729
> -    #6  0x000000000088913a in do_my_cleanups (
> -	pmy_chain=0xc31870 <final_cleanup_chain>,
> -	old_chain=0xae5720 <sentinel_cleanup>)
> -	at worktree-test1/gdbsupport/cleanups.cc:131
> -    #7  do_final_cleanups ()
> -	at worktree-test1/gdbsupport/cleanups.cc:143
> -
> -In this case, we're trying to call a Python C API function after
> -Py_Finalize() has been called from finalize_python().  I made
> -finalize_python set gdb_python_initialized to false and then cause
> -check_quit_flag() to return early when it's false.
> -
> -With these changes in place, GDB seems to be working again with
> -Python3.9b1.  I think it likely that there are other problems lurking.
> -I wouldn't be surprised to find that there are other calls into Python
> -where we don't first make sure that we have the GIL.  Further changes
> -may well be needed.
> -
> -I see no regressions testing on Rawhide using a GDB built with the
> -default Python version (3.8.3) versus one built using Python 3.9b1.
> -
> -I've also tested on Fedora 28, 29, 30, 31, and 32 (all x86_64) using
> -the default (though updated) system installed versions of Python on
> -those OSes.  This means that I've tested against Python versions
> -2.7.15, 2.7.17, 2.7.18, 3.7.7, 3.8.2, and 3.8.3.  In each case GDB
> -still builds without problem and shows no regressions after applying
> -this patch.
> -
> -gdb/ChangeLog:
> -
> -2020-MM-DD  Kevin Buettner  <kevinb@redhat.com>
> -	    Keith Seitz  <keiths@redhat.com>
> -
> -	* python/python.c (do_start_initialization): For Python 3.9 and
> -	later, call PyEval_SaveThread instead of PyEval_ReleaseLock.
> -	(class gdbpy_gil): Move to earlier in file.
> -	(finalize_python): Set gdb_python_initialized.
> -	(gdbpy_check_quit_flag): Acquire GIL via gdbpy_gil.  Return early
> -	when not initialized.
> -
> -[import into Buildroot, removing ChangeLog change to avoid conflict]
> -Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> ----
> - gdb/python/python.c | 32 ++++++++++++++++++++++++++++++--
> - 1 file changed, 30 insertions(+), 2 deletions(-)
> -
> -diff --git a/gdb/python/python.c b/gdb/python/python.c
> -index c23db2c1261..0b77354630e 100644
> ---- a/gdb/python/python.c
> -+++ b/gdb/python/python.c
> -@@ -235,6 +235,30 @@ gdbpy_enter::~gdbpy_enter ()
> -   restore_active_ext_lang (m_previous_active);
> - }
> - 
> -+/* A helper class to save and restore the GIL, but without touching
> -+   the other globals that are handled by gdbpy_enter.  */
> -+
> -+class gdbpy_gil
> -+{
> -+public:
> -+
> -+  gdbpy_gil ()
> -+    : m_state (PyGILState_Ensure ())
> -+  {
> -+  }
> -+
> -+  ~gdbpy_gil ()
> -+  {
> -+    PyGILState_Release (m_state);
> -+  }
> -+
> -+  DISABLE_COPY_AND_ASSIGN (gdbpy_gil);
> -+
> -+private:
> -+
> -+  PyGILState_STATE m_state;
> -+};
> -+
> - /* Set the quit flag.  */
> - 
> - static void
> -@@ -248,6 +272,10 @@ gdbpy_set_quit_flag (const struct extension_language_defn *extlang)
> - static int
> - gdbpy_check_quit_flag (const struct extension_language_defn *extlang)
> - {
> -+  if (!gdb_python_initialized)
> -+    return 0;
> -+
> -+  gdbpy_gil gil;
> -   return PyOS_InterruptOccurred ();
> - }
> - 
> -@@ -1573,6 +1601,7 @@ finalize_python (void *ignore)
> - 
> -   Py_Finalize ();
> - 
> -+  gdb_python_initialized = false;
> -   restore_active_ext_lang (previous_active);
> - }
> - 
> -@@ -1736,8 +1765,7 @@ do_start_initialization ()
> -     return false;
> - 
> -   /* Release the GIL while gdb runs.  */
> --  PyThreadState_Swap (NULL);
> --  PyEval_ReleaseLock ();
> -+  PyEval_SaveThread ();
> - 
> -   make_final_cleanup (finalize_python, NULL);
> - 
> --- 
> -2.31.1
> -
> diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
> index fd739f3969..a6e1d7f53c 100644
> --- a/package/gdb/Config.in.host
> +++ b/package/gdb/Config.in.host
> @@ -67,11 +67,6 @@ choice
>  	help
>  	  Select the version of gdb you wish to use.
>  
> -config BR2_GDB_VERSION_8_3
> -	bool "gdb 8.3.x"
> -	# gdbserver support missing
> -	depends on !BR2_riscv
> -
>  config BR2_GDB_VERSION_9_2
>  	bool "gdb 9.2.x"
>  	# gdbserver support missing
> @@ -92,7 +87,6 @@ config BR2_GDB_VERSION
>  	string
>  	default "arc-2020.09-release-gdb" if BR2_arc
>  	default "4ecb98fbc2f94dbe01b69384afbc515107de73df" if BR2_csky
> -	default "8.3.1"    if BR2_GDB_VERSION_8_3
>  	default "9.2"      if BR2_GDB_VERSION_9_2
>  	default "10.2"	   if BR2_GDB_VERSION_10 || !BR2_PACKAGE_HOST_GDB
>  	default "11.1"     if BR2_GDB_VERSION_11
> diff --git a/package/gdb/gdb.hash b/package/gdb/gdb.hash
> index e3b867b042..d3e83af0b9 100644
> --- a/package/gdb/gdb.hash
> +++ b/package/gdb/gdb.hash
> @@ -1,5 +1,4 @@
>  # From ftp://gcc.gnu.org/pub/gdb/releases/sha512.sum
> -sha512  9053a2dc6b9eb921907afbc4cecc75d635aa76df5e8c4f0e5824ccf57cb206b299c19b127fff000b65c334826ff8304a54ff6098428365a8e997cca886c39e9a  gdb-8.3.1.tar.xz
>  sha512  73635f00f343117aa5e2436f1e1597099e2bfb31ef7bb162b273fa1ea282c3fa9b0f52762e70bfc7ad0334addb8d159e9ac7cbe5998ca4f755ea8cf90714d274  gdb-9.2.tar.xz
>  sha512  3653762ac008e065c37cd641653184c9ff7ce51ee2222ade1122bec9d6cc64dffd4fb74888ef11ac1942064a08910e96b7865112ad37f4602eb0a16bed074caa  gdb-10.2.tar.xz
>  sha512  c40bf970e2f7c2107b29c5aa6a7150daa709d75ddadb73ac20742419d4637d158e3063a4c6ff6e47fae8ca8e1d36253973f85ea15445d004be6d5d7a2dd9bd46  gdb-11.1.tar.xz
> -- 
> 2.31.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Buildroot] [PATCH 5/5] support/testing: add suite of tests for gdb
  2021-10-09 19:16 ` [Buildroot] [PATCH 5/5] support/testing: add suite of tests for gdb Thomas Petazzoni
@ 2021-10-10 17:43   ` Yann E. MORIN
  0 siblings, 0 replies; 15+ messages in thread
From: Yann E. MORIN @ 2021-10-10 17:43 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Michael Fischer, Romain Naour, Buildroot List

Thomas, All,

On 2021-10-09 21:16 +0200, Thomas Petazzoni spake thusly:
> The list of tests is as follows:
> 
> TestGdbHostOnlyDefault: build just minimal host-gdb, default version
> 
> TestGdbHostOnlyAllFeatures: build host-gdb, default version, with all
> features enabled (TUI, Python, simulator)
> 
> TestGdbserverOnly: build just target gdbserver, default version
> 
> TestGdbFullTarget: build just target gdb, default version
> 
> TestGdbHostOnly9x: build minimal host-gdb, 9.x version
> 
> TestGdbHostGdbserver9x: build minimal host-gdb 9.x + gdbserver
> 
> TestGdbHostGdbTarget9x: build minimal host-gdb 9.x + full gdb
> 
> TestGdbHostOnly11x: build minimal host-gdb, 11.x version
> 
> TestGdbHostGdbserver11x: build minimal host-gdb 11.x + gdbserver
> 
> TestGdbHostGdbTarget11x: build minimal host-gdb 11.x + gdb
> 
> TestGdbArc: build minimal host-gdb + gdb + gdbserver, for the special
> ARC architecture version
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  support/testing/tests/package/test_gdb.py | 215 ++++++++++++++++++++++
>  1 file changed, 215 insertions(+)
>  create mode 100644 support/testing/tests/package/test_gdb.py
> 
> diff --git a/support/testing/tests/package/test_gdb.py b/support/testing/tests/package/test_gdb.py
> new file mode 100644
> index 0000000000..a7b0870644
> --- /dev/null
> +++ b/support/testing/tests/package/test_gdb.py
> @@ -0,0 +1,215 @@
> +import os
> +import infra.basetest
> +
> +
> +class BaseGdb(infra.basetest.BRTest):
> +    def verify_host_gdb(self, prefix="arm-linux"):
> +        cmd = ["host/bin/%s-gdb" % prefix, "--version"]
> +        # We don't check the return value, as it automatically raises
> +        # an exception if the command returns with a non-zero value
> +        infra.run_cmd_on_host(self.builddir, cmd)
> +
> +    def boot(self):
> +        img = os.path.join(self.builddir, "images", "rootfs.cpio")
> +        self.emulator.boot(arch="armv5",
> +                           kernel="builtin",
> +                           options=["-initrd", img,
> +                                    "-net", "nic",
> +                                    "-net", "user"])
> +        self.emulator.login()
> +
> +    def verify_gdbserver(self):
> +        cmd = "gdbserver --version"
> +        self.assertRunOk(cmd)
> +
> +    def verify_gdb(self):
> +        cmd = "gdb --version"
> +        self.assertRunOk(cmd)
> +
> +
> +class TestGdbHostOnlyDefault(BaseGdb):
> +    config = \
> +        infra.basetest.MINIMAL_CONFIG + \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +
> +
> +class TestGdbHostOnlyAllFeatures(BaseGdb):
> +    config = \
> +        infra.basetest.MINIMAL_CONFIG + \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_PACKAGE_HOST_GDB_TUI=y
> +        BR2_PACKAGE_HOST_GDB_PYTHON3=y
> +        BR2_PACKAGE_HOST_GDB_SIM=y
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +
> +
> +class TestGdbserverOnly(BaseGdb):
> +    config = \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_GDB=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        """
> +
> +    def test_run(self):
> +        self.boot()
> +        self.verify_gdbserver()
> +
> +
> +class TestGdbFullTarget(BaseGdb):
> +    config = \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_GDB=y
> +        BR2_PACKAGE_GDB_DEBUGGER=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        """
> +
> +    def test_run(self):
> +        self.boot()
> +        self.verify_gdb()
> +
> +
> +class TestGdbHostOnly9x(BaseGdb):
> +    config = \
> +        infra.basetest.MINIMAL_CONFIG + \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_GDB_VERSION_9_2=y
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +
> +
> +class TestGdbHostGdbserver9x(BaseGdb):
> +    config = \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_GDB_VERSION_9_2=y
> +        BR2_PACKAGE_GDB=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +        self.boot()
> +        self.verify_gdbserver()
> +
> +
> +class TestGdbHostGdbTarget9x(BaseGdb):
> +    config = \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_GDB_VERSION_9_2=y
> +        BR2_PACKAGE_GDB=y
> +        BR2_PACKAGE_GDB_DEBUGGER=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +        self.boot()
> +        self.verify_gdb()
> +
> +
> +class TestGdbHostOnly11x(BaseGdb):
> +    config = \
> +        infra.basetest.MINIMAL_CONFIG + \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_GDB_VERSION_11=y
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +
> +
> +class TestGdbHostGdbserver11x(BaseGdb):
> +    config = \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_GDB_VERSION_11=y
> +        BR2_PACKAGE_GDB=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +        self.boot()
> +        self.verify_gdbserver()
> +
> +
> +class TestGdbHostGdbTarget11x(BaseGdb):
> +    config = \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_GDB_VERSION_11=y
> +        BR2_PACKAGE_GDB=y
> +        BR2_PACKAGE_GDB_DEBUGGER=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +        self.boot()
> +        self.verify_gdb()
> +
> +
> +class TestGdbArc(BaseGdb):
> +    config = \
> +        """
> +        BR2_arcle=y
> +        BR2_archs4x_rel31=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_PACKAGE_GDB=y
> +        BR2_PACKAGE_GDB_SERVER=y
> +        BR2_PACKAGE_GDB_DEBUGGER=y
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb("arc-linux")
> -- 
> 2.31.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-10-10 17:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-09 19:16 [Buildroot] [PATCH 0/5] GDB updates Thomas Petazzoni
2021-10-09 19:16 ` [Buildroot] [PATCH 1/5] package/gdb: append to dependencies in conditional Thomas Petazzoni
2021-10-10  8:49   ` Yann E. MORIN
2021-10-10 10:05     ` Peter Korsgaard
2021-10-10 13:57     ` Thomas Petazzoni
2021-10-09 19:16 ` [Buildroot] [PATCH 2/5] package/gdb: add support for gdb 11.x Thomas Petazzoni
2021-10-10  9:10   ` Yann E. MORIN
2021-10-10 13:57     ` Thomas Petazzoni
2021-10-10 17:42       ` Yann E. MORIN
2021-10-09 19:16 ` [Buildroot] [PATCH 3/5] package/gdb: switch to gdb 10.x as the default Thomas Petazzoni
2021-10-10 17:42   ` Yann E. MORIN
2021-10-09 19:16 ` [Buildroot] [PATCH 4/5] package/gdb: drop support for version 8.3.x Thomas Petazzoni
2021-10-10 17:42   ` Yann E. MORIN
2021-10-09 19:16 ` [Buildroot] [PATCH 5/5] support/testing: add suite of tests for gdb Thomas Petazzoni
2021-10-10 17:43   ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.