irondash / cargokit

Integrate cargo build with flutter plugins and applications.
Other
51 stars 16 forks source link

Can Rust breakpoints work when linked to the Flutter app? #41

Open temeddix opened 6 months ago

temeddix commented 6 months ago

Compilers may embed some debugging information directly into the compiled code or generate separate files (like .pdb for Windows or .dSYM for macOS) that contain debugging symbols and information. These files aid the debugger in correlating the machine code with the original source code.

If such method is possible, it will hugely benefit users using Rinf. Breakpoints will work if we run Rust code directly with cargo run, but will they work if they are linked to a Flutter app?

image

knopp commented 6 months ago

Yes. Debug build will build the rust code with debug symbols. You can attach to running application and debug the rust code.

hilpara commented 3 weeks ago

@knopp I'm trying to get my workflow setup with flutter_rust_bridge and tested debugging. How ever I could not get this to work. I already wrote about it here. As I wrote I'm using the gallery as an example. On one instance of vscode I started flutter debugger and on the other one I attached to this running process. Attach seems to work, but when I hit the breakpoint, the debugger only shows a message in Debug Console : Stop reason: signal SIGPROF and I can't debug anything.

My launch.json:

{
            "type": "lldb",
            "request": "attach",
            "pid": "${command:pickProcess}",
            "name": "Debug Rust",
  }

So what am I doing wrong?