Hi, eranif!
What should I do to make CL recognize STL types like vector, set, map and show them more pretty in watches?
I tried to add this in predefined types:
Type: vector
Expresssion: $(Variable)
Debugger: pvector
But it doesn't help.
Debugger Predefined types for STL
-
- CodeLite Curious
- Posts: 1
- Joined: Mon Dec 14, 2009 1:09 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
- kspes
- CodeLite Enthusiast
- Posts: 41
- Joined: Sat Jan 30, 2010 2:18 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Debugger Predefined types for STL
I'm having problem with this feature, Predefined types has an entry for std::string, but locals (and watches) don't expand it properly. instead it gives me {...}
here's some demo code:
debugger "print s" gives:
I experienced this on multiple computers. Codelite 2.2.0.3681 and SVN trunk revision 3765
here's some demo code:
Code: Select all
#include <string>
int main(int argc, char **argv)
{
std::string s="test";
s="new value";
return 0;
}
and locals gives {...}$2 = {
static npos = 4294967295
,
_M_dataplus = {
<std::allocator<char>> = {
<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
members of std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider:
_M_p = 0x352c04 "test"
}
}
I experienced this on multiple computers. Codelite 2.2.0.3681 and SVN trunk revision 3765
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Debugger Predefined types for STL
You will need to double-click it to expand it / or click it (depends on the drop down selection you set)kspes wrote:and locals gives {...}
The list control used is not capable of displaying trees.
Eran
Make sure you have read the HOW TO POST thread
- kspes
- CodeLite Enthusiast
- Posts: 41
- Joined: Sat Jan 30, 2010 2:18 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Debugger Predefined types for STL
yeah, but what's the point of predefined debugger types then? I don't need to display a tree for std::string, just the string it represents. This way I have to click quite a few times to get the value I need and is usually burried in that stl clutter.
This is especially painful when using watches.
How are predefined types used? The default setting for string says "$(Variable)._M_dataplus._M_p"
"print s._M_dataplus._M_p" gives "$2 = 0x592c04 "test"" which would be great to be used in locals instead of {...}
The tree variant is useful, but for some types (like the debugger predefined types) I'd prefer this shortened version.
This is especially painful when using watches.
How are predefined types used? The default setting for string says "$(Variable)._M_dataplus._M_p"
"print s._M_dataplus._M_p" gives "$2 = 0x592c04 "test"" which would be great to be used in locals instead of {...}
The tree variant is useful, but for some types (like the debugger predefined types) I'd prefer this shortened version.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Debugger Predefined types for STL
Ah, ok. Now I understands what you wantkspes wrote:"print s._M_dataplus._M_p" gives "$2 = 0x592c04 "test"" which would be great to be used in locals instead of {...}
Settings -> Debugger Settings and enable the option: 'Evaluate items in the 'Locals' view based on the 'PreDefined' types where possible'
Start your debugging session again.
EDIT:
The reason it is 'OFF' by default is because of performance, evaluating each item can slow down the debugging (when u have tens or entries in the locals view), but in most cases it is harmless.
Eran
Make sure you have read the HOW TO POST thread
- kspes
- CodeLite Enthusiast
- Posts: 41
- Joined: Sat Jan 30, 2010 2:18 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Debugger Predefined types for STL
oooooh that's what I was looking for, thanks. I went over that dialog a dozen times, can't believe I missed that option
btw, why doesn't this work for watches as well? is this intentional or?
btw, why doesn't this work for watches as well? is this intentional or?