Jump to page: 1 2
Thread overview
How do you compile the front end?
Apr 02, 2004
kinghajj
Apr 02, 2004
Ilya Minkov
Apr 02, 2004
kinghajj
Apr 02, 2004
Ilya Minkov
Apr 02, 2004
Manfred Nowak
Apr 02, 2004
Ilya Minkov
Apr 02, 2004
J Anderson
Apr 02, 2004
Ilya Minkov
Apr 02, 2004
Ilya Minkov
Apr 03, 2004
J Anderson
Apr 03, 2004
J Anderson
Apr 03, 2004
Ilya Minkov
debugger formats was Re: How do you compile the front end?
Apr 03, 2004
Mark T
Apr 05, 2004
Walter
Apr 07, 2004
J Anderson
Apr 13, 2004
Walter
April 02, 2004
I tried, and got lots of errors: can you include a makefile in the next release, please? That would be *very* helpfull.


April 02, 2004
kinghajj schrieb:
> I tried, and got lots of errors: can you include a makefile in the next release,
> please? That would be *very* helpfull.

You cannot compile this front-end because you don't have a back-end. ;) It is primarily thought for other compiler and tool maintainers, as well as for everyone who wants to read the code.

Join D.gnu and grab one there, they compile against GCC source.

-eye
April 02, 2004
>You cannot compile this front-end because you don't have a back-end. ;) It is primarily thought for other compiler and tool maintainers, as well as for everyone who wants to read the code.
>
>Join D.gnu and grab one there, they compile against GCC source.
>
>-eye
..I thought that DMD made the OBJ files, and DMC made the exe from those.
If not windows, isn't that how it works on Linux, since it already has GCC on it
(usually).

I was trying to build the front end for Darwin (MacOS X).


April 02, 2004
kinghajj schrieb:
> ..I thought that DMD made the OBJ files, and DMC made the exe from those.
> If not windows, isn't that how it works on Linux, since it already has GCC on it
> (usually).

From DMC installation, only the linker is used directly. DMD is compiled statically against that part of DMC called "back-end" which generates object code (.obj files) from an abstract (C-level) representation of a program. Thus "back-end" is not included in the compiler source, but is included in every executable, and it's the same with GCC version. BTW, .obj file format is different between compilers. But they always contain already compiled machine code, which only has placeholders for the code which has to be found in other .obj files. The linker connects many .obj files to an executable by editing this placeholders and writing an OS-standard file format.

DMD for Linux contains a modified version of DMC back-end which outputs object files in the format which GNU linker understands under Linux, and uses the GCC linker. However, it's still a DMC back-end and it can only generate code for Intel CPUs, and it is an enormous amount of work to add support for different CPUs (exception may be AMD64), so don't expect it to ever be ported over to IBMs.

> I was trying to build the front end for Darwin (MacOS X).

Then you definately need one from D.gnu, namely the recent GDC, or you can ask resistor or someone else of the MacOS guys to send you a compiled one. Please read their discussion, i guess they have just made it work with MacOS X. BTW, its principle is exactly the same as with DMC, the compiler executable will contain the GCC back-and and only make use of the already installed GCC linker.

-eye
April 02, 2004
Ilya Minkov wrote:

> DMD for Linux contains a modified version of DMC back-end which outputs object files in the format which GNU linker understands under Linux, and uses the GCC linker.

Are the formats different between linux and windows? If they are the same, I would like to have a windows dmd to use with cygwin or msys.

So long!
April 02, 2004
Manfred Nowak schrieb:

> Ilya Minkov wrote:
> 
> 
>>DMD for Linux contains a modified version of DMC back-end which outputs object files in the format which GNU linker understands under Linux, and uses the GCC linker.
> 
> Are the formats different between linux and windows? If they are the
> same, I would like to have a windows dmd to use with cygwin or msys.

They are different. DMD on Windows uses OMF also used by Intel, Watcom, Borland (mutually not completely compatible!).  DMD and GCC on Linux use ELF. Cygwin GCC and MinGW on Windows use COFF very (but not quite) similar to that of Microsoft compilers. Perhaps you can use something like coff2omf available from Walter in his extended utility package, but i think it is somewhat unstable where it comes to code which imports from DLLs... There is also a Linker from Christof Meerwald (http://cmeerw.org/prog/owtools/) adapted from OpenWatcom, you can try if it links together DigitalMars code and MS and GCC code - it should understand many variants of COFF and OMF.

COFF is also a basis for executable file format on Windows, while ELF is executable on Linux.

Otherwise than linking with GCC you should not have any problem at all using DM tools from cygwin or msys. ;)

-eye
April 02, 2004
Ilya Minkov wrote:

