Re: ANNOUNCE: pahole v1.12 (BTF edition)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 2018-08-16 22:09, Arnaldo Carvalho de Melo wrote:
>	After a long time without announces, here is pahole 1.12,
>available at:
>	Please report any problems to me, I'll try and get problems
>fixed and implement any nice suggestion you guys may have, time
>permitting 8-)

Some more fun with C++-related DWARF (see //expected again):


$ cat x.cpp
#include <memory>
#include <vector>
namespace N2 {
        struct Foo {
                char x;
        };
}
struct Bar {
        std::vector<std::vector<N2::Foo>> barlist;
        N2::Foo foo;
};
Bar barobj;
N2::Foo fooobj;

struct Base {};
struct Der1 : public virtual Base {};
struct Der2 : public virtual Base {};
struct Derived : Der1, Der2 {};
Derived d;



$ g++-7 x.cpp -ggdb3 -c && pahole x.o  | tail -n 80
//
// pahole says nothing about types in namespaces -- like N2::Foo (fooobj) at all.
//
die__process_class: tag not supported 0x2f (template_type_parameter)!
die__process_class: tag not supported 0x30 (template_value_parameter)!
dwarf_expr: unhandled 0x12 DW_OP_ operation
dwarf_expr: unhandled 0x12 DW_OP_ operation
struct Bar {
        class vector<std::vector<N2::Foo, std::allocator<N2::Foo> >, std::allocator<std::vector<N2::Foo, std::allocator<N2::Foo> > > > barlist; /*     0    24 */
	//pahole strips first namespace
	//expected: "class std::vector<std::vec...."

        struct Foo                 foo;                  /*    24     1 */
	//expected: "struct N2::Foo  foo;"
        void ~Bar(class Bar *, int);

        void Bar(class Bar *);


        /* size: 32, cachelines: 1, members: 2 */
        /* padding: 7 */
        /* last cacheline: 32 bytes */
};
struct Base {

        /* size: 1, cachelines: 0, members: 0 */
        /* last cacheline: 1 bytes */
};
struct Derived : Der1, Der2 {
        /* struct Der1                <ancestor>; */     /*     0     8 */
        /* struct Der2                <ancestor>; */     /*     8     8 */
        void ~Derived(class Derived *, int, const void  * *);

        void Derived(class Derived *, int, const void  * *, );

        void Derived(class Derived *, int, const void  * *, const class Derived  &);

        void Derived(class Derived *, int, const void  * *);


        /* size: 16, cachelines: 1, members: 2 */
        /* last cacheline: 16 bytes */

        /* BRAIN FART ALERT! 16 != 0 + 0(holes), diff = 16 */
	//expected: no alert

};
struct Der1 : virtual Base {
        /* --- cacheline 67108863 boundary (4294967232 bytes) was 63 bytes ago --- */
	//expected: not to integer underflow
        /* struct Base                <ancestor>; */     /* 4294967295     0 */
        int ()(void) * *           _vptr.Der1;           /*     0     8 */
	//expected: print as "int (**)(void)". It's how function pointers go in
	//C and C++.

        void ~Der1(class Der1 *, int, const void  * *);

        void Der1(class Der1 *, int, const void  * *, );

        void Der1(class Der1 *, int, const void  * *, const class Der1  &);

        void Der1(class Der1 *, int, const void  * *);


        /* size: 8, cachelines: 1, members: 2 */
        /* last cacheline: 8 bytes */
};
struct Der2 : virtual Base {
        /* --- cacheline 67108863 boundary (4294967232 bytes) was 63 bytes ago --- */
        /* struct Base                <ancestor>; */     /* 4294967295     0 */
        int ()(void) * *           _vptr.Der2;           /*     0     8 */
        void ~Der2(class Der2 *, int, const void  * *);

        void Der2(class Der2 *, int, const void  * *, );

        void Der2(class Der2 *, int, const void  * *, const class Der2  &);

        void Der2(class Der2 *, int, const void  * *);


        /* size: 8, cachelines: 1, members: 2 */
        /* last cacheline: 8 bytes */
};



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux