public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [gdb.base] Enable macro test for clang compiler
@ 2021-03-10 15:45 Tomar, Sourabh Singh
  2021-03-10 19:10 ` Tom Tromey
  0 siblings, 1 reply; 10+ messages in thread
From: Tomar, Sourabh Singh @ 2021-03-10 15:45 UTC (permalink / raw)
  To: gdb-patches
  Cc: George, Jini Susan, Sharma, Alok Kumar, Achra, Nitika, Kumar N,
	 Bhuvanendra, E, Nagajyothi

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

[AMD Public Use]

Hi Everyone,

Requesting review on this patch, Please have a look.

Problem Description/Summary:
- clang compiler uses `-fdebug-macro` for the generating debug-info for macro's. Previously
Test `gdb/testsuite/gdb.base/macscp.exp` was appending `-g3` for `clang` compiler also. Resulting
In following error in `gdb.sum`:
```
UNSUPPORTED: gdb.base/macscp.exp: skipping test because debug information does not include macro 
information.
```
- This patch appends `-fdebug-macro` for clang compiler specifically.
- After this patch, above described error is resolved and all test cases are getting enabled and
tested with clang compiler.

gdb/testsuite/ChangeLog:

2021-03-10  Sourabh Singh Tomar  <SourabhSingh.Tomar@amd.com>

           * gdb.base/macscp.exp: Remove -g3 from additional_flags and
           append -fdebug-macro to additional_flags for clang.

Thank You so much!
Sourabh Singh Tomar

[-- Attachment #2: gdb.base-Enable-macro-test-for-clang-compiler.patch --]
[-- Type: application/octet-stream, Size: 2037 bytes --]

From 8982fb7a9507e15dfb77266f90c594b7c48e0321 Mon Sep 17 00:00:00 2001
From: Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
Date: Wed, 10 Mar 2021 20:27:22 +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-10  Sourabh Singh Tomar  <SourabhSingh.Tomar@amd.com>

       * gdb.base/macscp.exp: Remove -g3 from additional_flags and
       append -fdebug-macro to additional_flags for clang.
---
 gdb/testsuite/ChangeLog           | 5 +++++
 gdb/testsuite/gdb.base/macscp.exp | 7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 5767fa562c6..56653a25251 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -10902,6 +10902,11 @@
 
 	* gdb.base/macscp.exp: Append -g3 to additional_flags for clang.
 
+2021-03-10  Sourabh Singh Tomar  <SourabhSingh.Tomar@amd.com>
+
+	* gdb.base/macscp.exp: Remove -g3 from additional_flags and
+	append -fdebug-macro to additional_flags for clang.
+
 2017-11-22  Simon Marchi  <simon.marchi@ericsson.com>
 
 	* gdb.opt/inline-locals.exp: Mark tests as KFAIL.
diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp
index 724f7377b57..cbbdab526a4 100644
--- a/gdb/testsuite/gdb.base/macscp.exp
+++ b/gdb/testsuite/gdb.base/macscp.exp
@@ -21,10 +21,15 @@ 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
 }
 
+get_compiler_info
+if { [test_compiler_info "clang-*"] } {
+    lappend options additional_flags=-fdebug-macro
+}
+
 # Generate the intermediate object file.  This is required by Darwin to
 # have access to the .debug_macinfo section.
 if  {[gdb_compile "${srcdir}/${subdir}/macscp1.c" "${objfile}" \
-- 
2.17.1


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

end of thread, other threads:[~2021-04-26 19:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 15:45 [PATCH] [gdb.base] Enable macro test for clang compiler 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
2021-03-19  5:43               ` Tomar, Sourabh Singh
2021-04-26 19:38               ` Simon Marchi

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).