> They are different. DMD on Windows uses OMF also used by Intel, Watcom, Borland (mutually not completely compatible!).  DMD and GCC on Linux use ELF. Cygwin GCC and MinGW on Windows use COFF very (but not quite) similar to that of Microsoft compilers. Perhaps you can use something like coff2omf available from Walter in his extended utility package, but i think it is somewhat unstable where it comes to code which imports from DLLs... There is also a Linker from Christof Meerwald (http://cmeerw.org/prog/owtools/) adapted from OpenWatcom, you can try if it links together DigitalMars code and MS and GCC code - it should understand many variants of COFF and OMF.
>
> COFF is also a basis for executable file format on Windows, while ELF is executable on Linux.
>
> Otherwise than linking with GCC you should not have any problem at all using DM tools from cygwin or msys. ;)
>
> -eye

Interesting.

So do you know much about the CodeView format and how it differs from the COFF format? That's vague I know.

I'm just been trying to get my head around the format for this debugger me and Charles are writing and wonder if your a good resource for this subject.

-- 
-Anderson: http://badmama.com.au/~anderson/
April 02, 2004
J Anderson schrieb:

> Interesting.
> 
> So do you know much about the CodeView format and how it differs from the COFF format? That's vague I know.

I don't know how debugging information is embedded into executable. It
also seems that it is not very dependant of the object file format?

> I'm just been trying to get my head around the format for this debugger me and Charles are writing and wonder if your a good resource for this subject.

No, no, i don't know anything. All i can do is give useless advice to
clueless newbee users. ;)

BTW, why are you writing a debugger? You'll have an unportable Windows
debugger then... I would say it possibly makes more sense to change the
GNU debugger to unmangle D mangles correctly, i heard that GDC already
outputs debugging info. And steering of GDB can be fairly easily
embedded into IDEs. This will also shift the situation of GDC being the
new playground for language features. I believe many would like to see,
e.g. serialization being ported over from DLI - i just recently
discovered to my surprise it's *not* in DMD!

-eye
April 02, 2004
Ilya Minkov schrieb:

> No, no, i don't know anything. All i can do is give useless advice to
> clueless newbee users. ;)

Nontheless, i can be useful by googling.


http://www.jorgon.freeserve.co.uk/Other/pdb.htm

Describes the CodeView format. It states that executables only contain a link to a PDB file, which contains the complete information. According to this, PDB CodeView format changes and is for some versions not documented, but there exists an API to access it.


http://www.objmedia.demon.co.uk/freeSoftware/peFileExplorer.html

Open source to access information in executables.


http://www.orgon.com/w2k_internals/cd.html

These examples from a book can hook on debugger interface and read CodeView information. Here they are in executable form, they come with full source code with a book.


BTW, have you been thinking of reusing at least OpenWatcom debugger's source? It also understands CodeView, even if it dislikes it sometimes. People have reported that it likes to crash on DMC generated executables, but i was able to use it.

From the GoBug documentation it also appears that there was some other debug information type called COFF besides CodeView, on the other hand COFF is the .obj format and PE-COFF are executables.


http://www.windowsitlibrary.com/Content/356/11/5.html

This is a page from PE/COFF executable format description, about debug information.

I'll see if i can find anything else useful tomorrow.

-eye
April 03, 2004
Thanks a lot for your help.


Ilya Minkov wrote:

> Ilya Minkov schrieb:
>
>> No, no, i don't know anything. All i can do is give useless advice to
>> clueless newbee users. ;)
>
>
> Nontheless, i can be useful by googling.
>
>
> http://www.jorgon.freeserve.co.uk/Other/pdb.htm
>
> Describes the CodeView format. It states that executables only contain a link to a PDB file, which contains the complete information. According to this, PDB CodeView format changes and is for some versions not documented, but there exists an API to access it.
>
>
> http://www.objmedia.demon.co.uk/freeSoftware/peFileExplorer.html
>
> Open source to access information in executables.
>
>
> http://www.orgon.com/w2k_internals/cd.html
>
> These examples from a book can hook on debugger interface and read CodeView information. Here they are in executable form, they come with full source code with a book.
>
>
> BTW, have you been thinking of reusing at least OpenWatcom debugger's source? It also understands CodeView, even if it dislikes it sometimes. People have reported that it likes to crash on DMC generated executables, but i was able to use it.


I'll have a look.

>
> From the GoBug documentation it also appears that there was some other debug information type called COFF besides CodeView, on the other hand COFF is the .obj format and PE-COFF are executables.
>
>
> http://www.windowsitlibrary.com/Content/356/11/5.html
>
> This is a page from PE/COFF executable format description, about debug information.
>
> I'll see if i can find anything else useful tomorrow.
>
> -eye



-- 
-Anderson: http://badmama.com.au/~anderson/
« First   ‹ Prev
1 2