public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/18706] New: GDB reports array size zero.
@ 2015-07-22 13:38 andre.poenitz at digia dot com
  2020-04-30 16:22 ` [Bug gdb/18706] " cvs-commit at gcc dot gnu.org
  2020-04-30 16:23 ` ssbssa at sourceware dot org
  0 siblings, 2 replies; 3+ messages in thread
From: andre.poenitz at digia dot com @ 2015-07-22 13:38 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 18706
           Summary: GDB reports array size zero.
           Product: gdb
           Version: 7.8
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: andre.poenitz at digia dot com
  Target Milestone: ---

Created attachment 8449
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8449&action=edit
Output of readelf -wi

Running the following:

------------------------------ begin run.sh -------------------------
cat > b.h <<EOT
struct Foo
{
    Foo() {}
    virtual ~Foo();
};
EOT

cat > b.cpp <<EOT
#include "b.h"

Foo::~Foo() {}
EOT

cat > a.cpp <<EOT
#include "b.h"

int main()
{
    Foo proc[14];
    return 0;
}
EOT


g++ -g a.cpp b.cpp
gdb -ex 'break a.cpp:6' -ex run -ex 'py print("SIZE: %s" %
gdb.parse_and_eval("proc").type.sizeof)' -ex quit -batch a.out
------------------------------ begin run.sh -------------------------

yields output "SIZE: 0", even if it should be positive.

Moving  the destructor inline or similar gives the correct result (112 on
x86_64)

-- 
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 gdb/18706] GDB reports array size zero.
  2015-07-22 13:38 [Bug gdb/18706] New: GDB reports array size zero andre.poenitz at digia dot com
@ 2020-04-30 16:22 ` cvs-commit at gcc dot gnu.org
  2020-04-30 16:23 ` ssbssa at sourceware dot org
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-30 16:22 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Hannes Domani <ssbssa@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ee9d1e5f76033cd8432713a76381ade76697df04

commit ee9d1e5f76033cd8432713a76381ade76697df04
Author: Hannes Domani <ssbssa@yahoo.de>
Date:   Mon Apr 27 13:14:24 2020 +0200

    Calculate size of array of stubbed type

    Sizes of stubbed types are calculated on demand in check_typedef, so the
    same must also be done for arrays of stubbed types.

    A stubbed type is usually a structure that has only been forward declared,
    but can also happen if the structure has a virtual function that's not
    inline in the class definition.

    For these stubbed types, the size must be recalculated once the full
    definition is available.

    gdb/ChangeLog:

    2020-04-30  Hannes Domani  <ssbssa@yahoo.de>

            PR gdb/18706
            * gdbtypes.c (check_typedef): Calculate size of array of
            stubbed type.

    gdb/testsuite/ChangeLog:

    2020-04-30  Hannes Domani  <ssbssa@yahoo.de>

            PR gdb/18706
            * gdb.cp/stub-array-size.cc: New test.
            * gdb.cp/stub-array-size.exp: New file.
            * gdb.cp/stub-array-size.h: New test.
            * gdb.cp/stub-array-size2.cc: New test.

-- 
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 gdb/18706] GDB reports array size zero.
  2015-07-22 13:38 [Bug gdb/18706] New: GDB reports array size zero andre.poenitz at digia dot com
  2020-04-30 16:22 ` [Bug gdb/18706] " cvs-commit at gcc dot gnu.org
@ 2020-04-30 16:23 ` ssbssa at sourceware dot org
  1 sibling, 0 replies; 3+ messages in thread
From: ssbssa at sourceware dot org @ 2020-04-30 16:23 UTC (permalink / raw)
  To: gdb-prs

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

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
                 CC|                            |ssbssa at sourceware dot org
   Target Milestone|---                         |10.1
             Status|NEW                         |RESOLVED

--- Comment #2 from Hannes Domani <ssbssa at sourceware dot org> ---
Fixed.

-- 
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:[~2020-04-30 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-22 13:38 [Bug gdb/18706] New: GDB reports array size zero andre.poenitz at digia dot com
2020-04-30 16:22 ` [Bug gdb/18706] " cvs-commit at gcc dot gnu.org
2020-04-30 16:23 ` ssbssa at sourceware 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).