[PATCH] D40894: [XRay][compiler-rt+llvm] Update XRay trampoline CFI and register stashing semantics

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 22:18:01 PST 2017


dberris added a reviewer: dblaikie.
dberris added a subscriber: dblaikie.
dberris added a comment.

Adding @dblaikie to the review for the CFI directives (please feel free to nominate someone else who might know better).

The problem I'm having in particular here is the computation in the `ALIGNED_CALL_RAX` macro, where we're doing stack re-alignment just before the call to the custom event handler function (line 77). Working offline with a teammate here in Sydney, we're prototyping some potential ways of doing this correctly but using `.cfi_escape ...` and providing raw DWARF opcodes. Ideally I wouldn't have to go through such lengths, but without the correct CFI directives and/or DWARF information, debugging XRay instrumentation handlers and the trampolines becomes really hard (since the CFI directives would probably be wrong).

Before I go uploading a work-in-progress implementation here, is there an example somewhere of how to potentially resolve this in assembler?

One sticking point is the fact that there seems to be no way to get the current CFI offset from the assembler using either a directive or a special macro -- at least not one I can find from the assembler manuals.

Pointers would be most appreciated.


https://reviews.llvm.org/D40894





More information about the llvm-commits mailing list