-
Notifications
You must be signed in to change notification settings - Fork 1.2k
while debuggung with gdb, custom instructions not showing #1412
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
Comments
You'll have to provide some detail about how exactly you modified the toolchain to add support for your custom instructions. |
Adding custom instructions compilation support, to RISCV ... https://medium.com/@viveksgt/adding-custom-instructions-compilation-support-to-riscv-toolchain-78ce1b6efcf4 I followed these steps |
Did you do this?
|
This may also be relevant: |
Did that help at all @RohanAhmed1 ? |
Just remind that: gdb and binutils are shared same code base, but they are different folder in riscv-gnu-toolchain, so you need to apply those change for gdb folder as well, generally should be same change, but may facing some minor merge conflict due to the base version mismatch, because binutils and gdb had different release schedule. |
Thanks @kito-cheng - I always wondered why there were two different copies of
|
No update from @RohanAhmed1 for over a week so I am assuming that the issue has been explained by the need to make the relevant changes in the two copies of the |
Hi, apologies from my side for being late of trying suggestion of adding custom instructions in the gdb folder as well. Let me give you all of what I have done and what issue I am facing. Procedure and ExplanationI am adding custom instruction(vgmul.vv) in the toolchain in following path. At gdb/opcodes/riscv-opc.c and riscv-binutils/opcodes/riscv-opc.c At riscv-binutils/include/opcode/riscv-opc.h and gdb/include/opcode/riscv-opc.h Now, I am test this instrucion by making a simple test. Now, I build this test with the help of obj_folder of updated toolchain with;
and create disassmebly file with
This dissassembly file has the vgmul.vv instruction. It means that, my instruction is identifed by the toolchain and my test is running as well. IssueNow, I am debugging this with gdb of updated toolchain by:
and running this command to open the debugger window of dissambly by
As you see in this, my custom instruction is showing with .4byte instead of vgmul.vv Am I missing some files to update? |
After making the relevant code changes did you make sure to do a full/clean build?
BTW - your screenshot is really difficult to read - please use logs rather than screenshots for ease of readability and analysis. |
Yeah, I have followed this command to build except make distclean and use one more command. Let me write my steps to build.
-with-gcc-src= is used to save cloning time. Actually, It is a copy of a clone of gcc 13.0. Instead of using riscv RNU toolchain / gcc which I think was gcc 12.3 or something. I will try this command as well and let you know. Thanks. |
I don't think that
Cloning only happens the first time you do the following:
It doesn't happen thereafter.
I don't know what "riscv RNU toolchain" is.
|
Thanks you for your response. Yeah I mean riscv-gnu-toolchain repo. Well I tried it out with these steps now,
The issue is still remain. What can be other thing I can try? can you suggest some? |
Maybe ask about the issue on the GDB mailing list since this is not really a RISC-V specific issue? |
I added the custom instructions in toolchain. The toolchain works perfectly and my new instructions in also showing in dump file(disasmebly) with their proper naming convention but when I use gdb to debug, the hex is showing instead of the custom instruction name
The text was updated successfully, but these errors were encountered: