All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [pull request] Pull request for branch for-2011.08/debugging-improvements
@ 2011-07-11 21:53 Thomas Petazzoni
  2011-07-11 21:53 ` [Buildroot] [PATCH 1/4] debug: do not force installation of gdbserver Thomas Petazzoni
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2011-07-11 21:53 UTC (permalink / raw)
  To: buildroot

Hello,

Here is a small set of patches that improves a few things around
debugging.

The main change is that debugging symbols are now enabled by
default. As explained in the commit log, the reasoning is that
debugging symbols in the staging directory are often useful for remote
debugging, and disk space is typically not a problem for the staging
directory, as it remains on the development workstation. Binaries and
libraries for the target are still stripped by default, getting rid of
all debugging symbols.

Regards,

Thomas

The following changes since commit bd76bc5f80b963570e8eda92efc961e683264402:

  CHANGES: update with recent changes (2011-07-11 07:44:24 +0200)

are available in the git repository at:
  http://free-electrons.com/~thomas/buildroot.git for-2011.08/debugging-improvements

Thomas Petazzoni (4):
      debug: do not force installation of gdbserver
      debug: enable debugging symbols by default
      debug: provide an option to copy the gdbserver to the target
      config: improve help text and prompt for debugging related options

 Config.in                                |   34 ++++++++++++++++++-----------
 toolchain/gdb/Config.in                  |    8 +++++++
 toolchain/toolchain-external/ext-tool.mk |   10 ++++++++
 3 files changed, 39 insertions(+), 13 deletions(-)

Thanks,
-- 
Thomas Petazzoni

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

* [Buildroot] [PATCH 1/4] debug: do not force installation of gdbserver
  2011-07-11 21:53 [Buildroot] [pull request] Pull request for branch for-2011.08/debugging-improvements Thomas Petazzoni
@ 2011-07-11 21:53 ` Thomas Petazzoni
  2011-07-11 21:53 ` [Buildroot] [PATCH 2/4] debug: enable debugging symbols by default Thomas Petazzoni
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2011-07-11 21:53 UTC (permalink / raw)
  To: buildroot

The BR2_ENABLE_DEBUG option selects the compilation and installation
of gdbserver on the target. This is a bit restrictive, especially for
external toolchains, which may already contain a gdbserver on the
target.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 Config.in |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/Config.in b/Config.in
index a67c08d..b130b27 100644
--- a/Config.in
+++ b/Config.in
@@ -172,7 +172,6 @@ config BR2_DEPRECATED
 
 config BR2_ENABLE_DEBUG
 	bool "build packages with debugging symbols"
-	select BR2_PACKAGE_GDB_SERVER
 	help
 	  Build packages with debugging symbols
 	  enabled
-- 
1.7.4.1

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

* [Buildroot] [PATCH 2/4] debug: enable debugging symbols by default
  2011-07-11 21:53 [Buildroot] [pull request] Pull request for branch for-2011.08/debugging-improvements Thomas Petazzoni
  2011-07-11 21:53 ` [Buildroot] [PATCH 1/4] debug: do not force installation of gdbserver Thomas Petazzoni
@ 2011-07-11 21:53 ` Thomas Petazzoni
  2011-07-11 21:53 ` [Buildroot] [PATCH 3/4] debug: provide an option to copy the gdbserver to the target Thomas Petazzoni
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2011-07-11 21:53 UTC (permalink / raw)
  To: buildroot

The reasoning is that having debugging symbols in the staging
directory is often useful for remote debugging, and since the staging
directory is only stored on the development workstation, disk space is
usually not an issue.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 Config.in |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Config.in b/Config.in
index b130b27..dfca37b 100644
--- a/Config.in
+++ b/Config.in
@@ -172,6 +172,7 @@ config BR2_DEPRECATED
 
 config BR2_ENABLE_DEBUG
 	bool "build packages with debugging symbols"
+	default y
 	help
 	  Build packages with debugging symbols
 	  enabled
-- 
1.7.4.1

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

* [Buildroot] [PATCH 3/4] debug: provide an option to copy the gdbserver to the target
  2011-07-11 21:53 [Buildroot] [pull request] Pull request for branch for-2011.08/debugging-improvements Thomas Petazzoni
  2011-07-11 21:53 ` [Buildroot] [PATCH 1/4] debug: do not force installation of gdbserver Thomas Petazzoni
  2011-07-11 21:53 ` [Buildroot] [PATCH 2/4] debug: enable debugging symbols by default Thomas Petazzoni
@ 2011-07-11 21:53 ` Thomas Petazzoni
  2011-07-11 21:53 ` [Buildroot] [PATCH 4/4] config: improve help text and prompt for debugging related options Thomas Petazzoni
  2011-07-12  7:27 ` [Buildroot] [pull request] Pull request for branch for-2011.08/debugging-improvements Peter Korsgaard
  4 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2011-07-11 21:53 UTC (permalink / raw)
  To: buildroot

When an external toolchain is used, it is very likely that it contains
a pre-built version of a gdbserver that has the same version as the
cross-gdb included in the external toolchain. So, we now provide an
option that allows to copy this pre-built gdbserver to the target.

As the location of the gdbserver in the external toolchain is not
standardized, we only support the CodeSourcery and Crosstool-NG
layouts for the moment. Other locations can be added later.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 toolchain/gdb/Config.in                  |    8 ++++++++
 toolchain/toolchain-external/ext-tool.mk |   10 ++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/toolchain/gdb/Config.in b/toolchain/gdb/Config.in
index 8295f79..c5c9829 100644
--- a/toolchain/gdb/Config.in
+++ b/toolchain/gdb/Config.in
@@ -12,10 +12,18 @@ comment "Gdb debugger for the target needs WCHAR support in toolchain"
 
 config BR2_PACKAGE_GDB_SERVER
 	bool "Build gdb server for the Target"
+	depends on !BR2_TOOLCHAIN_EXTERNAL
 	help
 	    Build the gdbserver stub to run on the target.
 	    A full gdb is needed to debug the progam.
 
+config BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY
+	bool "Copy gdb server to the Target"
+	depends on BR2_TOOLCHAIN_EXTERNAL
+	help
+	  Copy the gdbserver provided by the external toolchain to the
+	  target.
+
 config BR2_PACKAGE_GDB_HOST
 	bool "Build gdb for the Host"
 	# cross-gdb is supposed to be part of the external
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index ef71ce0..64c389e 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -298,6 +298,16 @@ $(STAMP_DIR)/ext-toolchain-installed: $(TOOLCHAIN_EXTERNAL_DEPENDENCIES)
 	if [ -L $${ARCH_SYSROOT_DIR}/lib64 ] ; then \
 		$(call create_lib64_symlinks) ; \
 	fi ; \
+	if [ x"$(BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY)" == x"y" ] ; then \
+		if test -f "$${ARCH_SYSROOT_DIR}/usr/bin/gdbserver" ; then \
+			install -m 0755 -D $${ARCH_SYSROOT_DIR}/usr/bin/gdbserver $(TARGET_DIR)/usr/bin/gdbserver ; \
+		elif test -f "$${ARCH_SYSROOT_DIR}/../debug-root/gdbserver" ; then \
+			install -m 0755 -D $${ARCH_SYSROOT_DIR}/../debug-root/gdbserver ; \
+		else \
+			echo "Could not find gdbserver in external toolchain" ; \
+			exit 1 ; \
+		fi ; \
+	fi ; \
 	touch $@
 
 # Build toolchain wrapper for preprocessor, C and C++ compiler, and setup
-- 
1.7.4.1

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

* [Buildroot] [PATCH 4/4] config: improve help text and prompt for debugging related options
  2011-07-11 21:53 [Buildroot] [pull request] Pull request for branch for-2011.08/debugging-improvements Thomas Petazzoni
                   ` (2 preceding siblings ...)
  2011-07-11 21:53 ` [Buildroot] [PATCH 3/4] debug: provide an option to copy the gdbserver to the target Thomas Petazzoni
@ 2011-07-11 21:53 ` Thomas Petazzoni
  2011-07-12  7:27 ` [Buildroot] [pull request] Pull request for branch for-2011.08/debugging-improvements Peter Korsgaard
  4 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2011-07-11 21:53 UTC (permalink / raw)
  To: buildroot

The help text for the choice of different stripping levels is removed,
since it is not displayed by menuconfig. Instead, only the per-option
help text is visible, so this text is improved.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 Config.in |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/Config.in b/Config.in
index dfca37b..1c1c2a6 100644
--- a/Config.in
+++ b/Config.in
@@ -174,8 +174,12 @@ config BR2_ENABLE_DEBUG
 	bool "build packages with debugging symbols"
 	default y
 	help
-	  Build packages with debugging symbols
-	  enabled
+	  Build packages with debugging symbols enabled. All libraries
+	  and binaries in the 'staging' directory will have debugging
+	  symbols, which allows remote debugging even if libraries and
+	  binaries are stripped on the target. Whether libraries and
+	  binaries are stripped on the target is controlled by the
+	  BR2_STRIP_* options below.
 
 if BR2_ENABLE_DEBUG
 choice
@@ -208,32 +212,36 @@ endchoice
 endif
 
 choice
-	prompt "strip"
+	prompt "strip command for binaries on target"
 	default BR2_STRIP_strip
-	help
-	  Select whether to strip binaries and libraries for the target
-	  or not.
-	  strip   is the normal strip command
-	  sstrip  is a strip that discards more than the normal strip
-	  none    do not strip (only for debugging!)
 
 config BR2_STRIP_strip
 	bool "strip"
 	depends on !BR2_ELF2FLT
 	help
-	  strip   is the normal strip command
+	  Binaries and libraries in the target filesystem will be
+	  stripped using the normal 'strip' command. This allows to
+	  save space, mainly by removing debugging symbols. Debugging
+	  symbols on the target are unneeded on the target when remote
+	  debugging is used.
 
 config BR2_STRIP_sstrip
 	bool "sstrip"
 	select BR2_PACKAGE_SSTRIP_HOST
 	depends on !BR2_ELF2FLT
 	help
-	  sstrip  is a strip that discards more than the normal strip
+	  Binaries and libraries in the target filesystem will be
+	  stripped using the 'sstrip' command, which strips a little
+	  bit more than the traditional 'strip' command. This allows
+	  to save space, mainly by removing debugging
+	  symbols. Debugging symbols on the target are unneeded on the
+	  target when remote debugging is used.
 
 config BR2_STRIP_none
 	bool "none"
 	help
-	  none    do not strip (only for debugging!)
+	  Do not strip binaries and libraries in the target
+	  filesystem.
 endchoice
 
 choice
-- 
1.7.4.1

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

* [Buildroot] [pull request] Pull request for branch for-2011.08/debugging-improvements
  2011-07-11 21:53 [Buildroot] [pull request] Pull request for branch for-2011.08/debugging-improvements Thomas Petazzoni
                   ` (3 preceding siblings ...)
  2011-07-11 21:53 ` [Buildroot] [PATCH 4/4] config: improve help text and prompt for debugging related options Thomas Petazzoni
@ 2011-07-12  7:27 ` Peter Korsgaard
  2011-07-14 13:36   ` Thomas Petazzoni
  4 siblings, 1 reply; 8+ messages in thread
From: Peter Korsgaard @ 2011-07-12  7:27 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 Thomas> Hello,
 Thomas> Here is a small set of patches that improves a few things around
 Thomas> debugging.

 Thomas> The main change is that debugging symbols are now enabled by
 Thomas> default. As explained in the commit log, the reasoning is that
 Thomas> debugging symbols in the staging directory are often useful for remote
 Thomas> debugging, and disk space is typically not a problem for the staging
 Thomas> directory, as it remains on the development workstation. Binaries and
 Thomas> libraries for the target are still stripped by default, getting rid of
 Thomas> all debugging symbols.

Next to the size impact (which I agree is not a big problem) there's
also potentially a build time impact. Did you test this?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [pull request] Pull request for branch for-2011.08/debugging-improvements
  2011-07-12  7:27 ` [Buildroot] [pull request] Pull request for branch for-2011.08/debugging-improvements Peter Korsgaard
