puncover icon indicating copy to clipboard operation
puncover copied to clipboard

Add support for 64-bit addresses

Open dredfern-zoox opened this issue 2 years ago • 0 comments

The regex in collector.py currently assumes that the memory addresses output by nm are 8-characters wide (e.g. 32-bit addresses). Update the regex to accept any number of characters between 8 and 16 (to support 64-bit addresses).

Minimal test example using a 64-bit host machine and toolchain (shows no symbols on current master, but finds symbols on this commit):

echo "int main() { return 0; }" > test.cpp
g++ test.cpp   # uses host gcc tools (64-bit Linux) but same result for AARCH64 compilers
puncover --gcc_tools_base /usr/bin/ --elf ./a.out --src_root . --build_dir .

I'm not sure whether the regexes to parse assembly lines will also need updating in the future; the platform I'm working on does not have any disassembly wider than 9 characters. I did update the assembly addresses, though, and also added test cases for both address types.

dredfern-zoox avatar Jul 15 '22 20:07 dredfern-zoox