-
Notifications
You must be signed in to change notification settings - Fork 6
Expression evaluation for rust #20
Comments
I'm planning to do this, but it requires rust-lang/rust#33014, which in turn requires an LLVM patch (I have the start of this, but not enough to submit).
Could you expand on what you mean by this? Another missing function-call-related bit is calling methods on trait objects. That requires the second half of rust-lang/rust#1563 |
For example, if I have code like this: let mut v = vec![1,2,3];
v.push(4); // breakpoint is set here
println!("{}", v[3]); I've tried to call |
Yes, that's the problem in this case. One possible way to fix this would be to reimplement expression evaluation using miri, but that is a difficult project. |
You mean to do that inside of the rust-lldb, or as a separate project? |
Inside the rust-enabled lldb; but really preferably as some kind of library so we can do the same in gdb. |
Can you please provide some more details about what steps are need to be taken in order to implement expression evaluation using miri? |
I don't really know anything about miri; I"m afraid this investigation is one of the bigger parts of the task. |
Okay. Can I ask you about how rust expressions currently are "interpreted" in lldb? Are they compiled to something, or are they parsed and executed in terms of C-calls? |
Currently there is a parser and evaluator here: https://github.com/rust-lang-nursery/lldb/tree/rust-release-80-v1/source/Plugins/ExpressionParser/Rust. They aren't compiled, there is also a simple interpreter in there. Most of this would be replaced in the miri plan, but there would still need to be an lldb bridge to access local variables and memory, at the very least. |
What exactly is the status of expression evaluation in
I've tried to understand what I can evaluate from reading the different github threads, but it's still not clear to me what exactly is expected to work right now, and what is the syntax to use it. |
Function calls should work fine, and I'd expect an The best thing to do in cases where it fails is to try to write a small reproducer and then file a separate bug. I see I didn't write any tests for calls via |
Where should I file bugs? Here is an example, with the latest nightly: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6193616cd6aa584793bcb730269a6eac Both rust-gdb and rust-lldb fail
|
lldb bugs can be filed here. The best place for gdb bugs is gdb bugzilla. |
gdb 8 works for me, but not gdb 7.12 (which is what you have). I don't recall offhand what bug this was, but I guess this was fixed already. I still haven't looked into the lldb situation. |
I upgraded to gdb 8.2, still getting the same behavior:
|
The problem here is that when compiling with |
Is there a debug compilation option so that all functions are emitted? |
Sorry, I don't know. |
Hi! I'd like to ask about the status of expression evaluation in rust-lldb
From what I've experienced it supports only a small amount of features (like calling regular functions or methods of the primary structure
impl
s, but not methods from traits for example, and not methods from data structures likeVec
)Are there plans for adding support for such functionality?
The text was updated successfully, but these errors were encountered: