You're right, there is something up with resolving file paths. I created a new project called DeviceReboot and verified everything having to do with the build and resulting binary had no spaces in it. When I run the same script xgdb gave me this error:
Code: Select all
C:\Users\Amandio\workspace\DeviceReboot\bin>xgdb -x script
GNU gdb (XGDB) Community_14.2.1 (build 15182, Jun-24-2016)
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-mingw32 --target=xcore-elf".
For bug reporting instructions, please see: http://www.xmos.com/support.
0xfff004c8 in ?? ()
[Switching to thread 1 (tile[0] core[0])]#0 0xfff004c8 in ?? ()
Breakpoint 1 at 0x402d4
Breakpoint 2 at 0x4040c
Loading image to XCore 0
C:\Users\Amandio\workspace\DeviceReboot\bin/script:15: Error in sourced command file:
C:UsersAmandioworkspaceDeviceRebootbin/./image_n0c0_2.elf: No such file or directory.
(gdb) connect
0xfff004c8 in ?? ()
(gdb) thread
[Current thread is 1 (tile[0] core[0])]
(gdb) quit
Typing each command manually in the xgdb shell I found the error came from the load command and gave the same error. Looks like the file path is getting mangled and losing the directory separators when trying to resolve a relative path.
If I specify an absolute path to the image file the script works. So the script now looks like this (note the full path on line 3):
Code: Select all
connect
thread 1
file C:/Users/Amandio/workspace/DeviceReboot/bin/image_n0c0_2.elf
set arch xs2_reva
b write_sswitch_reg_no_ack
commands 1
silent
printf " write_sswitch_reg_no_ack(0x%x, 0x%x, 0x%x);\n", $r0, $r1, $r2
c
end
b _done
commands 2
silent
end
load
c
q
However, what I'm seeing now is that even though xgdb appears to now be properly running the script, nothing happens. Here is the output:
Code: Select all
C:\Users\Amandio\workspace\DeviceReboot\bin>xgdb -x script
GNU gdb (XGDB) Community_14.2.1 (build 15182, Jun-24-2016)
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-mingw32 --target=xcore-elf".
For bug reporting instructions, please see: http://www.xmos.com/support.
0xfff004c8 in ?? ()
[Switching to thread 1 (tile[0] core[0])]#0 0xfff004c8 in ?? ()
Breakpoint 1 at 0x402d4
Breakpoint 2 at 0x4040c
Loading image to XCore 0
Loading section .text, size 0x450 lma 0x40000
Loading section .init, size 0x1c lma 0x40450
Loading section .fini, size 0x30 lma 0x4046c
Loading section .eh_frame, size 0x24 lma 0x4049c
Loading section .cp.rodata, size 0x14 lma 0x404c0
Loading section .cp.const4, size 0x28 lma 0x404d4
Loading section .cp.rodata.cst4, size 0x4 lma 0x404fc
Loading section .dp.data, size 0x20 lma 0x40500
Loading section .dp.data.4, size 0x10 lma 0x40520
Start address 0x40000, load size 1328
Transfer rate: 81 KB/sec, 147 bytes/write.
Nothing happens after this and I have Ctrl+C to exit.