public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug libdw/29711] New: In libdw.h struct Dwarf, struct Dwarf_Abbrev is defined using typedef and not using #include <libdwP.h> is not the way to comply with the specification?
@ 2022-10-21  1:30 zhuorong.lin at outlook dot com
  2022-10-21  1:44 ` [Bug libdw/29711] " fche at redhat dot com
  2022-10-27 21:30 ` mark at klomp dot org
  0 siblings, 2 replies; 3+ messages in thread
From: zhuorong.lin at outlook dot com @ 2022-10-21  1:30 UTC (permalink / raw)
  To: elfutils-devel

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

            Bug ID: 29711
           Summary: In libdw.h struct Dwarf, struct Dwarf_Abbrev is
                    defined using typedef and not using #include
                    <libdwP.h> is not the way to comply with the
                    specification?
           Product: elfutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libdw
          Assignee: unassigned at sourceware dot org
          Reporter: zhuorong.lin at outlook dot com
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

Is directly typedef an undefined struct not in compliance with the
specification.

libdw.h
```
typedef struct Dwarf_Abbrev Dwarf_Abbrev;

/* Returned to show the last DIE has be returned.  */
#define DWARF_END_ABBREV ((Dwarf_Abbrev *) -1l)

/* Source code line information for CU.  */
typedef struct Dwarf_Lines_s Dwarf_Lines;

/* One source code line information.  */
typedef struct Dwarf_Line_s Dwarf_Line;

/* Source file information.  */
typedef struct Dwarf_Files_s Dwarf_Files;

/* One address range record.  */
typedef struct Dwarf_Arange_s Dwarf_Arange;

/* Address ranges of a file.  */
typedef struct Dwarf_Aranges_s Dwarf_Aranges;
```

libdwP.h
```

/* Abbreviation representation.  */
struct Dwarf_Abbrev
{
  Dwarf_Off offset;       /* Offset to start of abbrev into .debug_abbrev.  */
  unsigned char *attrp;   /* Pointer to start of attribute name/form pairs. */
  bool has_children : 1;  /* Whether or not the DIE has children. */
  unsigned int code : 31; /* The (unique) abbrev code.  */
  unsigned int tag;       /* The tag of the DIE. */
} attribute_packed;

#include "dwarf_abbrev_hash.h"


/* Files in line information records.  */
struct Dwarf_Files_s
  {
    unsigned int ndirs;
    unsigned int nfiles;
    struct Dwarf_Fileinfo_s
    {
      char *name;
      Dwarf_Word mtime;
      Dwarf_Word length;
    } info[0];
    /* nfiles of those, followed by char *[ndirs].  */
  };
typedef struct Dwarf_Fileinfo_s Dwarf_Fileinfo;


/* Representation of a row in the line table.  */

struct Dwarf_Line_s
{
  Dwarf_Files *files;

  Dwarf_Addr addr;
  unsigned int file;
  int line;
  unsigned short int column;
  unsigned int is_stmt:1;
  unsigned int basic_block:1;
  unsigned int end_sequence:1;
  unsigned int prologue_end:1;
  unsigned int epilogue_begin:1;
  /* The remaining bit fields are not flags, but hold values presumed to be
     small.  All the flags and other bit fields should add up to 48 bits
     to give the whole struct a nice round size.  */
  unsigned int op_index:8;
  unsigned int isa:8;
  unsigned int discriminator:24;
};

struct Dwarf_Lines_s
{
  size_t nlines;
  struct Dwarf_Line_s info[0];
};
```

-- 
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 libdw/29711] In libdw.h struct Dwarf, struct Dwarf_Abbrev is defined using typedef and not using #include <libdwP.h> is not the way to comply with the specification?
  2022-10-21  1:30 [Bug libdw/29711] New: In libdw.h struct Dwarf, struct Dwarf_Abbrev is defined using typedef and not using #include <libdwP.h> is not the way to comply with the specification? zhuorong.lin at outlook dot com
@ 2022-10-21  1:44 ` fche at redhat dot com
  2022-10-27 21:30 ` mark at klomp dot org
  1 sibling, 0 replies; 3+ messages in thread
From: fche at redhat dot com @ 2022-10-21  1:44 UTC (permalink / raw)
  To: elfutils-devel

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

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2022-10-21
     Ever confirmed|0                           |1
                 CC|                            |fche at redhat dot com

--- Comment #1 from Frank Ch. Eigler <fche at redhat dot com> ---
No specification requires elfutils to provide an other than forward declaration
of these types.  Keeping the definitions private is fine, given that opaque
pointers are used in the various libdw* api calls to clients.

-- 
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 libdw/29711] In libdw.h struct Dwarf, struct Dwarf_Abbrev is defined using typedef and not using #include <libdwP.h> is not the way to comply with the specification?
  2022-10-21  1:30 [Bug libdw/29711] New: In libdw.h struct Dwarf, struct Dwarf_Abbrev is defined using typedef and not using #include <libdwP.h> is not the way to comply with the specification? zhuorong.lin at outlook dot com
  2022-10-21  1:44 ` [Bug libdw/29711] " fche at redhat dot com
@ 2022-10-27 21:30 ` mark at klomp dot org
  1 sibling, 0 replies; 3+ messages in thread
From: mark at klomp dot org @ 2022-10-27 21:30 UTC (permalink / raw)
  To: elfutils-devel

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

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
                 CC|                            |mark at klomp dot org
         Resolution|---                         |NOTABUG

-- 
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:[~2022-10-27 21:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21  1:30 [Bug libdw/29711] New: In libdw.h struct Dwarf, struct Dwarf_Abbrev is defined using typedef and not using #include <libdwP.h> is not the way to comply with the specification? zhuorong.lin at outlook dot com
2022-10-21  1:44 ` [Bug libdw/29711] " fche at redhat dot com
2022-10-27 21:30 ` mark at klomp dot 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).