public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/25137] import dwarf assembler from gdb testsuite
  2019-01-01  0:00 [Bug default/25137] New: import dwarf assembler from gdb testsuite vries at gcc dot gnu.org
@ 2019-01-01  0:00 ` vries at gcc dot gnu.org
  2019-01-01  0:00 ` vries at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: vries at gcc dot gnu.org @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz

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

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

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Dwarf assembler was imported as part of
https://sourceware.org/git/?p=dwz.git;a=commit;h=b07c725e62272d582039ff8b6052e3405f0914b5
.

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

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

* [Bug default/25137] import dwarf assembler from gdb testsuite
  2019-01-01  0:00 [Bug default/25137] New: import dwarf assembler from gdb testsuite vries at gcc dot gnu.org
  2019-01-01  0:00 ` [Bug default/25137] " vries at gcc dot gnu.org
@ 2019-01-01  0:00 ` vries at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: vries at gcc dot gnu.org @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #0)
> The dwz code handles certain cases that may not be triggered with current
> toolchains.
> 
> F.i. we have in partition_dups_1:
> ...
>                   /* If there are dups within a single CU                   
> 
>                      (arguably a bug in the DWARF producer),                
> 
>                      keep them linked together, but don't link              
> 
>                      DIEs across different CUs.  */
> ...
> 

I added an assert to detect this situation, and it didn't trigger in the
regular test suite, but it did in the external testsuite.

I've minimized this to:
...
struct a {
  int b;
};

void
foo1 (int x)
{
  struct a var[x];
}

void
foo2 (int y)
{
  struct a var[y];
}

int
main ()
{
  foo1 (5);
  foo2 (6);
  return 0;
}
...

And compiled as:
...
$ gcc-9 test.c -g
...

The duplicate is on the basis that the array types 0x16c and 0x1c2 have a
subrange with identical exprloc as DW_AT_upper_bound:
...
 <1><f4>: Abbrev Number: 2 (DW_TAG_structure_type)
    <f5>   DW_AT_name        : a
    <f7>   DW_AT_byte_size   : 4
    <f8>   DW_AT_decl_file   : 1
    <f9>   DW_AT_decl_line   : 1
    <fa>   DW_AT_decl_column : 8
    <fb>   DW_AT_sibling     : <0x10b>
 <2><ff>: Abbrev Number: 3 (DW_TAG_member)
    <100>   DW_AT_name        : b
    <102>   DW_AT_decl_file   : 1
    <103>   DW_AT_decl_line   : 2
    <104>   DW_AT_decl_column : 7
    <105>   DW_AT_type        : <0x10b>
    <109>   DW_AT_data_member_location: 0
 <2><10a>: Abbrev Number: 0
 <1><10b>: Abbrev Number: 4 (DW_TAG_base_type)
    <10c>   DW_AT_byte_size   : 4
    <10d>   DW_AT_encoding    : 5       (signed)
    <10e>   DW_AT_name        : int
 <1><130>: Abbrev Number: 6 (DW_TAG_subprogram)
    <131>   DW_AT_name        : (indirect string, offset: 0x237): foo2
 <1><16c>: Abbrev Number: 9 (DW_TAG_array_type)
    <16d>   DW_AT_type        : <0xf4>
    <171>   DW_AT_sibling     : <0x17f>
 <2><175>: Abbrev Number: 10 (DW_TAG_subrange_type)
    <176>   DW_AT_type        : <0x17f>
    <17a>   DW_AT_upper_bound : 3 byte block: 91 68 6   (DW_OP_fbreg: -24;
DW_OP_deref)
<1><17f>: Abbrev Number: 11 (DW_TAG_base_type)
    <180>   DW_AT_byte_size   : 8
    <181>   DW_AT_encoding    : 7       (unsigned)
    <182>   DW_AT_name        : (indirect string, offset: 0x53): long unsigned
int
 <1><186>: Abbrev Number: 6 (DW_TAG_subprogram)
    <187>   DW_AT_external    : 1
    <187>   DW_AT_name        : (indirect string, offset: 0x232): foo1
 <1><1c2>: Abbrev Number: 12 (DW_TAG_array_type)
    <1c3>   DW_AT_type        : <0xf4>
 <2><1c7>: Abbrev Number: 10 (DW_TAG_subrange_type)
    <1c8>   DW_AT_type        : <0x17f>
    <1cc>   DW_AT_upper_bound : 3 byte block: 91 68 6   (DW_OP_fbreg: -24;
DW_OP_deref)
...

I'm not sure that this qualifies as bug in DWARF producer.

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

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

* [Bug default/25137] New: import dwarf assembler from gdb testsuite
@ 2019-01-01  0:00 vries at gcc dot gnu.org
  2019-01-01  0:00 ` [Bug default/25137] " vries at gcc dot gnu.org
  2019-01-01  0:00 ` vries at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: vries at gcc dot gnu.org @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz

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

            Bug ID: 25137
           Summary: import dwarf assembler from gdb testsuite
           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: ---

The dwz code handles certain cases that may not be triggered with current
toolchains.

F.i. we have in partition_dups_1:
...
                  /* If there are dups within a single CU                       
                     (arguably a bug in the DWARF producer),                    
                     keep them linked together, but don't link                  
                     DIEs across different CUs.  */
...

It would be good to be able to construct test-cases with specific DWARF
constructs, which is possible using the dwarf assembler of the gdb testsuite.

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

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [Bug default/25137] New: import dwarf assembler from gdb testsuite vries at gcc dot gnu.org
2019-01-01  0:00 ` [Bug default/25137] " vries at gcc dot gnu.org
2019-01-01  0:00 ` 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).