labath wrote:

The script code is not an exact equivalent of the "frame var" expression. 
Notice how in the "frame var", you explicitly dereference the object, while in 
the script, you call GetChildAtIndex directly on the pointer value. The "frame 
var" expression would be more similar to `script 
lldb.frame.FindVariable("ptr1").Dereference().GetChildAtIndex(0)`, and I'd 
guess (I didn't try reproducing this) that this will print the map member 
correctly.

That doesn't quite explain why is this failing, it might give us a clue about 
what could be happening. I suspect the problem here is that the map data 
formatter is just misbehaving when given a pointer value, and the 
implementation happens to end up returning the parent of the actual pair value. 
According to grep the `__cc_` member is used in the c++03 implementation of the 
map, and I don't think many people use/test the data formatters in c++03 mode, 
so it's kind of surprising that the formatter works at all.

https://github.com/llvm/llvm-project/pull/156033
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to