Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » the debugger
the debugger [message #17358] Fri, 08 August 2008 20:55 Go to next message
cocob is currently offline  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 #17359 is a reply to message #17358] Fri, 08 August 2008 21:40 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 598
Registered: December 2005
Location: Budapest, Hungary
Contributor
Quote:


- Add/remove breakpoints during execution doesn't work.

Try F9 key.

My favorite feature would be the ability to show content of Value types.
Re: the debugger [message #17360 is a reply to message #17358] Fri, 08 August 2008 22:21 Go to previous messageGo to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
ok but F9 show/add a red point at the left of my code but the programs doesn't stop on it or stop on it after it is removed ....
Re: the debugger [message #17361 is a reply to message #17360] Sat, 09 August 2008 00:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12118
Registered: November 2005
Ultimate Member
You have forgot to mention on what platform.

There are two things. With MSC, we are sort of victims of information that dbghelp.dll reveals us about the executable.

With GCC, we are victims of GDB....

Mirek
Re: the debugger [message #17442 is a reply to message #17358] Fri, 15 August 2008 12:32 Go to previous messageGo to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
I wants to know why gdb is a problem.
I'am not expert in debuggers but with gdb you can display values of very complex types adding some scripts or complex expression like these

display *(vec._M_impl._M_start + 3)
-> equivalent to vec[3]

or

define vector
printf "size=%d\n", $arg0._M_impl._M_finish - $arg0._M_impl._M_start
printf "capacity=%d\n", $arg0._M_impl._M_end_of_storage - $arg0._M_impl._M_start
end

to display size and capacity of a vector

This is examples but for me a lot a of expression can be evaluate by gdb and it would be great to do the same in theide !

cocob
Re: the debugger [message #18606 is a reply to message #17358] Sat, 11 October 2008 11:26 Go to previous messageGo to next message
cocob is currently offline  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 Go to previous messageGo to next message
cocob is currently offline  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 #19726 is a reply to message #17358] Wed, 07 January 2009 16:45 Go to previous messageGo to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
I have an other problem but very simple.

int n[4];

Impossible to display array values with MSC debugger...
Re: the debugger [message #21033 is a reply to message #19726] Mon, 27 April 2009 19:29 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 916
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Are there any plans to support setting/clearing breakpoints during the debug session (@ at least one of MSC/GDB)? This will be very handy.
Re: the debugger [message #21088 is a reply to message #21033] Sun, 03 May 2009 17:28 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 916
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

It looks like adding/removing breakpoints while in debug mode works in some cases. But in some cases - it doesn`t.
Looks like a bug(?).
Re: the debugger [message #21098 is a reply to message #21088] Sun, 03 May 2009 21:10 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 736
Registered: January 2008
Location: Moscow, Russia
Contributor

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 );
}
Re: the debugger [message #21100 is a reply to message #21098] Sun, 03 May 2009 22:29 Go to previous message
Mindtraveller is currently offline  Mindtraveller
Messages: 916
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

WinXP SP2,
MSC8, MSC9

[Updated on: Sun, 03 May 2009 22:29]

Report message to a moderator

Previous Topic: A problem with UPP application scale . . . UPP exonerated, the rest of the story.
Next Topic: Project isn't portable from windows to linux
Goto Forum:
  


Current Time: Sat Dec 07 00:40:56 CET 2019

Total time taken to generate the page: 0.01055 seconds