public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Tomar, Sourabh Singh" <SourabhSingh.Tomar@amd.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Cc: "George, Jini Susan" <JiniSusan.George@amd.com>,
	"Sharma, Alok Kumar" <AlokKumar.Sharma@amd.com>,
	"Kumar N, Bhuvanendra" <Bhuvanendra.KumarN@amd.com>,
	"Achra, Nitika" <Nitika.Achra@amd.com>
Subject: Macro info NOT accessible with GDB-trunk
Date: Mon, 17 May 2021 16:35:15 +0000	[thread overview]
Message-ID: <DM4PR12MB5295F5E3791614609A650A8D9D2D9@DM4PR12MB5295.namprd12.prod.outlook.com> (raw)

[AMD Public Use]

Hello Everyone,

With nearly-trunk based GDB, GDB is not able to show macro info for binaries compiled with
GCC & CLANG.

**NOTE**: It happens only for relative paths:
$tot-gcc -gdwarf-4 -g3 ./macro.c  // GDB able to show the 
OR
$clang -g -fdebug-macro ./macro.c  // -g defaults to Dwarfv4 in clang
GDB showing macro info **correctly**.

Details:
```
>llvm-dev>>>sourabh@llvm:~/work/dwarf/c_c++$ gdb --version
GNU gdb (GDB) 11.0.50.20210512-git
Using CLANG
>llvm-dev>>>sourabh@llvm:~/work/dwarf/c_c++$ clang --version
clang version 13.0.0 (https://github.com/llvm/llvm-project.git 5064a34165ccadf4718b2c159eff41f008261681)
>llvm-dev>>>sourabh@llvm:~/work/dwarf/c_c++$ clang -g -fdebug-macro macro.c
>llvm-dev>>>sourabh@llvm:~/work/dwarf/c_c++$ gdb a.out -q
Reading symbols from a.out...
(gdb) start
Temporary breakpoint 1 at 0x201664: file macro.c, line 2.
Starting program: /home/sourabh/work/dwarf/c_c++/a.out

Temporary breakpoint 1, main () at macro.c:2
2       int main() {}
(gdb) info macros
(gdb) q

Using GCC:
>llvm-dev>>>sourabh@llvm:~/work/dwarf/c_c++$ tot-gcc --version
gcc (GCC) 12.0.0 20210514 (experimental)
>llvm-dev>>>sourabh@llvm:~/work/dwarf/c_c++$ tot-gcc -gdwarf-4 -g3 macro.c
>llvm-dev>>>sourabh@llvm:~/work/dwarf/c_c++$ gdb a.out -q
Reading symbols from a.out...
(gdb) start
Temporary breakpoint 1 at 0x40048f: file macro.c, line 2.
Starting program: /home/sourabh/work/dwarf/c_c++/a.out

Temporary breakpoint 1, main () at macro.c:2
2       int main() {}
(gdb) info macros
(gdb) q
```
Can somebody please validate this ?

I wanted to know if anyone aware any macro related commit happened within last 10-20 days' time frame.
I'm investigating this, Any pointers greatly appreciated.

Thanks!
Sourabh.

             reply	other threads:[~2021-05-17 16:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 16:35 Tomar, Sourabh Singh [this message]
2021-05-17 16:51 ` Keith Seitz
2021-05-17 17:04   ` Tomar, Sourabh Singh
2021-05-17 17:17     ` Tomar, Sourabh Singh
2021-05-17 17:22     ` Keith Seitz
2021-09-16  4:18   ` Achra, Nitika
2021-10-04  3:46     ` Achra, Nitika
2021-10-06 16:11       ` Keith Seitz

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=DM4PR12MB5295F5E3791614609A650A8D9D2D9@DM4PR12MB5295.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=Nitika.Achra@amd.com \
    --cc=gdb@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).