@ 2011-07-14 13:36   ` Thomas Petazzoni
  2011-07-14 13:43     ` Peter Korsgaard
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2011-07-14 13:36 UTC (permalink / raw)
  To: buildroot

Le Tue, 12 Jul 2011 09:27:33 +0200,
Peter Korsgaard <jacmet@uclibc.org> a ?crit :

> Next to the size impact (which I agree is not a big problem) there's
> also potentially a build time impact. Did you test this?

Here is the result of a fairly big build for ARM (X.org, Gtk2, WebKit,
Midori), on a fairly big machine (quad-core, 12 GB of RAM), build was
done with BR2_JLEVEL=16, and the build does not include a toolchain (I
used an existing internal toolchain).

Without debugging symbols
=========================

 * Real time:	 		51 minutes
 * User time:			200 minutes
 * System time:	 		14 minutes
 * Size of output directory:	3.4 GB
 * Size of staging directory:	445 MB
 * Size of target directory:	102 MB

With debugging symbols
======================

 * Real time:			58 minutes
 * User time:			232 minutes
 * System time:			16 minutes
 * Size of output directory:	9.0 GB
 * Size of staging directory:	2.0 GB
 * Size of target directory:    102 MB

So, I'd say we should drop my patch 2/4.

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [pull request] Pull request for branch for-2011.08/debugging-improvements
  2011-07-14 13:36   ` Thomas Petazzoni
@ 2011-07-14 13:43     ` Peter Korsgaard
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Korsgaard @ 2011-07-14 13:43 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 >> Next to the size impact (which I agree is not a big problem) there's
 >> also potentially a build time impact. Did you test this?

 Thomas> Here is the result of a fairly big build for ARM (X.org, Gtk2, WebKit,
 Thomas> Midori), on a fairly big machine (quad-core, 12 GB of RAM), build was
 Thomas> done with BR2_JLEVEL=16, and the build does not include a toolchain (I
 Thomas> used an existing internal toolchain).

