Closed VzdornovNA88 closed 2 years ago
Chances are you compiled without debugging symbols in the executable or stripped them afterwards. Without debug symbols, disassembly is not possible and even in general your debug experience will be poor.
Use gdb from the command line (or use the Debug Console) and try disassembling yourself disassemble main
https://visualgdb.com/gdbreference/commands/disassemble
Please take a look at your compiler options. YOu should have -g -Og
. or -g -O0
https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
Bottom line, if gdb cannot find your function, neither can we.
Hi, again, like I said above , I have checked the gdb output with 'disassembly' command and the output is right(it means that gdb output contains the disassembled code), just You should read again my first message. And I have used '-g' options of compiler otherwise I wouldn't get disassembled info from gdb, once again, gdb works fine ! like I said in my first message but cortex debug doesn't show the same information, so what's next ?
Can you enable gdb debugging and with "showDevDebugOutput": true
and see in the debug console the commands sent to gdb and responses we get back. Maybe we didn't even get that far to send a gdb-command. I don't see any output from the Debug Console
You can issue gdb-commands yourself from the 'Debug Console' and see what you get. A simple mismatch between the exe-name between experiments (command-line vs. the settings in the debugger can do it) So, not it is not clear to me based on the info I see that gdb is able to disassemble. I can believe there is a problem but it works fine for me. I don't have your executable either so, I don't have much to go on. Can I have that or something liie that please? It is possible that we are unable to read the symbols from the executable as well..
I think I know what the problem is but I still need an executable. I can try to work with it, please know that I don't have your HW setup.
Ok, now this is a constructive dialogue for me, thanks. So , I am going to set '"showDevDebugOutput": true' and send the result of debugging in my next message. In addition , I applied gdb commands , like a 'disassembly main' in the text field of debug console of vs code, I want to say that I am fine debugging the program , if my settings in 'launch.json' file was wrong (as example name of elf file was wrong) I wouldn't run debug.
Ok, I have to think about this -> '... I still need an executable....', just it is NDA. I should make a minimal working example for that
Yes, any example is nice. Not sure how else I can debug. If this is not working, chances are that there are some other things not working (totally unrelated to disassembly), which is why it is important.
I have done : (unfortunately, I had to replace project NAME and elf)
start to main:
`Reading symbols from 'G:\XXX-01/build/XXX-01.elf'
Finished reading symbols
Please check TERMINAL tab (gdb-server) for output from openocd.exe
Launching server: "openocd.exe" "-c" "gdb_port 50000" "-c" "tcl_port 50001" "-c" "telnet_port 50002" "-s" "G:\XXX-01" "-f" "G:\XXX-01/openocd.cfg"
Launching GDB: "G:/stm32-gcc-cmake-tool-chain/eabi/bin/arm-none-eabi-gdb.exe" "-q" "--interpreter=mi2"
1-gdb-set target-async on
2-interpreter-exec console "source c:/Users/xxxxxxxxxx/.vscode/extensions/marus25.cortex-debug-0.4.7/support/gdbsupport.init"
3-interpreter-exec console "set print demangle on"
4-interpreter-exec console "set print asm-demangle on"
5-target-select extended-remote localhost:50000
6-interpreter-exec console "monitor reset halt"
7-target-download
8-interpreter-exec console "monitor reset halt"
9-enable-pretty-printing
10-interpreter-exec console "monitor foreach t [target names] { $t configure -event gdb-detach { shutdown } }"
undefinedG:\stm32-gcc-cmake-tool-chain\eabi\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-group-added","output":[["id","i1"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"console","content":"Reading symbols from G:\XXX-01/build/XXX-01.elf...\n"}]}
Reading symbols from G:\XXX-01/build/XXX-01.elf...
GDB -> App: {"token":1,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
GDB -> App: {"token":2,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
GDB -> App: {"token":3,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"cmd-param-changed","output":[["param","print asm-demangle"],["value","on"]]}]}
GDB -> App: {"token":4,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-group-started","output":[["id","i1"],["pid","42000"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-created","output":[["id","1"],["group-id","i1"]]}]}
GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"console","content":"0x080021a0 in prvIdleTask (pvParameters=
GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"console","content":"Temporary breakpoint 2, main () at G:/XXX-01/Core/Src/main.c:81\n"}]} Temporary breakpoint 2, main () at G:/XXX-01/Core/Src/main.c:81 GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"console","content":"81\t HAL_Init();\n"}]} 81 HAL_Init(); GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"exec","asyncClass":"stopped","output":[["reason","breakpoint-hit"],["disp","del"],["bkptno","2"],["frame",[["addr","0x080012e8"],["func","main"],["args",[]],["file","G:/XXX-01/Core/Src/main.c"],["fullname","G:\XXX-01\Core\Src\main.c"],["line","81"],["arch","armv7e-m"]]],["thread-id","1"],["stopped-threads","all"]]}]} GDB -> App: {"outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"breakpoint-deleted","output":[["id","2"]]}]} 14-thread-list-ids 15-thread-list-ids 16-data-list-register-names 17-data-list-register-names GDB -> App: {"token":14,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["thread-ids",[["thread-id","1"]]],["current-thread-id","1"],["number-of-threads","1"]]}} 18-thread-info 1 GDB -> App: {"token":15,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["thread-ids",[["thread-id","1"]]],["current-thread-id","1"],["number-of-threads","1"]]}} 19-thread-info 1 GDB -> App: {"token":16,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["register-names",["r0","r1","r2","r3","r4","r5","r6","r7","r8","r9","r10","r11","r12","sp","lr","pc","","","","","","","","","","xPSR","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","d10","d11","d12","d13","d14","d15","","","","","","","","","","","","","","","","","fpscr","msp","psp","primask","basepri","faultmask","control","s0","s1","s2","s3","s4","s5","s6","s7","s8","s9","s10","s11","s12","s13","s14","s15","s16","s17","s18","s19","s20","s21","s22","s23","s24","s25","s26","s27","s28","s29","s30","s31"]]]}} GDB -> App: {"token":17,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["register-names",["r0","r1","r2","r3","r4","r5","r6","r7","r8","r9","r10","r11","r12","sp","lr","pc","","","","","","","","","","xPSR","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","d10","d11","d12","d13","d14","d15","","","","","","","","","","","","","","","","","fpscr","msp","psp","primask","basepri","faultmask","control","s0","s1","s2","s3","s4","s5","s6","s7","s8","s9","s10","s11","s12","s13","s14","s15","s16","s17","s18","s19","s20","s21","s22","s23","s24","s25","s26","s27","s28","s29","s30","s31"]]]}} GDB -> App: {"token":18,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["threads",[[["id","1"],["target-id","Remote target"],["frame",[["level","0"],["addr","0x080012e8"],["func","main"],["args",[]],["file","G:/XXX-01/Core/Src/main.c"],["fullname","G:\XXX-01\Core\Src\main.c"],["line","81"],["arch","armv7e-m"]]],["state","stopped"]]]]]}} GDB -> App: {"token":19,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["threads",[[["id","1"],["target-id","Remote target"],["frame",[["level","0"],["addr","0x080012e8"],["func","main"],["args",[]],["file","G:/XXX-01/Core/Src/main.c"],["fullname","G:\XXX-01\Core\Src\main.c"],["line","81"],["arch","armv7e-m"]]],["state","stopped"]]]]]}} 20-data-list-register-values N GDB -> App: {"token":20,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["register-values",[[["number","0"],["value","536870912"]],[["number","1"],["value","536872004"]],[["number","2"],["value","134217728"]],[["number","3"],["value","134218981"]],[["number","4"],["value","536880012"]],[["number","5"],["value","0"]],[["number","6"],["value","0"]],[["number","7"],["value","0"]],[["number","8"],["value","0"]],[["number","9"],["value","0"]],[["number","10"],["value","0"]],[["number","11"],["value","0"]],[["number","12"],["value","0"]],[["number","13"],["value","0x2001fff8"]],[["number","14"],["value","134241591"]],[["number","15"],["value","0x80012e8 <main+2>"]],[["number","25"],["value","1627389952"]],[["number","58"],["value","0"]],[["number","59"],["value","0"]],[["number","60"],["value","0"]],[["number","61"],["value","0"]],[["number","62"],["value","0"]],[["number","63"],["value","0"]],[["number","64"],["value","0"]],[["number","65"],["value","0"]],[["number","66"],["value","0"]],[["number","67"],["value","0"]],[["number","68"],["value","0"]],[["number","69"],["value","0"]],[["number","70"],["value","0"]],[["number","71"],["value","0"]],[["number","72"],["value","0"]],[["number","73"],["value","0"]],[["number","90"],["value","0"]],[["number","91"],["value","0x2001fff8"]],[["number","92"],["value","0x0"]],[["number","93"],["value","0"]],[["number","94"],["value","0"]],[["number","95"],["value","0"]],[["number","96"],["value","0"]],[["number","97"],["value","0"]],[["number","98"],["value","0"]],[["number","99"],["value","0"]],[["number","100"],["value","0"]],[["number","101"],["value","0"]],[["number","102"],["value","0"]],[["number","103"],["value","0"]],[["number","104"],["value","0"]],[["number","105"],["value","0"]],[["number","106"],["value","0"]],[["number","107"],["value","0"]],[["number","108"],["value","0"]],[["number","109"],["value","0"]],[["number","110"],["value","0"]],[["number","111"],["value","0"]],[["number","112"],["value","0"]],[["number","113"],["value","0"]],[["number","114"],["value","0"]],[["number","115"],["value","0"]],[["number","116"],["value","0"]],[["number","117"],["value","0"]],[["number","118"],["value","0"]],[["number","119"],["value","0"]],[["number","120"],["value","0"]],[["number","121"],["value","0"]],[["number","122"],["value","0"]],[["number","123"],["value","0"]],[["number","124"],["value","0"]],[["number","125"],["value","0"]],[["number","126"],["value","0"]],[["number","127"],["value","0"]],[["number","128"],["value","0"]]]]]}} 21-stack-info-depth --thread 1 10000 22-data-list-register-values N 23-stack-info-depth --thread 1 10000 GDB -> App: {"token":21,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["depth","1"]]}} 24-stack-list-frames --thread 1 0 0 GDB -> App: {"token":22,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["register-values",[[["number","0"],["value","536870912"]],[["number","1"],["value","536872004"]],[["number","2"],["value","134217728"]],[["number","3"],["value","134218981"]],[["number","4"],["value","536880012"]],[["number","5"],["value","0"]],[["number","6"],["value","0"]],[["number","7"],["value","0"]],[["number","8"],["value","0"]],[["number","9"],["value","0"]],[["number","10"],["value","0"]],[["number","11"],["value","0"]],[["number","12"],["value","0"]],[["number","13"],["value","0x2001fff8"]],[["number","14"],["value","134241591"]],[["number","15"],["value","0x80012e8 <main+2>"]],[["number","25"],["value","1627389952"]],[["number","58"],["value","0"]],[["number","59"],["value","0"]],[["number","60"],["value","0"]],[["number","61"],["value","0"]],[["number","62"],["value","0"]],[["number","63"],["value","0"]],[["number","64"],["value","0"]],[["number","65"],["value","0"]],[["number","66"],["value","0"]],[["number","67"],["value","0"]],[["number","68"],["value","0"]],[["number","69"],["value","0"]],[["number","70"],["value","0"]],[["number","71"],["value","0"]],[["number","72"],["value","0"]],[["number","73"],["value","0"]],[["number","90"],["value","0"]],[["number","91"],["value","0x2001fff8"]],[["number","92"],["value","0x0"]],[["number","93"],["value","0"]],[["number","94"],["value","0"]],[["number","95"],["value","0"]],[["number","96"],["value","0"]],[["number","97"],["value","0"]],[["number","98"],["value","0"]],[["number","99"],["value","0"]],[["number","100"],["value","0"]],[["number","101"],["value","0"]],[["number","102"],["value","0"]],[["number","103"],["value","0"]],[["number","104"],["value","0"]],[["number","105"],["value","0"]],[["number","106"],["value","0"]],[["number","107"],["value","0"]],[["number","108"],["value","0"]],[["number","109"],["value","0"]],[["number","110"],["value","0"]],[["number","111"],["value","0"]],[["number","112"],["value","0"]],[["number","113"],["value","0"]],[["number","114"],["value","0"]],[["number","115"],["value","0"]],[["number","116"],["value","0"]],[["number","117"],["value","0"]],[["number","118"],["value","0"]],[["number","119"],["value","0"]],[["number","120"],["value","0"]],[["number","121"],["value","0"]],[["number","122"],["value","0"]],[["number","123"],["value","0"]],[["number","124"],["value","0"]],[["number","125"],["value","0"]],[["number","126"],["value","0"]],[["number","127"],["value","0"]],[["number","128"],["value","0"]]]]]}} GDB -> App: {"token":23,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["depth","1"]]}} GDB -> App: {"token":24,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["stack",[["frame",[["level","0"],["addr","0x080012e8"],["func","main"],["file","G:/XXX-01/Core/Src/main.c"],["fullname","G:\XXX-01\Core\Src\main.c"],["line","81"],["arch","armv7e-m"]]]]]]}} 25-stack-list-frames --thread 1 0 0 GDB -> App: {"token":25,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["stack",[["frame",[["level","0"],["addr","0x080012e8"],["func","main"],["file","G:/XXX-01/Core/Src/main.c"],["fullname","G:\XXX-01\Core\Src\main.c"],["line","81"],["arch","armv7e-m"]]]]]]}} 26-var-update --thread 1 --frame 0 --all-values watch_fd4c793dab04b768cefdb6138e763e19c04221867d9f14c628e929fa77ee39c7 27-var-update --thread 1 --frame 0 --all-values watch_631abb892b8dd67c8cc0a59da2617da920437e8c2028837f85a956fe1452b3da 28-var-update --thread 1 --frame 0 --all-values watch_f4a12306453dd4da79ebcee3a4b31ad6b3c2e545717404ed0486ed80b5d50461 GDB -> App: {"token":26,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","Variable object not found"]]}} 29-var-create watch_fd4c793dab04b768cefdb6138e763e19c04221867d9f14c628e929fa77ee39c7 @ "Analog_Channel[21]" GDB -> App: {"token":27,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","Variable object not found"]]}} 30-var-create watch_631abb892b8dd67c8cc0a59da2617da920437e8c2028837f85a956fe1452b3da @ "Resist_Channel[0]" GDB -> App: {"token":28,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","Variable object not found"]]}} 31-var-create watch_f4a12306453dd4da79ebcee3a4b31ad6b3c2e545717404ed0486ed80b5d50461 @ "PIT_5V_Channel[0]" GDB -> App: {"token":29,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","-var-create: unable to create variable object"]]}} watch: -var-create: unable to create variable object (from var-create watch_fd4c793dab04b768cefdb6138e763e19c04221867d9f14c628e929fa77ee39c7 @ "Analog_Channel[21]")GDB -> App: {"token":30,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","-var-create: unable to create variable object"]]}} watch: -var-create: unable to create variable object (from var-create watch_631abb892b8dd67c8cc0a59da2617da920437e8c2028837f85a956fe1452b3da @ "Resist_Channel[0]")GDB -> App: {"token":31,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","-var-create: unable to create variable object"]]}} watch: -var-create: unable to create variable object (from var-create watch_f4a12306453dd4da79ebcee3a4b31ad6b3c2e545717404ed0486ed80b5d50461 @ "PIT_5V_Channel[0]")32-data-evaluate-expression --thread 1 --frame 0 CODE GDB -> App: {"token":32,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","No symbol \"CODE\" in current context."]]}} hover: No symbol "CODE" in current context. (from data-evaluate-expression --thread 1 --frame 0 CODE)`
the result of applying 'disassemble main' for gdb from debug console of vs code during debugging and in the mode 'stop' at the main function :
disassemble main
33-thread-select 1
34-stack-select-frame 0
35-interpreter-exec console "disassemble main"
GDB -> App: {"token":33,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["new-thread-id","1"],["frame",[["level","0"],["addr","0x080012e8"],["func","main"],["args",[]],["file","G:/XXX-01/Core/Src/main.c"],["fullname","G:\XXX-01\Core\Src\main.c"],["line","81"],["arch","armv7e-m"]]]]}}
GDB -> App: {"token":34,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"console","content":"Dump of assembler code for function main:\n"}]}
Dump of assembler code for function main:
GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"console","content":" 0x080012e6 <+0>:\tpush\t{r3, lr}\n"}]}
0x080012e6 <+0>: push {r3, lr}
GDB -> App: {"outOfBandRecord":[{"isStream":true,"type":"console","content":"=> 0x080012e8 <+2>:\tbl\t0x8003e1c
the result of applying "Cortex-Debug: Set Force Disassembly" command for 'cortex-debug' extenssion in the same mode of debugger like a previos output
42-thread-list-ids GDB -> App: {"token":42,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["thread-ids",[["thread-id","1"]]],["current-thread-id","1"],["number-of-threads","1"]]}} 43-thread-info 1 GDB -> App: {"token":43,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["threads",[[["id","1"],["target-id","Remote target"],["frame",[["level","0"],["addr","0x080012e8"],["func","main"],["args",[]],["file","G:/XXX-01/Core/Src/main.c"],["fullname","G:\XXX-01\Core\Src\main.c"],["line","81"],["arch","armv7e-m"]]],["state","stopped"]]]]]}} 44-stack-info-depth --thread 1 10000 GDB -> App: {"token":44,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["depth","1"]]}} 45-stack-list-frames --thread 1 0 0 GDB -> App: {"token":45,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["stack",[["frame",[["level","0"],["addr","0x080012e8"],["func","main"],["file","G:/XXX-01/Core/Src/main.c"],["fullname","G:\XXX-01\Core\Src\main.c"],["line","81"],["arch","armv7e-m"]]]]]]}} 46-var-update --thread 1 --frame 0 --all-values watch_fd4c793dab04b768cefdb6138e763e19c04221867d9f14c628e929fa77ee39c7 47-var-update --thread 1 --frame 0 --all-values watch_631abb892b8dd67c8cc0a59da2617da920437e8c2028837f85a956fe1452b3da 48-var-update --thread 1 --frame 0 --all-values watch_f4a12306453dd4da79ebcee3a4b31ad6b3c2e545717404ed0486ed80b5d50461 GDB -> App: {"token":46,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","Variable object not found"]]}} 49-var-create watch_fd4c793dab04b768cefdb6138e763e19c04221867d9f14c628e929fa77ee39c7 @ "Analog_Channel[21]" GDB -> App: {"token":47,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","Variable object not found"]]}} 50-var-create watch_631abb892b8dd67c8cc0a59da2617da920437e8c2028837f85a956fe1452b3da @ "Resist_Channel[0]" GDB -> App: {"token":48,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","Variable object not found"]]}} 51-var-create watch_f4a12306453dd4da79ebcee3a4b31ad6b3c2e545717404ed0486ed80b5d50461 @ "PIT_5V_Channel[0]" GDB -> App: {"token":49,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","-var-create: unable to create variable object"]]}} watch: -var-create: unable to create variable object (from var-create watch_fd4c793dab04b768cefdb6138e763e19c04221867d9f14c628e929fa77ee39c7 @ "Analog_Channel[21]")GDB -> App: {"token":50,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","-var-create: unable to create variable object"]]}} watch: -var-create: unable to create variable object (from var-create watch_631abb892b8dd67c8cc0a59da2617da920437e8c2028837f85a956fe1452b3da @ "Resist_Channel[0]")GDB -> App: {"token":51,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","-var-create: unable to create variable object"]]}} watch: -var-create: unable to create variable object (from var-create watch_f4a12306453dd4da79ebcee3a4b31ad6b3c2e545717404ed0486ed80b5d50461 @ "PIT_5V_Channel[0]")
you can not look at errors when creating variables, the result without which will be the same
the result of applying "Cortex-Debug: View Memory" command for 'cortex-debug' extenssion in the same mode of debugger like a previos output
52-data-read-memory-bytes "0x00000000" 4096 GDB -> App: [{"token":52,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["memory",[[["begin","0x00000000"],["offset","0x00000000"],["end","0x00001000"],["contents","00000220015d00081d1500081f15000821150008231500082515000800000000000000000000000000000000413300082715000800000000e133000829150008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d000841150008511500086115000871150008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d00080000000000000000000000000000000000000000000000000000000000000000515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d000800000000515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008515d0008ffffffffffffffff844641ea000313f003036dd1403a41d351f8043b40f8043b51f8043b40f8043b51f8043b40f8043b51f8043b40f8043b51f8043b40f8043b51f8043b40f8043b51f8043b40f8043b51f8043b40f8043b51f8043b40f8043b51f8043b40f8043b51f8043b40f8043b51f8043b40f8043b51f8043b40f8043b51f8043b40f8043b51f8043b40f8043b51f8043b40f8043b403abdd2303211d351f8043b40f8043b51f8043b40f8043b51f8043b40f8043b51f8043b40f8043b103aedd20c3205d351f8043b40f8043b043af9d2043208d0d2071cbf11f8013b00f8013b01d30b8803806046704700bf082a13d38b078dd010f003038ad0c3f10403d21adb071cbf11f8013b00f8013b80d331f8023b20f8023b7be7043ad9d3013a11f8013b00f8013bf9d20b7803704b7843708b7883706046704700f1340191e838009c46a6464cf8045d90e8ff0fe54600bd90ec210b704700bf80ec210b704700bf90ec200b704700bf80ec200b704700bfd0ec200b704700bfc0ec200b704700bff0ec0201f0ec0211f0ec0221f0ec0231f0ec0241f0ec0251f0ec0261f0ec0271f0ec0281f0ec0291f0ec02a1f0ec02b1f0ec02c1f0ec02d1f0ec02e1f0ec02f1704700bfe0ec0201e0ec0211e0ec0221e0ec0231e0ec0241e0ec0251e0ec0261e0ec0271e0ec0281e0ec0291e0ec02a1e0ec02b1e0ec02c1e0ec02d1e0ec02e1e0ec02f1704700bfb0fc0181b0fc0191b0fc01a1b0fc01b1704700bfa0fc0181a0fc0191a0fc01a1a0fc01b1704700bfec4600b52de900502de9ff1f4ff000032de90c0001a905f01dffddf840e012b0704700bfec4600b52de900502de9ff1f4ff000032de90c0001a905f047ffddf840e012b0704700bfec4600b52de900502de9ff1f4ff000032de90c0001a905f057ffddf840e012b0704700bfec4600b52de900502de9ff1f4ff000032de90c0001ab05f01bffddf840e012b0704700bfec4600b52de900502de9ff1f4ff000032de90c0001aa05f087ffddf840e012b0704700bf10b5054c237833b9044b13b10448aff300800123237010bd4404002000000000946c000808b5034b1bb103490348aff3008008bd0000000048040020946c000810b58cb0002409940a940b942022214601a805f043fc51484ff0a04303604ff4403343608460c4600461012343610823836104774477036280f824404ff49063c3624ff48063036380f83840c46380f8404003f03bff002862d10023099309a93e4804f01ffb00285dd13d4b019306230293002303937f2204920422059206930deb0201354804f073f800284ed1354b01930c23029301a9304804f069f8002847d1314b01931223029301a92b4804f05ff8002840d12d4b01931823029301a9264804f055f8002839d1294b01934ff48073029301a9214804f04af8002831d1244b01934ff48373029301a91b4804f03ff850bb204b01934ff48673029301a9164804f035f818bb1c4b01934ff48973029301a9114804f02bf8e0b90cb010bd00f010fe99e700f00dfe9ee700f00afeade700f007feb4e700f004febbe700f001fec2e700f0fefdcae700f0fbfdd1e700f0f8fdd8e700f0f5fddfe76804002002003004040060080800900c1000c0102000f014400020198000501d0008302e00b589b020220021684605f087fb4548454b03604ff44033436000238360c36003610122426108228261037743770722026280f824304ff49062c2624ff48062026380f83830c36380f8403003f07efe00284ed1354b009306230193002302937f22039204220492059369462d4803f0bfff002840d12e4b00930c2301936946284803f0b5ff002839d12a4b0093122301936946234803f0abff002832d1264b00931823019369461e4803f0a1ff60bb224b00934ff4807301936946194803f097ff28bb1e4b00934ff4837301936946144803f08dfff0b91a4b00934ff48673019369460f4803f083ffb8b909b05df804fb00f067fdade700f064fdbbe700f061fdc2e700f05efdc9e700f05bfdcfe700f058fdd6e700f055fddde700f052fde4e700bfd4040020000100500800900c1000c0102000f0140008302e002090360080f03e0000524710b58cb0002409940a940b942022214601a805f0dffa8648864b03604ff4403343608460c46004610123436108238361047744770f23036280f824404ff49063c3624ff48063036380f83840c46380f8404003f0d7fd002840f0b6800023099309a9734804f0baf9002840f0b080724b019306230293002303937f2204920422059206930deb0201694803f00dff002840f0a080694b01930c23029301a9644803f002ff002840f09880654b01931223029301a95e4803f0f7fe002840f09080604b01931823029301a9594803f0ecfe002840f088805c4b01934ff48073029301a9534803f0e0fe00287fd1574b01934ff48373029301a94d4803f0d5fe002877d1534b01934ff48673029301a9484803f0cafe00286fd14e4b01934ff48973029301a9424803f0bffe002867d14a4b01934ff48c73029301a93d4803f0b4fe00285fd1454b01934ff40073029301a9374803f0a9fe002857d1414b019340f20623029301a9324803f09efe00284fd13c4b01934ff40373029301a92c4803f093fe002847d1384b019340f21223029301a9274803f088fe00283fd1334b01934ff40673029301a9214803f07dfec0bb2f4b01934ff44073029301a91c4803f073fe88bb0cb010bd00f058fc46e700f055fc4ce700f052fc5ce700f04ffc64e700f04cfc6ce700f049fc74e700f046fc7ce700f043fc84e700f040fc8ce700f03dfc94e700f03afc9ce700f037fca4e700f034fcace700f031fcb4e700f02efcbce700f02bfcc3e700f028fccae700bf400500200004005002003004040060080800900c1000c0102000f014400020198000501d000180210002b0250004002a0008302e001060320040c03a0080f03e0000214300b589b020220021684605f0a9f92348234b03604ff44033436000238360c36003610122426108228261037743770222026280f824304ff49062c2624ff48062026380f83830c36380f8403003f0a0fcd8b9144b009306230193002302937f22039204220492059369460c4803f0e2fd70b90d4b00930c2301936946074803f0d9fd40b909b05df804fb00f0bdfbe0e700f0bafbede700f0b7fbf3e7ac05002000050050001060320020903670b594b0044600230f9310931193129313930368b3f1a04f40d0834a934200f0a080824a934200f01d81814a934240f08880804a136801331360012b00f076817d4bda6c42f00802da64db6c03f008030e930e9b4ff440730f93032310930fa9764803f057fb7648764b03602623436000238360c360802202614ff4807242614ff480628261c361036204f035f9002840f057816a4b63659c6252e06a4a136801331360012b4ed0634bda6c42f00402da64da6c02f004020292029ada6c42f00102da64da6c02f001020392039ada6c42f00202da64db6c03f002030493049b03260f9610960fa9584803f013fb0f230f931096002511950fa94ff0904003f009fb4ff4a0430f93109611950fa9504803f000fb4f48504b0360052343608560c560802303614ff4807343614ff480638361c561056204f0dff878b9454b63659c6214b070bd3c4bda6c42f40052da64db6c03f400530193019ba5e700f0fefaece7394a136801331360012b4ed0324bda6c42f00102da64da6c02f001020692069ada6c42f00402da64da6c02f004020792079ada6c42f00202da64db6c03f002030893089bf0230f93032610960fa94ff0904003f0aefa30230f931096002511950fa9214803f0a5fa4ff400430f93109611950fa91e4803f09cfa1f48204b0360242343608560c560802303614ff4807343614ff480638361c561056204f07bf870b9154b63659c629ae70a4bda6c42f40052da64db6c03f400530593059ba5e700f09bfaede70001005000040050000500506404002000100240000c0048380700204400024060040020000800480004004818060020080002407806002030000240384a136801331360012b4fd0364bda6c42f00202da64da6c02f002020a920a9ada6c42f01002da64da6c02f010020b920b9ada6c42f00802da64db6c03f008030c930c9b42f203030f93032610960fa9264803f02dfa4ff47e530f931096002511950fa9224803f023fa4ff4f8430f93109611950fa91f4803f01afa1e481f4b0360252343608560c560802303614ff4807343614ff480638361c561056203f0f9ff70b9144b63659c6218e70e4bda6c42f48042da64db6c03f480430993099ba4e700f019faede7074bda6c42f48042da64db6c03f480430d930d9b7ee600f00bfaa5e664040020001002400004004800100048000c0048d80600201c00024008b54ff47a7000f007fe064a1368013313600221044803f0aafa044804f0e4f9efe700bf98070020001000486c080020704700207047000008b5044a0021044800f07efd034b186008bd00bfb86c00084d0e00089c07002000b583b01a4b9a6c42f004029a649a6c02f004020092009a9a6c42f001029a649b6c03f001030193019b002205210b2004f0bafe0b2004f0effe002205210c2004f0b2fe0c2004f0e7fe002205210d2004f0aafe0d2004f0dffe002205210e2004f0a2fe0e2004f0d7fe03b05df804fb0010024008b50f480f4b0360002343608360c3600374437483740122426182610221c161016242628262c262026343638363c36304f05ef800b908bd00f078f9fbe700bfa40700200064004008b51048104b036000238360c36003744374837426224261012282610621c1610221016242628262c26202630322426308228263c36304f037f800b908bd00f051f9fbe708080020006c004030b58bb00023059306930793089309930368364a934204d0354a93423ed00bb030bd344a136801331360012b2bd0324bda6c42f00102da64da6c02f001020192019ada6c42f00802da64db6c03f008030293029b"]]]]]}}]
The result was obtained using this file : XXX-01.zip
In addition, using the "Cortex-Debug: View Disassembly (Function)" command doesn't give me any outgoing information in the debug console but VS Code shows an error, like I said in my first message of the topic - "No function matching name/regexp 'main' found."
I noticed that you are using gcc-arm-none-eabi 10.2.1
. That is not what I have from ST. I have 9.3.1
.
Where can I download what you are using? What is your User/Workspace setting cortex-debug.armToolchainPath
set to? This is where objdump
exists. Without a proper/compatible objdump, this will not work.
I see the following above
`Reading symbols from 'G:\XXX-01/build/XXX-01.elf'
Finished reading symbols
So, objdump did run but not sure which version and we typically find it in the dir pointed to by cortex-debug.armToolchainPath
(or launch.json armToolchainPath
)
OK,I see, it looks like a bad path for arm tools, unfortunately this project is located on my job and settings for cortex debug, I can figure out that tomorrow only, but if it will be interesting for you I have repo with the similar project on github and also I have repo with project of sandbox which contains vs code in the docker those projects must work, at least, there is a short way to imitation my problem using those projects together.
If you can tell me where you downloaded ARM gnu tools, then I can do the same. If it is an issue with GCC 10.x, the I would like to get ahead of that. I can wait. If your repo has the details, then yes, I can look at it.
We had a similar situation with GDB 9.x where it broke stuff that was working with 8.x. They deprecated commands/aliases -- not documented or announced. They just did it.
VzdornovNA88 will most likely use the version from https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads as this is where you get the new versions from. We only use versions from this official source.
Exactly ! PhilippHaefele is right, I use this official source. So , now I can provide you with the following info :
I can explain why I sugest them , if you don't want to wait tommorow when I can send the info of settings for cortex-debug , You can run the sandbox and clone 'signaler_example_freertos' into it then you will get the similar state as mine, and then you can run debug, but also you can download and do all the same in your envirement manualy:
Anyway , I am gonna send the addition info for you tommorow, so that we can just wait tommorow , thanks for your help.
I downloaded it from the ARM website (Mac binaries). This is where I always go myself but there are people who get stuff from elsewhere. And, I usually switch to silicon-vendor-supplied versions just in case.
I will see what is going wrong, when my day job allows
Hi. You were right, my armToolchainPath was wrong , I changed it to "cortex-debug.armToolchainPath": "${env:CMAKE_NONE_EABI_STM32_TOOL_CHAIN}/eabi/bin/arm-none-eabi-objdump.exe", that is path to my toolchain gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux it the launch.json , the result is the same - cortex-debug doesn't show the window with disassembled info , look at that :
Then I decided to check the 'arm-none-eabi-objdump.exe' for finction main :
`PS G:\XXX-01\build> G:/stm32-gcc-cmake-tool-chain/eabi/bin/arm-none-eabi-objdump.exe --disassemble=main -S XXX-01.elf
as we can see that variant of command 'arm-none-eabi-objdump.exe' is workable , so let's go next :
`PS G:\XXX-01\build> G:/stm32-gcc-cmake-tool-chain/eabi/bin/arm-none-eabi-objdump.exe --syms XXX-01.elf
PS G:\XXX-01\build>`
as we can see that variant of command 'arm-none-eabi-objdump.exe' also works.
I am worried about the window disassembler , like I understood this window has to show disassembled info but it was not displayed. Let have a look :
if (url) { vscode.window.showTextDocument(vscode.Uri.parse(url)); }
Like I understood url mustn't become 'undefined' or 'null' and I checked the code and it sems to me that url contains string but I am worried about function vscode.Uri.parse(url)
...
Hmm... Anyway, 'vscode.window.showTextDocument(vscode.Uri.parse(url));' doesn't return the activated text editor
I think I know what is wrong. It is easy for me to fix this one case. But I need to know why and fix the root cause. The problem is that we are not finding the symbol 'main' although it is there in the elf file and the objdump clearly shows it. If it can't find main
, what else (globals, locals, etc.) can it not find or got mischaracterized. This is what I am more worried about.
The problem is it will take me some time to create a test environment with the elf file (since I don't have the HW) to and I have one more pressing issue that needs attention.
Yes, quite a few of the VSCode APIs don't return anything meaningful and most stuff is asynchronous. You ask for something and sometime in the future, it happens. Its JavaScript/NodeJS magic.
the fix is to not depend on main ? =))))) just a joke
as I understand it , until a full investigation is carried out and the true cause is found , this task will not receive the status of a bug or new task ?
is it possible to get more detailed information with a link to the place in the source code where it broke or at least where you see a quick fix now, for the sake of interest?
I understand (about VS Code API), but in the case of 'vscode.window.showTextDocument(vscode.Uri.parse(url));' , magic hasn't worked =)))
I never used those Tags. It is a bug. I didn't even know I had permission to label things. This is not my repo :-)
I am trying to figure out why this is not working, So, if you want to help.
let functions = this.functionSymbols.filter((s) => s.name === funcname);
It is probably returning an empty array for you. The rabbit hole starts. With the version of ARM tools and your executable, it is working fine for me. Hope it is not a Windows-specific issue (I am using a Mac)
@VzdornovNA88 Could you please put large amounts of text into a separate file and then attach it? Make scrolling and focussing a bit easier. Or you can use collapsible text
Also, we don't use objdump to do the disassembly. We use it only to get symbols table.
arm-none-eabi-objdump --syms -Wi -C XXX-01.elf
Maybe you can attach the output of that on your real executable unless that also is under NDA.
I have attached the output of similar command already in the last message, tomorrow I can apply your variant of that.
By the way, it could be really the specific system problem, but I didn't try my sandbox on Ubuntu 20 ,it's interesting case. Let me try it on next Monday.
Yes, I would like help you. I have little experience of running vs code extension under debugger I tried to figure out how clangd extension works in vs code, but I think it will be long time for me =)))
OK, your comment about long texts is accepted.
The -Wi -C
are super important and will produce some very large output so might be good to redirect to a file.
Hi, this is the result of arm-none-eabi-objdump --syms -Wi -C XXX-01.elf
, I hope it will help...
Hi , I promised to provide the result of running the project on Ubuntu 20, so , I've done it , like I thought, it looks like it only works on a Linux-based distrib.
Environment :
Version: 1.61.1 Commit: c13f1abb110fc756f9b3a6f16670df9cd9d4cf63 Date: 2021-10-14T01:15:35.620Z Electron: 13.5.1 Chrome: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Linux x64 5.4.0-81-generic snap
Settings :
`{ "name": "XXX-01 Debug", "type": "cortex-debug", "request": "launch", "runToEntryPoint": "main", "showDevDebugOutput": false, "servertype": "openocd", "cwd": "${workspaceRoot}", "interface": "swd", "device": "STM32G473VE",
"executable": "${workspaceRoot}/build/XXX-01.elf",
"svdFile" : "${env:CMAKE_NONE_EABI_STM32_TOOL_CHAIN}/cmsis-svd/data/STMicro/STM32G473xx.svd",
"gdbPath" : "${env:CMAKE_NONE_EABI_STM32_TOOL_CHAIN}/eabi/bin/arm-none-eabi-gdb",
"configFiles" : [ "${workspaceRoot}/openocd.cfg", ],
}`
@VzdornovNA88 That is very helpful as I was scratching my head. I will do a careful re-analysis of the issue using the same version of ARM tools as you are on Windows
. My primary machine is Mac and I was working fine, I tried Windows and it worked as well but -- I wasn't using the same ARM tools as you.
Got some free time this week, so lets see.
We have changed strategies (after multiple failed attempts). We are not using objdump without the -Wi
options which reduces the size of the output file -- although with missing info. Apart from objdump we now use nm to augment what info objdump gave us.
You can try out the latest and I can re-open this issue (or file a new one) if it is still an issue.
Thanks ,I am gonna try it out later maybe in month.
Hi.
Unfortunately, I can't apply the "Cortex-Debug: Set Force Disassembly" command. I expect a new window in working space of vs code but the extension doesn't show the window with disassembled information but the debugger step on the next instruction in disassembled code when I press the button F10,I think so because the cursor of debugger in my source stays in the place and int output of gdb new address of instruction is shown. So , I have checked the gdb output with 'disassembly' command and the output is right but the extension doesn't show the window with disassembled information.
Also, I have tried to apply "Cortex-Debug: View Disassembly (Function)" command but got error - "No function matching name/regexp 'main' found."
Short information about of context :
Windows 10
version of vs code : Версия: 1.61.0 (user setup) Фиксация: ee8c7def80afc00dd6e593ef12f37756d8f504ea Дата: 2021-10-07T18:13:09.652Z Electron: 13.5.1 Chrome: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 ОС: Windows_NT x64 10.0.16299
version of cortex debug v0.4.7
version of open OCD
version of arm tools gcc-arm-none-eabi 10.2.1
launch file contains :
"configurations": [ { "name": "KUT-01 Debug", "type": "cortex-debug", "request": "launch", "runToEntryPoint": "main", "showDevDebugOutput": false, "servertype": "openocd",
openocd.cfg file contains :
source [find interface/stlink.cfg] transport select "hla_swd" source [find target/stm32g4x.cfg]
Highly likely, I do something wrong but, unfortunately, I don't have much time to figuring out the right combinations of settings of chain 'vs code -> cortex debug -> open OCD -> gdb'.
Any help is welcome from more competent people in setting up this chain, thanks