Commit Graph

389 Commits

Author SHA1 Message Date
Arnaldo Carvalho de Melo 907831071f [LIB]: Make tag__print support DW_TAG_subprogram
Calling function__print.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-12 16:19:13 -02:00
Arnaldo Carvalho de Melo 26747d0053 [LIB]: Don't print the decl info in function__print
Its up to its callers, that will be moot soon as tag__print will call
function__print and as it already prints the decl info it'll be just a matter
of making all the function__print callers call tag__print instead and then
function__print will be unexported.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-12 16:17:53 -02:00
Arnaldo Carvalho de Melo df1832ac4f [LIB]: Introduce tag__print_decl_info
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-12 16:11:37 -02:00
Arnaldo Carvalho de Melo c1f96237b3 [LIB]: Remove unused variables in function__print
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-12 16:03:38 -02:00
Arnaldo Carvalho de Melo 3fe4f09a27 [LIB]: Move the stats printing bits out of function__print
Moving them to a new function, function__print_stats.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-12 16:00:07 -02:00
Arnaldo Carvalho de Melo d385563a53 [LIB]: Make the function methods return and receive a struct tag
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-12 15:47:26 -02:00
Arnaldo Carvalho de Melo 458e7d6867 [LIB]: Call enumeration__print in tag__print
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-12 15:24:41 -02:00
Arnaldo Carvalho de Melo 18703f8d3c [LIB]: Call typedef__print in tag__print
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-12 15:13:38 -02:00
Arnaldo Carvalho de Melo bc58353565 [LIB]: Pass prefix and suffix to class__snprintf in class__print
Fixing a regression introduced when doing the class__snprintf introduction out
of class__print, namely this one:

--- ctracer_sock.c.old  2007-01-12 14:57:56.000000000 -0200
+++ ctracer.c   2007-01-12 15:00:21.000000000 -0200
@@ -1668,7 +1668,7 @@
 };

   /* /pub/scm/linux/kernel/git/acme/linux-2.6/include/linux/fs.h:1050 */
  -struct {
  +typedef struct {
          size_t              written;     /*     0     4 */
          size_t              count;       /*     4     4 */
          union {
  @@ -1676,7 +1676,7 @@
                  void *      data;        /*           4 */
          } arg;                           /*     8     4 */
          int                 error;       /*    12     4 */
  -}; /* size: 16, cachelines: 1 */
  +} read_descriptor_t; /* size: 16, cachelines: 1 */
      /* last cacheline: 16 bytes */

   typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *, unsigned int, size_t);

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-12 15:03:59 -02:00
Arnaldo Carvalho de Melo 0661f26f9f [LIB]: Call cus__emit_ftype_definitions for DW_TAG_subroutine_type in cus__emit_tag_definitions
Thus emitting definitions/forward declarations for the types of function
pointers, not just for the return type of the function pointer.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-12 14:39:26 -02:00
Arnaldo Carvalho de Melo 0905197862 [LIB]: Create typedef__print out of cus__emit_typedef_definitions
This way cus__emit_typedef_definitions first looks for definitions in the
typedef that will be emitted, emits those definitions, then prints the typedef.

With this it'll be possible to make tag__print to print typedefs, when we know
that the definitions it needs were already previously emitted/printed.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-12 13:04:05 -02:00
Arnaldo Carvalho de Melo 0281ee673c [RPM]: New relase with the DW_TAG_reference work
Available at:

http://oops.ghostprotocols.net:81/acme/dwarves/rpm/

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-12 11:42:57 -02:00
Arnaldo Carvalho de Melo a1f5422656 [LIB]: Add support for DW_TAG_reference_type
One more C++ feature supported:

[acme@newtoy examples]$ pahole qsettings.o QConfFileSettingsPrivate
/* io/qsettings_p.h:233 */
struct QConfFileSettingsPrivate {
        struct QSettingsPrivate (null);               /*     0    76 */
        /* --- cacheline 2 boundary (64 bytes) was 12 bytes ago --- */
        class QConfFile *       confFiles[4];         /*    76    16 */
        enum Format             format;               /*    92     4 */
        /* --- cacheline 3 boundary (96 bytes) --- */
        bool                    (*readFunc)(class QIODevice &, class QMap<QString,QVariant> &); /*    96     4 */
        bool                    (*writeFunc)(class QIODevice &, const class QMap<QString,QVariant>  &); /*   100     4 */
        struct QString          extension;            /*   104     4 */
        >>>ERROR: type for caseSensitivity not found!
}; /* size: 112, cachelines: 4 */
   /* padding: 5 */
   /* last cacheline: 16 bytes */

/* BRAIN FART ALERT! 112 != 108 + 0(holes), diff = 4 */

[acme@newtoy examples]$

Now to see the problem with caseSensitivity type, probably was defined inside
some DW_TAG_namespace, that is not yet supported.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-12 11:06:59 -02:00
Arnaldo Carvalho de Melo 81f16372eb [RPM]: Add description tag contents
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-12 11:04:54 -02:00
Arnaldo Carvalho de Melo 0ad467a321 [LIB]: Replace type not found asserts by an error message
So that we can continue and see what was the problem, investigate using readelf
-wi and proceed to fix it, normally its just references to not yet supported
tags, so far the ones I know are not supported are DW_TAG_reference_type &
DW_TAG_namespace, i.e. tags not present in the C language, only on C++ and
other object oriented routines with such concepts.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-11 23:09:06 -02:00
Arnaldo Carvalho de Melo 04d65d98ff [PAHOLE]: Add a verbose command line option
For now it just affects showing differences in definitions of structs with the
same name found in different object files, that could be a real problem but
could as well be just a namespace colision not affecting the project's build
process as they were be local to specific objects.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-11 22:11:31 -02:00
Arnaldo Carvalho de Melo 0e99883168 [RPM]: Add a spec file to build a rpm file
Quick instructions:

[acme@newtoy pahole]$ pwd
/home/acme/pahole
[acme@newtoy pahole]$ mkdir -p rpm/{BUILD,RPMS/i586,SOURCES,SRPMS}
[acme@newtoy pahole]$ tar cfj rpm/SOURCES/pahole-0.tar.bz2 $(cat MANIFEST)
[acme@newtoy pahole]$ rpmbuild --define "_topdir /home/acme/pahole/rpm" -v -ba rpm/SPECS/dwarves.spec
<SNIP>
Wrote: /home/acme/pahole/rpm/SRPMS/dwarves-0-1.src.rpm
Wrote: /home/acme/pahole/rpm/RPMS/i586/dwarves-0-1.i586.rpm
Wrote: /home/acme/pahole/rpm/RPMS/i586/libdwarves1-0-1.i586.rpm
Wrote: /home/acme/pahole/rpm/RPMS/i586/libdwarves-devel-0-1.i586.rpm
Wrote: /home/acme/pahole/rpm/RPMS/i586/dwarves-debug-0-1.i586.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.37631
+ umask 022
+ cd /home/acme/pahole/rpm/BUILD
+ cd dwarves-0
+ rm -rf /var/tmp/dwarves-0-root
+ exit 0
[acme@newtoy pahole]$

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-11 16:50:26 -02:00
Arnaldo Carvalho de Melo e988381a48 [MANIFEST]: Add a MANIFEST file to use when building the tarball
[acme@newtoy pahole]$ tar cvfj rpm/SOURCES/pahole-0.tar.bz2 $(cat MANIFEST)

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-11 16:43:18 -02:00
Arnaldo Carvalho de Melo c916ae4a99 [CMAKE]: Add the INSTALL rules
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-11 16:41:54 -02:00
Arnaldo Carvalho de Melo 30b6aa2f73 [LIB]: Rename classes.[ch] to dwarves.[ch]
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-11 16:07:05 -02:00
Arnaldo Carvalho de Melo 7339f61868 [CMAKE]: Set a SONAME for libdwarves
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-11 16:04:22 -02:00
Arnaldo Carvalho de Melo 24842ef908 [CMAKE]: Rerename the library, this time to libdwarves
To avoid a problem in CMakeLists.txt where the lib and the pahole binary
targets had the same name, leading to the binary not being built, and its a
much cooler name anyway.

Thanks to Leonardo Chiquitto for the suggestion he gave on the #dwarves
channel!

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-11 15:28:08 -02:00
Arnaldo Carvalho de Melo 56f8ddb318 [CMAKE]: Rename libsoname.so to libpahole.so
Next cset will specify a soname, then a rpm specfile will be added.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-11 13:41:28 -02:00
Arnaldo Carvalho de Melo 5410d62210 [CLASSES]: Ditch union__print, not used at all
[acme@newtoy pahole]$ codiff -V build/libclasses.so.orig build/libclasses.so
/home/acme/pahole/classes.c:
  union__print | -198 (removed)
 1 function changed, 198 bytes removed
[acme@newtoy pahole]$

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-10 19:48:46 -02:00
Arnaldo Carvalho de Melo 465c4978b7 [CLASSES]: Fully support nested classes
Example:

[acme@newtoy pahole]$ pahole net/ipv4/tcp.o flowi
/* include/net/flow.h:13 */
struct flowi {
	int                        oif;                  /*     0     4 */
	int                        iif;                  /*     4     4 */
	__u32                      mark;                 /*     8     4 */
	union {
		struct {
			__be32     daddr;                /*     0     4 */
			__be32     saddr;                /*     4     4 */
			__u8       tos;                  /*     8     1 */
			__u8       scope;                /*     9     1 */
		} ip4_u;                                 /*          12 */
		struct {
			struct in6_addr daddr;           /*     0    16 */
			struct in6_addr saddr;           /*    16    16 */
			/* --- cacheline 1 boundary (32 bytes) --- */
			__be32     flowlabel;            /*    32     4 */
		} ip6_u;                                 /*          36 */
		struct {
			__le16     daddr;                /*     0     2 */
			__le16     saddr;                /*     2     2 */
			__u8       scope;                /*     4     1 */
		} dn_u;                                  /*           6 */
	} nl_u;                                          /*    12    36 */
	/* --- cacheline 1 boundary (32 bytes) was 16 bytes ago --- */
	__u8                       proto;                /*    48     1 */
	__u8                       flags;                /*    49     1 */

	/* XXX 2 bytes hole, try to pack */

	union {
		struct {
			__be16     sport;                /*     0     2 */
			__be16     dport;                /*     2     2 */
		} ports;                                 /*           4 */
		struct {
			__u8       type;                 /*     0     1 */
			__u8       code;                 /*     1     1 */
		} icmpt;                                 /*           2 */
		struct {
			__le16     sport;                /*     0     2 */
			__le16     dport;                /*     2     2 */
		} dnports;                               /*           4 */
		__be32             spi;                  /*           4 */
	} uli_u;                                         /*    52     4 */
	__u32                      secid;                /*    56     4 */
}; /* size: 60, cachelines: 2 */
   /* sum members: 58, holes: 1, sum holes: 2 */
   /* last cacheline: 28 bytes */

Supporting anonymous structs and unions just fine, even combinations of both,
like in struct page, in the Linux kernel:

[acme@newtoy pahole]$ pahole mm/mmap.o page
/* include/linux/mmzone.h:391 */
struct page {
	long unsigned int          flags;                /*     0     4 */
	atomic_t                   _count;               /*     4     4 */
	atomic_t                   _mapcount;            /*     8     4 */
	union {
		struct {
			long unsigned int private;       /*     0     4 */
			struct address_space * mapping;  /*     4     4 */
		};                                       /*           8 */
	};                                               /*    12     8 */
	long unsigned int          index;                /*    20     4 */
	struct list_head           lru;                  /*    24     8 */
	/* --- cacheline 1 boundary (32 bytes) --- */
}; /* size: 32, cachelines: 1 */

Or struct freebsd_sys_getdents_args in the OpenBSD kernel:

/* /usr/home/leonardo/openbsd/src/sys/compat/freebsd/freebsd_syscallargs.h:231 */
struct freebsd_sys_getdents_args {
	union {
		register_t         pad;                  /*           4 */
		struct {
			int        datum;                /*     0     4 */
		} le;                                    /*           4 */
		struct {
			int8_t     pad[0];               /*     0     0 */
			int        datum;                /*     0     4 */
		} be;                                    /*           4 */
	} fd;                                            /*     0     4 */
	union {
		register_t         pad;                  /*           4 */
		struct {
			void *     datum;                /*     0     4 */
		} le;                                    /*           4 */
		struct {
			int8_t     pad[0];               /*     0     0 */
			void *     datum;                /*     0     4 */
		} be;                                    /*           4 */
	} dirent;                                        /*     4     4 */
	union {
		register_t         pad;                  /*           4 */
		struct {
			unsigned int datum;              /*     0     4 */
		} le;                                    /*           4 */
		struct {
			int8_t     pad[0];               /*     0     0 */
			unsigned int datum;              /*     0     4 */
		} be;                                    /*           4 */
	} count;                                         /*     8     4 */
}; /* size: 12, cachelines: 1 */
   /* last cacheline: 12 bytes */
   /* definitions: 7 */

One more from the OpenBSD kernel:

/* /usr/home/leonardo/openbsd/src/sys/nfs/nfs.h:344 */
struct nfssvc_sock {
	struct {
		struct nfssvc_sock * tqe_next;           /*     0     4 */
		struct nfssvc_sock * * tqe_prev;         /*     4     4 */
	} ns_chain;                                      /*     0     8 */
	struct {
		struct nfsuid *    tqh_first;            /*     0     4 */
		struct nfsuid * *  tqh_last;             /*     4     4 */
	} ns_uidlruhead;                                 /*     8     8 */
	struct file *              ns_fp;                /*    16     4 */
	struct socket *            ns_so;                /*    20     4 */
	struct mbuf *              ns_nam;               /*    24     4 */
	struct mbuf *              ns_raw;               /*    28     4 */
	/* --- cacheline 1 boundary (32 bytes) --- */
	struct mbuf *              ns_rawend;            /*    32     4 */
	struct mbuf *              ns_rec;               /*    36     4 */
	struct mbuf *              ns_recend;            /*    40     4 */
	struct mbuf *              ns_frag;              /*    44     4 */
	int                        ns_flag;              /*    48     4 */
	int                        ns_solock;            /*    52     4 */
	int                        ns_cc;                /*    56     4 */
	int                        ns_reclen;            /*    60     4 */
	/* --- cacheline 2 boundary (64 bytes) --- */
	int                        ns_numuids;           /*    64     4 */
	u_int32_t                  ns_sref;              /*    68     4 */
	struct {
		struct nfsrv_descript * lh_first;        /*     0     4 */
	} ns_tq;                                         /*    72     4 */
	struct                     ns_uidhashtbl[29];    /*    76   116 */
	/* --- cacheline 6 boundary (192 bytes) --- */
	struct nfsrvw_delayhash    ns_wdelayhashtbl[16]; /*   192    64 */
	/* --- cacheline 8 boundary (256 bytes) --- */
}; /* size: 256, cachelines: 8 */
   /* definitions: 12 */

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-10 19:46:47 -02:00
Arnaldo Carvalho de Melo 63edfc24e0 [CLASSES]: Introduce class__snprintf, out of class__print
That now just calls class__snprintf with a huge buffer (struct
security_operations in the linux kernel uses about 18KB in its definition).

Now to make union__snprintf use it.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-10 16:39:20 -02:00
Arnaldo Carvalho de Melo feeaad9d37 [CLASSES]: Rename class__print_struct to class__print
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-10 14:27:03 -02:00
Arnaldo Carvalho de Melo c6e1a5eebd [CLASSES]: Ditch class_member__names
Was a awful function, to replace it added some new __snprintf methods for more
classes (array_type, class_member, etc), the end result is a much nicer
rendering, for instance:

@@ -6549,11 +6549,11 @@
         /* XXX 2 bytes hole, try to pack */

         union {
-                struct ff_constant_effect constant;             /*          10 */
-                struct ff_ramp_effect ramp;                 /*          12 */
-                struct ff_periodic_effect periodic;             /*          28 */
-                struct ff_condition_effect condition[2];         /*          24 */
-                struct ff_rumble_effect rumble;               /*           4 */
+                struct ff_constant_effect constant;      /*          10 */
+                struct ff_ramp_effect ramp;              /*          12 */
+                struct ff_periodic_effect periodic;      /*          28 */
+                struct ff_condition_effect condition[2];  /*          24 */
+                struct ff_rumble_effect rumble;          /*           4 */
         } u;                                             /*    16    28 */
         /* --- cacheline 1 boundary (32 bytes) was 12 bytes ago --- */
 }; /* size: 44, cachelines: 2 */

Previously when such big class members appeared the comments with the size and
offset were unaligned, now its only in extreme cases, such as the array above
that things get unaligned.

End result is a smaller library:

[acme@newtoy pahole]$ codiff -V build/libclasses.so.orig build/libclasses.so
/home/acme/pahole/classes.c:
  struct array_type   |   -4
   nr_members: -1
    -const char  *name   /*    36     4 */
 1 struct changed
  enumeration__print  |  +10 # 175 -> 185
  union__snprintf     |  +32 # 576 -> 608
  union__print        |  +16 # 182 -> 198
  class_member__names | -851 (removed)
  class_member__print | -721 # 1218 -> 497
  class__print_struct |  +54 # 1403 -> 1457
 6 functions changed, 112 bytes added, 1572 bytes removed, diff: -1460

/home/acme/pahole/classes.c:
  array_type__snprintf   | +249 (added)
  class_member__snprintf | +892 (added)
 2 functions changed, 1141 bytes added

build/libclasses.so:
 8 functions changed, 1253 bytes added, 1572 bytes removed, diff: -319

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-10 14:19:55 -02:00
Arnaldo Carvalho de Melo 8594be9256 [CLASSES]: Unexport class_member__names
Now to kill its last users.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-09 15:13:33 -02:00
Arnaldo Carvalho de Melo 5828563c91 [CODIFF]: Stop using class_member__names
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-09 15:10:57 -02:00
Arnaldo Carvalho de Melo 52b5bb606b [CLASSES]: Export tag__size()
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-09 15:10:31 -02:00
Arnaldo Carvalho de Melo b916bb459e [CTRACER]: Avoid comparing DW_TAG_subprogram with DW_AT_abstract_origin
See d0e47a6f2c commit.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-09 14:26:07 -02:00
Arnaldo Carvalho de Melo bd62cad409 [CODIFF]: Use ftype__snprintf
And with this the only user of parameter__names is gone, so ditch it.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-09 13:34:15 -02:00
Arnaldo Carvalho de Melo 8b797ddc38 [CLASSES]: Remove redundant setting in cus__emit_struct_definitions
cus__add_definition already dos this for us.

[acme@newtoy pahole]$ codiff -V build/libclasses.so.orig build/libclasses.so
/home/acme/pahole/classes.c:
  cus__emit_struct_definitions |  -13 # 336 -> 323
 1 function changed, 13 bytes removed
[acme@newtoy pahole]$

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-09 13:03:09 -02:00
Arnaldo Carvalho de Melo 406e9db7c1 [CLASSES]: Introduce die__process_tag
That does the common processing previously found in cu__process_unit,
cu__process_function and cu__process_class, reducing complexity and hopefully
supporting C++ a tad better by looking for more tags that can appear inside
class definitions, function within functions, etc.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-09 12:55:45 -02:00
Arnaldo Carvalho de Melo 770f579b71 [CODIFF]: Show a diff when bytes were removed and added
build/libclasses.so:
 36 functions changed, 3334 bytes added, 3348 bytes removed, diff: -14
[acme@newtoy pahole]$

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-09 12:22:03 -02:00
Arnaldo Carvalho de Melo c453da1b35 [CLASSES]: Rename the cu__{create_new,process} functions to die__
To better reflect that the main data structure being handled is Dwarf_Die.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-09 12:17:48 -02:00
Arnaldo Carvalho de Melo 49907df8a9 [CODIFF]: in verbose mode show if a function was removed or added
[acme@newtoy pahole]$ codiff -V build/libclasses.so.orig build/libclasses.so
/home/acme/pahole/classes.c:
  cu__create_new_tag              | -136 (removed)
  cu__create_new_class            | -123 (removed)
  cu__create_new_union            | -123 (removed)
  cu__create_new_base_type        | -112 (removed)
  cu__create_new_typedef          | -112 (removed)
  cu__create_new_array            | -474 (removed)
  cu__create_new_parameter        | -102 (removed)
  cu__create_new_label            |  -76 (removed)
  cu__create_new_variable         |  -76 (removed)
  cu__create_new_subroutine_type  | -216 (removed)
  cu__create_new_enumeration      | -261 (removed)
  cu__process_class               | -264 (removed)
  cu__create_new_lexblock         | -109 (removed)
  cu__create_new_inline_expansion |  -76 (removed)
  cu__process_function            | -424 (removed)
  cu__create_new_function         |  -96 (removed)
  cu__process_unit                | -319 (removed)
  cu__process                     | -249 (removed)
 18 functions changed, 3348 bytes removed

/home/acme/pahole/classes.c:
  die__create_new_tag              | +136 (added)
  die__create_new_class            | +123 (added)
  die__create_new_union            | +123 (added)
  die__create_new_base_type        | +112 (added)
  die__create_new_typedef          | +112 (added)
  die__create_new_array            | +474 (added)
  die__create_new_parameter        | +102 (added)
  die__create_new_label            |  +76 (added)
  die__create_new_variable         |  +76 (added)
  die__create_new_subroutine_type  | +216 (added)
  die__create_new_enumeration      | +261 (added)
  die__process_class               | +264 (added)
  die__create_new_lexblock         | +109 (added)
  die__create_new_inline_expansion |  +76 (added)
  die__process_function            | +410 (added)
  die__create_new_function         |  +96 (added)
  die__process_unit                | +319 (added)
  die__process                     | +249 (added)
 18 functions changed, 3334 bytes added

