[llvm-commits] CVS: llvm/utils/codegen-diff

Brian Gaeke gaeke at cs.uiuc.edu
Thu Oct 16 18:47:02 PDT 2003


Changes in directory llvm/utils:

codegen-diff updated: 1.2 -> 1.3

---
Log message:

Add debug variable.


---
Diffs of the changes:  (+6 -0)

Index: llvm/utils/codegen-diff
diff -u llvm/utils/codegen-diff:1.2 llvm/utils/codegen-diff:1.3
--- llvm/utils/codegen-diff:1.2	Thu Jul  3 16:44:32 2003
+++ llvm/utils/codegen-diff	Thu Oct 16 18:46:01 2003
@@ -1,11 +1,13 @@
 #!/usr/bin/perl
 
 use Getopt::Std;
+$DEBUG = 0;
 
 sub parse_objdump_file {
   my ($filename) = @_;
   my @result;
   open (INPUT, $filename) or die "$filename: $!\n";
+  print "opened objdump output file $filename\n" if $DEBUG;
   while (<INPUT>) {
     if (/\s*([0-9a-f]*):\t(([0-9a-f]{2} )+) *\t(.*)$/) {
       my ($addr, $bytes, $instr) = ($1, $2, $4);
@@ -13,6 +15,7 @@
       $bytes =~ s/\s*(.*\S)\s*/$1/; # trim any remaining whitespace
       $instr =~ s/\s*(.*\S)\s*/$1/;
       push (@result, {'addr' => $addr, 'bytes' => $bytes, 'instr' => $instr});
+      print "addr=$addr bytes='$bytes' instr='$instr'\n" if $DEBUG;
     }
   }
   close INPUT;
@@ -24,6 +27,7 @@
   my @result;
   my $got_addr;
   open (INPUT, $filename) or die "$filename: $!\n";
+  print "opened gdb output file $filename\n" if $DEBUG;
   while (<INPUT>) {
     if (/^(0x[0-9a-f]*):\t([^\t]*)\t[^:]*:\t((0x[0-9a-f]{2}\s*)+)\s*$/) {
       my ($addr, $bytes, $instr) = ($1, $3, $2);
@@ -32,6 +36,7 @@
       $bytes =~ s/\s*(.*\S)\s*/$1/;  # trim any remaining whitespace
       $instr =~ s/\s*(.*\S)\s*/$1/;
       push (@result, {'addr' => $addr, 'bytes' => $bytes, 'instr' => $instr});
+      print "addr=$addr bytes='$bytes' instr='$instr'\n" if $DEBUG;
     } elsif (/^(0x[0-9a-f]*):\t$/) { # deal with gdb's line breaker
       $got_addr = $1;
     } elsif ($got_addr && /^    ([^\t]*)\t[^:]*:\t((0x[0-9a-f]{2}\s*)+)\s*$/) {
@@ -41,6 +46,7 @@
       $bytes =~ s/\s*(.*\S)\s*/$1/;  # trim any remaining whitespace
       $instr =~ s/\s*(.*\S)\s*/$1/;
       push (@result, {'addr' => $addr, 'bytes' => $bytes, 'instr' => $instr});
+      print "addr=$addr bytes='$bytes' instr='$instr'\n" if $DEBUG;
       undef $got_addr;
     }
   }





More information about the llvm-commits mailing list