hotspot icon indicating copy to clipboard operation
hotspot copied to clipboard

fix: display disassembly correctly on aarch64

Open pcc opened this issue 7 months ago • 6 comments

On aarch64 (and possibly other architectures) objdump splits the instruction mnemonic from the operands with a tab so the existing code would only show the mnemonic. Change the code so that it ignores tabs after the first two so that the whole instruction is displayed.

pcc avatar May 26 '25 06:05 pcc

Sounds good. Mind to share a screen before/after?

Note: there's ongoing work to use a disassembler library, so the fix may only be temporary...

GitMensch avatar May 26 '25 16:05 GitMensch

Sure, here is before/after

Screenshot from 2025-05-26 15-36-47 Screenshot from 2025-05-26 15-39-52

pcc avatar May 26 '25 22:05 pcc

hm the test failures are related, can you please have a look at those?

FAIL!  : TestDisassemblyOutput::testParse(objdump2.txt) 'line.branchVisualisation.isEmpty()' returned FALSE. ()

milianw avatar May 27 '25 17:05 milianw

Thanks. I was having some trouble figuring out how to run the tests yesterday, make test failed with missing binariers so it seemed like I would need to build the tests (and their dependencies) manually. I'm away from the machine that I was using for developing hotspot but from the CI output it looks like the dev-asan target will build all the tests? It may be worth documenting that somewhere, e.g. in CONTRIBUTING.md.

pcc avatar May 27 '25 17:05 pcc

hm the normal build should also include tests, I run those via ctest --output-on-failure -j8 or similar myself. the CI clazy/clang-tidy jobs are sadly broken, please ignore those for now, but otherwise it should just work?

generally though, if you figure something out that you would have liked to see documented more clearly, by all means please create a PR to add the missing documentation after you figured it out!

thanks a lot for your contributions, I'll try to find some more time for your other changes the next days - please nag me if you don't hear in time, I'm notoriously busy with other projects these days

milianw avatar May 28 '25 07:05 milianw

hm the normal build should also include tests, I run those via ctest --output-on-failure -j8 or similar myself. the CI clazy/clang-tidy jobs are sadly broken, please ignore those for now, but otherwise it should just work?

Figured it out. Right, the tests are built by default, but I was building with Nix which was disabling them unbeknownst to me. I figured out why they were failing (sent #729), sent them a PR to enable tests (https://github.com/NixOS/nixpkgs/pull/413058) and finally fixed the failing tests here.

generally though, if you figure something out that you would have liked to see documented more clearly, by all means please create a PR to add the missing documentation after you figured it out!

I guess the only thing worth documenting is that ctest should be used to run tests, since this might not be obvious to everyone (some CMake using projects like LLVM have their own testing tools). Sent #730 for that.

pcc avatar Jun 01 '25 22:06 pcc