Thanks!

 Thomas> Without debugging symbols
 Thomas> =========================

 Thomas>  * Size of output directory:	3.4 GB
 Thomas>  * Size of staging directory:	445 MB

 Thomas> With debugging symbols
 Thomas> ======================

 Thomas>  * Size of output directory:	9.0 GB
 Thomas>  * Size of staging directory:	2.0 GB

 Thomas> So, I'd say we should drop my patch 2/4.

Yeah, this is a bit too much.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2011-07-14 13:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-11 21:53 [Buildroot] [pull request] Pull request for branch for-2011.08/debugging-improvements Thomas Petazzoni
2011-07-11 21:53 ` [Buildroot] [PATCH 1/4] debug: do not force installation of gdbserver Thomas Petazzoni
2011-07-11 21:53 ` [Buildroot] [PATCH 2/4] debug: enable debugging symbols by default Thomas Petazzoni
2011-07-11 21:53 ` [Buildroot] [PATCH 3/4] debug: provide an option to copy the gdbserver to the target Thomas Petazzoni
2011-07-11 21:53 ` [Buildroot] [PATCH 4/4] config: improve help text and prompt for debugging related options Thomas Petazzoni
2011-07-12  7:27 ` [Buildroot] [pull request] Pull request for branch for-2011.08/debugging-improvements Peter Korsgaard
2011-07-14 13:36   ` Thomas Petazzoni
2011-07-14 13:43     ` Peter Korsgaard

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.