This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/18706] New: GDB reports array size zero.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]