pyocd / pyOCD

Open source Python library for programming and debugging Arm Cortex-M microcontrollers
https://pyocd.io
Apache License 2.0
1.11k stars 477 forks source link

Unable to set breakpoints in vscode #931

Closed farrenv closed 4 years ago

farrenv commented 4 years ago

I am developing in a virtual machine passing through DAPlink running on K20DX as debugger connected to an nRF52840 on the Agora target. I am able to flash binaries to the Agora, and I am able to start and run a debugging session. However, I am unable to set a breakpoint anywhere other than the first line in main().

Here is the debug output that is generated starting a debugging session until it reaches main()

1: (267) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
1: (300) LaunchOptions  ExePath='/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/BUILD/EP_AGORA/GCC_ARM-DEBUG/mbed-os-example-blinky.elf'
1: (300) LaunchOptions  WorkingDirectory='/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky'
1: (300) LaunchOptions  ExeArguments=''
1: (301) LaunchOptions  MIMode='gdb'
1: (301) LaunchOptions  MIDebuggerPath='/tools/gcc-arm-none-eabi-9-2020-q2/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gdb'
1: (301) LaunchOptions  WaitDynamicLibLoad='false'
1: (301) LaunchOptions  DebugServer='/usr/local/bin/pyocd-gdbserver'
1: (301) LaunchOptions  DebugServerArgs=''
1: (301) LaunchOptions  ServerStarted='GDB\ server\ started'
1: (301) LaunchOptions  FilterStderr='true'
1: (301) LaunchOptions  ServerLaunchTimeout='20000'
1: (301) LaunchOptions>
1: (301) LaunchOptions    <SetupCommands>
1: (301) LaunchOptions        <Command IgnoreFailures='false' Description='connect to target'>-target-select remote localhost:3333</Command>
1: (301) LaunchOptions        <Command IgnoreFailures='false' Description='load file'>-file-exec-and-symbols /home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/BUILD/EP_AGORA/GCC_ARM-DEBUG/mbed-os-example-blinky.elf</Command>
1: (301) LaunchOptions        <Command IgnoreFailures='false' Description='reset monitor'>-interpreter-exec console "monitor reset"</Command>
1: (301) LaunchOptions        <Command IgnoreFailures='false' Description='halt monitor'>-interpreter-exec console "monitor halt"</Command>
1: (302) LaunchOptions        <Command IgnoreFailures='false' Description='flash target'>-target-download</Command>
1: (302) LaunchOptions    </SetupCommands>
1: (302) LaunchOptions</LocalLaunchOptions>
1: (419) Starting: "/usr/local/bin/pyocd-gdbserver"
1: (2237) Starting: "/tools/gcc-arm-none-eabi-9-2020-q2/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gdb" --interpreter=mi
1: (2242) DebuggerPid=29833
1: (2306) ->=thread-group-added,id="i1"
1: (2309) ->~"GNU gdb (GNU Arm Embedded Toolchain 9-2020-q2-update) 8.3.1.20191211-git\n"
1: (2309) ->~"Copyright (C) 2019 Free Software Foundation, Inc.\n"
1: (2315) ->~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law."
1: (2315) ->~"\nType \"show copying\" and \"show warranty\" for details.\n"
1: (2315) ->~"This GDB was configured as \"--host=x86_64-linux-gnu --target=arm-none-eabi\".\n"
1: (2316) ->~"Type \"show configuration\" for configuration details.\n"
1: (2317) ->~"For bug reporting instructions, please see:\n"
1: (2317) ->~"<http://www.gnu.org/software/gdb/bugs/>.\n"
1: (2317) ->~"Find the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>."
1: (2317) ->~"\n\n"
1: (2317) ->~"For help, type \"help\".\n"
1: (2318) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"
1: (2318) ->(gdb)
1: (2323) <-1001-gdb-set target-async on
1: (2325) ->1001^done
1: (2325) ->(gdb)
1: (2328) 1001: elapsed time 6
1: (2338) <-1002-target-select remote localhost:3333
1: (2499) ->=thread-group-started,id="i1",pid="42000"
1: (2499) ->&"warning: No executable has been specified and target does not support\ndetermining executable automatically.  Try using the \"file\" command."
1: (2499) ->&"\n"
1: (2499) ->=thread-created,id="1",group-id="i1"
1: (2508) <-1003-thread-info 1
1: (2805) ->~"0x000055b4 in ?? ()\n"
1: (2805) ->*stopped,frame={addr="0x000055b4",func="??",args=[],arch="arm"},thread-id="1",stopped-threads="all"
1: (2805) ->1002^connected
1: (2805) ->(gdb)
1: (2816) 1002: elapsed time 477
1: (2817) <-1004-file-exec-and-symbols /home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/BUILD/EP_AGORA/GCC_ARM-DEBUG/mbed-os-example-blinky.elf
1: (2832) ->1003^done,threads=[{id="1",target-id="Thread 1",frame={level="0",addr="0x000055b4",func="??",args=[],arch="arm"},state="stopped"}]
1: (2832) ->(gdb)
1: (2835) 1003: elapsed time 326
1: (3688) ->1004^done
1: (3688) ->(gdb)
1: (3689) 1004: elapsed time 871
1: (3689) <-1005-interpreter-exec console "monitor reset"
1: (3744) ->1005^done
1: (3744) ->(gdb)
1: (3744) 1005: elapsed time 55
1: (3744) <-1006-interpreter-exec console "monitor halt"
1: (3749) ->1006^done
1: (3749) ->(gdb)
1: (3749) 1006: elapsed time 4
1: (3749) <-1007-target-download
1: (3751) ->1007+download,{section=".text",section-size="37892",total-size="3704027"}
1: (3751) ->1007+download,{section=".text",section-sent="1984",section-size="37892",total-sent="1984",total-size="3704027"}
1: (3772) ->1007+download,{section=".ARM.exidx",section-size="8",total-size="3704027"}
1: (3774) ->1007+download,{section=".data",section-size="2632",total-size="3704027"}
1: (3980) ->[---|---|---|---|---|---|---|---|---|----]
1: (8318) ->[========================================]
1: (8361) ->1007^done,address="0x41bc",load-size="40532",transfer-rate="70456",write-rate="1762"
1: (8361) ->(gdb)
1: (8362) 1007: elapsed time 4612
1: (8362) <-1008-interpreter-exec console "set pagination off"
1: (8362) ->=cmd-param-changed,param="pagination",value="off"
1: (8362) ->1008^done
1: (8363) ->(gdb)
1: (8363) 1008: elapsed time 0
1: (8363) <-1009-gdb-set auto-solib-add on
1: (8363) ->1009^done
1: (8364) ->(gdb)
1: (8364) 1009: elapsed time 0
1: (8364) <-1010-gdb-set solib-search-path /home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/BUILD/EP_AGORA/GCC_ARM-DEBUG:
1: (8381) ->1010^done
1: (8381) ->(gdb)
1: (8381) 1010: elapsed time 17
1: (8381) <-1011-environment-cd /home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky
1: (8382) ->1011^done
1: (8382) ->(gdb)
1: (8382) 1011: elapsed time 0
1: (8382) <-1012-file-exec-and-symbols /home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/BUILD/EP_AGORA/GCC_ARM-DEBUG/mbed-os-example-blinky.elf
1: (8663) ->1012^done
1: (8663) ->(gdb)
1: (8664) 1012: elapsed time 281
1: (8665) <-1013-interpreter-exec console "show architecture"
1: (8666) ->~"The target architecture is set automatically (currently armv7e-m)\n"
1: (8666) ->1013^done
1: (8666) ->(gdb)
1: (8666) 1013: elapsed time 1
1: (8668) <-1014-break-insert -f main
1: (8695) ->1014^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x000001bc",func="main()",file="./main.cpp",fullname="/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/main.cpp",line="14",thread-groups=["i1"],times="0",original-location="main"}
1: (8696) ->(gdb)
1: (8696) 1014: elapsed time 27
1: (8703) Send Event AD7EngineCreateEvent
1: (8705) Send Event AD7ProgramCreateEvent
<--   C (setFunctionBreakpoints-3): {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":3}
<--   C (configurationDone-4): {"command":"configurationDone","type":"request","seq":4}
1: (8783) Send Event AD7LoadCompleteEvent
pyocd-gdbserver: 0000756:WARNING:gdb_server:pyocd-gdbserver is deprecated; please use the new combined pyocd tool.
pyocd-gdbserver: 0001121:INFO:board:Target type is nrf52840
pyocd-gdbserver: 0001338:INFO:dap:DP IDR = 0x2ba01477 (v1 rev2)
pyocd-gdbserver: 0001404:INFO:ap:AHB-AP#0 IDR = 0x24770011 (AHB-AP var1 rev2)
pyocd-gdbserver: 0001458:INFO:ap:AP#1 IDR = 0x02880000 (AP var0 rev0)
pyocd-gdbserver: 0001463:INFO:target_nRF52:NRF52840 not in secure state
pyocd-gdbserver: 0001487:INFO:rom_table:AHB-AP#0 Class 0x1 ROM table #0 @ 0xe00ff000 (designer=244 part=008)
pyocd-gdbserver: 0001502:INFO:rom_table:[0]<e000e000:SCS-M4 class=14 designer=43b part=00c>
pyocd-gdbserver: 0001565:INFO:rom_table:[1]<e0001000:DWT class=14 designer=43b part=002>
pyocd-gdbserver: 0001580:INFO:rom_table:[2]<e0002000:FPB class=14 designer=43b part=003>
pyocd-gdbserver: 0001588:INFO:rom_table:[3]<e0000000:ITM class=14 designer=43b part=001>
pyocd-gdbserver: 0001603:INFO:rom_table:[4]<e0040000:TPIU-M4 class=9 designer=43b part=9a1 devtype=11 archid=0000 devid=ca1:0:0>
pyocd-gdbserver: 0001621:INFO:rom_table:[5]<e0041000:ETM-M4 class=9 designer=43b part=925 devtype=13 archid=0000 devid=0:0:0>
pyocd-gdbserver: 0001635:INFO:cortex_m:CPU core #0 is Cortex-M4 r0p1
pyocd-gdbserver: 0001659:INFO:cortex_m:FPU present: FPv4-SP
pyocd-gdbserver: 0001676:INFO:dwt:4 hardware watchpoints
pyocd-gdbserver: 0001684:INFO:fpb:6 hardware breakpoints, 4 literal comparators
pyocd-gdbserver: 0001750:INFO:server:Semihost server started on port 4444 (core 0)
pyocd-gdbserver: 0001753:INFO:gdbserver:GDB server started on port 3333 (core 0)
=thread-group-added,id="i1"
GNU gdb (GNU Arm Embedded Toolchain 9-2020-q2-update) 8.3.1.20191211-git
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
pyocd-gdbserver: 0001863:INFO:gdbserver:One client connected!
0x000055b4 in ?? ()
pyocd-gdbserver: 0002429:INFO:gdbserver:Attempting to load Argon
pyocd-gdbserver: 0002430:INFO:gdbserver:Attempting to load RTX5
pyocd-gdbserver: 0002434:INFO:gdbserver:RTX5 loaded successfully
1007+download,{section=".text",section-size="37892",total-size="3704027"}
1007+download,{section=".text",section-sent="1984",section-size="37892",total-sent="1984",total-size="3704027"}
1007+download,{section=".ARM.exidx",section-size="8",total-size="3704027"}
1007+download,{section=".data",section-size="2632",total-size="3704027"}
[---|---|---|---|---|---|---|---|---|----]
[========================================]
pyocd-gdbserver: 0007869:INFO:loader:Erased chip, programmed 40960 bytes (10 pages), skipped 0 bytes (0 pages) at 8.74 kB/s
=cmd-param-changed,param="pagination",value="off"
<--   C (threads-5): {"command":"threads","type":"request","seq":5}
1: (8798) <-1015-thread-info
1: (8839) ->1015^done,threads=[{id="1",target-id="Thread 1",frame={level="0",addr="0x000041bc",func="Reset_Handler",args=[],file="./mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/startup_NRF52840.S",fullname="/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/startup_NRF52840.S",line="141",arch="armv7e-m"},state="stopped"}],current-thread-id="1"
1: (8839) ->(gdb)
1: (8840) 1015: elapsed time 41
1: (8851) <-1016-stack-list-frames 0 1000
1: (8852) ->1016^done,stack=[frame={level="0",addr="0x000041bc",func="Reset_Handler",file="./mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/startup_NRF52840.S",fullname="/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/startup_NRF52840.S",line="141",arch="armv7e-m"}]
1: (8854) ->(gdb)
1: (8856) 1016: elapsed time 4
1: (8859) Send Event AD7ProcessInfoUpdatedEvent
1: (8860) Send Event AD7ThreadCreateEvent
1: (8872) <--exec-continue
1: (8873) ->^running
1: (8873) ->*running,thread-id="all"
1: (8873) ->~"Note: automatically using hardware breakpoints for read-only addresses.\n"
Note: automatically using hardware breakpoints for read-only addresses.
1: (8876) ->(gdb)
<--   C (threads-6): {"command":"threads","type":"request","seq":6}
1: (9595) ->=thread-created,id="2",group-id="i1"
1: (9596) ->~"[New Thread 536874720]\n"
1: (9596) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x000001bc",func="main()",file="./main.cpp",fullname="/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/main.cpp",line="14",thread-groups=["i1"],times="1",original-location="main"}
1: (9596) <-1017-thread-info 2
[New Thread 536874720]
1: (9660) ->=thread-exited,id="1",group-id="i1"
1: (9660) ->=thread-created,id="3",group-id="i1"
1: (9660) ->~"[New Thread 536875056]\n"
1: (9660) ->=thread-created,id="4",group-id="i1"
1: (9660) ->~"[New Thread 536874988]\n"
1: (9660) ->~"[Switching to Thread 536874720]\n"
1: (9661) Send Event AD7ThreadDestroyEvent
1: (9662) <-1018-thread-info 3
[New Thread 536875056]
1: (9662) <-1019-thread-info 4
[New Thread 536874988]
[Switching to Thread 536874720]
1: (9671) ->~"\n"
1: (9672) ->~"Thread 2 \"main\" hit Breakpoint 1, main () at ./main.cpp:14\n"

1: (9672) ->~"14\t{\n"
Thread 2 "main" hit Breakpoint 1, main () at ./main.cpp:14
14  {
1: (9672) ->*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x000001bc",func="main",args=[],file="./main.cpp",fullname="/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/main.cpp",line="14",arch="armv7e-m"},thread-id="2",stopped-threads="all"
1: (9672) <-1020-thread-info
1: (9735) ->1017^done,threads=[{id="2",target-id="Thread 536874720",details="Running; Priority 24",name="main",frame={level="0",addr="0x000001bc",func="main",args=[],file="./main.cpp",fullname="/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/main.cpp",line="14",arch="armv7e-m"},state="stopped"}]
1: (9735) ->(gdb)
1: (9735) 1017: elapsed time 139
1: (9735) Send Event AD7ProcessInfoUpdatedEvent
1: (9735) Send Event AD7ThreadCreateEvent
<--   C (threads-7): {"command":"threads","type":"request","seq":7}
1: (11967) ->1018^done,threads=[{id="3",target-id="Thread 536875056",details="Ready; Priority 1",name="rtx_idle",frame={level="0",addr="0x000024c4",func="osRtxIdleThread",args=[{name="argument",value="0x0 <software_init_hook>"}],file="./mbed-os/rtos/source/TARGET_CORTEX/mbed_rtx_handlers.c",fullname="/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/mbed-os/rtos/source/TARGET_CORTEX/mbed_rtx_handlers.c",line="50",arch="armv7e-m"},state="stopped"}]
1: (11967) ->(gdb)
1: (11967) 1018: elapsed time 2305
1: (11967) Send Event AD7ThreadCreateEvent
<--   C (threads-8): {"command":"threads","type":"request","seq":8}
1: (13949) ->1019^done,threads=[{id="4",target-id="Thread 536874988",details="Waiting[MsgGet]; Priority 40",name="rtx_timer",frame={level="0",addr="0x000033e4",func="osMessageQueueGet",args=[{name="mq_id",value="0x20000f68 <os_timer_mq_cb>"},{name="msg_ptr",value="0x20001368 <os_timer_thread_stack+752>"},{name="msg_ptr@entry",value="0x20001368 <os_timer_thread_stack+752>"},{name="msg_prio",value="0x0 <software_init_hook>"},{name="msg_prio@entry",value="0x0 <software_init_hook>"},{name="timeout",value="0"},{name="timeout@entry",value="4294967295"}],file="./mbed-os/rtos/source/TARGET_CORTEX/rtx5/RTX/Source/rtx_msgqueue.c",fullname="/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/mbed-os/rtos/source/TARGET_CORTEX/rtx5/RTX/Source/rtx_msgqueue.c",line="871",arch="armv7e-m"},state="stopped"}]
1: (13949) ->(gdb)
1: (13949) 1019: elapsed time 4287
1: (13949) Send Event AD7ThreadCreateEvent
<--   C (threads-9): {"command":"threads","type":"request","seq":9}
1: (14286) ->1020^done,threads=[{id="2",target-id="Thread 536874720",details="Running; Priority 24",name="main",frame={level="0",addr="0x000001bc",func="main",args=[],file="./main.cpp",fullname="/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/main.cpp",line="14",arch="armv7e-m"},state="stopped"},{id="3",target-id="Thread 536875056",details="Ready; Priority 1",name="rtx_idle",frame={level="0",addr="0x000024c4",func="osRtxIdleThread",args=[{name="argument",value="0x0 <software_init_hook>"}],file="./mbed-os/rtos/source/TARGET_CORTEX/mbed_rtx_handlers.c",fullname="/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/mbed-os/rtos/source/TARGET_CORTEX/mbed_rtx_handlers.c",line="50",arch="armv7e-m"},state="stopped"},{id="4",target-id="Thread 536874988",details="Waiting[MsgGet]; Priority 40",name="rtx_timer",frame={level="0",addr="0x000033e4",func="osMessageQueueGet",args=[{name="mq_id",value="0x20000f68 <os_timer_mq_cb>"},{name="msg_ptr",value="0x20001368 <os_timer_thread_stack+752>"},{name="msg_ptr@entry",value="0x20001368 <os_timer_thread_stack+752>"},{name="msg_prio",value="0x0 <software_init_hook>"},{name="msg_prio@entry",value="0x0 <software_init_hook>"},{name="timeout",value="0"},{name="timeout@entry",value="4294967295"}],file="./mbed-os/rtos/source/TARGET_CORTEX/rtx5/RTX/Source/rtx_msgqueue.c",fullname="/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/mbed-os/rtos/source/TARGET_CORTEX/rtx5/RTX/Source/rtx_msgqueue.c",line="871",arch="armv7e-m"},state="stopped"}],current-thread-id="2"
1: (14287) ->(gdb)
1: (14287) 1020: elapsed time 4614
1: (14287) <-1021-stack-list-frames 0 1000
1: (14287) ->1021^done,stack=[frame={level="0",addr="0x000001bc",func="main",file="./main.cpp",fullname="/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/main.cpp",line="14",arch="armv7e-m"}]
1: (14287) ->(gdb)
1: (14288) 1021: elapsed time 0
1: (14291) <-1022-break-delete 1
1: (14292) ->1022^done
1: (14292) ->(gdb)
1: (14292) 1022: elapsed time 0
1: (14292) Send Event AD7EntryPointEvent
Execute debugger commands using "-exec <command>", for example "-exec info registers" will list registers in use (when GDB is the debugger)
<--   C (threads-10): {"command":"threads","type":"request","seq":10}
<--   C (stackTrace-11): {"command":"stackTrace","arguments":{"threadId":536874720,"startFrame":0,"levels":20},"type":"request","seq":11}
1: (14354) <-1023-stack-list-arguments 0 0 0
1: (14356) ->1023^done,stack-args=[frame={level="0",args=[]}]
1: (14356) ->(gdb)
1: (14357) 1023: elapsed time 2
<--   C (scopes-12): {"command":"scopes","arguments":{"frameId":1000},"type":"request","seq":12}
1: (14830) <-1024-stack-list-variables 0
1: (14831) ->1024^done,variables=[{name="led"}]
1: (14831) ->(gdb)
1: (14833) 1024: elapsed time 2
1: (14839) <-1025-var-create - * "led"
1: (15024) ->1025^done,name="var1",numchild="1",value="{...}",type="mbed::DigitalOut",thread-id="2",has_more="0"
1: (15024) ->(gdb)
1: (15025) 1025: elapsed time 185
<--   C (variables-13): {"command":"variables","arguments":{"variablesReference":1000},"type":"request","seq":13}

Here is the output generated when I attempt to add a breakpoint to line 19: image

<--   C (setBreakpoints-15): {"command":"setBreakpoints","arguments":{"source":{"name":"main.cpp","path":"/home/vagrant/Desktop/Projects/Examples/mbed-os-example-blinky/main.cpp","sources":[],"checksums":[]},"lines":[19],"breakpoints":[{"line":19}],"sourceModified":false},"type":"request","seq":15}
1: (419579) <-1027-break-insert -f main.cpp:19
1: (419580) ->&"No line 19 in file \"main.cpp\".\n"
1: (419580) ->1027^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="main.cpp:19",times="0",original-location="main.cpp:19"}
1: (419580) ->(gdb)
1: (419581) 1027: elapsed time 1
1: (419585) Send Event AD7BreakpointErrorEvent

I've searched for why gdb would report "No line x in file". I tried adding -ggdb to the list of compiler flags but that had no effect. I reduced the compiler optimization from -Og to -O0. This actually allowed me to set breakpoints, but mbed crashes after one pass through the while loop. I think there may be an issue with sleep and the 0 optimization.

Host OS: Linux KDE Plasma Virtual Machine Embedded OS: mbed-os-6.2.0 IDE: vscode (1.47.3) Debugger: DAPLink on Flidor development board Target: Agora pyocd: 0.27.2

farrenv commented 4 years ago

@flit @trowbridgec @AGlass0fMilk @maclobdell

farrenv commented 4 years ago

While attempting to get Jlink to work I added a printf to the code. I was running arm-none-eabi-gdb manually when I set a breakpoint at line 19 as before. The debugger became trapped at line 21 where I had added the printf. I went back and tried pyocd and it was happy to set and find the breakpoint on line 21. I believe this issue can be closed. Thanks! image

0Grit commented 4 years ago

Use a container