diff options
| author | Brian Gaeke <gaeke@uiuc.edu> | 2003-10-16 23:46:01 +0000 |
|---|---|---|
| committer | Brian Gaeke <gaeke@uiuc.edu> | 2003-10-16 23:46:01 +0000 |
| commit | 8026243e552b81bf85db780910cf4eb1b058c8ca (patch) | |
| tree | 12ba0f94a0722ab1b0206102bd1aaaea70b9b7c5 /llvm/utils/codegen-diff | |
| parent | c05684ad224fe81407790e0136711f1f6b7e191a (diff) | |
Add debug variable.
llvm-svn: 9188
Diffstat (limited to 'llvm/utils/codegen-diff')
| -rwxr-xr-x | llvm/utils/codegen-diff | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/utils/codegen-diff b/llvm/utils/codegen-diff index 9b2930b47e48..2c3ac4c6dfa8 100755 --- a/llvm/utils/codegen-diff +++ b/llvm/utils/codegen-diff @@ -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 @@ sub parse_objdump_file { $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 @@ sub parse_gdb_file { 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 @@ sub parse_gdb_file { $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 @@ sub parse_gdb_file { $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; } } |
