Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#3544: RV64: Port test common.getretaddr to RV64 #7169

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ziyao233
Copy link
Contributor

Port assembly in common/getretaddr.c to riscv64 and implements tailcall_with_retaddr().

Issue: #3544

Port assembly in common/getretaddr.c to riscv64 and implements
tailcall_with_retaddr().

Issue: DynamoRIO#3544
ret
mv t0, a0
mv a0, ra
jr t0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comments here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1: comments would be useful to note details of the RISC-V ISA that readers may be unfamiliar with (like t0 is a temp reg that doesn't need to be saved, ra has the return address, ...)

@ksco ksco requested a review from derekbruening December 25, 2024 08:17
ret
mv t0, a0
mv a0, ra
jr t0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1: comments would be useful to note details of the RISC-V ISA that readers may be unfamiliar with (like t0 is a temp reg that doesn't need to be saved, ra has the return address, ...)

mv t0, ra
call next_instr
next_instr:
mv a0, ra
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(No action requested)

I'm a little confused by this routine that's called get_retaddr but seems to get the retaddr of an internal call instr that points to the instr at next_instr. I don't see how that's useful for the caller.

I guess the precise returned value is not really what the caller wants; maybe the goal is only to verify that this sequence of instrs work under DR (as noted by the "make sure dynamorio can handle this non-call" comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants