Skip to content

Commit 690998b

Browse files
author
James Hogan
committed
scripts/checkstack.pl: Add metag support
Adapt checkstack.pl so that it works for metag. Signed-off-by: James Hogan <james.hogan@imgtec.com>
1 parent 00512bd commit 690998b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

scripts/checkstack.pl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# $1 (first bracket) matches the dynamic amount of the stack growth
3535
#
3636
# use anything else and feel the pain ;)
37-
my (@stack, $re, $dre, $x, $xs);
37+
my (@stack, $re, $dre, $x, $xs, $funcre);
3838
{
3939
my $arch = shift;
4040
if ($arch eq "") {
@@ -44,6 +44,7 @@
4444

4545
$x = "[0-9a-f]"; # hex character
4646
$xs = "[0-9a-f ]"; # hex character or space
47+
$funcre = qr/^$x* <(.*)>:$/;
4748
if ($arch eq 'arm') {
4849
#c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64
4950
$re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o;
@@ -66,6 +67,10 @@
6667
# 2b6c: 4e56 fb70 linkw %fp,#-1168
6768
# 1df770: defc ffe4 addaw #-28,%sp
6869
$re = qr/.*(?:linkw %fp,|addaw )#-([0-9]{1,4})(?:,%sp)?$/o;
70+
} elsif ($arch eq 'metag') {
71+
#400026fc: 40 00 00 82 ADD A0StP,A0StP,#0x8
72+
$re = qr/.*ADD.*A0StP,A0StP,\#(0x$x{1,8})/o;
73+
$funcre = qr/^$x* <[^\$](.*)>:$/;
6974
} elsif ($arch eq 'mips64') {
7075
#8800402c: 67bdfff0 daddiu sp,sp,-16
7176
$re = qr/.*daddiu.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o;
@@ -109,7 +114,6 @@
109114
#
110115
# main()
111116
#
112-
my $funcre = qr/^$x* <(.*)>:$/;
113117
my ($func, $file, $lastslash);
114118

115119
while (my $line = <STDIN>) {

0 commit comments

Comments
 (0)