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.

Implement debugger

See original GitHub issue

The work has started: https://github.com/intellij-rust/intellij-rust/tree/fc2cfb8e0fc76984495a34ae6a83cbb37188c699/debugger

State of the art

The debugger is officially available in CLion since 2018.1. Note, CLion doesn’t support debugging with msvc toolchains, so if you are using Windows, you need:

  • install gnu rust toolchain (rustup install stable-gnu)
  • setup gnu (Cygwin or MinGW) toolchains in CLion (Preferences > Build, Execution, Deployment > Toolchains).

To debug you just need to:

  • Run debug command via gutter icon 2018-05-28 11 46 26
  • Or create Cargo Command run configurtion screen shot 2018-05-28 at 11 50 04 and run debugging via debug action

2018-05-28 11 52 16

Old content

Old content

If you use CLion and the nightly Cargo, you should be able to Debug Cargo configuration:

https://zippy.gfycat.com/AcidicMediocreCoati.webm

A major missing piece is that we don’t pass command line arguments to the debuggee yet (this requires some work on the Cargo side of things first).

Old content 2

Currently for technical reasons (commit message) debugger is implemented as a separate plugin.

The current build can be download from TeamCity: Download. It may work with CLion 2016.3.2 and intellij-rust 0.1.0.1611.

Note that this is super unstable, debugger can invoke any kind of undefined behavior, including, but not limited to, summoning of nasal daemons. Most importantly, rust debugger may (though in theory it should not) break C++ debugging.

Nonetheless, step into and local variables view more or less work 😃

debugger

As you can see on the screenshot, at the moment you unfortunately have to create a separate Cargo debug run configuration type (as opposed to the usual Run cargo command). Also, you only can debug binaries now 😦

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:254
  • Comments:137 (37 by maintainers)

github_iconTop GitHub Comments

42reactions
laktakcommented, Jul 18, 2016

Getting a good debugger for Rust would be a great help, especially as the current options are rather limited.

31reactions
matkladcommented, Jan 20, 2017

@windoze the plugin totally works with CLion, you don’t need to migrate anything.

I’m planing to start the work on the debugger soon 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How Debuggers Work - The Debugging Book
Let us detail how we implement execute() . The commands() method returns a list of all commands (as strings) from the class. ......
Read more >
How to debug for absolute beginners - Visual Studio
You use a debugger to help you find bugs. A debugging tool can find bugs for you only if it knows the intent...
Read more >
Debugging in Visual Studio Code
One of the great things in Visual Studio Code is debugging support. Set breakpoints, step-in, inspect variables and more.
Read more >
How does a debugger work? - Stack Overflow
The debugger is able to use information from symbol files to translate from addresses to variable names and locations in the source code....
Read more >
debugger - JavaScript - MDN Web Docs
The debugger statement invokes any available debugging functionality, such as setting a breakpoint. If no debugging functionality is ...
Read more >

github_iconTop Related Medium Post

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