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 » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Valgrind support in TheIDE
Valgrind support in TheIDE [message #15840] Sun, 11 May 2008 17:59 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yep, it is quite rudimentary, but helpful anyway.

In TheIDE there is now Debug/"Run in Valgrind". It uses XML output which is then parsed to more readable form to console output and, more importantly, is understood by theide when doublecking (or pressing F4) (goes to line listed).

On related news, I have fixed all valgrind problems I have spotted when testing TheIDE in valgrind (and which were not coming from glibc, gtk etc..). (Unfortunately, most were really insignificant, nothing to explain recent Ubuntu problem).

Mirek
Re: Valgrind support in TheIDE [message #15935 is a reply to message #15840] Mon, 19 May 2008 05:36 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Valgrind exists only on Linux. I've attached a patch.


Regards,
Novo
Re: Valgrind support in TheIDE [message #15957 is a reply to message #15935] Mon, 19 May 2008 22:02 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Patch to make it work on both ubuntu 7.04 and 8.04.

void Ide::Valgrind()
{
	static String ValgrindLogFile = "";
	static bool hasValgrind = true;
	
	// runs valgrind --help to find if the correct option is
	// --log-file-exactly (ubuntu 7.04) or --log-file (ubuntu 8.04)
	if(hasValgrind && ValgrindLogFile == "")
	{
		One<Host> h = CreateHostRunDir();
		String fn = GetTempFileName();
		FileOut f(fn);
		String cmdline;
		if(!IsNull(h->Execute("valgrind --help", f)))
		{
			f.Close();
			String txt = LoadFile(fn);
			DeleteFile(fn);
			if(txt.Find("--log-file-exactly") > 0)
			   ValgrindLogFile = "--log-file-exactly";
			else if (txt.Find("--log-file") > 0)
			   ValgrindLogFile = "--log-file";
			else
				hasValgrind = false;
		}
		else
			hasValgrind = false;
	}
	if(!hasValgrind)
		return;
	
	if(!Build())
		return;
	One<Host> h = CreateHostRunDir();
.........................................


(applied to svn)

Ciao

Max

[Updated on: Mon, 19 May 2008 22:03]

Report message to a moderator

Re: Valgrind support in TheIDE [message #15961 is a reply to message #15957] Tue, 20 May 2008 00:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mdelfede wrote on Mon, 19 May 2008 16:02

Patch to make it work on both ubuntu 7.04 and 8.04.

void Ide::Valgrind()
{
	static String ValgrindLogFile = "";
	static bool hasValgrind = true;
	
	// runs valgrind --help to find if the correct option is
	// --log-file-exactly (ubuntu 7.04) or --log-file (ubuntu 8.04)
	if(hasValgrind && ValgrindLogFile == "")
	{
		One<Host> h = CreateHostRunDir();
		String fn = GetTempFileName();
		FileOut f(fn);
		String cmdline;
		if(!IsNull(h->Execute("valgrind --help", f)))
		{
			f.Close();
			String txt = LoadFile(fn);
			DeleteFile(fn);
			if(txt.Find("--log-file-exactly") > 0)
			   ValgrindLogFile = "--log-file-exactly";
			else if (txt.Find("--log-file") > 0)
			   ValgrindLogFile = "--log-file";
			else
				hasValgrind = false;
		}
		else
			hasValgrind = false;
	}
	if(!hasValgrind)
		return;
	
	if(!Build())
		return;
	One<Host> h = CreateHostRunDir();
.........................................


(applied to svn)

Ciao

Max


Nice heurestics Smile Applying.

Mirek
Re: Valgrind support in TheIDE [message #15970 is a reply to message #15961] Tue, 20 May 2008 13:47 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
ehehe... we must live with such dummy stuffs Smile
Btw, a messagebox telling that Valgrind is not installed would be nice... or, I could add the dependency to debian package.

Ciao

Max
Re: Valgrind support in TheIDE [message #15976 is a reply to message #15935] Wed, 21 May 2008 05:35 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Novo wrote on Sun, 18 May 2008 23:36

Valgrind exists only on Linux. I've attached a patch.



Could you please apply this patch to TheIDE? My firewall complains about TheIDE launching a network-enabled application all the time ...


Regards,
Novo
Re: Valgrind support in TheIDE [message #15979 is a reply to message #15976] Wed, 21 May 2008 12:58 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Novo wrote on Wed, 21 May 2008 05:35

Novo wrote on Sun, 18 May 2008 23:36

Valgrind exists only on Linux. I've attached a patch.



Could you please apply this patch to TheIDE? My firewall complains about TheIDE launching a network-enabled application all the time ...


Applied!

Max
Previous Topic: PROFILEMT flag
Next Topic: File selector displays hidden items ant its icons in different color
Goto Forum:
  


Current Time: Thu Mar 28 20:28:02 CET 2024

Total time taken to generate the page: 0.01110 seconds