From: "Tomar, Sourabh Singh" <SourabhSingh.Tomar@amd.com>
To: Tom Tromey <tom@tromey.com>,
"Tomar,
Sourabh Singh via Gdb-patches" <gdb-patches@sourceware.org>
Cc: "George, Jini Susan" <JiniSusan.George@amd.com>,
"Achra, Nitika" <Nitika.Achra@amd.com>,
"Sharma, Alok Kumar" <AlokKumar.Sharma@amd.com>,
"E, Nagajyothi" <Nagajyothi.E@amd.com>,
"Kumar N, Bhuvanendra" <Bhuvanendra.KumarN@amd.com>
Subject: RE: [PATCH] [gdb.base] Enable macro test for clang compiler
Date: Tue, 16 Mar 2021 05:14:29 +0000 [thread overview]
Message-ID: <MW2PR12MB2474C201C21E9A743A790F4A9D6B9@MW2PR12MB2474.namprd12.prod.outlook.com> (raw)
In-Reply-To: <87lfao19ys.fsf@tromey.com>
[-- Attachment #1: Type: text/plain, Size: 2532 bytes --]
[AMD Public Use]
Hi Tom,
>> This is ok with one minor tweak. If you have write access (I didn't
>> look) you can just fix it up and check it in.
Thanks for reviewing this! I have made the suggested changes. I do not have write access(as of now),
Could you please commit this on my behalf 😊
>> The body of the if/elseif/else blocks should be indented.
>> For Tcl, GDB uses a 4 space indent.
Thanks for the pointers, I'll keep this in mind for future reviews/patches.
ChangeLog:
gdb/testsuite/ChangeLog
2021-03-16 Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
* gdb.base/info-macros.exp: Append -fdebug-macro to
additional_flags for clang.
* gdb.base/macscp.exp: Likewise.
* gdb.base/style.exp: Likewise.
* gdb.linespec/macro-relative.exp: Likewise.
Thanks,
Sourabh.
-----Original Message-----
From: Tom Tromey <tom@tromey.com>
Sent: Tuesday, March 16, 2021 1:11 AM
To: Tomar, Sourabh Singh via Gdb-patches <gdb-patches@sourceware.org>
Cc: Tom Tromey <tom@tromey.com>; Tomar, Sourabh Singh <SourabhSingh.Tomar@amd.com>; George, Jini Susan <JiniSusan.George@amd.com>; Achra, Nitika <Nitika.Achra@amd.com>; Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; E, Nagajyothi <Nagajyothi.E@amd.com>; Kumar N, Bhuvanendra <Bhuvanendra.KumarN@amd.com>
Subject: Re: [PATCH] [gdb.base] Enable macro test for clang compiler
[CAUTION: External Email]
>>>>> ">" == Tomar, Sourabh Singh via Gdb-patches <gdb-patches@sourceware.org> writes:
>> Apologies missed the attachment/patch.
No worries.
>> Updated ChangeLog:
>> 2021-03-15 Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
>> * gdb.base/info-macros.exp: Append -fdebug-macro to
>> additional_flags for clang.
>> * gdb.base/macscp.exp: Likewise.
>> * gdb.base/style.exp: Likewise.
>> * gdb.linespec/macro-relative.exp: Likewise.
This is ok with one minor tweak. If you have write access (I didn't
look) you can just fix it up and check it in.
>> +if {[test_compiler_info gcc*]} {
>> # 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"
>> +} elseif {[test_compiler_info clang*]} { set options
>> +"additional_flags=-fdebug-macro"
>> +} else {
>> + untested "no compiler info"
>> + return -1
>> +}
The body of the if/elseif/else blocks should be indented.
For Tcl, GDB uses a 4 space indent.
thanks,
Tom
[-- Attachment #2: gdb.base-Enable-macro-test-for-clang-compiler.patch --]
[-- Type: application/octet-stream, Size: 4442 bytes --]
From 519c45ce18827be589a33440c97e3f9b8ff8219a Mon Sep 17 00:00:00 2001
From: Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
Date: Tue, 16 Mar 2021 10:27:01 +0530
Subject: [PATCH] [gdb.base] Enable macro test for clang compiler
`clang` uses `-fdebug-macro` switch to enable debug-info
for macros.
gdb/testsuite/ChangeLog:
2021-03-16 Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
* gdb.base/info-macros.exp: Append -fdebug-macro to
additional_flags for clang.
* gdb.base/macscp.exp: Likewise.
* gdb.base/style.exp: Likewise.
* gdb.linespec/macro-relative.exp: Likewise.
---
gdb/testsuite/ChangeLog | 8 ++++++++
gdb/testsuite/gdb.base/info-macros.exp | 16 +++++++++-------
gdb/testsuite/gdb.base/macscp.exp | 4 +++-
gdb/testsuite/gdb.base/style.exp | 5 ++++-
gdb/testsuite/gdb.linespec/macro-relative.exp | 2 ++
5 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 6eddfc16c39..7a16d36f2c8 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2021-03-16 Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
+
+ * gdb.base/info-macros.exp: Append -fdebug-macro to
+ additional_flags for clang.
+ * gdb.base/macscp.exp: Likewise.
+ * gdb.base/style.exp: Likewise.
+ * gdb.linespec/macro-relative.exp: Likewise.
+
2021-03-12 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.python/py-bad-printers.exp: Extend test names to make them
diff --git a/gdb/testsuite/gdb.base/info-macros.exp b/gdb/testsuite/gdb.base/info-macros.exp
index 90da9dbe16d..c75229f80d9 100644
--- a/gdb/testsuite/gdb.base/info-macros.exp
+++ b/gdb/testsuite/gdb.base/info-macros.exp
@@ -22,15 +22,17 @@ if [using_fission] {
}
get_compiler_info
-if ![test_compiler_info gcc*] {
- untested "no compiler info"
- return -1
+if { [test_compiler_info gcc*] } {
+ # 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"
+} elseif { [test_compiler_info clang*] } {
+ set options "additional_flags=-fdebug-macro"
+} else {
+ untested "no compiler info"
+ return -1
}
-# 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 "failed to prepare" ${testfile} ${srcfile} $options] } {
return -1
}
diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp
index 724f7377b57..9d295ad20de 100644
--- a/gdb/testsuite/gdb.base/macscp.exp
+++ b/gdb/testsuite/gdb.base/macscp.exp
@@ -21,8 +21,10 @@ set objfile [standard_output_file ${testfile}.o]
set options { debug additional_flags=-DFROM_COMMANDLINE=ARG}
get_compiler_info
-if { [test_compiler_info "gcc-*"] || [test_compiler_info "clang-*"] } {
+if { [test_compiler_info "gcc-*"] } {
lappend options additional_flags=-g3
+} elseif { [test_compiler_info "clang-*"] } {
+ lappend options additional_flags=-fdebug-macro
}
# Generate the intermediate object file. This is required by Darwin to
diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp
index 0754c9daa49..4a3428bc63f 100644
--- a/gdb/testsuite/gdb.base/style.exp
+++ b/gdb/testsuite/gdb.base/style.exp
@@ -21,9 +21,12 @@ standard_testfile
set test_macros 0
set options debug
get_compiler_info
-if { [test_compiler_info "gcc-*"] || [test_compiler_info "clang-*"] } {
+if { [test_compiler_info "gcc-*"] } {
lappend options additional_flags=-g3
set test_macros 1
+} elseif { [test_compiler_info "clang-*"] } {
+ lappend options additional_flags=-fdebug-macro
+ set test_macros 1
}
if {[build_executable "failed to build" $testfile $srcfile $options]} {
diff --git a/gdb/testsuite/gdb.linespec/macro-relative.exp b/gdb/testsuite/gdb.linespec/macro-relative.exp
index 32375e5cb7c..c8e5b29d81f 100644
--- a/gdb/testsuite/gdb.linespec/macro-relative.exp
+++ b/gdb/testsuite/gdb.linespec/macro-relative.exp
@@ -31,6 +31,8 @@ set opts {debug additional_flags=-I.}
get_compiler_info
if [test_compiler_info gcc*] {
lappend opts additional_flags=-g3
+} elseif [test_compiler_info clang*] {
+ lappend opts additional_flags=-fdebug-macro
}
if { [file pathtype $objdir] == "relative" } {
--
2.17.1
next prev parent reply other threads:[~2021-03-16 5:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-10 15:45 Tomar, Sourabh Singh
2021-03-10 19:10 ` Tom Tromey
2021-03-12 5:38 ` Tomar, Sourabh Singh
2021-03-12 14:12 ` Tom Tromey
2021-03-15 5:47 ` Tomar, Sourabh Singh
2021-03-15 5:51 ` Tomar, Sourabh Singh
2021-03-15 19:40 ` Tom Tromey
2021-03-16 5:14 ` Tomar, Sourabh Singh [this message]
2021-03-19 5:43 ` Tomar, Sourabh Singh
2021-04-26 19:38 ` Simon Marchi
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=MW2PR12MB2474C201C21E9A743A790F4A9D6B9@MW2PR12MB2474.namprd12.prod.outlook.com \
--to=sourabhsingh.tomar@amd.com \
--cc=AlokKumar.Sharma@amd.com \
--cc=Bhuvanendra.KumarN@amd.com \
--cc=JiniSusan.George@amd.com \
--cc=Nagajyothi.E@amd.com \
--cc=Nitika.Achra@amd.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).