[PATCH] Fix markup_oops to work with 32-bit userspace on a 64-bitkernel

From: Matthew Wilcox
Date: Mon Jul 13 2009 - 10:18:26 EST



A 32-bit perl can't handle 64-bit addresses without using the BigInt package.

Signed-off-by: Matthew Wilcox <willy@xxxxxxxxxxxxxxx>

diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl
index 528492b..8977401 100644
--- a/scripts/markup_oops.pl
+++ b/scripts/markup_oops.pl
@@ -1,6 +1,7 @@
#!/usr/bin/perl

use File::Basename;
+use Math::BigInt;

# Copyright 2008, Intel Corporation
#
@@ -172,8 +173,8 @@ while (<STDIN>) {
parse_x86_regs($line);
}

-my $decodestart = hex($target) - hex($func_offset);
-my $decodestop = hex($target) + 8192;
+my $decodestart = Math::BigInt->from_hex("0x$target") - Math::BigInt->from_hex("0x$func_offset");
+my $decodestop = Math::BigInt->from_hex("0x$target") + 8192;
if ($target eq "0") {
print "No oops found!\n";
print "Usage: \n";

--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/