![]() Most people's first instinct is to do this by inserting print statements into the code to output the required data. Hopefully the existence of these bugs will be detected by the code's tests, but why the bug occurs will still require work to establish: debugging.Īll debugging involves a cycle of gathering data on the problem, formulating hypotheses about what might be causing the problem and then gathering further data to confirm or refute the hypotheses. /gdb/gdbtypes.It is very rare for interesting code to contain no bugs at first writing. Using host libthread_db library "/usr/lib/libthread_db.so.1".īreakpoint 1, rust_gdb::main () at src/main.rs:14 To make this setting permanent, add 'set debuginfod enabled off' to. This GDB supports auto-downloading debuginfo from the following URLs:Įnable debuginfod for this session? (y or ) Starting program: /tmp/rust-gdb/target/debug/rust-gdb Here:īreakpoint 1 at 0x875f: file src/main.rs, line 14. Are you able to view it from the debuggers? Because apparently rust-gdb panics if I try to print it! And rust-lldb simply prints an empty array. However (and that is a question open to everyone) I have an array in a Rust program, with values mixed between the two variants Some(i32) and None. ![]() Moreover, since it is just a wrapper around GDB, I'd say that should be possible to integrate with RealGUD (I still have problems in using dap-mode even for the simplest program). Actually using rust-gdb is not "good", but at least is decent. I use all of the packages you use, except for company (switched to corfu) and hs-minor-mode. I really need a way to point gdb at the start of a test Works well for me except for my problem debugging tests. Many of us, with deep experience, find symbolic debuggers extremely useful. I think it is unhelpful to intimate to people starting out in Rust that somehow there is something wrong with using them. I started programming a long time ago inside symbolic debuggers, and to this day my first job in a new IDE/language is to establish how to use the symbolic debugger. ![]() On the rare occasions I cannot see immediately why a test is failing I would like to run the test in a symbolic and whilst you two may not find symbolic debuggers useful, I do. My problem is I cannot connect the debugger to tests. I am debugging my main programmes happily in emacs (See below). But it happens so rarely that each time I have to remind myself how to set things up. I will note that for the longest time, I saw no point in using a debugger with Rust (just as notes), but I have encountered a few situations where a debugger was very helpful. I have had to do some remote debugging of Windows services written in Rust, and used Visual Studio together with msvsmon, and found this to be a mostly smooth experience (there's a crate called "verboten" that will help install msvsmon as a service in a maximally dangerous-and-helpful mode). Personally I found configuring debug profiles is VSCode to be a little fiddly, so I just stick with rust-lldb. My gut feeling is that a lot of people who debug Rust code use CodeLLDB in Visual Studio Code - but that's purely anecdotal. I have seen other use rust-gdb and be happy with it.īut when you ask what the defacto rust debugger is, then I'm not sure what to reply. Personally I prefer using rust-lldb, which I believe used to be a wrapper around lldb that added a few rust-related helpers, but nowadays looks to be its own lldb binary.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |