X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=scripts%2Fcheckstack.pl;h=14ee68e991dd45767b8ded17747da02a59c703f1;hb=dfaa9e2c5707b2c217c0121aac796e0fa3051482;hp=358f96c75b43b831868fc93c6ed90233a3ea6a71;hpb=585e93ae83b80c874bf4eb50a239027cef5db4af;p=safe%2Fjmp%2Flinux-2.6 diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl index 358f96c..14ee68e 100755 --- a/scripts/checkstack.pl +++ b/scripts/checkstack.pl @@ -14,6 +14,7 @@ # M68k port by Geert Uytterhoeven and Andreas Schwab # AVR32 port by Haavard Skinnemoen # PARISC port by Kyle McMartin +# sparc port by Martin Habets # # Usage: # objdump -d vmlinux | scripts/checkstack.pl [arch] @@ -36,6 +37,7 @@ my (@stack, $re, $dre, $x, $xs); my $arch = shift; if ($arch eq "") { $arch = `uname -m`; + chomp($arch); } $x = "[0-9a-f]"; # hex character @@ -80,7 +82,10 @@ my (@stack, $re, $dre, $x, $xs); $re = qr/.*st[dw]u.*r1,-($x{1,8})\(r1\)/o; } elsif ($arch =~ /^s390x?$/) { # 11160: a7 fb ff 60 aghi %r15,-160 - $re = qr/.*ag?hi.*\%r15,-(([0-9]{2}|[3-9])[0-9]{2})/o; + # or + # 100092: e3 f0 ff c8 ff 71 lay %r15,-56(%r15) + $re = qr/.*(?:lay|ag?hi).*\%r15,-(([0-9]{2}|[3-9])[0-9]{2}) + (?:\(\%r15\))?$/ox; } elsif ($arch =~ /^sh64$/) { #XXX: we only check for the immediate case presently, # though we will want to check for the movi/sub @@ -90,8 +95,11 @@ my (@stack, $re, $dre, $x, $xs); } elsif ($arch =~ /^blackfin$/) { # 0: 00 e8 38 01 LINK 0x4e0; $re = qr/.*[[:space:]]LINK[[:space:]]*(0x$x{1,8})/o; + } elsif ($arch eq 'sparc' || $arch eq 'sparc64') { + # f0019d10: 9d e3 bf 90 save %sp, -112, %sp + $re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o; } else { - print("wrong or unknown architecture\n"); + print("wrong or unknown architecture \"$arch\"\n"); exit } }