build/libclasses.so:
 36 functions changed, 3334 bytes added, 3348 bytes removed

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-09 12:16:46 -02:00
Arnaldo Carvalho de Melo 049c8fccfc [CLASSES]: Add the tag after the switch
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-09 12:04:12 -02:00
Arnaldo Carvalho de Melo 5cbea44c42 [CLASSES]: Use just struct type to represent DW_TAG_union_type
Reducing the memory required to represent such tags.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-09 10:17:39 -02:00
Arnaldo Carvalho de Melo 8062d1a874 [CLASSES]: Make struct class and enumeration share more thru struct type
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-09 10:00:47 -02:00
Arnaldo Carvalho de Melo 99610d5857 [CLASSES]: Handle DW_TAG_enumeration_type in cu__process_class
In C++ we can have enums defined inside classes.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-08 22:06:11 -02:00
Arnaldo Carvalho de Melo 746f462b4e [CODIFF]: Show more info in verbose mode for function diffs
Example:

Applying this patch to the linux kernel sources:

     diff --git a/include/net/xfrm.h b/include/net/xfrm.h
     index e476541..178eb50 100644
     - a/include/net/xfrm.h
     + b/include/net/xfrm.h
     @@ -853,7 +853,7 @@ struct xfrm_algo_comp_info {
      struct xfrm_algo_desc {
 	     char *name;
 	     char *compat;
     -	u8 available:1;
     +	u8 available;
 	     union {
 		     struct xfrm_algo_auth_info auth;
 		     struct xfrm_algo_encr_info encr;

We get this result:

[acme@newtoy linux-2.6]$ codiff -V /tmp/vmlinux.before vmlinux
net/xfrm/xfrm_algo.c:
  struct xfrm_algo_desc     |   +0
    available:1;
     from: u8                    /*     8(7)     1(1) */
     to:   u8                    /*     8(0)     1(0) */
 1 struct changed
  xfrm_count_auth_supported |  -15 # 42 -> 27
  xfrm_count_enc_supported  |  -15 # 42 -> 27
  xfrm_get_byname           |  -14 # 250 -> 236
  xfrm_probe_algs           | -102 # 284 -> 182
 4 functions changed, 146 bytes removed

net/xfrm/xfrm_user.c:
  struct xfrm_algo_desc |   +0
    available:1;
     from: u8                    /*     8(7)     1(1) */
     to:   u8                    /*     8(0)     1(0) */
 1 struct changed

vmlinux:
 4 functions changed, 146 bytes removed

See the info after the '#' character? old size -> new size.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-08 12:21:47 -02:00
Arnaldo Carvalho de Melo d0e47a6f2c [CODIFF]: Avoid comparing DW_TAG_subprogram with DW_AT_abstract_origin
We were comparing DW_TAG_subprogram tags without low_pc/high_pc with
aliases to it, that have low_pc/high_pc, not good.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-08 12:07:59 -02:00
Arnaldo Carvalho de Melo e8e38bd27e [PFUNCT]: Only check duplicates in verbose mode
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-08 11:42:52 -02:00
Arnaldo Carvalho de Melo e5251f65a8 [CLASSES]: Introduce cu__tag_not_handled
Makign the tag not handled warnings homogeneous.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-07 23:57:32 -02:00
Luis Cludio R. Gonalves 346e3a7e17 [CMAKE]: Fix build on ubuntu
Signed-off-by: Luis Cludio R. Gonalves <lclaudio@unix.sh>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-07 23:56:43 -02:00
Arnaldo Carvalho de Melo 0872d8e312 [CLASSES]: Support abstract origin in formal parameters
Sortof, mostly works, but still has a problem where the abstract origin is not
being found, but for now its ok to keep the bandaid, everything works as
before, there are more important things to do right now.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-07 17:57:00 -02:00
Arnaldo Carvalho de Melo 29103e42be [CLASSES]: Handle DW_AT_abstract_origin in DW_TAG_subprogram
We have to check for a possible alias (abstract origin attribute) and handle
that when we want the function name, if it is an alias, do the lookup and cache
the result in ->name, that after all doesn't have a value in the first place.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-07 17:13:39 -02:00
Arnaldo Carvalho de Melo fddb3f4e15 [CLASSES]: Remove dead code
[acme@newtoy pahole]$ codiff build/libclasses.so.orig build/libclasses.so
/home/acme/pahole/classes.c:
  cu__create_new_function |  -90
 1 function changed, 90 bytes removed
[acme@newtoy pahole]$

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-07 15:54:41 -02:00