public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/27368] New: [dwz, dwarf5] Handle .debug_macro version 5
@ 2021-02-08 10:51 vries at gcc dot gnu.org
  2021-02-08 10:54 ` [Bug default/27368] " vries at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-08 10:51 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=27368

            Bug ID: 27368
           Summary: [dwz, dwarf5] Handle .debug_macro version 5
           Product: dwz
           Version: unspecified
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: default
          Assignee: nobody at sourceware dot org
          Reporter: vries at gcc dot gnu.org
                CC: dwz at sourceware dot org
  Target Milestone: ---

When doing:
...
$ make clean; make check CC="gcc -ggdb3"
...
I get:
...
dwz: 1: Unhandled .debug_macro version 5
dwz: 2: Unhandled .debug_macro version 5
dwz: No suitable DWARF found for multifile optimization
FAIL: testsuite/dwz.tests/multifile.sh
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug default/27368] [dwz, dwarf5] Handle .debug_macro version 5
  2021-02-08 10:51 [Bug default/27368] New: [dwz, dwarf5] Handle .debug_macro version 5 vries at gcc dot gnu.org
@ 2021-02-08 10:54 ` vries at gcc dot gnu.org
  2021-02-08 10:55 ` vries at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-08 10:54 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=27368

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
> $ make clean; make check CC="gcc -ggdb3"

Should have been:
...
$ make clean; make check CC="gcc -ggdb3 -gdwarf-5"                              
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug default/27368] [dwz, dwarf5] Handle .debug_macro version 5
  2021-02-08 10:51 [Bug default/27368] New: [dwz, dwarf5] Handle .debug_macro version 5 vries at gcc dot gnu.org
  2021-02-08 10:54 ` [Bug default/27368] " vries at gcc dot gnu.org
@ 2021-02-08 10:55 ` vries at gcc dot gnu.org
  2021-02-08 10:57 ` jakub at redhat dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-08 10:55 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=27368

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Using:
...
$ git diff
diff --git a/dwz.c b/dwz.c
index 10860bf..5b5be1b 100644
--- a/dwz.c
+++ b/dwz.c
@@ -9844,7 +9844,8 @@ read_macro (DSO *dso)
        }

       version = read_16 (ptr);
-      if (version != 4)
+      bool supported_version_p = 4 <= version && version <= 5;
+      if (!supported_version_p)
        {
          error (0, 0, "%s: Unhandled .debug_macro version %d", dso->filename,
                 version);
...
I get:
...
                === dwz Summary ===

# of expected passes            63
# of unsupported tests          1
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug default/27368] [dwz, dwarf5] Handle .debug_macro version 5
  2021-02-08 10:51 [Bug default/27368] New: [dwz, dwarf5] Handle .debug_macro version 5 vries at gcc dot gnu.org
  2021-02-08 10:54 ` [Bug default/27368] " vries at gcc dot gnu.org
  2021-02-08 10:55 ` vries at gcc dot gnu.org
@ 2021-02-08 10:57 ` jakub at redhat dot com
  2021-02-08 11:28 ` vries at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at redhat dot com @ 2021-02-08 10:57 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=27368

Jakub Jelinek <jakub at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at redhat dot com

--- Comment #3 from Jakub Jelinek <jakub at redhat dot com> ---
I'm not sure I like the 4 <= version operand order, can't you just do
if (version < 4 || version > 5)
?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug default/27368] [dwz, dwarf5] Handle .debug_macro version 5
  2021-02-08 10:51 [Bug default/27368] New: [dwz, dwarf5] Handle .debug_macro version 5 vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-02-08 10:57 ` jakub at redhat dot com
@ 2021-02-08 11:28 ` vries at gcc dot gnu.org
  2021-02-08 11:36 ` jakub at redhat dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-08 11:28 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=27368

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> I'm not sure I like the 4 <= version operand order, can't you just do
> if (version < 4 || version > 5)
> ?

I can, of course.

But I don't like that one.  My feeling is that the supported_version_p is
easier to read, and requires less mental arithmetic.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug default/27368] [dwz, dwarf5] Handle .debug_macro version 5
  2021-02-08 10:51 [Bug default/27368] New: [dwz, dwarf5] Handle .debug_macro version 5 vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-02-08 11:28 ` vries at gcc dot gnu.org
@ 2021-02-08 11:36 ` jakub at redhat dot com
  2021-02-08 11:43 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at redhat dot com @ 2021-02-08 11:36 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=27368

--- Comment #5 from Jakub Jelinek <jakub at redhat dot com> ---
I'm fine with the temporary variable, but can you swap the operands on 4 <=
version at least?  At least in GCC we want constants on the rhs of comparisons
and dwz follows or used to follow that.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug default/27368] [dwz, dwarf5] Handle .debug_macro version 5
  2021-02-08 10:51 [Bug default/27368] New: [dwz, dwarf5] Handle .debug_macro version 5 vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-02-08 11:36 ` jakub at redhat dot com
@ 2021-02-08 11:43 ` vries at gcc dot gnu.org
  2021-02-08 14:39 ` mark at klomp dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-08 11:43 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=27368

--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #5)
> I'm fine with the temporary variable, but can you swap the operands on 4 <=
> version at least?  At least in GCC we want constants on the rhs of
> comparisons and dwz follows or used to follow that.

Ah, I see.  Sure, will do.

FWIW, I like this notation:
...
  4 <= version && version <= 5
...
because it most closely mimics:
...
  4 <= version <= 5
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug default/27368] [dwz, dwarf5] Handle .debug_macro version 5
  2021-02-08 10:51 [Bug default/27368] New: [dwz, dwarf5] Handle .debug_macro version 5 vries at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-02-08 11:43 ` vries at gcc dot gnu.org
@ 2021-02-08 14:39 ` mark at klomp dot org
  2021-02-09  7:36 ` vries at gcc dot gnu.org
  2021-02-09  7:42 ` vries at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: mark at klomp dot org @ 2021-02-08 14:39 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=27368

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at klomp dot org

--- Comment #7 from Mark Wielaard <mark at klomp dot org> ---
The version check should be fine.
My preference would simply be version != 4 && version !=5.

This should fine as is with GCC DWARF5 since:

    DW_MACRO_GNU_define ==              DW_MACRO_define
    DW_MACRO_GNU_undef ==               DW_MACRO_undef
    DW_MACRO_GNU_start_file ==          DW_MACRO_start_file
    DW_MACRO_GNU_end_file ==            DW_MACRO_end_file
    DW_MACRO_GNU_define_indirect ==     DW_MACRO_define_strp
    DW_MACRO_GNU_undef_indirect ==      DW_MACRO_undef_strp
    DW_MACRO_GNU_transparent_include == DW_MACRO_import

That leaves:

    DW_MACRO_define_strx
    DW_MACRO_undef_strx

But those are never generated by GCC (see also DW_FORM_strx[1234] support).

dwz itself could generate (probably behind a --dwarf5 flag):

    DW_MACRO_define_sup
    DW_MACRO_undef_sup
    DW_MACRO_import_sup

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug default/27368] [dwz, dwarf5] Handle .debug_macro version 5
  2021-02-08 10:51 [Bug default/27368] New: [dwz, dwarf5] Handle .debug_macro version 5 vries at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2021-02-08 14:39 ` mark at klomp dot org
@ 2021-02-09  7:36 ` vries at gcc dot gnu.org
  2021-02-09  7:42 ` vries at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-09  7:36 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=27368

--- Comment #8 from Tom de Vries <vries at gcc dot gnu.org> ---
Patch allowing version 5 .debug_macro committed:

https://sourceware.org/git/?p=dwz.git;a=commit;h=b2e260969ad591ac1b46ea05dc3df4a73a4b4796

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug default/27368] [dwz, dwarf5] Handle .debug_macro version 5
  2021-02-08 10:51 [Bug default/27368] New: [dwz, dwarf5] Handle .debug_macro version 5 vries at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2021-02-09  7:36 ` vries at gcc dot gnu.org
@ 2021-02-09  7:42 ` vries at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-09  7:42 UTC (permalink / raw)
  To: dwz

https://sourceware.org/bugzilla/show_bug.cgi?id=27368

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #9 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Mark Wielaard from comment #7)
> The version check should be fine.
> My preference would simply be version != 4 && version !=5.
> 
> This should fine as is with GCC DWARF5 since:
> 
>     DW_MACRO_GNU_define ==              DW_MACRO_define
>     DW_MACRO_GNU_undef ==               DW_MACRO_undef
>     DW_MACRO_GNU_start_file ==          DW_MACRO_start_file
>     DW_MACRO_GNU_end_file ==            DW_MACRO_end_file
>     DW_MACRO_GNU_define_indirect ==     DW_MACRO_define_strp
>     DW_MACRO_GNU_undef_indirect ==      DW_MACRO_undef_strp
>     DW_MACRO_GNU_transparent_include == DW_MACRO_import
> 
> That leaves:
> 
>     DW_MACRO_define_strx
>     DW_MACRO_undef_strx
> 
> But those are never generated by GCC (see also DW_FORM_strx[1234] support).
> 
> dwz itself could generate (probably behind a --dwarf5 flag):
> 
>     DW_MACRO_define_sup
>     DW_MACRO_undef_sup
>     DW_MACRO_import_sup

Thanks for the detailed explanation.

I'm closing this PR, since I understand from this that .debug_macro 5 is now
sufficiently supported.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2021-02-09  7:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 10:51 [Bug default/27368] New: [dwz, dwarf5] Handle .debug_macro version 5 vries at gcc dot gnu.org
2021-02-08 10:54 ` [Bug default/27368] " vries at gcc dot gnu.org
2021-02-08 10:55 ` vries at gcc dot gnu.org
2021-02-08 10:57 ` jakub at redhat dot com
2021-02-08 11:28 ` vries at gcc dot gnu.org
2021-02-08 11:36 ` jakub at redhat dot com
2021-02-08 11:43 ` vries at gcc dot gnu.org
2021-02-08 14:39 ` mark at klomp dot org
2021-02-09  7:36 ` vries at gcc dot gnu.org
2021-02-09  7:42 ` vries at gcc dot gnu.org

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