[lldb-dev] Bug? in evaluation

Andrey Zaytsev andrey.zaytsev at jetbrains.com
Mon Jun 10 13:46:57 PDT 2013


Hello everyone.

I just realised thing which leads to crash of debuggee in some cases. We had a bug in our tracker: http://youtrack.jetbrains.com/issue/OC-7389

We have some system of value renderers. Each renderer(e.g for NSCollections) evaluates some stuff to get info about collection elements. So does a number of Summary and Synthetic Providers too.
 
In SB-API it is implemented with EvaluateExpression function. One of the ways we can evaluate expression is to call lldb::SBFrame::EvaluateExpression() member function. Actually it performs execution on selected thread/frame. But not on the frame we call EvaluateExpression function on. It's very not obvious and in my opinion buggy. Usage of API in this way leads to crashes of debuggee process like in the ticket above. So crashes not only attempt to evaluate expression but attempt to get local variables with dynamic types if it executes target as well.

So workaround for us was to select specified thread/frame before doing evaluation. So does interpreter's expr command.


-- 
Andrey Zaytsev
Software Developer
JetBrains, Inc
http://www.jetbrains.com/
"Develop with pleasure!"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20130611/57280870/attachment.html>


More information about the lldb-dev mailing list