[SOLVED] JLinkGDBServer -xc reports "Unsupported remote command" for all commands in gdb script

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] JLinkGDBServer -xc reports "Unsupported remote command" for all commands in gdb script

    Hello,
    I'm working in an environment that supports debugging many embedded projects. I'm attempting to run JLinkGDBServerCL, but I need to avoid polluting `~/.gdbinit` as much as possible. Helpfully, JLinkGDBServer provides the `-xc` switch for executing gdb command files. Unfortunately, none of the commands seem to be accepted when I use this switch:

    Source Code

    1. SEGGER J-Link GDB Server V7.54d Command Line Version
    2. JLinkARM.dll V7.54d (DLL compiled Sep 28 2021 16:18:25)
    3. WARNING: Unknown command line parameter /home/vagrant/Documents/product/build/product/bin/product_main_application.out found.
    4. Command line: -nosilent -device AT91SAM7S256 -endian little -if JTAG -speed auto -port 2159 -swoport 2160 -telnetport 2161 -timeout 15000 -singlerun -halt -xc /home/vagrant/Documents/product/build/product/etc/gdb/reset.gdbinit -ir -vd /home/vagrant/Documents/product/build/product/bin/product_main_application.out
    5. -----GDB Server start settings-----
    6. GDBInit file: /home/vagrant/Documents/product/build/product/etc/gdb/reset.gdbinit
    7. GDB Server Listening port: 2159
    8. SWO raw output listening port: 2160
    9. Terminal I/O port: 2161
    10. Accept remote connection: yes
    11. Generate logfile: off
    12. Verify download: on
    13. Init regs on start: on
    14. Silent mode: off
    15. Single run mode: on
    16. Target connection timeout: 15000 ms
    17. ------J-Link related settings------
    18. J-Link Host interface: USB
    19. J-Link script: none
    20. J-Link settings file: none
    21. ------Target related settings------
    22. Target device: AT91SAM7S256
    23. Target interface: JTAG
    24. Target interface speed: auto
    25. Target endian: little
    26. Connecting to J-Link...
    27. J-Link is connected.
    28. Firmware: J-Link V9 compiled May 7 2021 16:26:12
    29. Hardware: V9.30
    30. S/N: 609300498
    31. Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
    32. Checking target voltage...
    33. Target voltage: 3.09 V
    34. Listening on TCP/IP port 2159
    35. Connecting to target...
    36. J-Link found 1 JTAG device, Total IRLen = 4
    37. JTAG ID: 0x3F0F0F0F (ARM7)
    38. Connected to target
    39. Waiting for GDB connection...Connected to 127.0.0.1
    40. Executing script file [/home/vagrant/Documents/product/build/product/etc/gdb/reset.gdbinit] ...
    41. WARNING: Unsupported remote command "monitor sleep 500"
    42. WARNING: Unsupported remote command "monitor halt"
    43. WARNING: Unsupported remote command "load"
    44. WARNING: Unsupported remote command "set mem inaccessible-by-default off"
    45. WARNING: Unsupported remote command "monitor flash download = 1"
    46. WARNING: Unsupported remote command "monitor flash breakpoints = 1"
    47. WARNING: Unsupported remote command "tb main"
    48. WARNING: Unsupported remote command "monitor reset"
    49. Reading all registers
    50. Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
    51. Read 4 bytes @ address 0xFFFFFFFC (Data = 0x00000000)
    52. Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
    53. Read 4 bytes @ address 0xFFFFFFFC (Data = 0x00000000)
    54. Read 2 bytes @ address 0x00000000 (Data = 0x0000)
    55. Read 2 bytes @ address 0xFFFFFFFE (Data = 0x0000)
    56. Read 2 bytes @ address 0xFFFFFFFC (Data = 0x0000)
    57. Read 2 bytes @ address 0x00000000 (Data = 0x0000)
    58. Read 2 bytes @ address 0xFFFFFFFE (Data = 0x0000)
    59. Read 2 bytes @ address 0xFFFFFFFC (Data = 0x0000)
    60. Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
    61. Read 4 bytes @ address 0xFFFFFFFC (Data = 0x00000000)
    62. Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
    63. Read 4 bytes @ address 0xFFFFFFFC (Data = 0x00000000)
    64. Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
    65. Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
    66. Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
    67. Downloading 112 bytes @ address 0x00101400 - Verified OK
    68. Downloading 15952 bytes @ address 0x00101600 - Verified OK
    69. Downloading 16016 bytes @ address 0x00105450 - Verified OK
    70. Downloading 15888 bytes @ address 0x001092E0 - Verified OK
    71. Downloading 16080 bytes @ address 0x0010D0F0 - Verified OK
    72. Downloading 16064 bytes @ address 0x00110FC0 - Verified OK
    73. Downloading 16096 bytes @ address 0x00114E80 - Verified OK
    74. Downloading 16048 bytes @ address 0x00118D60 - Verified OK
    75. Downloading 16032 bytes @ address 0x0011CC10 - Verified OK
    76. Downloading 16000 bytes @ address 0x00120AB0 - Verified OK
    77. Downloading 16032 bytes @ address 0x00124930 - Verified OK
    78. Downloading 16032 bytes @ address 0x001287D0 - Verified OK
    79. Downloading 2444 bytes @ address 0x0012C670 - Verified OK
    80. Downloading 7248 bytes @ address 0x0012CFFC - Verified OK
    81. Downloading 2 bytes @ address 0x0013FFFE - Verified OK
    82. Writing register (PC = 0x 101400)
    Display All

    The gdb script in question is as follows:

    Source Code

    1. monitor sleep 500
    2. monitor halt
    3. load
    4. set mem inaccessible-by-default off
    5. monitor flash download = 1
    6. monitor flash breakpoints = 1
    7. tb main
    8. monitor reset
    I tried wrapping the commands in `eval "<line>"` to no avail. The `-x` flag yields the same result. How can I make JLinkGDBServer execute this gdb script upon connection? Thanks for your time.
  • The -xc option is for GDB not GDBServer.
    These are 2 different products from 2 different vendors.
    gdbinit files are for GDB, not GDBServer.

    I need to check why the "GDBInit file:" output for GDBServer actually exists because it does not really make any sense.
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.