public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Macro info NOT accessible with GDB-trunk
@ 2021-05-17 16:35 Tomar, Sourabh Singh
  2021-05-17 16:51 ` Keith Seitz
  0 siblings, 1 reply; 8+ messages in thread
From: Tomar, Sourabh Singh @ 2021-05-17 16:35 UTC (permalink / raw)
  To: gdb
  Cc: George, Jini Susan, Sharma, Alok Kumar, Kumar N, Bhuvanendra,
	Achra, Nitika

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

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

end of thread, other threads:[~2021-10-06 16:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17 16:35 Macro info NOT accessible with GDB-trunk Tomar, Sourabh Singh
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

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