Skip to content

Commit 162f50c

Browse files
Fix stacktrace-analyzer to handle calls optimized into branches
1 parent 017c758 commit 162f50c

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

utils/stm32stack.pl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,21 @@
104104

105105
$call_graph{$source}->{$t} = 1;
106106
}
107+
if (/: R_[A-Za-z0-9_]+_JUMP\d+[ \t]+(.*)/) {
108+
# Optimizing compiler can jump instead of call last function
109+
my $t = $1;
110+
111+
if ($t eq ".text") {
112+
$t = "\@$objfile";
113+
} elsif ($t =~ /^\.text\+0x(.*)$/) {
114+
$t = "$1\@$objfile";
115+
}
116+
if ($t ne $source) {
117+
$call_graph{$source}->{$t} = 1;
118+
} else {
119+
warn "May have found optimized recursive call for $source ...ignoring recursion\n";
120+
}
121+
}
107122
}
108123
close(DISASSEMBLY);
109124

0 commit comments

Comments
 (0)