Closed arkup closed 5 years ago
Hello! TriCore is not official in capstone framework. We have llvm-tricore and a forked repository of aquynh/capstone. I updated the README.md saying that those are our dependencies. If you install our capstone and llvm-tricore as stated in README.md, the ditricore is going to work.
cool! thanks I will try it. BTW. Would be great if you could send pull req to capstone so they officially support tricore.
@arkup The full support of Tricore was added into the mainstream capstone: https://github.com/capstone-engine/capstone/tree/next/arch/TriCore
Feel free to try and report any bugs if there are any.
See also https://github.com/TriDis/ditricore/issues/2#issuecomment-1600261757
@XVilka Thank you for adding support for Tricore. I conducted a quick test, and it works fine, well done.
There is one thing I dislike : the "%" symbol prepended to the registry name. I assume that it may be intended to distinguish better e.g. "a15" from "#0xa15," but it confuses me when transitioning from IDA, Ghidra, Lauterbach. It would be appreciated to use unified formatting or if a cs_option could be implemented to automatically remove the "%" symbol from the register name and prepended # before hex number e.g. addi %d0, %d0, 0x1110 -> addi d0, d0, #0x1110
@imbillow what do you think about that? It's different from other architectures in Rizin as well, maybe we could change it before the 5.0 release?
@XVilka Thank you for adding support for Tricore. I conducted a quick test, and it works fine, well done.
There is one thing I dislike : the "%" symbol prepended to the registry name.
I assume that it may be intended to distinguish better e.g. "a15" from "#0xa15," but it confuses me when transitioning from IDA, Ghidra, Lauterbach. It would be appreciated to use unified formatting or if a cs_option could be implemented to automatically remove the "%" symbol from the register name and prepended # before hex number
e.g. addi %d0, %d0, 0x1110 -> addi d0, d0, #0x1110
cc @XVilka
I referred to the disassembly style of objdump, which can be easily changed if desired. However, considering that the existing tests are also in this style, it feels a bit troublesome.
Objdump uses AT&T style by default, while many prefer Intel style, which is the default everywhere else outside binutils.
existing tests are also in this style, it feels a bit troublesome.
Maybe some simple python script could help with renaming?
@wargio @ret2libc @thestr4ng3r do you have any opinion on the matter?
we could implement it
we could implement it
@wargio implement what? Sorry I don't understand without details.
Add the implementation to change the "assembly style". this should be an easy task in any language.
If most other architectures, like ARM, are using the style with addi d0, d0, #0x1110
I think TriCore should support it as well.
@imbillow so, I guess the consensus that removing %
would be better. Could you please quickly do that and send a PR to Capstone while they didn't release 5.0 yet?
@kabeor please wait for this before tagging
@XVilka Sure. I was going to release at Saturday morning.
@imbillow so, I guess the consensus that removing
%
would be better. Could you please quickly do that and send a PR to Capstone while they didn't release 5.0 yet?
I'm sorry. Due to some personal matters at home, I will not be able to submit code for the next few days (estimated 3-7 days).
@imbillow Don't worry, we can wait for it.
@imbillow so, I guess the consensus that removing
%
would be better. Could you please quickly do that and send a PR to Capstone while they didn't release 5.0 yet?I'm sorry. Due to some personal matters at home, I will not be able to submit code for the next few days (estimated 3-7 days).
No worries, I will do it tonight.
@imbillow so, I guess the consensus that removing
%
would be better. Could you please quickly do that and send a PR to Capstone while they didn't release 5.0 yet?I'm sorry. Due to some personal matters at home, I will not be able to submit code for the next few days (estimated 3-7 days).
No worries, I will do it tonight.
By the way, in most cases, just modifying 'TriCoreInsnPrinter.c' will be enough, which should be fairly easy. However, some instructions have implicit register operands (like '%a15'), for which I hardcoded the '%' in the tablegen files. This might be a bit troublesome.
Sent a PR here: https://github.com/capstone-engine/capstone/pull/2067
Hi, which fork of the capstone framework are you using? I see in the src:
err_no = cs_open(CS_ARCH_TRICORE, (cs_mode)0, handle);
but capstone is not official supporting tricore(?)