All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4] gdb: enable simulator support for host build
@ 2016-05-31 21:01 Waldemar Brodkorb
  2016-05-31 21:24 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Waldemar Brodkorb @ 2016-05-31 21:01 UTC (permalink / raw)
  To: buildroot

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>
---
v3 -> v4:
  - the workaround is Blackfin specific and is not fixed
    upstream. Problem with ARM reported by Thomas Petazzoni
v2 -> v3:
  - add workaround for GDB bug when in-tree compile is used,
    problem reported by Thomas Petazzoni
  - tested with GDB 7.9, 7.10.1, 7.11
v1 -> v2:
  - no changes
---
 package/gdb/Config.in.host |  5 +++++
 package/gdb/gdb.mk         | 17 +++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
index 257d68a..dc149b6 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 0a7af1e..84f2029 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 && \
-- 
2.1.4

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

* [Buildroot] [PATCH v4] gdb: enable simulator support for host build
  2016-05-31 21:01 [Buildroot] [PATCH v4] gdb: enable simulator support for host build Waldemar Brodkorb
@ 2016-05-31 21:24 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-05-31 21:24 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 31 May 2016 23:01:36 +0200, Waldemar Brodkorb wrote:
> 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>
> ---
> v3 -> v4:
>   - the workaround is Blackfin specific and is not fixed
>     upstream. Problem with ARM reported by Thomas Petazzoni
> v2 -> v3:
>   - add workaround for GDB bug when in-tree compile is used,
>     problem reported by Thomas Petazzoni
>   - tested with GDB 7.9, 7.10.1, 7.11
> v1 -> v2:
>   - no changes
> ---
>  package/gdb/Config.in.host |  5 +++++
>  package/gdb/gdb.mk         | 17 +++++++++++++++--
>  2 files changed, 20 insertions(+), 2 deletions(-)

This one builds, tested for both ARM and Blackfin, so: applied to next.
Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2016-05-31 21:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-31 21:01 [Buildroot] [PATCH v4] gdb: enable simulator support for host build Waldemar Brodkorb
2016-05-31 21:24 ` Thomas Petazzoni

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.