public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Prevent appending "-g" after "-g3" to compile options in info-macros.exp.
@ 2014-01-14 17:44 Andreas Arnez
  2014-01-14 17:48 ` Tom Tromey
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Arnez @ 2014-01-14 17:44 UTC (permalink / raw)
  To: gdb-patches

When upstream gcc is given a command line with "-g3" followed by "-g",
it doesn't generate a ".debug_macro" section.  This is because the last
option wins, thus downgrading the debug level again.  Without any macro
debug information in the executable, info-macros.exp obviously yields
many failures.

Since "-g" is appended by DejaGnu's target_compile whenever the "debug"
option is set, the fix just removes that option.

testsuite/
2014-01-14  Andreas Arnez  <arnez@linux.vnet.ibm.com>

	* gdb.base/info-macros.exp: Remove "debug" from the compile
	options.
---
 gdb/testsuite/gdb.base/info-macros.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/info-macros.exp b/gdb/testsuite/gdb.base/info-macros.exp
index ff889f4..121e00b 100644
--- a/gdb/testsuite/gdb.base/info-macros.exp
+++ b/gdb/testsuite/gdb.base/info-macros.exp
@@ -27,7 +27,7 @@ if ![test_compiler_info gcc*] {
   return -1
 }
 
-set options "debug additional_flags=-g3"
+set options "additional_flags=-g3"
 
 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} $options] } {
     untested ${testfile}.exp
-- 
1.8.3.1

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

* Re: [PATCH] Prevent appending "-g" after "-g3" to compile options in info-macros.exp.
  2014-01-14 17:44 [PATCH] Prevent appending "-g" after "-g3" to compile options in info-macros.exp Andreas Arnez
@ 2014-01-14 17:48 ` Tom Tromey
  2014-01-15 12:46   ` Andreas Arnez
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2014-01-14 17:48 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches

>>>>> "Andreas" == Andreas Arnez <arnez@linux.vnet.ibm.com> writes:

Andreas> 2014-01-14  Andreas Arnez  <arnez@linux.vnet.ibm.com>
Andreas> 	* gdb.base/info-macros.exp: Remove "debug" from the compile
Andreas> 	options.
 
Andreas> -set options "debug additional_flags=-g3"
Andreas> +set options "additional_flags=-g3"
 
Would you mind adding a comment explaining why "debug" doesn't appear
here?  Ok with that.

Tom

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

* Re: [PATCH] Prevent appending "-g" after "-g3" to compile options in info-macros.exp.
  2014-01-14 17:48 ` Tom Tromey
@ 2014-01-15 12:46   ` Andreas Arnez
  2014-01-15 15:08     ` Tom Tromey
  2014-01-22 16:10     ` Andreas Krebbel
  0 siblings, 2 replies; 5+ messages in thread
From: Andreas Arnez @ 2014-01-15 12:46 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches, Ulrich Weigand

On Tue, Jan 14 2014, Tom Tromey wrote:

>>>>>> "Andreas" == Andreas Arnez <arnez@linux.vnet.ibm.com> writes:
>
> Andreas> 2014-01-14  Andreas Arnez  <arnez@linux.vnet.ibm.com>
> Andreas> 	* gdb.base/info-macros.exp: Remove "debug" from the compile
> Andreas> 	options.
>
> Andreas> -set options "debug additional_flags=-g3"
> Andreas> +set options "additional_flags=-g3"
>
> Would you mind adding a comment explaining why "debug" doesn't appear
> here?  Ok with that.

Sure.  How about this?

-----

Subject: [PATCH] Prevent appending "-g" after "-g3" to compile options
 in info-macros.exp.

When upstream gcc is given a command line with "-g3" followed by "-g",
it doesn't generate a ".debug_macro" section.  This is because the last
option wins, thus downgrading the debug level again.  Without any macro
debug information in the executable, info-macros.exp obviously yields
many failures.

Since "-g" is appended by DejaGnu's target_compile whenever the "debug"
option is set, the fix just removes that option.

testsuite/
2014-01-15  Andreas Arnez  <arnez@linux.vnet.ibm.com>

	* gdb.base/info-macros.exp: Remove "debug" from the compile
	options.
---
 gdb/testsuite/gdb.base/info-macros.exp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/info-macros.exp b/gdb/testsuite/gdb.base/info-macros.exp
index ff889f4..798d9b5 100644
--- a/gdb/testsuite/gdb.base/info-macros.exp
+++ b/gdb/testsuite/gdb.base/info-macros.exp
@@ -27,7 +27,9 @@ if ![test_compiler_info gcc*] {
   return -1
 }
 
-set options "debug additional_flags=-g3"
+# Don't use "debug" here.  Otherwise "-g" would be appended to the gcc
+# command line, possibly overriding "-g3" (depending on gcc version).
+set options "additional_flags=-g3"
 
 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} $options] } {
     untested ${testfile}.exp
-- 
1.8.3.1

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

* Re: [PATCH] Prevent appending "-g" after "-g3" to compile options in info-macros.exp.
  2014-01-15 12:46   ` Andreas Arnez
@ 2014-01-15 15:08     ` Tom Tromey
  2014-01-22 16:10     ` Andreas Krebbel
  1 sibling, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2014-01-15 15:08 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches, Ulrich Weigand

>>>>> "Andreas" == Andreas Arnez <arnez@linux.vnet.ibm.com> writes:

>> Would you mind adding a comment explaining why "debug" doesn't appear
>> here?  Ok with that.

Andreas> Sure.  How about this?

Perfect, thanks.

Tom

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

* Re: [PATCH] Prevent appending "-g" after "-g3" to compile options in info-macros.exp.
  2014-01-15 12:46   ` Andreas Arnez
  2014-01-15 15:08     ` Tom Tromey
@ 2014-01-22 16:10     ` Andreas Krebbel
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Krebbel @ 2014-01-22 16:10 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches

On Wed, Jan 15, 2014 at 01:46:41PM +0100, Andreas Arnez wrote:
> testsuite/
> 2014-01-15  Andreas Arnez  <arnez@linux.vnet.ibm.com>
> 
> 	* gdb.base/info-macros.exp: Remove "debug" from the compile
> 	options.

Applied. Thanks!

-Andreas-

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

end of thread, other threads:[~2014-01-22 16:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-14 17:44 [PATCH] Prevent appending "-g" after "-g3" to compile options in info-macros.exp Andreas Arnez
2014-01-14 17:48 ` Tom Tromey
2014-01-15 12:46   ` Andreas Arnez
2014-01-15 15:08     ` Tom Tromey
2014-01-22 16:10     ` Andreas Krebbel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).