Move all to deprecated folder.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
From cbc39812c1721d7edd20285134fdf748d0f26127 Mon Sep 17 00:00:00 2001
|
||||
From: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
|
||||
Date: Fri, 23 May 2014 09:01:14 +0100
|
||||
Subject: [PATCH] Include asm/ptrace.h for linux-aarch64-low.c
|
||||
|
||||
A recent change to glibc removed asm/ptrace.h from user.h for AArch64.
|
||||
This meant that cross-native builds of gdbserver using trunk glibc broke
|
||||
because linux-aarch64-low.c because user_hwdebug_state couldn't be found.
|
||||
|
||||
This is like commit #036cd38182bde32d8297b630cd5c861d53b8949e
|
||||
|
||||
2014-05-23 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
|
||||
|
||||
* linux-aarch64-low.c (asm/ptrace.h): Include.
|
||||
[Romain:
|
||||
- rebase on top of 7.7.1]
|
||||
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
|
||||
---
|
||||
gdb/gdbserver/linux-aarch64-low.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c
|
||||
index 1b0da6c..ba66bc8 100644
|
||||
--- a/gdb/gdbserver/linux-aarch64-low.c
|
||||
+++ b/gdb/gdbserver/linux-aarch64-low.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <signal.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/ptrace.h>
|
||||
+#include <asm/ptrace.h>
|
||||
#include <sys/uio.h>
|
||||
|
||||
#include "gdb_proc_service.h"
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From 9c45794265a9dc9aebfbdc520d378dfc8fb7b694 Mon Sep 17 00:00:00 2001
|
||||
From: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
|
||||
Date: Thu, 22 May 2014 16:07:20 +0100
|
||||
Subject: [PATCH] Include asm/ptrace.h in aarch64-linux-nat.c
|
||||
|
||||
A recent change to glibc removed asm/ptrace.h from user.h for
|
||||
AArch64. This meant that cross-native builds of gdb using trunk
|
||||
glibc broke because aarch64-linux-nat.c because user_hwdebug_state
|
||||
couldn't be found.
|
||||
|
||||
Fixed by including asm/ptrace.h like other ports.
|
||||
|
||||
2014-05-22 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
|
||||
|
||||
* aarch64-linux-nat.c (asm/ptrace.h): Include.
|
||||
|
||||
[Romain: rebase on top of 7.7.1]
|
||||
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
|
||||
---
|
||||
gdb/aarch64-linux-nat.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
|
||||
index 31c26c6..710aa9b 100644
|
||||
--- a/gdb/aarch64-linux-nat.c
|
||||
+++ b/gdb/aarch64-linux-nat.c
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include <sys/ptrace.h>
|
||||
#include <sys/utsname.h>
|
||||
+#include <asm/ptrace.h>
|
||||
|
||||
#include "gregset.h"
|
||||
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From 59432cbfe267ad89b7cfc73dcd702b8282ef4e9d Mon Sep 17 00:00:00 2001
|
||||
From: Romain Naour <romain.naour@openwide.fr>
|
||||
Date: Fri, 10 Apr 2015 22:58:07 +0200
|
||||
Subject: [PATCH] gdbserver: fix uClibc whithout MMU.
|
||||
|
||||
Since commit d86d4aafd4fa22fa4cccb83253fb187b03f97f48, the pid
|
||||
must be retrieved from current_inferior.
|
||||
|
||||
The change has not been made in the function linux_read_offsets().
|
||||
|
||||
Fixes:
|
||||
http://autobuild.buildroot.net/results/9e4/9e4df085319e346803c26c65478accb27eb950ae/build-end.log
|
||||
|
||||
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
|
||||
---
|
||||
gdb/gdbserver/linux-low.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
|
||||
index 1a40897..71d078a 100644
|
||||
--- a/gdb/gdbserver/linux-low.c
|
||||
+++ b/gdb/gdbserver/linux-low.c
|
||||
@@ -4933,7 +4933,7 @@ static int
|
||||
linux_read_offsets (CORE_ADDR *text_p, CORE_ADDR *data_p)
|
||||
{
|
||||
unsigned long text, text_end, data;
|
||||
- int pid = lwpid_of (get_thread_lwp (current_inferior));
|
||||
+ int pid = lwpid_of (current_inferior);
|
||||
|
||||
errno = 0;
|
||||
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
From deb44829ecc1dd38275af0fcf91acd319e227a89 Mon Sep 17 00:00:00 2001
|
||||
From: Max Filippov <jcmvbkbc@gmail.com>
|
||||
Date: Fri, 17 Apr 2015 03:07:41 +0300
|
||||
Subject: [PATCH 1/2] gdbserver/xtensa: drop xtensa_usrregs_info
|
||||
|
||||
xtensa_usrregs_info refers to undefined variables xtensa_num_regs and
|
||||
xtensa_regmap. Drop xtensa_usrregs_info and replace pointer to usrregs
|
||||
in regs_info with NULL since all registers are read/set through regsets.
|
||||
|
||||
2015-04-17 Max Filippov <jcmvbkbc@gmail.com>
|
||||
gdb/gdbserver/
|
||||
* linux-xtensa-low.c (xtensa_usrregs_info): Remove.
|
||||
(regs_info): Replace usrregs pointer with NULL.
|
||||
|
||||
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
|
||||
---
|
||||
Backported from: deb44829ecc1dd38275af0fcf91acd319e227a89
|
||||
Changes to ChangeLog are dropped.
|
||||
|
||||
gdb/gdbserver/linux-xtensa-low.c | 8 +-------
|
||||
2 files changed, 6 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c
|
||||
index f7fafaf..e786da5 100644
|
||||
--- a/gdb/gdbserver/linux-xtensa-low.c
|
||||
+++ b/gdb/gdbserver/linux-xtensa-low.c
|
||||
@@ -186,16 +186,10 @@ static struct regsets_info xtensa_regsets_info =
|
||||
NULL, /* disabled_regsets */
|
||||
};
|
||||
|
||||
-static struct usrregs_info xtensa_usrregs_info =
|
||||
- {
|
||||
- xtensa_num_regs,
|
||||
- xtensa_regmap,
|
||||
- };
|
||||
-
|
||||
static struct regs_info regs_info =
|
||||
{
|
||||
NULL, /* regset_bitmap */
|
||||
- &xtensa_usrregs_info,
|
||||
+ NULL, /* usrregs */
|
||||
&xtensa_regsets_info
|
||||
};
|
||||
|
||||
--
|
||||
1.8.1.4
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From a2d5a9d76f2366ed93095fc5a63eafa06b22f808 Mon Sep 17 00:00:00 2001
|
||||
From: Max Filippov <jcmvbkbc@gmail.com>
|
||||
Date: Fri, 17 Apr 2015 02:52:50 +0300
|
||||
Subject: [PATCH 2/2] gdbserver/xtensa: fix typo in XCHAL_HAVE_LOOPS
|
||||
|
||||
This fixes lbeg/lend/lcount registers handling through gdbserver.
|
||||
|
||||
2015-04-17 Max Filippov <jcmvbkbc@gmail.com>
|
||||
gdb/gdbserver/
|
||||
* linux-xtensa-low.c (xtensa_fill_gregset)
|
||||
(xtensa_store_gregset): Check XCHAL_HAVE_LOOPS instead of
|
||||
XCHAL_HAVE_LOOP.
|
||||
|
||||
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
|
||||
---
|
||||
Backported from: a2d5a9d76f2366ed93095fc5a63eafa06b22f808
|
||||
Changes to ChangeLog are dropped.
|
||||
|
||||
gdb/gdbserver/linux-xtensa-low.c | 4 ++--
|
||||
2 files changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c
|
||||
index e786da5..4daccee 100644
|
||||
--- a/gdb/gdbserver/linux-xtensa-low.c
|
||||
+++ b/gdb/gdbserver/linux-xtensa-low.c
|
||||
@@ -59,7 +59,7 @@ xtensa_fill_gregset (struct regcache *regcache, void *buf)
|
||||
|
||||
/* Loop registers, if hardware has it. */
|
||||
|
||||
-#if XCHAL_HAVE_LOOP
|
||||
+#if XCHAL_HAVE_LOOPS
|
||||
collect_register_by_name (regcache, "lbeg", (char*)&rset[R_LBEG]);
|
||||
collect_register_by_name (regcache, "lend", (char*)&rset[R_LEND]);
|
||||
collect_register_by_name (regcache, "lcount", (char*)&rset[R_LCOUNT]);
|
||||
@@ -94,7 +94,7 @@ xtensa_store_gregset (struct regcache *regcache, const void *buf)
|
||||
|
||||
/* Loop registers, if hardware has it. */
|
||||
|
||||
-#if XCHAL_HAVE_LOOP
|
||||
+#if XCHAL_HAVE_LOOPS
|
||||
supply_register_by_name (regcache, "lbeg", (char*)&rset[R_LBEG]);
|
||||
supply_register_by_name (regcache, "lend", (char*)&rset[R_LEND]);
|
||||
supply_register_by_name (regcache, "lcount", (char*)&rset[R_LCOUNT]);
|
||||
--
|
||||
1.8.1.4
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From 570805e96bb8c458795b04f4745700795997ef40 Mon Sep 17 00:00:00 2001
|
||||
From: Romain Naour <romain.naour@openwide.fr>
|
||||
Date: Fri, 10 Apr 2015 22:58:07 +0200
|
||||
Subject: [PATCH] gdbserver: fix uClibc whithout MMU.
|
||||
|
||||
Since commit d86d4aafd4fa22fa4cccb83253fb187b03f97f48, the pid
|
||||
must be retrieved from current_thread.
|
||||
|
||||
The change has not been made in the function linux_read_offsets().
|
||||
|
||||
Fixes:
|
||||
http://autobuild.buildroot.net/results/9e4/9e4df085319e346803c26c65478accb27eb950ae/build-end.log
|
||||
|
||||
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
|
||||
---
|
||||
gdb/gdbserver/linux-low.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
|
||||
index 4d19c87..7585b80 100644
|
||||
--- a/gdb/gdbserver/linux-low.c
|
||||
+++ b/gdb/gdbserver/linux-low.c
|
||||
@@ -4933,7 +4933,7 @@ static int
|
||||
linux_read_offsets (CORE_ADDR *text_p, CORE_ADDR *data_p)
|
||||
{
|
||||
unsigned long text, text_end, data;
|
||||
- int pid = lwpid_of (get_thread_lwp (current_thread));
|
||||
+ int pid = lwpid_of (current_thread);
|
||||
|
||||
errno = 0;
|
||||
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
From deb44829ecc1dd38275af0fcf91acd319e227a89 Mon Sep 17 00:00:00 2001
|
||||
From: Max Filippov <jcmvbkbc@gmail.com>
|
||||
Date: Fri, 17 Apr 2015 03:07:41 +0300
|
||||
Subject: [PATCH 1/2] gdbserver/xtensa: drop xtensa_usrregs_info
|
||||
|
||||
xtensa_usrregs_info refers to undefined variables xtensa_num_regs and
|
||||
xtensa_regmap. Drop xtensa_usrregs_info and replace pointer to usrregs
|
||||
in regs_info with NULL since all registers are read/set through regsets.
|
||||
|
||||
2015-04-17 Max Filippov <jcmvbkbc@gmail.com>
|
||||
gdb/gdbserver/
|
||||
* linux-xtensa-low.c (xtensa_usrregs_info): Remove.
|
||||
(regs_info): Replace usrregs pointer with NULL.
|
||||
|
||||
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
|
||||
---
|
||||
Backported from: deb44829ecc1dd38275af0fcf91acd319e227a89
|
||||
Changes to ChangeLog are dropped.
|
||||
|
||||
gdb/gdbserver/linux-xtensa-low.c | 8 +-------
|
||||
2 files changed, 6 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c
|
||||
index f7fafaf..e786da5 100644
|
||||
--- a/gdb/gdbserver/linux-xtensa-low.c
|
||||
+++ b/gdb/gdbserver/linux-xtensa-low.c
|
||||
@@ -186,16 +186,10 @@ static struct regsets_info xtensa_regsets_info =
|
||||
NULL, /* disabled_regsets */
|
||||
};
|
||||
|
||||
-static struct usrregs_info xtensa_usrregs_info =
|
||||
- {
|
||||
- xtensa_num_regs,
|
||||
- xtensa_regmap,
|
||||
- };
|
||||
-
|
||||
static struct regs_info regs_info =
|
||||
{
|
||||
NULL, /* regset_bitmap */
|
||||
- &xtensa_usrregs_info,
|
||||
+ NULL, /* usrregs */
|
||||
&xtensa_regsets_info
|
||||
};
|
||||
|
||||
--
|
||||
1.8.1.4
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From a2d5a9d76f2366ed93095fc5a63eafa06b22f808 Mon Sep 17 00:00:00 2001
|
||||
From: Max Filippov <jcmvbkbc@gmail.com>
|
||||
Date: Fri, 17 Apr 2015 02:52:50 +0300
|
||||
Subject: [PATCH 2/2] gdbserver/xtensa: fix typo in XCHAL_HAVE_LOOPS
|
||||
|
||||
This fixes lbeg/lend/lcount registers handling through gdbserver.
|
||||
|
||||
2015-04-17 Max Filippov <jcmvbkbc@gmail.com>
|
||||
gdb/gdbserver/
|
||||
* linux-xtensa-low.c (xtensa_fill_gregset)
|
||||
(xtensa_store_gregset): Check XCHAL_HAVE_LOOPS instead of
|
||||
XCHAL_HAVE_LOOP.
|
||||
|
||||
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
|
||||
---
|
||||
Backported from: a2d5a9d76f2366ed93095fc5a63eafa06b22f808
|
||||
Changes to ChangeLog are dropped.
|
||||
|
||||
gdb/gdbserver/linux-xtensa-low.c | 4 ++--
|
||||
2 files changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c
|
||||
index e786da5..4daccee 100644
|
||||
--- a/gdb/gdbserver/linux-xtensa-low.c
|
||||
+++ b/gdb/gdbserver/linux-xtensa-low.c
|
||||
@@ -59,7 +59,7 @@ xtensa_fill_gregset (struct regcache *regcache, void *buf)
|
||||
|
||||
/* Loop registers, if hardware has it. */
|
||||
|
||||
-#if XCHAL_HAVE_LOOP
|
||||
+#if XCHAL_HAVE_LOOPS
|
||||
collect_register_by_name (regcache, "lbeg", (char*)&rset[R_LBEG]);
|
||||
collect_register_by_name (regcache, "lend", (char*)&rset[R_LEND]);
|
||||
collect_register_by_name (regcache, "lcount", (char*)&rset[R_LCOUNT]);
|
||||
@@ -94,7 +94,7 @@ xtensa_store_gregset (struct regcache *regcache, const void *buf)
|
||||
|
||||
/* Loop registers, if hardware has it. */
|
||||
|
||||
-#if XCHAL_HAVE_LOOP
|
||||
+#if XCHAL_HAVE_LOOPS
|
||||
supply_register_by_name (regcache, "lbeg", (char*)&rset[R_LBEG]);
|
||||
supply_register_by_name (regcache, "lend", (char*)&rset[R_LEND]);
|
||||
supply_register_by_name (regcache, "lcount", (char*)&rset[R_LCOUNT]);
|
||||
--
|
||||
1.8.1.4
|
||||
|
||||
@@ -0,0 +1,267 @@
|
||||
From d4eb69fc4b50f9a0babd70b28d0601b40f31bd0f Mon Sep 17 00:00:00 2001
|
||||
From: Max Filippov <jcmvbkbc@gmail.com>
|
||||
Date: Thu, 2 Jul 2015 15:10:58 +0300
|
||||
Subject: [PATCH] xtensa: implement NPTL helpers
|
||||
|
||||
These changes allow debugging multithreaded NPTL xtensa applications.
|
||||
|
||||
2015-08-20 Max Filippov <jcmvbkbc@gmail.com>
|
||||
gdb/gdbserver/
|
||||
* configure.srv (xtensa*-*-linux*): Add srv_linux_thread_db=yes.
|
||||
* linux-xtensa-low.c (arch/xtensa.h gdb_proc_service.h): New
|
||||
#includes.
|
||||
(ps_get_thread_area): New function.
|
||||
|
||||
2015-08-20 Max Filippov <jcmvbkbc@gmail.com>
|
||||
gdb/
|
||||
* arch/xtensa.h: New file.
|
||||
* xtensa-linux-nat.c (gdb_proc_service.h): New #include.
|
||||
(ps_get_thread_area): New function.
|
||||
* xtensa-linux-tdep.c (xtensa_linux_init_abi): Add call to
|
||||
set_gdbarch_fetch_tls_load_module_address to enable TLS support.
|
||||
* xtensa-tdep.c (osabi.h): New #include.
|
||||
(xtensa_gdbarch_init): Call gdbarch_init_osabi to register
|
||||
xtensa-specific hooks.
|
||||
* xtensa-tdep.h (struct xtensa_elf_gregset_t): Add threadptr
|
||||
member and move the structure to arch/xtensa.h.
|
||||
|
||||
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
|
||||
---
|
||||
Backported from: 40045d91812b25c88c8275b8c08d27c234b68ba8
|
||||
Changes to ChangeLog files are dropped.
|
||||
|
||||
gdb/arch/xtensa.h | 46 ++++++++++++++++++++++++++++++++++++++++
|
||||
gdb/gdbserver/configure.srv | 1 +
|
||||
gdb/gdbserver/linux-xtensa-low.c | 21 ++++++++++++++++++
|
||||
gdb/xtensa-linux-nat.c | 22 ++++++++++++++++++
|
||||
gdb/xtensa-linux-tdep.c | 4 ++++
|
||||
gdb/xtensa-tdep.c | 4 ++++
|
||||
gdb/xtensa-tdep.h | 24 ++------------------
|
||||
7 files changed, 100 insertions(+), 22 deletions(-)
|
||||
create mode 100644 gdb/arch/xtensa.h
|
||||
|
||||
diff --git a/gdb/arch/xtensa.h b/gdb/arch/xtensa.h
|
||||
new file mode 100644
|
||||
index 0000000..fe96584
|
||||
--- /dev/null
|
||||
+++ b/gdb/arch/xtensa.h
|
||||
@@ -0,0 +1,46 @@
|
||||
+/* Common Target-dependent code for the Xtensa port of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright (C) 2003-2015 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This file is part of GDB.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+#ifndef XTENSA_H
|
||||
+#define XTENSA_H
|
||||
+
|
||||
+/* Xtensa ELF core file register set representation ('.reg' section).
|
||||
+ Copied from target-side ELF header <xtensa/elf.h>. */
|
||||
+
|
||||
+typedef uint32_t xtensa_elf_greg_t;
|
||||
+
|
||||
+typedef struct
|
||||
+{
|
||||
+ xtensa_elf_greg_t pc;
|
||||
+ xtensa_elf_greg_t ps;
|
||||
+ xtensa_elf_greg_t lbeg;
|
||||
+ xtensa_elf_greg_t lend;
|
||||
+ xtensa_elf_greg_t lcount;
|
||||
+ xtensa_elf_greg_t sar;
|
||||
+ xtensa_elf_greg_t windowstart;
|
||||
+ xtensa_elf_greg_t windowbase;
|
||||
+ xtensa_elf_greg_t threadptr;
|
||||
+ xtensa_elf_greg_t reserved[7+48];
|
||||
+ xtensa_elf_greg_t ar[64];
|
||||
+} xtensa_elf_gregset_t;
|
||||
+
|
||||
+#define XTENSA_ELF_NGREG (sizeof (xtensa_elf_gregset_t) \
|
||||
+ / sizeof (xtensa_elf_greg_t))
|
||||
+
|
||||
+#endif
|
||||
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
|
||||
index 0b18d1d..320c26a 100644
|
||||
--- a/gdb/gdbserver/configure.srv
|
||||
+++ b/gdb/gdbserver/configure.srv
|
||||
@@ -352,6 +352,7 @@ case "${target}" in
|
||||
xtensa*-*-linux*) srv_regobj=reg-xtensa.o
|
||||
srv_tgtobj="$srv_linux_obj linux-xtensa-low.o"
|
||||
srv_linux_regsets=yes
|
||||
+ srv_linux_thread_db=yes
|
||||
;;
|
||||
tilegx-*-linux*) srv_regobj=reg-tilegx.o
|
||||
srv_regobj="${srv_regobj} reg-tilegx32.o"
|
||||
diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c
|
||||
index 4daccee..debe467 100644
|
||||
--- a/gdb/gdbserver/linux-xtensa-low.c
|
||||
+++ b/gdb/gdbserver/linux-xtensa-low.c
|
||||
@@ -26,6 +26,8 @@ extern const struct target_desc *tdesc_xtensa;
|
||||
|
||||
#include <asm/ptrace.h>
|
||||
#include <xtensa-config.h>
|
||||
+#include "arch/xtensa.h"
|
||||
+#include "gdb_proc_service.h"
|
||||
|
||||
#include "xtensa-xtregs.c"
|
||||
|
||||
@@ -179,6 +181,25 @@ xtensa_breakpoint_at (CORE_ADDR where)
|
||||
xtensa_breakpoint, xtensa_breakpoint_len) == 0;
|
||||
}
|
||||
|
||||
+/* Called by libthread_db. */
|
||||
+
|
||||
+ps_err_e
|
||||
+ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ lwpid_t lwpid, int idx, void **base)
|
||||
+{
|
||||
+ xtensa_elf_gregset_t regs;
|
||||
+
|
||||
+ if (ptrace (PTRACE_GETREGS, lwpid, NULL, ®s) != 0)
|
||||
+ return PS_ERR;
|
||||
+
|
||||
+ /* IDX is the bias from the thread pointer to the beginning of the
|
||||
+ thread descriptor. It has to be subtracted due to implementation
|
||||
+ quirks in libthread_db. */
|
||||
+ *base = (void *) ((char *) regs.threadptr - idx);
|
||||
+
|
||||
+ return PS_OK;
|
||||
+}
|
||||
+
|
||||
static struct regsets_info xtensa_regsets_info =
|
||||
{
|
||||
xtensa_regsets, /* regsets */
|
||||
diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c
|
||||
index 77ad3e0..5538d5b 100644
|
||||
--- a/gdb/xtensa-linux-nat.c
|
||||
+++ b/gdb/xtensa-linux-nat.c
|
||||
@@ -37,6 +37,9 @@
|
||||
#include "gregset.h"
|
||||
#include "xtensa-tdep.h"
|
||||
|
||||
+/* Defines ps_err_e, struct ps_prochandle. */
|
||||
+#include "gdb_proc_service.h"
|
||||
+
|
||||
/* Extended register set depends on hardware configs.
|
||||
Keeping these definitions separately allows to introduce
|
||||
hardware-specific overlays. */
|
||||
@@ -280,6 +283,25 @@ xtensa_linux_store_inferior_registers (struct target_ops *ops,
|
||||
store_xtregs (regcache, regnum);
|
||||
}
|
||||
|
||||
+/* Called by libthread_db. */
|
||||
+
|
||||
+ps_err_e
|
||||
+ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ lwpid_t lwpid, int idx, void **base)
|
||||
+{
|
||||
+ xtensa_elf_gregset_t regs;
|
||||
+
|
||||
+ if (ptrace (PTRACE_GETREGS, lwpid, NULL, ®s) != 0)
|
||||
+ return PS_ERR;
|
||||
+
|
||||
+ /* IDX is the bias from the thread pointer to the beginning of the
|
||||
+ thread descriptor. It has to be subtracted due to implementation
|
||||
+ quirks in libthread_db. */
|
||||
+ *base = (void *) ((char *) regs.threadptr - idx);
|
||||
+
|
||||
+ return PS_OK;
|
||||
+}
|
||||
+
|
||||
void _initialize_xtensa_linux_nat (void);
|
||||
|
||||
void
|
||||
diff --git a/gdb/xtensa-linux-tdep.c b/gdb/xtensa-linux-tdep.c
|
||||
index 61ea9b0..99e0d3e 100644
|
||||
--- a/gdb/xtensa-linux-tdep.c
|
||||
+++ b/gdb/xtensa-linux-tdep.c
|
||||
@@ -106,6 +106,10 @@ xtensa_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
xtensa_linux_gdb_signal_from_target);
|
||||
set_gdbarch_gdb_signal_to_target (gdbarch,
|
||||
xtensa_linux_gdb_signal_to_target);
|
||||
+
|
||||
+ /* Enable TLS support. */
|
||||
+ set_gdbarch_fetch_tls_load_module_address (gdbarch,
|
||||
+ svr4_fetch_objfile_link_map);
|
||||
}
|
||||
|
||||
/* Provide a prototype to silence -Wmissing-prototypes. */
|
||||
diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c
|
||||
index 55e7d98..4b693ed 100644
|
||||
--- a/gdb/xtensa-tdep.c
|
||||
+++ b/gdb/xtensa-tdep.c
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "value.h"
|
||||
#include "dis-asm.h"
|
||||
#include "inferior.h"
|
||||
+#include "osabi.h"
|
||||
#include "floatformat.h"
|
||||
#include "regcache.h"
|
||||
#include "reggroups.h"
|
||||
@@ -3273,6 +3274,9 @@ xtensa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
set_solib_svr4_fetch_link_map_offsets
|
||||
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
|
||||
|
||||
+ /* Hook in the ABI-specific overrides, if they have been registered. */
|
||||
+ gdbarch_init_osabi (info, gdbarch);
|
||||
+
|
||||
return gdbarch;
|
||||
}
|
||||
|
||||
diff --git a/gdb/xtensa-tdep.h b/gdb/xtensa-tdep.h
|
||||
index caa2988..5b28cab 100644
|
||||
--- a/gdb/xtensa-tdep.h
|
||||
+++ b/gdb/xtensa-tdep.h
|
||||
@@ -18,6 +18,8 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
+#include "arch/xtensa.h"
|
||||
+
|
||||
/* XTENSA_TDEP_VERSION can/should be changed along with XTENSA_CONFIG_VERSION
|
||||
whenever the "tdep" structure changes in an incompatible way. */
|
||||
|
||||
@@ -81,28 +83,6 @@ typedef enum
|
||||
} xtensa_target_flags_t;
|
||||
|
||||
|
||||
-/* Xtensa ELF core file register set representation ('.reg' section).
|
||||
- Copied from target-side ELF header <xtensa/elf.h>. */
|
||||
-
|
||||
-typedef uint32_t xtensa_elf_greg_t;
|
||||
-
|
||||
-typedef struct
|
||||
-{
|
||||
- xtensa_elf_greg_t pc;
|
||||
- xtensa_elf_greg_t ps;
|
||||
- xtensa_elf_greg_t lbeg;
|
||||
- xtensa_elf_greg_t lend;
|
||||
- xtensa_elf_greg_t lcount;
|
||||
- xtensa_elf_greg_t sar;
|
||||
- xtensa_elf_greg_t windowstart;
|
||||
- xtensa_elf_greg_t windowbase;
|
||||
- xtensa_elf_greg_t reserved[8+48];
|
||||
- xtensa_elf_greg_t ar[64];
|
||||
-} xtensa_elf_gregset_t;
|
||||
-
|
||||
-#define XTENSA_ELF_NGREG (sizeof (xtensa_elf_gregset_t) \
|
||||
- / sizeof (xtensa_elf_greg_t))
|
||||
-
|
||||
/* Mask. */
|
||||
|
||||
typedef struct
|
||||
--
|
||||
1.8.1.4
|
||||
|
||||
72
deprecated/firmware/buildroot/package/gdb/Config.in
Normal file
72
deprecated/firmware/buildroot/package/gdb/Config.in
Normal file
@@ -0,0 +1,72 @@
|
||||
comment "gdb/gdbserver needs a toolchain w/ threads, threads debug"
|
||||
depends on !BR2_nios2 && !BR2_bfin
|
||||
depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_HAS_THREADS_DEBUG
|
||||
|
||||
config BR2_PACKAGE_GDB
|
||||
bool "gdb"
|
||||
# When the external toolchain gdbserver is copied to the
|
||||
# target, we don't allow building a separate gdbserver. The
|
||||
# one from the external toolchain should be used.
|
||||
select BR2_PACKAGE_GDB_SERVER if \
|
||||
(!BR2_PACKAGE_GDB_DEBUGGER && !BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY)
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS && BR2_TOOLCHAIN_HAS_THREADS_DEBUG
|
||||
depends on !BR2_nios2 && !BR2_bfin
|
||||
help
|
||||
GDB, the GNU Project debugger, allows you to see what is
|
||||
going on `inside' another program while it executes -- or
|
||||
what another program was doing at the moment it crashed.
|
||||
|
||||
This option allows to build gdbserver and/or the gdb
|
||||
debugger for the target.
|
||||
|
||||
For embedded development, the most common solution is to
|
||||
build only 'gdbserver' for the target, and use a cross-gdb
|
||||
on the host. See BR2_PACKAGE_HOST_GDB in the Toolchain menu
|
||||
to enable one. Notice that external toolchains often provide
|
||||
their own pre-built cross-gdb and gdbserver binaries.
|
||||
|
||||
http://www.gnu.org/software/gdb/
|
||||
|
||||
if BR2_PACKAGE_GDB
|
||||
|
||||
config BR2_PACKAGE_GDB_SERVER
|
||||
bool "gdbserver"
|
||||
depends on !BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY
|
||||
help
|
||||
Build the gdbserver stub to run on the target.
|
||||
A full gdb is needed to debug the progam.
|
||||
|
||||
config BR2_PACKAGE_GDB_DEBUGGER
|
||||
bool "full debugger"
|
||||
select BR2_PACKAGE_NCURSES
|
||||
depends on BR2_USE_WCHAR
|
||||
depends on !BR2_sh && !BR2_sh64 && !BR2_microblaze
|
||||
|
||||
comment "full gdb on target needs a toolchain w/ wchar"
|
||||
depends on !BR2_sh && !BR2_sh64 && !BR2_microblaze
|
||||
depends on !BR2_USE_WCHAR
|
||||
|
||||
if BR2_PACKAGE_GDB_DEBUGGER
|
||||
|
||||
config BR2_PACKAGE_GDB_TUI
|
||||
bool "TUI support"
|
||||
help
|
||||
This option enables terminal user interface (TUI) for gdb
|
||||
|
||||
"The GDB Text User Interface (TUI) is a terminal interface
|
||||
which uses the curses library to show the source file, the
|
||||
assembly output, the program registers and GDB commands in
|
||||
separate text windows."
|
||||
|
||||
https://sourceware.org/gdb/current/onlinedocs/gdb/TUI.html
|
||||
|
||||
config BR2_PACKAGE_GDB_PYTHON
|
||||
bool "Python support"
|
||||
# Only Python 2.x is supported by gdb for now
|
||||
depends on BR2_PACKAGE_PYTHON
|
||||
help
|
||||
This option enables Python support in the target gdb.
|
||||
|
||||
endif
|
||||
|
||||
endif
|
||||
60
deprecated/firmware/buildroot/package/gdb/Config.in.host
Normal file
60
deprecated/firmware/buildroot/package/gdb/Config.in.host
Normal file
@@ -0,0 +1,60 @@
|
||||
config BR2_PACKAGE_HOST_GDB
|
||||
bool "Build cross gdb for the host"
|
||||
# When the external toolchain gdbserver is used, we shouldn't
|
||||
# allow to build a cross-gdb, as the one of the external
|
||||
# toolchain should be used.
|
||||
depends on !BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY
|
||||
depends on !BR2_nios2
|
||||
help
|
||||
Build a cross gdb that runs on the host machine and debugs
|
||||
programs running on the target. It requires 'gdbserver'
|
||||
installed on the target, see BR2_PACKAGE_GDB_SERVER to
|
||||
enable it.
|
||||
|
||||
if BR2_PACKAGE_HOST_GDB
|
||||
|
||||
config BR2_PACKAGE_HOST_GDB_TUI
|
||||
bool "TUI support"
|
||||
help
|
||||
This option enables terminal user interface (TUI) for gdb
|
||||
|
||||
config BR2_PACKAGE_HOST_GDB_PYTHON
|
||||
bool "Python support"
|
||||
help
|
||||
This option enables the Python support in the cross gdb.
|
||||
|
||||
choice
|
||||
prompt "GDB debugger Version"
|
||||
depends on !BR2_arc
|
||||
depends on !BR2_microblaze
|
||||
default BR2_GDB_VERSION_7_9
|
||||
help
|
||||
Select the version of gdb you wish to use.
|
||||
|
||||
config BR2_GDB_VERSION_7_7
|
||||
bool "gdb 7.7.x"
|
||||
depends on BR2_DEPRECATED_SINCE_2015_05
|
||||
|
||||
config BR2_GDB_VERSION_7_8
|
||||
bool "gdb 7.8.x"
|
||||
|
||||
config BR2_GDB_VERSION_7_9
|
||||
bool "gdb 7.9.x"
|
||||
|
||||
config BR2_GDB_VERSION_7_10
|
||||
bool "gdb 7.10.x"
|
||||
|
||||
endchoice
|
||||
|
||||
endif
|
||||
|
||||
# If cross-gdb is not enabled, the latest working version is chosen.
|
||||
config BR2_GDB_VERSION
|
||||
string
|
||||
depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
|
||||
default "arc-2015.12-gdb" if BR2_arc
|
||||
default "6be65fb56ea6694a9260733a536a023a1e2d4d57" if BR2_microblaze
|
||||
default "7.7.1" if BR2_GDB_VERSION_7_7
|
||||
default "7.8.2" if BR2_GDB_VERSION_7_8
|
||||
default "7.9.1" if BR2_GDB_VERSION_7_9 || !BR2_PACKAGE_HOST_GDB
|
||||
default "7.10.1" if BR2_GDB_VERSION_7_10
|
||||
36
deprecated/firmware/buildroot/package/gdb/gdb-python-config
Executable file
36
deprecated/firmware/buildroot/package/gdb/gdb-python-config
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This shell script is used to fake Python. Gdb wants to be passed a
|
||||
# Python interpreter, to run its own python-config.py program, which
|
||||
# uses sysconfig. However, when cross-compiling, this doesn't work
|
||||
# well since we would have to use the host Python, whose sysconfig
|
||||
# module would return host values.
|
||||
#
|
||||
# As recommended at
|
||||
# https://sourceware.org/gdb/wiki/CrossCompilingWithPythonSupport,
|
||||
# this wrapper shell script can be used as a replacement. It ignores
|
||||
# the python-config.py script passed as first arguments, and
|
||||
# "emulates" its behavior.
|
||||
|
||||
if [ $# -ne 2 ] ; then
|
||||
echo "Bad # args." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The first argument is the path to python-config.py, ignore it.
|
||||
|
||||
case "$2" in
|
||||
--includes)
|
||||
echo "-I${STAGING_DIR}/usr/include/python2.7"
|
||||
;;
|
||||
--ldflags)
|
||||
echo "-lpthread -ldl -lutil -lm -lpython2.7"
|
||||
;;
|
||||
--exec-prefix)
|
||||
echo "/usr"
|
||||
;;
|
||||
*)
|
||||
echo "Bad arg $2." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
8
deprecated/firmware/buildroot/package/gdb/gdb.hash
Normal file
8
deprecated/firmware/buildroot/package/gdb/gdb.hash
Normal file
@@ -0,0 +1,8 @@
|
||||
# From ftp://gcc.gnu.org/pub/gdb/releases/sha512.sum
|
||||
sha512 887b9b726dae8f6e3e5e41574460a67e4f9002b0d47bc985dcf63bdf3518397a90b6a208cb5b19e5ed2341715ad75cfeed4df4fb423f39f74218e36bc87f1cab gdb-7.7.1.tar.bz2
|
||||
sha512 face5bf1b4ce144fc8604fc84620beed956177a11fd632b4e41906fc7f632910b2b43a50e6cfdfd6cbd876ee527c813bddab8df29dc560a6c36694cdb8edc4e4 gdb-7.8.2.tar.xz
|
||||
sha512 eebdf88b24e52e792b8a4b89ea85790de72b462a7810b44975fdf4232c068f353b15506071f450102a9d4bcecdde8e93dc3748a10699b7f73f3e04fb2d9d8414 gdb-7.9.1.tar.xz
|
||||
sha512 17a5138277a31685a5c2a841cb47ed9bc4626ea617b8ca77750513b300299f4fbbffe504958b5372de610dcb952c679cf8fa9c1bdadd380294fbf59b6e366010 gdb-7.10.1.tar.xz
|
||||
# No hash for the ARC & microblaze variants, comes from the github-helper:
|
||||
none xxx gdb-arc-2015.12-gdb.tar.gz
|
||||
none xxx gdb-6be65fb56ea6694a9260733a536a023a1e2d4d57.tar.gz
|
||||
197
deprecated/firmware/buildroot/package/gdb/gdb.mk
Normal file
197
deprecated/firmware/buildroot/package/gdb/gdb.mk
Normal file
@@ -0,0 +1,197 @@
|
||||
################################################################################
|
||||
#
|
||||
# gdb
|
||||
#
|
||||
################################################################################
|
||||
|
||||
GDB_VERSION = $(call qstrip,$(BR2_GDB_VERSION))
|
||||
GDB_SITE = $(BR2_GNU_MIRROR)/gdb
|
||||
GDB_SOURCE = gdb-$(GDB_VERSION).tar.xz
|
||||
|
||||
ifeq ($(BR2_arc),y)
|
||||
GDB_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(GDB_VERSION))
|
||||
GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_microblaze),y)
|
||||
GDB_SITE = $(call github,Xilinx,gdb,$(GDB_VERSION))
|
||||
GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
|
||||
endif
|
||||
|
||||
# Use .tar.bz2 for 7.7.x since there was no .tar.xz release back then
|
||||
ifneq ($(filter 7.7.%,$(GDB_VERSION)),)
|
||||
GDB_SOURCE = gdb-$(GDB_VERSION).tar.bz2
|
||||
endif
|
||||
|
||||
GDB_LICENSE = GPLv2+, LGPLv2+, GPLv3+, LGPLv3+
|
||||
GDB_LICENSE_FILES = COPYING COPYING.LIB COPYING3 COPYING3.LIB
|
||||
|
||||
# We only want gdbserver and not the entire debugger.
|
||||
ifeq ($(BR2_PACKAGE_GDB_DEBUGGER),)
|
||||
GDB_SUBDIR = gdb/gdbserver
|
||||
HOST_GDB_SUBDIR = .
|
||||
else
|
||||
GDB_DEPENDENCIES = ncurses \
|
||||
$(if $(BR2_PACKAGE_LIBICONV),libiconv)
|
||||
endif
|
||||
|
||||
# For the host variant, we really want to build with XML support,
|
||||
# which is needed to read XML descriptions of target architectures. We
|
||||
# also need ncurses.
|
||||
HOST_GDB_DEPENDENCIES = host-expat host-ncurses
|
||||
|
||||
# Apply the Xtensa specific patches
|
||||
XTENSA_CORE_NAME = $(call qstrip, $(BR2_XTENSA_CORE_NAME))
|
||||
ifneq ($(XTENSA_CORE_NAME),)
|
||||
define GDB_XTENSA_PRE_PATCH
|
||||
tar xf $(BR2_XTENSA_OVERLAY_DIR)/xtensa_$(XTENSA_CORE_NAME).tar \
|
||||
-C $(@D) --strip-components=1 gdb
|
||||
endef
|
||||
GDB_PRE_PATCH_HOOKS += GDB_XTENSA_PRE_PATCH
|
||||
HOST_GDB_PRE_PATCH_HOOKS += GDB_XTENSA_PRE_PATCH
|
||||
endif
|
||||
|
||||
# Prevent gdb to build the documentation
|
||||
define GDB_DISABLE_DOC
|
||||
$(SED) '/^SUBDIRS =/ s/doc//' $(@D)/gdb/Makefile.in
|
||||
if test -e $(@D)/bfd/doc/Makefile.in ; then \
|
||||
$(SED) 's/^INFO_DEPS =.*$$/INFO_DEPS =/' $(@D)/bfd/doc/Makefile.in ; \
|
||||
fi
|
||||
if test -e $(@D)/gprof/Makefile.in ; then \
|
||||
$(SED) 's/^INFO_DEPS =.*$$/INFO_DEPS =/' $(@D)/gprof/Makefile.in ; \
|
||||
fi
|
||||
endef
|
||||
GDB_PRE_CONFIGURE_HOOKS += GDB_DISABLE_DOC
|
||||
HOST_GDB_PRE_CONFIGURE_HOOKS += GDB_DISABLE_DOC
|
||||
|
||||
# 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.
|
||||
GDB_DISABLE_BINUTILS_CONF_OPTS = \
|
||||
--disable-binutils \
|
||||
--disable-ld \
|
||||
--disable-gas
|
||||
|
||||
GDB_CONF_ENV = \
|
||||
ac_cv_type_uintptr_t=yes \
|
||||
gt_cv_func_gettext_libintl=yes \
|
||||
ac_cv_func_dcgettext=yes \
|
||||
gdb_cv_func_sigsetjmp=yes \
|
||||
bash_cv_func_strcoll_broken=no \
|
||||
bash_cv_must_reinstall_sighandlers=no \
|
||||
bash_cv_func_sigsetjmp=present \
|
||||
bash_cv_have_mbstate_t=yes \
|
||||
gdb_cv_func_sigsetjmp=yes
|
||||
|
||||
# The shared only build is not supported by gdb, so enable static build for
|
||||
# build-in libraries with --enable-static.
|
||||
GDB_CONF_OPTS = \
|
||||
--without-uiout \
|
||||
--disable-gdbtk \
|
||||
--without-x \
|
||||
--disable-sim \
|
||||
$(GDB_DISABLE_BINUTILS_CONF_OPTS) \
|
||||
$(if $(BR2_PACKAGE_GDB_SERVER),--enable-gdbserver) \
|
||||
--with-curses \
|
||||
--without-included-gettext \
|
||||
--disable-werror \
|
||||
--enable-static
|
||||
|
||||
ifeq ($(BR2_PACKAGE_GDB_TUI),y)
|
||||
GDB_CONF_OPTS += --enable-tui
|
||||
else
|
||||
GDB_CONF_OPTS += --disable-tui
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_GDB_PYTHON),y)
|
||||
GDB_CONF_OPTS += --with-python=$(TOPDIR)/package/gdb/gdb-python-config
|
||||
GDB_DEPENDENCIES += python
|
||||
else
|
||||
GDB_CONF_OPTS += --without-python
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_EXPAT),y)
|
||||
GDB_CONF_OPTS += --with-expat
|
||||
GDB_CONF_OPTS += --with-libexpat-prefix=$(STAGING_DIR)/usr
|
||||
GDB_DEPENDENCIES += expat
|
||||
else
|
||||
GDB_CONF_OPTS += --without-expat
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_XZ),y)
|
||||
GDB_CONF_OPTS += --with-lzma
|
||||
GDB_DEPENDENCIES += xz
|
||||
else
|
||||
GDB_CONF_OPTS += --without-lzma
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_ZLIB),y)
|
||||
GDB_CONF_OPTS += --with-zlib
|
||||
GDB_DEPENDENCIES += zlib
|
||||
else
|
||||
GDB_CONF_OPTS += --without-zlib
|
||||
endif
|
||||
|
||||
# This removes some unneeded Python scripts and XML target description
|
||||
# files that are not useful for a normal usage of the debugger.
|
||||
define GDB_REMOVE_UNNEEDED_FILES
|
||||
$(RM) -rf $(TARGET_DIR)/usr/share/gdb
|
||||
endef
|
||||
|
||||
GDB_POST_INSTALL_TARGET_HOOKS += GDB_REMOVE_UNNEEDED_FILES
|
||||
|
||||
# This installs the gdbserver somewhere into the $(HOST_DIR) so that
|
||||
# it becomes an integral part of the SDK, if the toolchain generated
|
||||
# by Buildroot is later used as an external toolchain. We install it
|
||||
# in debug-root/usr/bin/gdbserver so that it matches what Crosstool-NG
|
||||
# does.
|
||||
define GDB_SDK_INSTALL_GDBSERVER
|
||||
$(INSTALL) -D -m 0755 $(TARGET_DIR)/usr/bin/gdbserver \
|
||||
$(HOST_DIR)/usr/$(GNU_TARGET_NAME)/debug-root/usr/bin/gdbserver
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_PACKAGE_GDB_SERVER),y)
|
||||
GDB_POST_INSTALL_TARGET_HOOKS += GDB_SDK_INSTALL_GDBSERVER
|
||||
endif
|
||||
|
||||
# A few notes:
|
||||
# * --target, because we're doing a cross build rather than a real
|
||||
# host build.
|
||||
# * --enable-static because gdb really wants to use libbfd.a
|
||||
HOST_GDB_CONF_OPTS = \
|
||||
--target=$(GNU_TARGET_NAME) \
|
||||
--enable-static \
|
||||
--without-uiout \
|
||||
--disable-gdbtk \
|
||||
--without-x \
|
||||
--enable-threads \
|
||||
--disable-werror \
|
||||
--without-included-gettext \
|
||||
$(GDB_DISABLE_BINUTILS_CONF_OPTS) \
|
||||
--disable-sim
|
||||
|
||||
ifeq ($(BR2_PACKAGE_HOST_GDB_TUI),y)
|
||||
HOST_GDB_CONF_OPTS += --enable-tui
|
||||
else
|
||||
HOST_GDB_CONF_OPTS += --disable-tui
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON),y)
|
||||
HOST_GDB_CONF_OPTS += --with-python=$(HOST_DIR)/usr/bin/python2
|
||||
HOST_GDB_DEPENDENCIES += host-python
|
||||
else
|
||||
HOST_GDB_CONF_OPTS += --without-python
|
||||
endif
|
||||
|
||||
# legacy $arch-linux-gdb symlink
|
||||
define HOST_GDB_ADD_SYMLINK
|
||||
cd $(HOST_DIR)/usr/bin && \
|
||||
ln -snf $(GNU_TARGET_NAME)-gdb $(ARCH)-linux-gdb
|
||||
endef
|
||||
|
||||
HOST_GDB_POST_INSTALL_HOOKS += HOST_GDB_ADD_SYMLINK
|
||||
|
||||
HOST_GDB_POST_INSTALL_HOOKS += gen_gdbinit_file
|
||||
|
||||
$(eval $(autotools-package))
|
||||
$(eval $(host-autotools-package))
|
||||
Reference in New Issue
Block a user