summaryrefslogtreecommitdiff
path: root/package/gdb
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2016-05-31 23:01:36 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-05-31 23:14:00 +0200
commit86aa4d8d11cbe49d81ce0a054570d6e5d59f372e (patch)
tree54df296ffa589286dd3a776777fe875bd40a7d33 /package/gdb
parent0542bb79e823505a730b6a2c2f01b33b6293cf03 (diff)
gdb: enable simulator support for host build
Add an option to enable GDB simulator support, so it can be used to test some no-MMU systems. Newer GDB Blackfin Simulator need a workaround for in-tree compile. It doesn't break for older Buildroot supported GDB Blackfin Simulator. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/gdb')
-rw-r--r--package/gdb/Config.in.host5
-rw-r--r--package/gdb/gdb.mk17
2 files changed, 20 insertions, 2 deletions
diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
index 257d68ac9..dc149b636 100644
--- a/package/gdb/Config.in.host
+++ b/package/gdb/Config.in.host
@@ -23,6 +23,11 @@ config BR2_PACKAGE_HOST_GDB_PYTHON
help
This option enables the Python support in the cross gdb.
+config BR2_PACKAGE_HOST_GDB_SIM
+ bool "Simulator support"
+ help
+ This option enables the simulator support in the cross gdb.
+
choice
prompt "GDB debugger Version"
depends on !BR2_arc
diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index 0a7af1ef6..84f2029e9 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -163,8 +163,7 @@ HOST_GDB_CONF_OPTS = \
--enable-threads \
--disable-werror \
--without-included-gettext \
- $(GDB_DISABLE_BINUTILS_CONF_OPTS) \
- --disable-sim
+ $(GDB_DISABLE_BINUTILS_CONF_OPTS)
ifeq ($(BR2_PACKAGE_HOST_GDB_TUI),y)
HOST_GDB_CONF_OPTS += --enable-tui
@@ -179,6 +178,20 @@ else
HOST_GDB_CONF_OPTS += --without-python
endif
+# workaround a bug if in-tree build is used for bfin sim
+define HOST_GDB_BFIN_SIM_WORKAROUND
+ $(RM) $(@D)/sim/common/tconfig.h
+endef
+
+ifeq ($(BR2_PACKAGE_HOST_GDB_SIM),y)
+HOST_GDB_CONF_OPTS += --enable-sim
+ifeq ($(BR2_bfin),y)
+HOST_GDB_PRE_CONFIGURE_HOOKS += HOST_GDB_BFIN_SIM_WORKAROUND
+endif
+else
+HOST_GDB_CONF_OPTS += --disable-sim
+endif
+
# legacy $arch-linux-gdb symlink
define HOST_GDB_ADD_SYMLINK
cd $(HOST_DIR)/usr/bin && \