We want to reach array__fprintf() from here, with the class_member
name, as __tag__name() isn't handling arrays properly.
I.e. to print an array when we have its name we can't use __tag__name().
This also stops printing 0 for zero sized arrays and trows away the
extra DW_TAG_const_type that comes with zero sized arrays, where we
have:
class_member type: DW_TAG_const_type 1
DW_TAG_const_type 1: DW_TAG_array_type 2
DW_TAG_array_type 2: 0 entries, type: DW_TAG_const_type 3
DW_TAG_const_type 3: real type of the zero sized array
For instance, after this patch we get a sane reconstruction of this
type:
$ pahole -C filename /home/acme/git/build/v5.0-rc2+/ipc/mqueue.o
struct filename {
const char * name; /* 0 8 */
const char * uptr; /* 8 8 */
int refcnt; /* 16 4 */
/* XXX 4 bytes hole, try to pack */
struct audit_names * aname; /* 24 8 */
const char iname[]; /* 32 0 */
/* size: 32, cachelines: 1, members: 5 */
/* sum members: 28, holes: 1, sum holes: 4 */
/* last cacheline: 32 bytes */
};
$
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Build instructions:
1. install cmake
2. mkdir build
3. cd build
4. cmake -D__LIB=lib ..
5. make install
Default is to be installed on /usr/local, see rpm spec file for
installing on other places.
Known to work scenarios:
Mandriva Cooker:
cmake 2.4.5-1mdv2007.1
libelfutils1-devel 0.123-1mdv2007.1
Debian Unstable:
cmake 2.4.5-1
libdw-dev 0.123-2
Fedora Core 6:
cmake 2.4.5-2.fc6
elfutils-devel 0.126-1.fc6