Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/2] Use -fno-asynchronous-unwind-tables if C program is compiled without debug info on x86
Date: Tue, 19 Apr 2016 07:50:00 -0000	[thread overview]
Message-ID: <1461052220-10149-2-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <1461052220-10149-1-git-send-email-yao.qi@linaro.org>

.eh_frame is added in default on x86 and x86_64 so that DWARF unwinder
is always used, but prologue unwinders won't be used at all.  IOW,
prologue unwinders are not tested by regression tests.  If the test is
intended to compiled *without* debug info, we shouldn't generate any
debug info (.eh_frame for example) at all.

This patch is to disable async-unwind-tables generation if the C program
is intended to compile without debug info on x86-like target.

gdb/testsuite:

2016-04-18  Pierre Langlois  <pierre.langlois@arm.com>
	    Yao Qi  <yao.qi@linaro.org>

	PR gdb/19947
	* lib/gdb.exp (gdb_compile): Append
	"additional_flags=-fno-asynchronous-unwind-tables" if C program
	is compiled without debug info on x86.
---
 gdb/testsuite/lib/gdb.exp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 0d8a3b0..5b789af 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3419,6 +3419,15 @@ proc gdb_compile {source dest type options} {
 	set options [lreplace $options $nowarnings $nowarnings $flag]
     }
 
+    if {([lsearch -exact $options debug] == -1
+	 || [lsearch -exact $options nodebug] != -1)
+	 && ([istarget "i?86-*-*"] || [istarget "x86_64-*-*"])
+	 && ([lsearch -regexp $options {(c\+\+|ada|f77|f90)}] == -1) } {
+	# C program is intended to compile without debug information
+	# on x86 target.
+	lappend options "additional_flags=-fno-asynchronous-unwind-tables"
+    }
+
     if { $type == "executable" } {
 	if { ([istarget "*-*-mingw*"]
 	      || [istarget "*-*-*djgpp"]
-- 
1.9.1


  reply	other threads:[~2016-04-19  7:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19  7:50 [PATCH 0/2] PR 19947: throw right exception in read_code and read_stack Yao Qi
2016-04-19  7:50 ` Yao Qi [this message]
2016-04-19 13:35   ` [PATCH 1/2] Use -fno-asynchronous-unwind-tables if C program is compiled without debug info on x86 Pedro Alves
2016-04-20  8:38     ` Yao Qi
2016-04-22 12:30       ` Pedro Alves
2016-04-22 14:23         ` Yao Qi
2016-04-22 14:36           ` Pedro Alves
2016-04-22 16:05             ` Yao Qi
2016-04-19  7:50 ` [PATCH 2/2] Throw NOT_AVAILABLE_ERROR in read_stack and read_code Yao Qi
2016-04-22 13:41   ` Pedro Alves
2016-05-04 14:08     ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461052220-10149-2-git-send-email-yao.qi@linaro.org \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox