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

Add insn cmd to interactive debug mode #1709

Merged

Conversation

abejgonzalez
Copy link
Contributor

This PR adds a new interactive debug mode cmd of insn with the same API as the pc command to print out the instruction associated with the PC of a specific hart. This command can be used with the until* commands to run a binary "until" the "insn" value is a specific value.

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

This looks like a reasonable addition to me, but do you think it makes sense to enhance it by printing out the disassembled instruction after printing out its opcode? I guess it doesn't matter much since the main purpose is the until aspect, not the printing aspect, so I'll leave it up to you.

@abejgonzalez
Copy link
Contributor Author

This looks like a reasonable addition to me, but do you think it makes sense to enhance it by printing out the disassembled instruction after printing out its opcode? I guess it doesn't matter much since the main purpose is the until aspect, not the printing aspect, so I'll leave it up to you.

It would be nice. I have a commit ready to add it but I'm unsure of the format for output. Right now it looks like the following:

(spike) insn 0
0x0202859300000297 auipc   t0, 0x0

If there is no preference on the format (i.e. <HEX> <DISASM>) then I can commit it.

@abejgonzalez
Copy link
Contributor Author

This looks like a reasonable addition to me, but do you think it makes sense to enhance it by printing out the disassembled instruction after printing out its opcode? I guess it doesn't matter much since the main purpose is the until aspect, not the printing aspect, so I'll leave it up to you.

It would be nice. I have a commit ready to add it but I'm unsure of the format for output. Right now it looks like the following:

(spike) insn 0
0x0202859300000297 auipc   t0, 0x0

If there is no preference on the format (i.e. <HEX> <DISASM>) then I can commit it.

Done.

riscv/interactive.cc Outdated Show resolved Hide resolved
@aswaterman
Copy link
Collaborator

Yeah, that's fine.

Can you squash these commits into one?

@aswaterman
Copy link
Collaborator

Also note that CI is broken until #1710 is merged.

@abejgonzalez
Copy link
Contributor Author

Yeah, that's fine.

Can you squash these commits into one?

Will do.

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

LGTM.

@aswaterman aswaterman merged commit ed5f817 into riscv-software-src:master Jun 27, 2024
3 checks passed
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.

2 participants