question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No source file name <src\main.rs> (from break-insert)

See original GitHub issue

Trying to get the debugger working with a Rust project and seem to run into this.

ERR No source file named e:\Projects\RustyPill\src\main.rs. (from break-insert "e:\\Projects\\RustyPill\\src\\main.rs:40"):
Error: No source file named e:\Projects\RustyPill\src\main.rs. (from break-insert "e:\\Projects\\RustyPill\\src\\main.rs:40")

My launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            /* Configuration for the STM32F103C8T6 *Black Pill* board */
            "type": "cortex-debug",
            "request": "launch",
            "name": "Debug (OpenOCD)",
            "servertype": "openocd",
            "cwd": "${workspaceRoot}",
            "preLaunchTask": "Cargo Build",
            "runToMain": true,
            "executable": "./target/thumbv7m-none-eabi/release/rusty_pill",
            "device": "STM32F103C8",
            "configFiles": [
                "interface/stlink.cfg",
                "target/stm32f1x.cfg"
            ],
            "postLaunchCommands": [
                "monitor arm semihosting enable",
            ],
            "svdFile": "${workspaceRoot}/.vscode/STM32F103.svd",
            "showDevDebugOutput": true,
        }
    ]
}

FWIW, main.rs does exist πŸ˜‰

.
β”œβ”€β”€ Cargo.lock 
β”œβ”€β”€ Cargo.toml 
β”œβ”€β”€ memory.x   
β”œβ”€β”€ openocd.cfg
β”œβ”€β”€ openocd.gpb
β”œβ”€β”€ src        
β”‚   └── main.rs
└── target
    β”œβ”€β”€ CACHEDIR.TAG
    β”œβ”€β”€ debug
    β”œβ”€β”€ release
    └── thumbv7m-none-eabi

I’m on Windows if that makes a difference.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
haneefdmcommented, Apr 14, 2021

Closing for now, you can continue to report progress/issues

0reactions
ashthespycommented, Apr 15, 2021

Happy to report that it was user error as usual - built it with debug symbols, and things are working as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No source file named main.c. gdb break point setting
No source file named main.c. Even when I pass specific function name (in main.c file) to break . it says: such function not...
Read more >
Cannot set GDB / Debugger breakpoints (#877) Β· Issues - GitLab
src/main.rs exists, but doesn't get recognized by GDB. 20:17:50.0718 gbp-gdb-debugger[ 4646]: DEBUG: gdb-error: No source file named ...
Read more >
error "failed to fetch file at path \"main\"" Β· Issue #52 Β· cs01/gdbgui
I have the target executable in /target/debug/myexecutable . And the source in /src/main.rs . GDB can find the file, it I type break...
Read more >
C / C++ IDE (CDT) Β» No source file named main.cpp - Eclipse
Dear All, Recently I experienced very common problem with "No source file named /home/.../main.cpp." With "Stop on startup at: main",Β ...
Read more >
breakpoint - "No source file named" - NXP Community
Hi There, I have recently moved a project from an old hard drive to a new one. I have been able to import...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found