This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#7182 - ARM Disassembler
Attached to Project:
Rockbox
Opened by Toni (ahellmann) - Thursday, 17 May 2007, 17:56 GMT+2
Last edited by Barry Wardell (barrywardell) - Thursday, 02 August 2007, 00:28 GMT+2
Opened by Toni (ahellmann) - Thursday, 17 May 2007, 17:56 GMT+2
Last edited by Barry Wardell (barrywardell) - Thursday, 02 August 2007, 00:28 GMT+2
|
DetailsFirst approach of a simple ARM disassembler.
Compared to the gnu objdump it has following enhancements: - shows 'const' data in the disassembly - shows calculated 'const' data (i.e. mov rx, #v1 followed by sub/add rx, rx, #v2) - skips disassembly of accessed 'const' data Currently thumb disassembly is not supported. The binary input must not exceed 8MB. |
This task depends upon
Closed by Barry Wardell (barrywardell)
Thursday, 02 August 2007, 00:28 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed to SVN
Thursday, 02 August 2007, 00:28 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed to SVN
The offsets for branches (and other instructions) are being decoded wrongly. e.g. when running the supplied win32 .exe, I would get "b 0x20" in the output, but with my version compiled for Linux (32-bit x86) I get "b 0xa800020".
I'm attaching my modified version of your code, which includes a Makefile. Can anyone get this working? My attempts at debugging have failed.
The only changes I made to the two .c files were the following:
diff -r ORIG/disasm_arm.c new/disasm_arm.c
2a3
> #include <stdint.h>
197c198
< off = (ULONG)((unsigned __int64)(val&0xff) << (32 - 2 * ((val >> 8) & 15))) | ((val&0xff) >> 2 * ((val >> 8) & 15));
---
> off = (ULONG)((uint64_t)(val&0xff) << (32 - 2 * ((val >> 8) & 15))) | ((val&0xff) >> 2 * ((val >> 8) & 15));
diff -r ORIG/main.c new/main.c
13c13
< void main(int argc, char **argv)
---
> int main(int argc, char **argv)
23c23
< printf(" disassembles input file to 'disasm.txt'");
---
> printf(" disassembles input file to 'disasm.txt'\\n");
118c118
< }
\\ No newline at end of file
---
> }
Toni - what are your plans for this disassembler? I think it could be nice if it was added to Rockbox SVN - maybe in something like a "utils" directory at the same level as apps, tools, firmware etc could be created for tools like this - and we can keep "tools" for tools required to build/install Rockbox.
I agree that it would be great to see this in SVN. Do you plan on working on it further?