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:
Display All
The gdb script in question is as follows:
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.
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
- SEGGER J-Link GDB Server V7.54d Command Line Version
- JLinkARM.dll V7.54d (DLL compiled Sep 28 2021 16:18:25)
- WARNING: Unknown command line parameter /home/vagrant/Documents/product/build/product/bin/product_main_application.out found.
- 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
- -----GDB Server start settings-----
- GDBInit file: /home/vagrant/Documents/product/build/product/etc/gdb/reset.gdbinit
- GDB Server Listening port: 2159
- SWO raw output listening port: 2160
- Terminal I/O port: 2161
- Accept remote connection: yes
- Generate logfile: off
- Verify download: on
- Init regs on start: on
- Silent mode: off
- Single run mode: on
- Target connection timeout: 15000 ms
- ------J-Link related settings------
- J-Link Host interface: USB
- J-Link script: none
- J-Link settings file: none
- ------Target related settings------
- Target device: AT91SAM7S256
- Target interface: JTAG
- Target interface speed: auto
- Target endian: little
- Connecting to J-Link...
- J-Link is connected.
- Firmware: J-Link V9 compiled May 7 2021 16:26:12
- Hardware: V9.30
- S/N: 609300498
- Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
- Checking target voltage...
- Target voltage: 3.09 V
- Listening on TCP/IP port 2159
- Connecting to target...
- J-Link found 1 JTAG device, Total IRLen = 4
- JTAG ID: 0x3F0F0F0F (ARM7)
- Connected to target
- Waiting for GDB connection...Connected to 127.0.0.1
- Executing script file [/home/vagrant/Documents/product/build/product/etc/gdb/reset.gdbinit] ...
- WARNING: Unsupported remote command "monitor sleep 500"
- WARNING: Unsupported remote command "monitor halt"
- WARNING: Unsupported remote command "load"
- WARNING: Unsupported remote command "set mem inaccessible-by-default off"
- WARNING: Unsupported remote command "monitor flash download = 1"
- WARNING: Unsupported remote command "monitor flash breakpoints = 1"
- WARNING: Unsupported remote command "tb main"
- WARNING: Unsupported remote command "monitor reset"
- Reading all registers
- Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
- Read 4 bytes @ address 0xFFFFFFFC (Data = 0x00000000)
- Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
- Read 4 bytes @ address 0xFFFFFFFC (Data = 0x00000000)
- Read 2 bytes @ address 0x00000000 (Data = 0x0000)
- Read 2 bytes @ address 0xFFFFFFFE (Data = 0x0000)
- Read 2 bytes @ address 0xFFFFFFFC (Data = 0x0000)
- Read 2 bytes @ address 0x00000000 (Data = 0x0000)
- Read 2 bytes @ address 0xFFFFFFFE (Data = 0x0000)
- Read 2 bytes @ address 0xFFFFFFFC (Data = 0x0000)
- Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
- Read 4 bytes @ address 0xFFFFFFFC (Data = 0x00000000)
- Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
- Read 4 bytes @ address 0xFFFFFFFC (Data = 0x00000000)
- Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
- Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
- Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
- Downloading 112 bytes @ address 0x00101400 - Verified OK
- Downloading 15952 bytes @ address 0x00101600 - Verified OK
- Downloading 16016 bytes @ address 0x00105450 - Verified OK
- Downloading 15888 bytes @ address 0x001092E0 - Verified OK
- Downloading 16080 bytes @ address 0x0010D0F0 - Verified OK
- Downloading 16064 bytes @ address 0x00110FC0 - Verified OK
- Downloading 16096 bytes @ address 0x00114E80 - Verified OK
- Downloading 16048 bytes @ address 0x00118D60 - Verified OK
- Downloading 16032 bytes @ address 0x0011CC10 - Verified OK
- Downloading 16000 bytes @ address 0x00120AB0 - Verified OK
- Downloading 16032 bytes @ address 0x00124930 - Verified OK
- Downloading 16032 bytes @ address 0x001287D0 - Verified OK
- Downloading 2444 bytes @ address 0x0012C670 - Verified OK
- Downloading 7248 bytes @ address 0x0012CFFC - Verified OK
- Downloading 2 bytes @ address 0x0013FFFE - Verified OK
- Writing register (PC = 0x 101400)
The gdb script in question is as follows:
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.