From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9856A3858C98; Thu, 16 May 2024 10:34:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9856A3858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1715855679; bh=+mc0fKIWS+KBviOWNh5N4p/ncRmb/AVRaLuWG+LSeBo=; h=From:To:Subject:Date:From; b=Onl/mZR4GBDgKjhAdiveDTRyxujYe5Yk1uhPjFFB7y0SjRmnnkZaHf7d/9mho2sx3 1fNp7g+/H9whvGIqgzKHxy1IEorUbMPwwWLk6gjRPd02Q/+1AFQTG+h9dvJEAYCSoR YOSic9IQER9tG8sc6/l7C4lpsqAh+VrHA8wqGypc= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/31745] New: [gdb/symtab] Can't print pre-defined macros with binaries built with clang -save-temps Date: Thu, 16 May 2024 10:34:39 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31745 Bug ID: 31745 Summary: [gdb/symtab] Can't print pre-defined macros with binaries built with clang -save-temps Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: symtab Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- Consider a hello world compiled with clang: ... $ clang-15 -gdwarf-5 -g3 -fdebug-macro ~/data/hello.c ... Printing a pre-defined macro works fine (thanks to commit e7e7469e7a3 "gdb:= Fix issue with Clang CLI macros", the fix for PR29034): ... $ gdb -q -batch a.out -ex start -ex "p __DBL_MAX__" Temporary breakpoint 1 at 0x6af: file /home/vries/data/hello.c, line 6. Temporary breakpoint 1, main () at /home/vries/data/hello.c:6 6 printf ("hello\n"); $1 =3D 1.7976931348623157e+308 ... However, if we add -save-temps: ... $ clang-15 -gdwarf-5 -g3 -fdebug-macro ~/data/hello.c -save-temps hello.s:4:2: warning: inconsistent use of MD5 checksums .file 1 "/home/vries" "data/hello.c" ^ ... we get: ... $ gdb -q -batch a.out -ex start -ex "p __DBL_MAX__" Temporary breakpoint 1 at 0x6af: file /home/vries/data/hello.c, line 6. Temporary breakpoint 1, main () at /home/vries/data/hello.c:6 6 printf ("hello\n"); No symbol "__DBL_MAX__" in current context. ... It's possible something is wrong with the debug info, so let's try to see w= hat lldb does: ... $ lldb -b a.out -o "b main" -o run -o "print __DBL_MAX__" (lldb) target create "a.out" Current executable set to '/home/vries/gcc/a.out' (x86_64). (lldb) b main Breakpoint 1: where =3D a.out`main + 15 at hello.c:6:3, address =3D 0x00000000000006af (lldb) run Process 10477 stopped * thread #1, name =3D 'a.out', stop reason =3D breakpoint 1.1 frame #0: 0x00005555555546af a.out`main at hello.c:6:3 3 int 4 main (void) 5 { -> 6 printf ("hello\n"); 7 return 0; 8 } Process 10477 launched: '/home/vries/gcc/a.out' (x86_64) (lldb) print __DBL_MAX__ (double) $0 =3D 1.7976931348623157E+308 ... It has no problems getting the info, which would suggest that gdb could be fixed as well. --=20 You are receiving this mail because: You are on the CC list for the bug.=