|
|
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » the debugger
the debugger [message #17358] |
Fri, 08 August 2008 20:55 |
cocob
Messages: 156 Registered: January 2008
|
Experienced Member |
|
|
Hello all,
Excuse me for my impatience ! But i want to know if improvement in theide debugger are envisaged.
I know this is not the priority but i'm using theide for some projects since 6 months and the debugger is for me the only thing which need to be improved.
I have always same problem.
- Add/remove breakpoints during execution doesn't work.
- Sometimes my program or/and theide is stucked.
- watching values is limited and it would be nice to show
expression like b.size() or b[index] (where b is a STL container)
(if it is not possible it would be really nice the debugging session was not broken adding expressions like these.)
- and some others little problems, ....
thanks for your answer.
cocob
|
|
|
|
|
|
|
Re: the debugger [message #18606 is a reply to message #17358] |
Sat, 11 October 2008 11:26 |
cocob
Messages: 156 Registered: January 2008
|
Experienced Member |
|
|
I have done some test with theIDE on windows with MSC9
Here my example source :
#include <vector>
int main(int argc, const char *argv[])
{
std::vector<int> vec;
std::vector<int>::iterator iter;
vec.push_back(1);
vec.push_back(4);
vec.push_back(3);
iter = vec.begin();
int a = *iter;
return 0;
}
I have tried to watch these expressions
1 - (vec._Mylast - vec._Myfirst)
2 - vec.size()
3 - vec[0]
4 - *iter
5 - *(vec._Myfirst+1)
and the results
1 - ff698284->??
2 - Unknown membre 'size'
3 - Invalid operand
4 - Only pointer can be dereferenced
5 - 4
So only the last expression works.
I know that 2, 3, 4 are difficult because we sould parse c++, detect specific STL type (vector) and replace the expression.
But why the first expression doesn't work ?
cocob
[Updated on: Sat, 11 October 2008 11:27] Report message to a moderator
|
|
|
Re: the debugger [message #18716 is a reply to message #17358] |
Sat, 18 October 2008 12:40 |
cocob
Messages: 156 Registered: January 2008
|
Experienced Member |
|
|
Here a little code to solve my problem of printing values in STL vectors. I think it would be great to improve this to print values for other types.
String Gdb::GetVarType(const String& var)
{
String type = FastCmd("ptype " + var);
StringStream ss(type);
String ln = ss.GetLine();
const char *s = strchr(ln, '=');
if(s) {
s++;
while(*s == ' ')
s++;
return String(s);
}
else
return "";
}
String Gdb::TransformExp(const String& exp)
{
String newExp;
int b = exp.Find('[');
if(b>0) {
int e = exp.Find(']', b+1);
if(b>0) {
// we have a *[*] expression so evaluate the index
String index = exp.Mid(b+1, e-b-1);
index = Print(index);
String tab = exp.Mid(0, b);
String tabType = GetVarType(tab);
if(tabType.GetLength()==0) return exp;
if(tabType.Left(17)=="class std::vector") {
newExp << "*(" << tab << "._M_impl._M_start+" << index << ")";
return newExp;
} else {
newExp << tab << "[" << index << "]";
return newExp;
}
}
}
return exp;
}
String Gdb::Print(const String& exp)
{
String newExp = TransformExp(exp);
String q = FastCmd("print " + newExp);
StringStream ss(q);
String ln = ss.GetLine();
const char *s = strchr(ln, '=');
if(s) {
s++;
while(*s == ' ')
s++;
return DataClean(s);
}
else
return DataClean(ln);
}
[Updated on: Sat, 18 October 2008 19:05] Report message to a moderator
|
|
|
|
|
|
Re: the debugger [message #21098 is a reply to message #21088] |
Sun, 03 May 2009 21:10 |
|
Which operating system and what compiler is used?
I use mostly GCC in UBUNTU-i386 and the GCC / MINGW in Windows XP. Nothing like I have not noticed. Apparently the case in your environment.
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
Goto Forum:
Current Time: Fri Sep 20 20:51:26 CEST 2024
Total time taken to generate the page: 0.03749 seconds
|
|
|