We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Is there a possibility to use *fromelf* or any other tool to generate a disassembly file from elf file but with function names and their instructions only?Something similar to the following format:
myFunction 0x060058d8: 2201 ." MOVS r2,#1 0x060058da: 2801 .( CMP r0,#1 0x060058dc: d100 .. BNE 0x60058e0 ; myFunction + 8 0x060058de: 2202 ." MOVS r2,#2 0x060058e0: 8808 .. LDRH r0,[r1,#0]
How does this differ markedly from what it does now?
.text_6 QUADSPI_Valid_WriteBuffer 0x200001e8: e92d4ff8 -..O PUSH {r3-r11,lr} 0x200001ec: 4682 .F MOV r10,r0 0x200001ee: 4689 .F MOV r9,r1 0x200001f0: 0014 .. MOVS r4,r2 0x200001f2: f05f0b00 _... MOVS r11,#0 0x200001f6: 2500 .% MOVS r5,#0 0x200001f8: 2600 .& MOVS r6,#0 0x200001fa: 2700 .' MOVS r7,#0 0x200001fc: f05f0800 _... MOVS r8,#0 0x20000200: 2000 . MOVS r0,#0
Most people would probably run a script against the output to reformat, trim or crop the content, perhaps in Perl or AWK?
Heck, if you're a C programmer, it's the sort of thing you should be able to code pretty quickly.
20000034 SUB16 QUADSPI_Valid_WriteEnable_PH: ; Xref 200000DE 2000012A 20000166 200001CC 20000034 ; 20000204 2000026C 200002C8 20000606 20000034 B510 push {r4, lr} 20000036 2000 movs r0, #0 20000038 49FC ldr r1, [pc, #1008] ; ($2000042C=$00000048) 2000003A 4449 add r1, r9 2000003C 6008 str r0, [r1, #0] 2000003E 60C8 str r0, [r1, #12] 20000040 6148 str r0, [r1, #20] 20000042 6188 str r0, [r1, #24] 20000044 F44F 5000 mov.w r0, #8192 ; $2000 20000048 6208 str r0, [r1, #32] 2000004A 2000 movs r0, #0 2000004C 6108 str r0, [r1, #16] 2000004E 6248 str r0, [r1, #36] 20000050 61C8 str r0, [r1, #28] 20000052 F44F 7080 mov.w r0, #256 ; $100 20000056 6288 str r0, [r1, #40] 20000058 2000 movs r0, #0 2000005A F000 FD06 bl QUADSPI_SetFIFOThreshold 2000005E 2000 movs r0, #0 20000060 F000 FD0D bl QUADSPI_SetDataLength 20000064 2006 movs r0, #6 20000066 49F1 ldr r1, [pc, #964] ; ($2000042C=$00000048) 20000068 4449 add r1, r9 2000006A 62C8 str r0, [r1, #44] 2000006C 4608 mov r0, r1 2000006E F000 FC89 bl QUADSPI_ComConfig_Init 20000072 BF00 nop 20000074 LOC loc_20000074: ; Xref 2000007C 20000074 2020 movs r0, #32 20000076 F000 FD77 bl QUADSPI_GetFlagStatus 2000007A 2801 cmp r0, #1 2000007C D0FA beq.n loc_20000074 2000007E 2200 movs r2, #0 20000080 2102 movs r1, #2 20000082 4608 mov r0, r1 20000084 F000 FCAE bl QUADSPI_AutoPollingMode_Config 20000088 2001 movs r0, #1 2000008A F000 FD14 bl QUADSPI_AutoPollingModeStopCmd 2000008E 2000 movs r0, #0 20000090 F000 FCF5 bl QUADSPI_SetDataLength 20000094 F04F 6000 mov.w r0, #134217728 ; $8000000 20000098 49E4 ldr r1, [pc, #912] ; ($2000042C=$00000048) 2000009A 4449 add r1, r9 2000009C 6008 str r0, [r1, #0] 2000009E 2000 movs r0, #0 200000A0 6248 str r0, [r1, #36] 200000A2 F04F 7080 mov.w r0, #16777216 ; $1000000 200000A6 6108 str r0, [r1, #16] 200000A8 2005 movs r0, #5 200000AA 62C8 str r0, [r1, #44] 200000AC 4608 mov r0, r1 200000AE F000 FC69 bl QUADSPI_ComConfig_Init 200000B2 BF00 nop 200000B4 LOC loc_200000B4: ; Xref 200000BC 200000B4 2008 movs r0, #8 200000B6 F000 FD57 bl QUADSPI_GetFlagStatus 200000BA 2800 cmp r0, #0 200000BC D0FA beq.n loc_200000B4 200000BE 2008 movs r0, #8 200000C0 F000 FD5C bl QUADSPI_ClearFlag 200000C4 2002 movs r0, #2 200000C6 F000 FD59 bl QUADSPI_ClearFlag 200000CA BF00 nop 200000CC LOC loc_200000CC: ; Xref 200000D4 200000CC 2020 movs r0, #32 200000CE F000 FD4B bl QUADSPI_GetFlagStatus 200000D2 2801 cmp r0, #1 200000D4 D0FA beq.n loc_200000CC 200000D6 BD10 pop {r4, pc}