[lldb-dev] Rust support in LLDB, again

2019-09-28 Thread Vadim Chugunov via lldb-dev
Hi,
Last year there was an effort led by Tom Tromey to add Rust language
support into LLDB.  He had implemented a fairly complete language plugin,
however it was not accepted into mainline because of supportability
concerns.I guess these concerns had some merit, because this change did
not survive even in Rust's private branch
 due to the difficulty
of rebasing on top of LLVM 9.

I am wondering if there's a more limited version of this, that *can* be
merged into mainline:
In terms of its memory model, Rust is not that far off from C++, so
treating Rust types is if they were C++ types basically works.  There is
only one major problem: currently LLDB cannot deal with tagged unions,
which Rust code uses quite heavily.   When such a type is encountered, LLDB
just emits an empty struct, which makes it impossible to examine the
contents.

My tentative proposal is to modify LLDB's DWARFASTParserClang to handle
DW_TAG_variant et al, and create a C++ approximation of these types, e.g.
as a polymorphic class, or just an untagged union.   This would provide at
least a minimal level of functionality for Rust (and possibly other
languages) and be a much lesser maintenance burden on LLDB core team.
What would y'all say?
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] Stepping in a breakpoint callback with Python

2019-09-28 Thread Nikita Karetnikov via lldb-dev
Jim,

> So the problem you are having is getting the scripted step started in
"trace"
> with the SBThread::StepUsingScriptedStep?  Did you try passing False for
> "resume_immediately" and then returning False from "trace".

Yes, I did.  In fact, I tried all these combinations:

resume_immediately = True,  return True
resume_immediately = True,  return False
resume_immediately = False, return True
resume_immediately = False, return False

None of them produces the trace.

I think the 'thread step-scripted' hack should work for my usecase, but I
yet
have to try it.  I'll let you know if I hit some limitation again.

Thanks,
Nikita
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev