3

Problem: I've created a summary for my object, let's think a trivial boost::intrusive_ptr (I have more complex, so this is just for example )

now if I have:

boost::intrusive_ptr< MyClass > pobj;

and I type from the console

p pobj

I'll see summary for MyClass.

But what if I want to see it's internal px member - that is pobj.px ?

I know two ways:

  • put summary into a category, then temporary disable it (inconvenient)
  • frame variable -Y0 and this second would be ideal, but what to do if I want to see a result of an expression ? that is something like p MyObj.GetContents.GetSmartPtr()

I've tried already something like:

frame variable -Y0 0ドル

but this doesn't work.

I use XCode 4.6.3.

Is there a way to turn off summary ? Probably someone knows if this was cured in XCode 5 or latest lldb ?

asked Jun 23, 2013 at 18:00

2 Answers 2

3

You can see the raw information by using frame variable -R.

(lldb) fr v test
(std::__1::string) test = "hi there"
(lldb) fr v -R test
(std::__1::string) test = {
 __r_ = {
 std::__1::__libcpp_compressed_pair_imp<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__rep, std::__1::allocator<char> > = {
 __first_ = {
 = {
[...]

update: OP clarifies that he's at a value in a convenience variable, e.g. std::string foo () { return std::string("hi there"); }

(lldb) p foo()
(std::string) 0ドル = "hi there"

and wants to view 0ドル without any formatting -- and frame variable doesn't have access to the convenience variables so this needs to go through the expression (aka p) command. In this case, the only workaround I know is to temporarily disable the format e.g. type category disable libcxx which is what this person is hoping to avoid doing.

answered Jun 23, 2013 at 20:22
Sign up to request clarification or add additional context in comments.

2 Comments

this doesn't help against expressions. that is if there is no 'test' but std::string is just returned as a result of a function.
The Top-of-Tree open source LLDB has a -R (—raw-output) flag
0

Instead of p ... do dwim-print -R -- ....

help p reveals that p is an alias for dwim-print --, and then help dwim-print reveals the option -R, which stands for "raw output".

Also, as the other answer says, if you were using fr v ("print all local variables", aka frame variable), that has the same flag: fr -v -R.

answered Dec 24, 2024 at 11:14

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.