Count value is not getting printed for shared pointers.
Setup :
CodeLite : 14.0.2
GDB : GNU gdb (GDB) 8.1
GDB might not have the issue as i can print this directly from the debug terminal of the CodeLite.
-stack-list-variables --thread 1 --frame 0 --all-values
DEBUG>>-stack-list-variables --thread 1 --frame 0 --all-values
DEBUG>>^done,variables=[{name="p1",value="std::shared_ptr<int> (use count 2, weak count 0) = {get() = 0xf32020}"},{name="p2",value="std::shared_ptr<int> (use count 2, weak count 0) = {get() = 0xf32020}"}]
Please help here.
BR,Rajdeep
GDB printing for std::shared_pointer
-
- CodeLite Curious
- Posts: 2
- Joined: Thu Dec 05, 2019 1:28 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
GDB printing for std::shared_pointer
You do not have the required permissions to view the files attached to this post.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: GDB printing for std::shared_pointer
By looking at CodeLite's source, I can see that this is the command used by CodeLIte to query the locals:
What is the result you get when you run this command locally?
EDIT:
I just tested this locally, the problem is like I said: the output displayed by CodeLIte is because CodeLite uses the command above and not the one you printed. iirc, this is because of older gdb versions
You can open a bug for this
Eran
Code: Select all
-stack-list-variables --skip-unavailable 2
EDIT:
I just tested this locally, the problem is like I said: the output displayed by CodeLIte is because CodeLite uses the command above and not the one you printed. iirc, this is because of older gdb versions
You can open a bug for this
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 2
- Joined: Thu Dec 05, 2019 1:28 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: GDB printing for std::shared_pointer
Hey Eran,
Here is the printout :
One question :
Do you mean to open a bug for codelite or in GDB ?
I haven't done it before. Would you help me ?
-BR,Rajdeep
Here is the printout :
Code: Select all
-stack-list-variables --skip-unavailable 2
DEBUG>>-stack-list-variables --skip-unavailable 2
DEBUG>>^done,variables=[{name="p1",type="std::shared_ptr<int>"},{name="p2",type="std::shared_ptr<int>"}]
Do you mean to open a bug for codelite or in GDB ?
I haven't done it before. Would you help me ?
-BR,Rajdeep
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: GDB printing for std::shared_pointer
This is now fixed in git master
Eran
Eran
Make sure you have read the HOW TO POST thread