#39 Fails to debug if workspace path contains space

Behavior (41)

Reproducible: always.
Steps to reproduce:
1) Click menu Run, Debug Configurations. Window appears.
2) "GDB Hardware Debugging", my configuration item, card Startup, Image file name, click Workspace. Window appears
3) Select some ELF. Note my workspace is C:Documents and Settingsgeorgeworkspace, i.e. it contains space character.
For example ${workspace_loc:uart-testDebuguart-test.elf}
4) Press Apply and Debug buttons.

What happens:
In Console view for simulavr many these lines:
decoder.h:59: WARNING: Unknown opcode: 0xffff
In Console view for avr-gdb:

No symbol "new" in current context.
target remote localhost:4242
0x00000000 in __vectors ()
restore C:Documents and Settingsgeorgeworkspaceuart-testDebuguart-test.elf
No symbol "and" in current context.
tbreak main
Breakpoint 1 at 0x68: file ../test_uart.c, line 32.
main () at ../test_uart.c:32
32 {

My Eclipse's working directory contains " " (space).
I have no idea about the "No symbol "new" in current context."


  • You can forget about it.
    It turned out to be problem in gdb (version 6.6).
    It does the same if I manually use a command-line.

  • Thomas Holland
    Thomas Holland

    This is indeed a problem of gdb and Eclipse/CDT.

    The GDB Hardware Debugger configuration uses the gdb command 'restore' to load the image, but it seems that 'restore' does not work with spaces in filenames.

    However I just tried a workaround that seems to work:

    In the debugging configuration for your project on the 'Startup' tab disable the 'Load image', and instead enter the following into the text field at the top under 'Initialization Commands':

    load \"C:\your path with spaces\project\Debug\file.elf\"

    (with backslashes in front of the quotes and double backslashes in the path)

    Unlike 'restore' the gdb 'load' command can handle quoted strings. I have only tested it with simulavr, but the same should hopefully also work for avarice.

    I leave this bug report open, as I still plan on writing a replacement for the "GDB Hardware Debugging" configuration especially geared for AVR debugging.

    P.S. The "No symbol "new" in current context." message is normal and can be ignored. Eclipse/CDT sends a 'gdb-set new-console on' command to gdb, but avr-gdb does not have a 'new-console' variable so this call fails (without negative effects).