www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - dmd0xf - Tango dmd package from team0xf

reply Peter Modzelewski <peter.modzelewski gmail.com> writes:
We are proud to introduce to you our new Creation. dmd0xf is a massive 
package containing all you need to code in D on Windows working out of 
the box. All you need to do is unpack this archive and add its bin to 
your PATH environment variable. Newest release contains:

     * dmd 1.025
     * dsss 0.75 , rebuild included; rebuild is suggested when working 
with Tango.
     * build v 3.04 - when you use build with this package, you must 
link dmd-tango-base.lib, for example build yourApp.d dmd-tango-base.lib
     * Tango 0.99.4 Frank release with Tangobos - Tangobos will let you 
use most of phobos in your tango projects
     * Tango backtrace hack for 0.99.4

dmd0xf is available from tango's website, as one of the community 
downloads ( 
http://www.dsource.org/projects/tango/wiki/CommunityDownloads ), and on 
our download site ( http://team0xf.com/index.php?n=Site.Download ). We 
will try to keep it up to date, working and stable.

This is also first time we present Tango backtrace hack, working like 
similar tool for phobos we were publishing for some time. I wrote also 
short article about using backtrace hack, you can find  it on my blog: 
http://petermodzelewski.blogspot.com/2008/01/development-in-d-with-use-of-backtrace.html
Phobos backtrace hack is available on 
http://team0xf.com/index.php?n=Site.Download

Thanks for your time. We will be thankful for any feedback.
Jan 16 2008
next sibling parent reply Jason House <jason.james.house gmail.com> writes:
Peter Modzelewski wrote:

 We are proud to introduce to you our new Creation. dmd0xf is a massive
 package containing all you need to code in D on Windows working out of
 the box.
Cool. Any plans to support more than windows?
Jan 16 2008
parent Pragma <ericanderton yahoo.com> writes:
Jason House Wrote:

 Peter Modzelewski wrote:
 
 We are proud to introduce to you our new Creation. dmd0xf is a massive
 package containing all you need to code in D on Windows working out of
 the box.
Cool. Any plans to support more than windows?
Seriously. We could use a .deb for us Ubuntu/Debian folks.
Jan 18 2008
prev sibling next sibling parent reply Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
Peter Modzelewski wrote:
 We are proud to introduce to you our new Creation. dmd0xf is a massive 
 package containing all you need to code in D on Windows working out of 
 the box. All you need to do is unpack this archive and add its bin to 
 your PATH environment variable. Newest release contains:
 
     * dmd 1.025
[snip]
 dmd0xf is available from tango's website, as one of the community 
 downloads ( 
 http://www.dsource.org/projects/tango/wiki/CommunityDownloads ), and on 
 our download site ( http://team0xf.com/index.php?n=Site.Download ). We 
 will try to keep it up to date, working and stable.
Did you get permission from Walter to distribute this? AFAIK only the Tango team has permission to redistribute DMD. (The "tango community download" link also points to the team0xf site, so even that one is in violation of copyright unless you guys have permission; I don't know the exact nature of Walter's permission for Tango so I don't know if this would be allowed if it was on their site)
Jan 16 2008
parent reply John Reimer <terminal.node gmail.com> writes:
Frits van Bommel wrote:
 Peter Modzelewski wrote:
 We are proud to introduce to you our new Creation. dmd0xf is a massive 
 package containing all you need to code in D on Windows working out of 
 the box. All you need to do is unpack this archive and add its bin to 
 your PATH environment variable. Newest release contains:

     * dmd 1.025
[snip]
 dmd0xf is available from tango's website, as one of the community 
 downloads ( 
 http://www.dsource.org/projects/tango/wiki/CommunityDownloads ), and 
 on our download site ( http://team0xf.com/index.php?n=Site.Download ). 
 We will try to keep it up to date, working and stable.
Did you get permission from Walter to distribute this? AFAIK only the Tango team has permission to redistribute DMD. (The "tango community download" link also points to the team0xf site, so even that one is in violation of copyright unless you guys have permission; I don't know the exact nature of Walter's permission for Tango so I don't know if this would be allowed if it was on their site)
I was also wondering about this. It seems that there would have to be explicit permission since the dmd packaged download is not on dsource. The original permission for Tango/dmd download was specific to dsource only and through the Tango webspace only (if I remember correctly). Perhaps these guys got extra permission from Walter? If so, it would be nice if they had made this information known in their announcement. :) -JJR
Jan 16 2008
parent reply Peter Modzelewski <peter.modzelewski gmail.com> writes:
John Reimer wrote:
 Frits van Bommel wrote:
 Peter Modzelewski wrote:
 We are proud to introduce to you our new Creation. dmd0xf is a 
 massive package containing all you need to code in D on Windows 
 working out of the box. All you need to do is unpack this archive and 
 add its bin to your PATH environment variable. Newest release contains:

     * dmd 1.025
[snip]
 dmd0xf is available from tango's website, as one of the community 
 downloads ( 
 http://www.dsource.org/projects/tango/wiki/CommunityDownloads ), and 
 on our download site ( http://team0xf.com/index.php?n=Site.Download 
 ). We will try to keep it up to date, working and stable.
Did you get permission from Walter to distribute this? AFAIK only the Tango team has permission to redistribute DMD. (The "tango community download" link also points to the team0xf site, so even that one is in violation of copyright unless you guys have permission; I don't know the exact nature of Walter's permission for Tango so I don't know if this would be allowed if it was on their site)
I was also wondering about this. It seems that there would have to be explicit permission since the dmd packaged download is not on dsource. The original permission for Tango/dmd download was specific to dsource only and through the Tango webspace only (if I remember correctly). Perhaps these guys got extra permission from Walter? If so, it would be nice if they had made this information known in their announcement. :) -JJR
We were not aware about the problem with dmd redistribution. For now we've removed the link from the tango page. We are now waiting for a response from the tango team if they will support that package and host it on dsource. By the way. Don't be afraid of the "hack" keyword. :) Both the Tango backtrace hack as well as the phobos backtrace hack are really little modifications of those libraries, which have no influence on their runtime or performance. The modification is only to print a backtrace when the program crashes. Jason House wrote:
 Peter Modzelewski wrote:

 We are proud to introduce to you our new Creation. dmd0xf is a massive
 package containing all you need to code in D on Windows working out of
 the box.
Cool. Any plans to support more than windows?
Not for now. But maybe in the future :)
Jan 17 2008
parent reply =?UTF-8?B?SnVsaW8gQ8Opc2FyIENhcnJhc2NhbCBVcnF1aWpv?= writes:
Peter Modzelewski wrote:
 We were not aware about the problem with dmd redistribution. For now 
 we've removed the link from the tango page. We are now waiting for a 
 response from the tango team if they will support that package and host 
 it on dsource.
Could you provide only the "hack" while the license issue is worked out? Thanks -- Julio César Carrascal Urquijo http://jcesar.artelogico.com/
Jan 17 2008
next sibling parent reply Tom S <h3r3tic remove.mat.uni.torun.pl> writes:
Julio César Carrascal Urquijo wrote:
 Peter Modzelewski wrote:
 We were not aware about the problem with dmd redistribution. For now 
 we've removed the link from the tango page. We are now waiting for a 
 response from the tango team if they will support that package and 
 host it on dsource.
Could you provide only the "hack" while the license issue is worked out?
Sure :) http://team0xf.com:8080/tangoTrace?ca=tip;type=zip or hg clone from http://team0xf.com:8080/tangoTrace Cheers! -- Tomasz Stachowiak http://h3.team0xf.com/ h3/h3r3tic on #D freenode
Jan 17 2008
parent =?UTF-8?B?SnVsaW8gQ8Opc2FyIENhcnJhc2NhbCBVcnF1aWpv?= writes:
Tom S wrote:
 Julio César Carrascal Urquijo wrote:
 Could you provide only the "hack" while the license issue is worked out?
Sure :) http://team0xf.com:8080/tangoTrace?ca=tip;type=zip or hg clone from http://team0xf.com:8080/tangoTrace Cheers!
Thanks -- Julio César Carrascal Urquijo http://jcesar.artelogico.com/
Jan 17 2008
prev sibling parent reply Sean Kelly <sean f4.ca> writes:
Julio César Carrascal Urquijo wrote:
 Peter Modzelewski wrote:
 We were not aware about the problem with dmd redistribution. For now
 we've removed the link from the tango page. We are now waiting for a
 response from the tango team if they will support that package and
 host it on dsource.
Could you provide only the "hack" while the license issue is worked out?
For what it's worth, Tango has supported stack tracing via a plug-in for quite a while now. So I am wondering if this is mostly a matter of visibility or convenience? Either way, we'll look into addressing this issue for the next release. Sean
Jan 17 2008
parent reply =?UTF-8?B?SnVsaW8gQ8Opc2FyIENhcnJhc2NhbCBVcnF1aWpv?= writes:
Sean Kelly wrote:
 For what it's worth, Tango has supported stack tracing via a plug-in for
 quite a while now.  So I am wondering if this is mostly a matter of
 visibility or convenience?  Either way, we'll look into addressing this
 issue for the next release.
 
 
 Sean
I tried the flectioned plugin before but at the time it didn't compile in the version of DMD I was using and didn't have time to checkout why so I just give up. Having it in an integrated package certainly has it's advantages. Maybe it could be included in the next official release of Tango, now that Tangobos is included in this one. -- Julio César Carrascal Urquijo http://jcesar.artelogico.com/
Jan 18 2008
parent Sean Kelly <sean f4.ca> writes:
Julio César Carrascal Urquijo wrote:
 Sean Kelly wrote:
 For what it's worth, Tango has supported stack tracing via a plug-in for
 quite a while now.  So I am wondering if this is mostly a matter of
 visibility or convenience?  Either way, we'll look into addressing this
 issue for the next release.
I tried the flectioned plugin before but at the time it didn't compile in the version of DMD I was using and didn't have time to checkout why so I just give up.
Yeah it's been a while since I tried flectioned and I had to fix it a bit to get it running with the current Tango. I'll see if Thomas K. will update the DSource version, but in the interim I've put my copy here in case anyone wants to use it: http://www.invisibleduck.org/~sean/tmp/flectioned.d
 Having it in an integrated package certainly has it's advantages. Maybe
 it could be included in the next official release of Tango, now that
 Tangobos is included in this one.
It's something we'll definitely re-examine. We'd considered it before, but flectioned is distributed under a different license than Tango, coordinating releases may be an issue, etc. As an alternative, what if DSSS could auto download and install flectioned to get people automatically up and running with its stack trace features? It would mean writing an install script for DSSS that modifies sc.ini/dmd.conf, but perhaps this would be worthwhile for some people? Sean
Jan 18 2008
prev sibling next sibling parent reply Peter Modzelewski <peter.modzelewski gmail.com> writes:
Peter Modzelewski wrote:
 We are proud to introduce to you our new Creation. 
 [snip]
Hello. Unfortunately I must announce that dmd0xf is no more. I'm still a student and was not aware, and not even caring, of all the law issues related with dmd0xf. We were not aware that it is necessity to have Walter Brights agreement to redistribute dmd. Therefore we must remove dmd0xf for now. The good thing is that we introduced the backtrace problem again, and some people started to additionally look into it. Anyway, sorry for all that. I hope no one was insulted by this attempt. Piotr.
Jan 17 2008
next sibling parent Stephane Wirtel <stephane.wirtel descasoft.com> writes:
Thanks Piotr
Jan 18 2008
prev sibling parent reply =?ISO-8859-1?Q?Julio_C=E9sar_Carrascal_Urquijo?= writes:
Peter Modzelewski wrote:
 Peter Modzelewski wrote:
 We are proud to introduce to you our new Creation. [snip]
Hello. Unfortunately I must announce that dmd0xf is no more. I'm still a student and was not aware, and not even caring, of all the law issues related with dmd0xf. We were not aware that it is necessity to have Walter Brights agreement to redistribute dmd. Therefore we must remove dmd0xf for now. The good thing is that we introduced the backtrace problem again, and some people started to additionally look into it. Anyway, sorry for all that. I hope no one was insulted by this attempt. Piotr.
I thank you for the effort and certainly have to say that the backtrace hack is awesome. Please don't drop the hack with dmd0xf. I would be delighted if it could be included in the distribution of Tango. Thanks again. -- Julio César Carrascal Urquijo http://jcesar.artelogico.com/
Jan 18 2008
parent Peter Modzelewski <peter.modzelewski gmail.com> writes:
Julio César Carrascal Urquijo wrote:
 Peter Modzelewski wrote:
 Peter Modzelewski wrote:
 We are proud to introduce to you our new Creation. [snip]
Hello. Unfortunately I must announce that dmd0xf is no more. I'm still a student and was not aware, and not even caring, of all the law issues related with dmd0xf. We were not aware that it is necessity to have Walter Brights agreement to redistribute dmd. Therefore we must remove dmd0xf for now. The good thing is that we introduced the backtrace problem again, and some people started to additionally look into it. Anyway, sorry for all that. I hope no one was insulted by this attempt. Piotr.
I thank you for the effort and certainly have to say that the backtrace hack is awesome. Please don't drop the hack with dmd0xf. I would be delighted if it could be included in the distribution of Tango. Thanks again.
Thanks a lot for your kind words. As dmd0xf is no more, you can find the patcher on our download page: http://team0xf.com/index.php?n=Site.Download Some tips related to the backtrace hack and installing it in tango can be found on http://petermodzelewski.blogspot.com/
Jan 18 2008
prev sibling parent Robert Fraser <fraserofthenight gmail.com> writes:
I was working on this for Flute last night and it might be sort of 
relevant. Basically, it uses the Windows debug info to look up the file 
and line information of the actual line that was being executed from the 
execution address. For long functions, this is often more valuable than 
just the name of the function. It'll take a little coercing to compile 
since it's been taken out of context, but may prove useful. Only for 
D1/Phobos/Windows, though porting to D2 or Tango will take very little 
effort.

version(Windows)
{
	/// Can we lookup debug info?
	private bool debugInfo = false;
	
	version(inPhobos)
	{
	    import std.c.windows.windows;
	    import std.c.string : strlen;
	}
	else
	    { } //TANGO
	
	private enum
	{
		MAX_MODULE_NAME32 = 255,
		TH32CS_SNAPMODULE = 0x08,
		SYMOPT_LOAD_LINES = 0x10,
	}
	
	private extern(Windows) struct MODULEENTRY32
	{
		DWORD  dwSize;
		DWORD  th32ModuleID;
		DWORD  th32ProcessID;
		DWORD  GlblcntUsage;
		DWORD  ProccntUsage;
		BYTE  *modBaseAddr;
		DWORD  modBaseSize;
		HMODULE hModule;
		char   szModule[MAX_MODULE_NAME32 + 1];
		char   szExePath[MAX_PATH];
	}
	
	private extern(Windows) struct IMAGEHLP_LINE
	{
		DWORD SizeOfStruct;
	    PVOID Key;
	    DWORD LineNumber;
	    PTSTR FileName;
	    DWORD Address;
	}
	alias IMAGEHLP_LINE* PIMAGEHLP_LINE;
	
	private extern(Windows) BOOL Module32First(HANDLE, MODULEENTRY32*);
	private extern(Windows) BOOL Module32Next(HANDLE, MODULEENTRY32*);
	private extern(Windows) HANDLE CreateToolhelp32Snapshot(DWORD,DWORD);
	
	private HMODULE imagehlp;
	private HANDLE proc;
	private extern(Windows) DWORD function(DWORD) SymSetOptions;
	private extern(Windows) BOOL function(HANDLE, PCSTR, BOOL) SymInitialize;
	private extern(Windows) BOOL function(HANDLE) SymCleanup;
	private extern(Windows) DWORD function(HANDLE, HANDLE, PCSTR, PCSTR, 
DWORD, DWORD) SymLoadModule;
	private extern(Windows) BOOL function(HANDLE, DWORD, PDWORD, 
PIMAGEHLP_LINE) SymGetLineFromAddr;
	
	
	/**
      * Initalize libraries needed to lookup file/line information in 
exception stack
      * traces.
      */
	private void initDebugInfo()
	{
		MODULEENTRY32 moduleEntry;
		moduleEntry.dwSize = moduleEntry.sizeof;
		char buffer[4096];
		
		try
		{
			scope(failure)
			{
				if(imagehlp)
					FreeLibrary(imagehlp);
				
				SymSetOptions = null;
				SymInitialize = null;
				SymCleanup = null;
				SymLoadModule = null;
				SymGetLineFromAddr = null;
			}
			
			proc = GetCurrentProcess();
			if(!proc)
				throw new Exception("GetCurrentProcess() returned null");
			
			HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, 0);
			if(!snapshot)
				throw new Exception("CreateToolHelp32Snapshot failed");
			
			imagehlp = LoadLibraryA("imagehlp.dll");
			if(!imagehlp)
				throw new Exception("Failed to load imagehlp.dll");
			
			SymSetOptions = cast(typeof(SymSetOptions)) GetProcAddress(imagehlp, 
"SymSetOptions");
			if(!SymSetOptions)
				throw new Exception("Failed to load SymSetOptions");
			
			SymInitialize = cast(typeof(SymInitialize)) GetProcAddress(imagehlp, 
"SymInitialize");
			if(!SymInitialize)
				throw new Exception("Failed to load SymInitialize");
			
			SymCleanup = cast(typeof(SymCleanup)) GetProcAddress(imagehlp, 
"SymCleanup");
			if(!SymCleanup)
				throw new Exception("Failed to load SymCleanup");
			
			SymLoadModule = cast(typeof(SymLoadModule)) GetProcAddress(imagehlp, 
"SymLoadModule");
			if(!SymLoadModule)
				throw new Exception("Failed to load SymLoadModule");
			
			SymGetLineFromAddr = cast(typeof(SymGetLineFromAddr)) 
GetProcAddress(imagehlp, "SymGetLineFromAddr");
			if(!SymGetLineFromAddr)
				throw new Exception("Failed to load SymGetLineFromAddr");
			
			// Since Flectioned doesn't load the line inforamtion when loading
			// symbols, we have little choice but to load all the symbols again, this
			// time with SYMOPT_LOAD_LINES on.
			if(!SymCleanup(proc))
				throw new Exception("SymCleanup failed");
			SymSetOptions(SYMOPT_LOAD_LINES);
			if(!SymInitialize(proc, null, FALSE))
				throw new Exception("SymInitialize failed");
			
			// We have to enumerate through the modules individually so that each
			// module finds its search path
			if(!Module32First(snapshot, &moduleEntry))
				throw new Exception("Module32First Failed");
			do
			{
				if(GetModuleFileNameA(moduleEntry.hModule, buffer.ptr, buffer.length))
					SymLoadModule(proc, HANDLE.init, buffer.ptr, null, 0, 0);
			}
			while(Module32Next(snapshot, &moduleEntry));
			
			debugInfo = true;
		}
		catch(Exception e)
		{
			//write(e.toString() ~ "\n");
		}
	}
	
	
     /**
      * Close librries needed to lookup file/line information in 
exception stack traces.
      */
	private void closeDebugInfo()
	{
		if(debugInfo)
		{
			SymCleanup(proc);
			FreeLibrary(imagehlp);
			
			SymSetOptions = null;
			SymInitialize = null;
			SymCleanup = null;
			SymLoadModule = null;
			SymGetLineFromAddr = null;
		}
	}
	
	/**
      * Attempts to look up the file/line in the debug info given an 
execution
      * address.
      *
      * Params:
      *     addr = the execution address to look up
      * Returns: If the lookup is succesful, returns "[file]:[line]", 
where [file]
      *     is the filename where the code is located and [line] is th 
line of code
      *     the address refers to. On failure returns "0x[address]", 
where [address]
      *     is the hexadecimal representation of addr.
      */
	private char[] getDebugInfo(void* addr)
	{
		char[] toHex(size_t val)
		{
			const int percision = (void*).sizeof * 2;
			
			version(inPhobos)

			else
				{ } // TANGO
		}
		
		if(!debugInfo || !addr)
			goto Lunknown;
		
		IMAGEHLP_LINE lineInfo;
		DWORD displacement;
		lineInfo.SizeOfStruct = lineInfo.sizeof;
		
		if(!SymGetLineFromAddr(proc, cast(DWORD) addr, &displacement, &lineInfo))
			goto Lunknown;
		
		return lineInfo.FileName[0 .. strlen(lineInfo.FileName)] ~ ":" ~
		        itoa(lineInfo.LineNumber);
		
		Lunknown:
			return toHex(cast(size_t) addr);
	}
}
Jan 20 2008