[ooo-build-commit] .: bin/vtable-check doc/l10n.txt

Michael Meeks mmeeks at kemper.freedesktop.org
Mon Oct 4 04:43:24 PDT 2010


 bin/vtable-check |   99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 doc/l10n.txt     |    2 +
 2 files changed, 101 insertions(+)

New commits:
commit 6c3a73ec54abb53dab3a5c08da89ec9b5028cf92
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Mon Oct 4 12:41:02 2010 +0100

    add vtable checker prototype

diff --git a/bin/vtable-check b/bin/vtable-check
new file mode 100755
index 0000000..8cb6f8d
--- /dev/null
+++ b/bin/vtable-check
@@ -0,0 +1,99 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+#
+# Use example: vtable-check *.so
+#
+
+my $list_sizes = 0;
+
+sub read_vtables($$)
+{
+    my $vtables = shift;
+    my $file = shift;
+    my $pipe;
+
+    open ($pipe, "objdump -T $file |") || die "Can't objdump -T $file: $!";
+    while (<$pipe>) {
+	next if (/\*UND\*/);
+	next if (! /\s+_ZT[vV]/);
+
+#        0058dc3e        g       DF  .text    0000000f      Base        _ZTv0_n12_N10SwDocShellD0Ev
+	/([0-9a-f]*)\s+([gw ])\s+..\s+(\S*)\s*([0-9a-f]+)\s+(\S*)\s+(.*)$/  || die "un-parseable vtable entry '$_'";
+
+	my ($address, $linkage, $type, $sizehex, $ver, $symbol) = ($1, $2, $3, $4, $5, $6);
+	my $size = hex ($sizehex);
+	die "Vtable '$symbol' multiply defined" if (defined ($vtables->{$symbol}));
+	$vtables->{$symbol} = $size;
+    }
+}
+
+sub print_syntax()
+{
+    print STDERR "vtable-check [--list] [--help] <list-of-so-files>\n";
+    print STDERR "  this tool generates signatures for vtable sizes, that can be compared\n";
+    print STDERR "  between patches to ensure that no incomplete type changes have \n";
+    print STDERR "  accidentally created new virtual methods\n";
+    print STDERR "  --list      prints out all vtable sizes\n";
+    print STDERR "  --help      help\n";
+}
+
+#
+# munge options
+#
+my @files = ();
+for my $arg (@ARGV) {
+    if ($arg =~ m/^--list/) {
+	$list_sizes = 1;
+    } elsif ($arg =~ m/^--help/) {
+	print_syntax();
+    } else {
+	push @files, $arg;
+    }
+}
+print_syntax() if (!@files);
+
+#
+# read relocation data from elf shared libraries
+#
+my %libs;
+print STDERR "reading vtables ";
+
+for my $file (@files) {
+    my %vtables = ();
+    read_vtables (\%vtables, $file);
+    next if (!keys (%vtables));
+    $libs{$file} = \%vtables;
+    print STDERR ".";
+}
+print STDERR "\n";
+
+print STDERR "sanity check";
+
+my %global_syms = ();
+for my $file (keys %libs) {
+    my $vtables = $libs{$file};
+    for my $sym (%{$vtables}) {
+	if (defined $global_syms{$sym}) {
+#	    print "multiply defined vtable '$sym'\n";
+	    if ($global_syms{$sym} != $vtables->{$sym}) {
+		die "Error - serious vtable size mismatch on $sym\n";
+	    }
+	}
+	$global_syms{$sym} = $vtables->{$sym};
+    }
+}
+print STDERR "ed.\n";
+
+if ($list_sizes) {
+    for my $file (sort keys %libs) {
+	my $vtables = $libs{$file};
+
+	print "file: $file\n";
+	for my $sym (sort { $vtables->{$a} cmp $vtables->{$b} } keys %{$vtables}) {
+	    print $vtables->{$sym} . "\t$sym\n";
+	}
+	print "\n";
+    }
+}
diff --git a/doc/l10n.txt b/doc/l10n.txt
index b44c11e..420df61 100644
--- a/doc/l10n.txt
+++ b/doc/l10n.txt
@@ -22,6 +22,8 @@
 			+ can we do it in some better way ?
 			+ with XML diffs or something ?
 
+	* http://www.openoffice.org/issues/show_bug.cgi?id=99480
+		+ default font usage in impress.
 
 
 The conclusion / design:


More information about the ooo-build-commit mailing list