You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I'm having issues debugging a Bevy project. When I place a breakpoint inside de main() function, it works as it should, but when I place a breakpoint inside a system, the program does not stop.
I use VSCode (also tried with Zed) on Windows 11.
I tried both static and dynamic linking.
I tried to debug with LLDB and cppvsdbg.
In the example below if I place the breakpoint on the println!("Hello World!"); inside the main function it works, but if I place the breakpoint on println!("Hello Setup!"); or println!("Hello process!!"); it does not work.
use bevy::prelude::*;fnmain(){println!("Hello World!");// breakpoint here worksApp::new().add_plugins(DefaultPlugins).add_systems(Startup, setup).add_systems(Update, process).run();}fnsetup(mutcommands:Commands){
commands.spawn(Camera2d);println!("Hello Setup!");// breakpoint here does not work}fnprocess(_commands:Commands){println!("Hello process!!");// breakpoint here does not work}
[package]
name = "bevy_game"version = "0.1.0"edition = "2024"
[dependencies]
bevy = { version = "0.17.2", features = ["dynamic_linking"] }
# Enable a small amount of optimization in debug mode
[profile.dev]
opt-level = 1# Enable high optimizations for dependencies (incl. Bevy), but not for our code:
[profile.dev.package."*"]
opt-level = 3# for Windows
[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I'm having issues debugging a Bevy project. When I place a breakpoint inside de
main()function, it works as it should, but when I place a breakpoint inside a system, the program does not stop.I use VSCode (also tried with Zed) on Windows 11.
I tried both static and dynamic linking.
I tried to debug with LLDB and cppvsdbg.
In the example below if I place the breakpoint on the
println!("Hello World!");inside themainfunction it works, but if I place the breakpoint onprintln!("Hello Setup!");orprintln!("Hello process!!");it does not work.launch.json (cppvsdbg):
{ "configurations": [ { "name": "(Windows) Launch", "type": "cppvsdbg", "request": "launch", "program": "${workspaceFolder}\\target\\debug\\bevy_game.exe", "preLaunchTask": "rust: cargo build", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [ {"name":"PATH", "value":"%USERPROFILE%/.rustup/toolchains/stable-x86_64-pc-windows-msvc/bin;${workspaceFolder}/target/debug/deps;%PATH%"} ], "console": "integratedTerminal", "logging": {"moduleLoad": false} } ] }launch.json (lldb):
{ "type": "lldb", "request": "launch", "name": "cargo run -p bevy_game --features=bevy/dynamic_linking", "cwd": "${workspaceFolder}", "program": "${workspaceFolder}\\target\\debug\\bevy_game.exe", "cargo":{ "args": [ "run", "--bin=bevy_game", "--package=bevy_game" ], "filter": { "name": "bevy_game", "kind": "bin" } }, "env": { "RUST_BACKTRACE": "short", "RUSTC_TOOLCHAIN": "C:\\Users\\steph\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc", "PATH": "%USERPROFILE%/.rustup/toolchains/stable-x86_64-pc-windows-msvc/bin;${workspaceFolder}/target/debug/deps;%PATH%" }, "args": [], "sourceMap": {}, "sourceLanguages": [ "rust" ], "preLaunchTask": "rust: cargo build" }Cargo.toml
Beta Was this translation helpful? Give feedback.
All reactions