GCC, SUN LD, suggestions about debugging multiprocessors


          From comp.compilers

Related articles
GCC, SUN LD, suggestions about debugging multiprocessors harvard!rutgers!umn-cs!uucp@BBN.COM (1988-03-15)
Re: GCC, SUN LD, suggestions about debugging multiprocessors michael@hao.UCAR.EDU (1988-03-19)
| List of all articles for this month |

From: harvard!rutgers!umn-cs!uucp@BBN.COM
Newsgroups: comp.arch,comp.compilers,comp.sys.m68k
Keywords: GCC SUN LD multi-processors
Distribution: na
Organization: SERC/3M, St. Paul

This letter talks kindly towards the GNU C compiler, rather harshly
about the SUN link editor, and more harshly about Ph.D projects in
multi-processing systems.

We are currently using the GNU C compiler (V1.15) on a SUN 3 (on which it
works fine by the way) and are trying to develop it as a "universal"
system of putting stand-alone code into 68000/68020 stand-alone systems.

During this process we have/are running into some problems with the GNU
C compiler and particularly with the SUN link editor. Perhaps someone
somewhere can offer some suggestions.

First, the compiler problem. For low level operations such as unsigned long
multiplies, GCC cheats a bit in that it simply calls a routine which has
previously been compiled by the SUN normal compiler. This routine does, you
guessed it, an unsigned long multiply. The opcode generated for this routine
is therefore SUN 3 (i.e. 68020) dependent and in fact for the unsigned long
multiply, it uses the 68020 microcode command for that operation. This rather
naturely does not run on a 68000. I suppose we could get around this by
hand coding 68000 assembly code into the relatively few appropriate places
in the GCC source and using #ifdef mc68000. Has anyone got any other
suggestions before we do this?

We also noticed that GCC generated MIT format opcode (as does the SUN CC
command). We have commonly used Motorola format however and wondered if
someone has built up the translation tables to interrept MOT opcode
mnemonics rather or in addition to MIT format. Obviously this is for
hand written MOT format assembler we have previously written and do not
particularly want to trash. Please either post or mail to me since I
do not hav FTP capabilities (or at least don't know how to use them).

It would also be nice if someone at FSF or a willing donor, contrinbuted
the standard IO routines, in GCC source for PRINTF, SCANF, etc. Providing
the GETCHAR and PUTCHAR is very system dependent, but a GOOD set of IO
routines rather the the hacked versions we have would be very nice.

Back on the track.....
The major problem we have encountered is trying to debug the downloaded code.
PRINTF is not my ideal and this is particularly true when, as we are currently
doing, you only get a register dump and a program counter. We have
been unable to make the SUN link editor LD provide a useful link map for
non-relocatable code. Does anyone know how to do this? The SUN manuals
do not show many switches for LD and the link map produced is very primitive
without much detail. As a question and suggestion for FSF, is (will) the
GNU linker provide link maps (ala VMS, Whitesmith's) which can be used
for very low level debugging. If it does (will) when is (will) the linker
be available?

One other comment about the SUN linker, we tried cross-compiling C into 68020
code on our VAX using Whitesmith's compiler, downloading that code to the SUN
and then linking. LD complained about a "missing magic number". Does anyone
have any knowledge of this or will chanting in the light of a full moon while
standing is swamp water and chanting things I won't mention in reverse reveal
the true magic number to me.

A few suggestions for the future......
The reason we are interested in stand-alone system is to provide a modular
multi-processing environment made up of commercial processor boards.
While not the greatest in terms of compactness, it will probably work a lot
faster (take this either way) than special purpose architectures which
are dedicated to a particular task that was good for a Ph.D and take that long
to program.

What we need however is a way to {\it DEBUG} the system. Based on my naive
nature, it would seem very plausible that something like GDB could be made to
control other processors either directly or by passing commands to the
ROM monitor generally available on stand-alone systems.

In operation, you would compile, download and start execution at the (known)
starting address of your code on one of the multi-processors. GDB-M, to
coin a name, would then control the operation of that processor just as
it works on the SUN central CPU except that the SUN CPU would push and pull
the control data. Symbolic debugging should still be possible, even easier,
since the code on the multi-processors would typically be loaded at absolute
addresses. Comments.

As always the opinions expressed herein are expressly my own and are not
the opinions of my company.

{ihnp4, tundra, umn-cs}!mmm!schultz

John C. Schultz @ 3M Co.
3M Center, Bldg. 518-1-1
St. Paul, MN 55144
(612) 733-4047

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.