Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
usdt: fix parsing sp register in arguments on AArch64
One of the USDT probes for OpenJDK on AArch64 has an argument as an offset from the stack pointer register like "8@[sp, 112]". This causes the argument parser to fail: Parse error: 8@x22 8@x20 8@x23 8@x0 8@x26 8@x27 8@[sp, 112] 8@[sp, 120] ------------------------------------------^ The error message then repeats forever. Changed ArgumentParser_aarch64::parse_register so it accepts either "xNN" or "sp" and outputs the register name rather than the register number. The stack pointer is in a separate field `sp` in `struct pt_regs` rather than in the `regs[]` array [1]. Note that the parser currently accepts "x31" and converts that into a reference to `regs[31]' but that array only has 31 elements. Made x31 an alias for `sp` to avoid undefined behaviour from reading past the end of the array. [1]: https://elixir.bootlin.com/linux/latest/source/arch/arm64/include/asm/ptrace.h#L160 Change-Id: I88b6ff741914b5d06ad5798a55bd21ea03f69825 Signed-off-by: Nick Gasson <nick.gasson@arm.com>
- Loading branch information
1 parent
aeea0e9
commit 5011f99
Showing
3 changed files
with
40 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters