Code::Blocks Forums
User forums => Help => Topic started by: rickkky on November 26, 2011, 12:16:05 am
-
Hi,
Since I have upgrade my ubuntu (10.10 -> codeblocks 10.05), I can not watch any of the contents of variable in debug mode. However, my "cbp" files have not changed!...
Example:
QString tmp = "test";
Watches:
tmp.toStdString() = "Attempt to take address of value not located in memory..."
or:
tmp.toStdString().c_str() = "Attempt to take address of value not located in memory..."
This becomes totally impossible to debug anything (C++/Qt for me) in these conditions ... :-(
Please, does anyone have an idea (except: "boot 10.04") to help me resolve this issue?
Regard.
<http://homepage.gna.org/ldapcppei/Frontends/Howto.html>
-
tmp.toStdString() = "Attempt to take address of value not located in memory..."
[...]
tmp.toStdString().c_str() = "Attempt to take address of value not located in memory..."
Are you aware that a debugger cannot understand this C++ code which needs to be compiled? I guess you should understand what a debugger is able to do and what not. The debugger cannot simply evaluate "tmp.toStdString()" - that's why you see the error. (At least not without special instrumentation.)
-
Are you aware that a debugger cannot understand this C++ code which needs to be compiled?
I confess that I do not know all that can do a debugger or not, but I am aware at least of what it was doing before and what it is no longer able to do. ;-) And because I am an optimist guy, my motto is: "larger version, more features"...
Worse than the described issue, here is what I can do when I boot on my old partition of my mechanic hard drive designed in the last century (ubuntu 10.04):
Code:
...
entry *zone = ...; // here (1) , "entry" is a ldapcppei::class based on a "std::set" (cf. <http://homepage.gna.org/ldapcppei/>)
<breakpoint>
...
Watches give:
(*zone)["zoneName"]->getStrValue() = (display the actual str content of the attribute "zoneName") !...
(where "operator[](char*)" is a search method -and "attribute" positionning- of the class "entry" in libldapcppei ...)
Here I have to admit, like you, I become quite contemplative ... :shock: but: yes this works!... :shock: :shock:
(1): line 176 in <http://homepage.gna.org/ldapcppei/archives/ldapEasyAdminFrontends/sources/bind9domain.so/bind9domain.cpp>.
Complement: "tmp.toStdString()" (compiled) does not shock me. When "tmp" exists, its method "QString::toStdString()" simply points to the memory address of the "std::string" of the object. And, after all, the role of a debugger is to show the contents of memory addresses. (However, for the example above, I have no explanation for the fact that it works... I just see it works - with Lucid Lynx, not with my Oneric Ocelot and C::B 10.05...).
-
not with my Oneric Ocelot and C::B 10.05...).
What about if you try a recent debugger nightly? Debugging has improved a lot!
Note that changing the OS might also mean to change the compiler, the debugger and the framework (versions). So there can be many reasons.
-
What about if you try a recent debugger nightly? Debugging has improved a lot!
This seems the same, but I live in GMT-10... ;-)
Note that changing the OS might also mean to change the compiler, the debugger and the framework...
This is not wrong, but my companion, Friday, suggests to me that I should not be the only one in the world to debug with older distributions and want to continue with the new one... So I wonder if I should return to the previous version. :?
-
New info : with kdbg, "tmp.toStdString()" works !... (ubuntu 11.10)
And in addition, (QString)ident shows its {value}! 8)
(line 36: <http://homepage.gna.org/ldapcppei/archives/ldapEasyAdminFrontends/sources/netfilter.so/main.cpp>)
Is there finaly a problem with C::B 10.05?... :shock:
-
What about if you try a recent debugger nightly? Debugging has improved a lot!
-
?...
(Apparently, it seems that I did not understand the question... (?)
Sorry: I may control the debuggers as badly as the English language - and vice versa ... :D )
my dbg version is the one of the current ubuntu distribution: gdb 7.3-0ubuntu2...
-
Debugger nightly (http://forums.codeblocks.org/index.php/topic,15440.0.html)
-
Ok!... (I did not know the concept ... :D ). Thanks.
It's the same ...
See: "ident.toStdString()" under the cursor (because I cannot add anything in the window "watches", which stays disable) on the screenshot below: the message is the same...
But, this works with "tmp.c_str()" ... (tmp is a std::string)
(this works with "ident" too, but doesn't show its value - only several values of pointers...)
-
Goto to Settings->Debugger... and find the option "Enable watch scripts" then disabled the option and try again.
-
Yes, now it's ok ...
(but the window "watches" stays disabled... ;-) - Would I have improperly installed? ...)
-
This is not the watches window:)
This is the new tooltip, which looks like the new watches, but unfortunately you cannot edit watches in there.
The real watches window can be shown with Debug->Debugging windows->Watches
-
Oh yes: this is no longer right-click ... but direct entry into the field ...
Very cool the option "Evaluate expression under cursor"... :D
Thank you very much for your help...