home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-07 | 92.6 KB | 2,542 lines |
- diff -rc --new-file gdb-4.12/Product-Info /gnu/src/amiga/gdb-4.12/Product-Info
- *** gdb-4.12/Product-Info Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/Product-Info Tue Jul 12 17:16:37 1994
- ***************
- *** 0 ****
- --- 1,33 ----
- + .name
- + gdb
- + .fullname
- + GNU debugger
- + .type
- + Programmer Tool
- + .short
- + GNU debugger (incomplete port)
- + .description
- + The purpose of a debugger such as GDB is to allow you to see what is
- + going on "inside" another program while it executes, or what another
- + program was doing at the moment it crashed.
- +
- + GDB can do four main kinds of things (plus other things in support of
- + these) to help you catch bugs in the act: (1) start your program,
- + specifying anything that might affect its behavior, (2) make your
- + program stop on specified conditions, (3) examine what has happened,
- + when your program has stopped, (4) change things in your program, so
- + you can experiment with correcting the effects of one bug and go on to
- + learn about another.
- +
- + You can use GDB to debug programs written in C, C++, and Modula-2.
- + Fortran support will be added when a GNU Fortran compiler is ready.
- + .version
- + 4.12
- + .author
- + Free Software Foundation
- + .requirements
- + Amiga binary requires ixemul.library.
- + .distribution
- + GNU Public License
- + .described-by
- + Fred Fish (fnf@amigalib.com)
- diff -rc --new-file gdb-4.12/bfd/Makefile.in /gnu/src/amiga/gdb-4.12/bfd/Makefile.in
- *** gdb-4.12/bfd/Makefile.in Thu Feb 3 16:46:35 1994
- --- /gnu/src/amiga/gdb-4.12/bfd/Makefile.in Fri Jun 17 07:33:34 1994
- ***************
- *** 113,118 ****
- --- 113,119 ----
- BFD32_BACKENDS = \
- aout-adobe.o \
- aout32.o \
- + amiga.o \
- bout.o \
- cf-i386lynx.o \
- cf-m68klynx.o \
- ***************
- *** 232,238 ****
- hp300bsd.c hp300hpux.c \
- i386lynx.c cf-i386lynx.c m68klynx.c cf-m68klynx.c \
- sparclynx.c cf-sparclynx.c aix386-core.c hpux-core.c \
- ! irix-core.c lynx-core.c osf-core.c hash.c linker.c
-
- HFILES = aout-target.h aoutf1.h aoutx.h coffcode.h \
- coffswap.h ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
- --- 233,239 ----
- hp300bsd.c hp300hpux.c \
- i386lynx.c cf-i386lynx.c m68klynx.c cf-m68klynx.c \
- sparclynx.c cf-sparclynx.c aix386-core.c hpux-core.c \
- ! irix-core.c lynx-core.c osf-core.c hash.c linker.c amiga.c
-
- HFILES = aout-target.h aoutf1.h aoutx.h coffcode.h \
- coffswap.h ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
- ***************
- *** 492,497 ****
- --- 493,500 ----
-
- bfd.ps:
- (cd $(docdir); $(MAKE) bfd.ps $(FLAGS_TO_PASS))
- +
- + amiga.o: amiga.c libamiga.h bfd.h
-
- # What appears below is generated by a hacked mkdep using gcc -MM.
-
- diff -rc --new-file gdb-4.12/bfd/amiga.c /gnu/src/amiga/gdb-4.12/bfd/amiga.c
- *** gdb-4.12/bfd/amiga.c Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/bfd/amiga.c Fri Jun 17 07:33:35 1994
- ***************
- *** 0 ****
- --- 1,1019 ----
- + /* BFD back-end for Commodore-Amiga AmigaDOS binaries.
- + Copyright (C) 1990-1994 Free Software Foundation, Inc.
- + Contributed by Leonard Norrgard. Partially based on the bout
- + and ieee BFD backends and Markus Wild's tool hunk2gcc.
- +
- + This file is part of BFD, the Binary File Descriptor library.
- +
- + This program is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 2 of the License, or
- + (at your option) any later version.
- +
- + This program is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + GNU General Public License for more details.
- +
- + You should have received a copy of the GNU General Public License
- + along with this program; if not, write to the Free Software
- + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
- +
- + /* TODO:
- +
- + - writing of object files
- +
- + - .chipdata, .chipbss
- +
- + - fix fixme:s
- +
- + BFD:
- + - add flag to say if the format allows multiple sections with the
- + same name. Fix bfd_get_section_by_name() and bfd_make_section()
- + accordingly.
- +
- + - dumpobj.c: the disassembler: use relocation record data to find symbolic
- + names of addresses, when available. Needs new routine where one can
- + specify the source section of the symbol to be printed as well as some
- + rewrite of the disassemble functions.
- +
- + */
- +
- + #include "bfd.h"
- + #include "sysdep.h"
- + #include "libbfd.h"
- + #include "libamiga.h"
- +
- + #define GL(x) bfd_get_32 (abfd, (bfd_byte *) (x))
- +
- + #define DEBUG_AMIGA 0
- +
- + static boolean amiga_digest_file ();
- + static boolean amiga_mkobject ();
- +
- + reloc_howto_type howto_hunk_reloc8 =
- + {
- + HUNK_RELOC8, /* type */
- + 0, /* rightshift */
- + 0, /* size */
- + 0, /* bitsize */
- + true, /* pc_relative */
- + 0, /* bitpos */
- + complain_overflow_bitfield, /* complain_on_overflow */
- + 0, /* special_function */
- + "reloc8", /* textual name */
- + false, /* partial_inplace? */
- + 0x000000ff, /* src_mask */
- + 0x000000ff, /* dst_mask */
- + true /* pcrel_offset */
- + };
- +
- + reloc_howto_type howto_hunk_reloc16 =
- + {HUNK_RELOC16,0,0,0,true,0,complain_overflow_bitfield,0,"reloc16",false,0x0000ffff,0x0000ffff,true};
- +
- + reloc_howto_type howto_hunk_reloc32 =
- + {HUNK_RELOC32,0,0,0,true,0,complain_overflow_bitfield,0,"reloc32",false,0xffffffff,0xffffffff,true};
- +
- + reloc_howto_type howto_hunk_drel8 =
- + {HUNK_DREL8,0,0,0,false,0,complain_overflow_bitfield,0,"drel8",false,0x000000ff,0x000000ff,true};
- +
- + reloc_howto_type howto_hunk_drel16 =
- + {HUNK_DREL16,0,0,0,false,0,complain_overflow_bitfield,0,"drel16",false,0x0000ffff,0x0000ffff,true};
- +
- + reloc_howto_type howto_hunk_drel32 =
- + {HUNK_DREL32,0,0,0,false,0,complain_overflow_bitfield,0,"drel32",false,0xffffffff,0xffffffff,true};
- +
- + reloc_howto_type *amiga_howto_array[2][3] =
- + {
- + { &howto_hunk_reloc8, &howto_hunk_reloc16, &howto_hunk_reloc32 },
- + { &howto_hunk_drel8, &howto_hunk_drel16, &howto_hunk_drel32 }
- + };
- +
- + static bfd_target *
- + amiga_object_p (abfd)
- + bfd *abfd;
- + {
- + char buf[8];
- + unsigned int x;
- + struct stat stat_buffer;
- +
- + /* An Amiga object file must be at least 8 bytes long. */
- + if (bfd_read ((PTR) buf, 1, 8, abfd) != 8)
- + {
- + bfd_error = wrong_format;
- + return 0;
- + }
- +
- + /* Does it look like an Amiga object file? */
- + x = GL(buf);
- + if ((x != HUNK_UNIT) && (x != HUNK_HEADER))
- + {
- + /* Not an Amiga file. */
- + bfd_error = wrong_format;
- + return 0;
- + }
- +
- + /* So far it seems to be an Amiga file. Now slurp it
- + in and examine it closer. */
- + if (-1 == fstat (fileno ((FILE *) abfd->iostream), &stat_buffer))
- + {
- + bfd_error = system_call_error;
- + return 0;
- + }
- +
- + /* Can't fail and return (but must be declared boolean to suit
- + other bfd requirements). */
- + (void) amiga_mkobject (abfd);
- +
- + AMIGA_DATA(abfd)->symbol_tail_ptr = &AMIGA_DATA(abfd)->external_symbols;
- +
- + AMIGA_DATA(abfd)->first_byte = (unsigned long *) bfd_alloc (abfd, stat_buffer.st_size);
- + bfd_seek (abfd, 0, SEEK_SET);
- + bfd_read (AMIGA_DATA(abfd)->first_byte, 1, stat_buffer.st_size, abfd);
- + AMIGA_DATA(abfd)->file_pointer = AMIGA_DATA(abfd)->first_byte;
- + AMIGA_DATA(abfd)->file_end = (unsigned long *)((unsigned char *)AMIGA_DATA(abfd)->first_byte + stat_buffer.st_size);
- +
- + if (!amiga_digest_file (abfd))
- + {
- + /* Something went wrong. */
- + return (struct bfd_target *) 0;
- + }
- +
- + /* Set default architecture to m68k:68020. */
- + abfd->arch_info = bfd_scan_arch ("m68k:68020");
- +
- + return abfd->xvec;
- + }
- +
- + /* Skip over the hunk length longword + the number of longwords given there. */
- + #define next_hunk(abfd) \
- + { AMIGA_DATA(abfd)->file_pointer += 1 + GL(AMIGA_DATA(abfd)->file_pointer); }
- +
- + static asection *
- + amiga_get_section_by_hunk_number (abfd, hunk_number)
- + bfd *abfd;
- + unsigned int hunk_number;
- + {
- + /* A cache, so we don't have to search the entire list every time. */
- + static asection *last_reference;
- + asection *p;
- +
- + if (last_reference)
- + if (last_reference->target_index == hunk_number)
- + return last_reference;
- + for (p = abfd->sections; p != NULL; p = p->next)
- + if (p->target_index == hunk_number)
- + {
- + last_reference = p;
- + return p;
- + }
- + BFD_FAIL();
- + return (asection *) 0;
- + }
- +
- + /* Remember about a symbol found at the current file position.
- + Return number of longwords to advance the file_pointer with. */
- + static unsigned long
- + amiga_add_symbol (abfd, hunk_number)
- + bfd *abfd;
- + unsigned int hunk_number;
- + {
- + int length;
- +
- + amiga_symbol_type *symbol = bfd_alloc (abfd, sizeof (amiga_symbol_type));
- +
- + if (symbol)
- + {
- + amiga_data_type *amiga_data = AMIGA_DATA(abfd);
- + unsigned long *file_pointer = amiga_data->file_pointer;
- + unsigned char type = GL(file_pointer) >> 24;
- +
- + ++abfd->symcount;
- + *amiga_data->symbol_tail_ptr = symbol;
- + amiga_data->symbol_tail_ptr = &symbol->next;
- +
- + symbol->symbol.the_bfd = abfd;
- +
- + /* The symbol name is not necessarily nul-terminated in the file.
- + So, we move it to start on the length word and put a NUL at the
- + end of it all. This way, we avoid allocating separate memory for
- + the symbol name, while assuring that the name is nul-terminated. */
- +
- + length = (GL(file_pointer) & 0xffffff) << 2;
- + strncpy ((char *) file_pointer, (char *) (file_pointer + 1), length);
- + *(((char *)file_pointer) + length) = '\0';
- +
- + symbol->symbol.name = (char *)file_pointer;
- + symbol->symbol.udata = (PTR) NULL;
- + symbol->symbol.flags = ((type == EXT_DEF) || (type == EXT_ABS))
- + ? BSF_GLOBAL : BSF_NO_FLAGS;
- + symbol->symbol.value = ((type == EXT_DEF) || (type == EXT_ABS))
- + ? (symvalue) GL(file_pointer + 1 + (length>>2)) : 0;
- + symbol->symbol.section = amiga_get_section_by_hunk_number (abfd, hunk_number);
- + symbol->hunk_number = hunk_number;
- + symbol->type = type;
- + symbol->next = 0;
- + }
- + return length >> 2;
- + }
- +
- + static void
- + amiga_add_reloc (abfd, section, offset, symbol_number, howto, target_hunk)
- + bfd *abfd;
- + asection *section;
- + bfd_size_type offset;
- + int symbol_number;
- + reloc_howto_type *howto;
- + unsigned int target_hunk;
- + {
- + amiga_reloc_type *reloc;
- +
- + reloc = (amiga_reloc_type *) bfd_alloc (abfd, sizeof (amiga_reloc_type));
- + reloc->next = 0;
- +
- + abfd -> flags |= HAS_RELOC;
- + section -> flags |= SEC_RELOC;
- + ++section->reloc_count;
- + if (amiga_per_section(section)->reloc_tail_ptr)
- + amiga_per_section(section)->reloc_tail_ptr->next = reloc;
- + else
- + section->relocation = (struct reloc_cache_entry *) reloc;
- + amiga_per_section(section)->reloc_tail_ptr = reloc;
- + amiga_per_section(section)->reloc_tail_ptr->next = (amiga_reloc_type *) 0;
- + reloc->relent.address = offset;
- + reloc->relent.addend = 0;
- + reloc->relent.howto = howto;
- + reloc->symbol_number = symbol_number;
- + reloc->target_hunk = target_hunk;
- + }
- +
- + /* BFD doesn't currently allow multiple sections with the same
- + name, so we try a little harder to get a unique name. */
- + asection *
- + amiga_make_unique_section (abfd, name)
- + bfd *abfd;
- + CONST char *name;
- + {
- + asection *section;
- +
- + section = bfd_make_section (abfd, name);
- + if (!section)
- + {
- + int i = 1;
- + char *new_name;
- +
- + new_name = bfd_alloc (abfd, strlen(name) + 3);
- +
- + /* We try to come up with an original name (since BFD
- + currently requires all sections to have different names). */
- + while (!section && (i<=99))
- + {
- + sprintf (new_name, "%s_%u", name, i);
- + section = bfd_make_section (abfd, new_name);
- + }
- +
- + if (!section)
- + {
- + /* Complain about the given name. */
- + bfd_error = bad_value;
- + return 0;
- + }
- + }
- + return section;
- + }
- +
- + static boolean
- + amiga_digest_file (abfd)
- + bfd *abfd;
- + {
- + int is_chip;
- + int units = 0;
- + int hunk_number;
- + char *current_name = 0;
- + asection *current_section;
- + amiga_data_type *amiga_data = AMIGA_DATA(abfd);
- + int hunk_type;
- +
- + /* Hunk numbers starts with 0, but we pre-increment the hunk_number when
- + we assign a new one, so this really makes the first hunk number 0. */
- + hunk_number = -1;
- +
- + while (units < 2)
- + {
- + hunk_type = HUNK_VALUE(GL(amiga_data->file_pointer++));
- + #if DEBUG_AMIGA
- + printf ("Processing %s hunk...",
- + hunk_type == HUNK_UNIT ? "HUNK_UNIT" :
- + hunk_type == HUNK_NAME ? "HUNK_NAME" :
- + hunk_type == HUNK_DEBUG ? "HUNK_DEBUG" :
- + hunk_type == HUNK_OVERLAY ? "HUNK_OVERLAY" :
- + hunk_type == HUNK_BREAK ? "HUNK_BREAK" :
- + hunk_type == HUNK_HEADER ? "HUNK_HEADER" :
- + hunk_type == HUNK_CODE ? "HUNK_CODE" :
- + hunk_type == HUNK_DATA ? "HUNK_DATA" :
- + hunk_type == HUNK_BSS ? "HUNK_BSS" :
- + hunk_type == HUNK_RELOC8 ? "HUNK_RELOC8" :
- + hunk_type == HUNK_RELOC16 ? "HUNK_RELOC16" :
- + hunk_type == HUNK_RELOC32 ? "HUNK_RELOC32" :
- + hunk_type == HUNK_DREL8 ? "HUNK_DREL8" :
- + hunk_type == HUNK_DREL16 ? "HUNK_DREL16" :
- + hunk_type == HUNK_DREL32 ? "HUNK_DREL32" :
- + hunk_type == HUNK_SYMBOL ? "HUNK_SYMBOL" :
- + hunk_type == HUNK_EXT ? "HUNK_EXT" :
- + hunk_type == HUNK_END ? "HUNK_END" :
- + hunk_type == HUNK_LIB ? "HUNK_LIB" :
- + hunk_type == HUNK_INDEX ? "HUNK_INDEX" :
- + "*unknown*");
- + #endif
- + switch (hunk_type)
- + {
- + case HUNK_UNIT:
- + current_name =
- + (GL(amiga_data->file_pointer) == 0)
- + ? "" : (char *)(amiga_data->file_pointer + 1);
- +
- + /* Allow only one program unit per bfd. */
- + if (units++)
- + break;
- +
- + /* We always initialize hunk_number to -1, as desribed above. */
- + hunk_number = -1;
- +
- + next_hunk (abfd);
- + break;
- +
- + case HUNK_NAME:
- + {
- + int length = GL(amiga_data->file_pointer) << 2;
- +
- + /* Change the name to a nul-terminated string. */
- + strncpy ((char *)amiga_data->file_pointer, (char *)(amiga_data->file_pointer + 1), length);
- + *(((char *) amiga_data->file_pointer) + length) = '\0';
- + current_name = (char *) amiga_data->file_pointer;
- +
- + /* Can't use next_hunk() here, as we wrote over the hunk length
- + that next_hunk() looks at. */
- + amiga_data->file_pointer += 1 + (length>>2);
- + }
- + break;
- +
- + case HUNK_DEBUG:
- + /* The format for the HUNK_DEBUG, as produced by Amiga GNU C:
- +
- + longwords:
- +
- + |---------------|
- + | HUNK_DEBUG | 0x3f1, Amigados imposed
- + |---------------|
- + | N | Size of this hunk in longwords
- + |---------------|
- + | AMIGA_ZMAGIC | 0413, same as BSD unix ZMAGIC
- + |---------------|
- + | symtabsize | size of the symbol table in bytes
- + |---------------|
- + | stringtabsize | size of the string table in bytes
- + |---------------|
- + | symtab data | symbol table in a.out format,
- + : : size is symtabsize.
- + : .....:
- + |..........| |
- + | stringtab | string table in a.out format,
- + : data : size is stringtabsize.
- + : : (can start on byte boundary,
- + |---------------| and can be padded at the end).
- +
- + /* Same as BSD unix ZMAGIC, but I don't want to include
- + any BSD files here. */
- +
- + #define AMIGA_ZMAGIC 0413
- +
- + /* Identifier for the GNU C format for HUNK_DEBUG on the Amiga. */
- + if (GL(amiga_data->file_pointer + 1) == AMIGA_ZMAGIC)
- + {
- + amiga_data->symtab_size = GL(amiga_data->file_pointer + 2);
- + amiga_data->stringtab_size = GL(amiga_data->file_pointer + 3);
- + adata(abfd).sym_filepos =
- + (file_ptr) ((char *)(amiga_data->file_pointer + 4) - (char *)amiga_data->first_byte);
- + adata(abfd).str_filepos = adata(abfd).sym_filepos
- + + amiga_data->symtab_size;
- + }
- + else
- + fprintf (stderr, "unknown debug hunk type\n");
- + next_hunk (abfd);
- + break;
- +
- + case HUNK_OVERLAY:
- + /* Poor man's virtual memory. Not yet supported. */
- + /* fixme */
- + fprintf (stderr, "Warning: HUNK_OVERLAY encountered, ignoring.\n");
- + next_hunk (abfd);
- + break;
- +
- + case HUNK_BREAK:
- + /* HUNK_BREAK indicates the end of an overlay node. This
- + hunk consists of a single longword, HUNK_BREAK. As we
- + do not yet support overlays, we ignore thins hunk for now. */
- + /* fixme */
- + fprintf(stderr, "Warning: HUNK_BREAK encountered, ignoring.\n");
- + next_hunk (abfd);
- + break;
- +
- + case HUNK_HEADER:
- + /* This is the header of a load file.
- +
- + Skip resident library names (never used, it's
- + an obsolete feature of the file format). fixme: verify that! */
- + while (GL(amiga_data->file_pointer))
- + next_hunk (abfd);
- +
- + /* Skip null-word, table_size, F & L, and size-table. */
- + amiga_data->file_pointer += 4 + GL(amiga_data->file_pointer + 1) - GL(amiga_data->file_pointer + 2);
- + break;
- +
- + case HUNK_CODE:
- + is_chip = HUNK_ATTRIBUTE (GL(amiga_data->file_pointer - 1)) == HUNK_ATTR_CHIP;
- + if (is_chip)
- + fprintf (stderr, "Warning: CHIP code hunks are not supported, ignoring CHIP attribute\n");
- +
- + current_section = amiga_make_unique_section (abfd, (current_name && current_name[0]) ? current_name : ".text");
- + if (current_section == 0)
- + {
- + /* Fatal error. */
- + return false;
- + }
- + current_section->filepos = (char *) (amiga_data->file_pointer + 1) - (char *)amiga_data->first_byte;
- + current_section->_raw_size = GL(amiga_data->file_pointer) << 2;
- + current_section->target_index = ++hunk_number;
- + bfd_set_section_flags (abfd, current_section, SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS);
- +
- + next_hunk (abfd);
- + break;
- +
- + case HUNK_DATA:
- + current_section = amiga_make_unique_section (abfd, (current_name && current_name[0]) ? current_name : ".data");
- + if (current_section == 0)
- + {
- + /* Fatal error. */
- + return false;
- + }
- + current_section->filepos = (char *) (amiga_data->file_pointer + 1) - (char *)amiga_data->first_byte;
- + current_section->_raw_size = GL(amiga_data->file_pointer) << 2;
- + current_section->target_index = ++hunk_number;
- + bfd_set_section_flags (abfd, current_section, SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS);
- + next_hunk (abfd);
- + break;
- +
- + case HUNK_BSS:
- + current_section = amiga_make_unique_section (abfd, (current_name && current_name[0]) ? current_name : ".bss");
- + if (current_section == 0)
- + {
- + /* Fatal error. */
- + return false;
- + }
- + current_section->filepos = (file_ptr) -1;
- + current_section->_raw_size = GL(amiga_data->file_pointer) << 2;
- + current_section->target_index = ++hunk_number;
- + bfd_set_section_flags (abfd, current_section, SEC_ALLOC);
- + ++ amiga_data->file_pointer;
- + break;
- +
- + case HUNK_RELOC8:
- + case HUNK_RELOC16:
- + case HUNK_RELOC32:
- + case HUNK_DREL8:
- + case HUNK_DREL16:
- + case HUNK_DREL32:
- + {
- + int size, base_relative;
- + reloc_howto_type *howto;
- +
- + base_relative = GL(&amiga_data->file_pointer[-1]) >= HUNK_DREL32;
- + size = (base_relative ? HUNK_DREL8 : HUNK_RELOC8) - GL(&amiga_data->file_pointer[-1]);
- + howto = amiga_howto_array[base_relative][size];
- +
- + while (GL(amiga_data->file_pointer))
- + {
- + long to_reloc = GL(amiga_data->file_pointer + 1);
- + long n = GL(amiga_data->file_pointer);
- + long i = 1;
- +
- + while (i++ < n)
- + amiga_add_reloc (abfd, current_section,
- + GL(amiga_data->file_pointer + i + 1),
- + -1, howto, to_reloc);
- + amiga_data->file_pointer += GL(amiga_data->file_pointer) + 2;
- + }
- + ++amiga_data->file_pointer;
- + }
- + break;
- +
- + case HUNK_SYMBOL:
- + /* "You use this block to attach a symbol table to a hunk so that
- + you can use a symbolic debugger on the code. The linker passes
- + symbol table blocks through attached to the hunk and, if the hunks
- + are coagulated, coagulates the symbol tables. The loader does not
- + load symbol table blocks into memory; when this is required,
- + the debugger is expected to read the load file."
- + -- The AmigaDOS Manual, 3rd ed.
- +
- + GNU C on the Amiga passes all needed debug information in the
- + debug hunk (HUNK_DEBUG). Thus we do not depend on HUNK_SYMBOL
- + for the GNU debugger GDB to get symbol information and can safely
- + ignore this hunk.
- + If, however, someone would like to add full support for
- + HUNK_SYMBOL to be able to use some debugger that doesn't
- + understand the GNU C debug hunk, please go ahead.
- + As of this writing, the BarFly debugger written by
- + Ralph "laire" Schmidt is starting to understand the GNU C debug
- + hunk. As the GNU version of the debug hunk is publically
- + documented, unlike for example the format used by SAS Insitute
- + on the Amiga, I hope other debugger writers will follow his
- + example. -- vinsci@nic.funet.fi */
- +
- + /* The formats of the HUNK_SYMBOL and HUNK_EXT hunks are exactly
- + the same, except the type byte of anything in the HUNK_SYMBOL
- + is always zero. Thus we ignore the symbol hunk by ignoring
- + all EXT_SYMB's below and can thus reuse the code. */
- +
- + /* Fall through */
- +
- + case HUNK_EXT:
- +
- + while (GL(amiga_data->file_pointer))
- + {
- + int num, size, base_relative;
- + unsigned char type;
- + reloc_howto_type *howto;
- +
- + /* Make sure we don't set this flag for HUNK_SYMBOL hunks. */
- + if (hunk_type == HUNK_EXT)
- + abfd -> flags |= HAS_SYMS;
- +
- + switch (type = (GL(amiga_data->file_pointer) >> 24))
- + {
- + case EXT_SYMB: /* This is a symbol from HUNK_SYMBOL, which we
- + ignore. See long description above. */
- + num = GL(amiga_data->file_pointer) & 0xffffff;
- + amiga_data->file_pointer += 2 + num;
- + break;
- +
- + case EXT_DEF: /* Relocatable definition. */
- + case EXT_ABS: /* Absolute definition. */
- + /* case EXT_RES: obsolete; Resident library definition. */
- +
- + num = amiga_add_symbol (abfd, hunk_number);
- + amiga_data->file_pointer += 2 + num;
- + break;
- +
- + case EXT_COMMON: /* 32 bit reference to COMMON block. */
- + {
- + int i = 0;
- +
- + num = amiga_add_symbol (abfd, hunk_number);
- + amiga_data->file_pointer += 2 + num;
- +
- + num = GL(amiga_data->file_pointer);
- + while (i++ < num)
- + amiga_add_reloc
- + (abfd, current_section, GL(amiga_data->file_pointer + i),
- + amiga_data->a.n_symbols, &howto_hunk_drel32, -1);
- + next_hunk (abfd);
- + }
- + break;
- +
- + case EXT_REF8: /* 8 bit reference to symbol. */
- + case EXT_REF16: /* 16 bit reference to symbol. */
- + case EXT_REF32: /* 32 bit reference to symbol. */
- + case EXT_DEXT8: /* 8 bit data relative reference. */
- + case EXT_DEXT16: /* 16 bit data relative reference. */
- + case EXT_DEXT32: /* 32 bit data relative reference. */
- + size = GL(amiga_data->file_pointer) >> 24;
- + base_relative = size >= EXT_DEXT32;
- + switch (size)
- + {
- + case EXT_REF32:
- + case EXT_DEXT32:
- + size = 2;
- + break;
- + case EXT_REF16:
- + case EXT_DEXT16:
- + size = 1;
- + break;
- + default:
- + size = 0;
- + }
- + howto = amiga_howto_array[base_relative][size];
- +
- + num = amiga_add_symbol (abfd, hunk_number);
- +
- + amiga_data->file_pointer += 1 + num;
- + {
- + int i = 0;
- +
- + num = GL(amiga_data->file_pointer);
- + while (i++ < num)
- + amiga_add_reloc (abfd, current_section,
- + GL(amiga_data->file_pointer + i),
- + amiga_data->a.n_symbols, howto, -1);
- + }
- + next_hunk (abfd);
- + break;
- +
- + default:
- + fprintf (stderr, "Unknown symbol type %d, don't know how to handle.\n", type);
- + /* Fatal error. */
- + return false;
- + }
- + }
- + ++ amiga_data->file_pointer;
- + break;
- +
- + case HUNK_END:
- + break;
- +
- + case HUNK_LIB:
- + case HUNK_INDEX:
- + fprintf (stderr, "Can not handle HUNK_LIB and HUNK_INDEX hunks.\nConvert the library to ALINK (join) format.\n");
- + break;
- +
- + default:
- + fprintf (stderr, "Unknown hunk type $%x, unit offset = $%x.\n",
- + GL(amiga_data->file_pointer -1),
- + ((amiga_data->file_pointer - 1) - amiga_data->first_byte) * 4);
- + /* Fatal error. */
- + return false;
- + }
- +
- + #if DEBUG_AMIGA
- + printf ("...hunk processed.\n");
- + #endif
- + if (amiga_data->file_pointer >= amiga_data->file_end)
- + break;
- + }
- +
- + /* OK. */
- + return true;
- + }
- +
- + static boolean
- + amiga_mkobject (abfd)
- + bfd *abfd;
- + {
- + struct amiga_data_struct *rawptr;
- +
- + rawptr = (struct amiga_data_struct *) bfd_zalloc (abfd, sizeof (struct amiga_data_struct));
- + abfd->tdata.amiga_data = rawptr;
- +
- + return true;
- + }
- +
- + static boolean
- + amiga_write_object_contents (abfd)
- + bfd *abfd;
- + {
- + /* fixme */
- + return true;
- + }
- +
- + static boolean
- + amiga_get_section_contents (abfd, section, location, offset, count)
- + bfd *abfd;
- + sec_ptr section;
- + PTR location;
- + file_ptr offset;
- + bfd_size_type count;
- + {
- + memmove ((void *) location,
- + (void *) (((int) AMIGA_DATA(abfd)->first_byte)
- + + (int) section->filepos
- + + (int) offset),
- + count);
- + return true;
- + }
- +
- + boolean
- + amiga_new_section_hook (abfd, newsect)
- + bfd *abfd;
- + asection *newsect;
- + {
- + newsect->used_by_bfd = (PTR) bfd_alloc (abfd, sizeof (amiga_per_section_type));
- + newsect->alignment_power = 2;
- + amiga_per_section(newsect)->reloc_tail_ptr = (amiga_reloc_type *) 0;
- + return true;
- + }
- +
- + void
- + amiga_slurp_symbol_table (abfd)
- + bfd *abfd;
- + {
- + /* fixme: currently we always load the symbols at check_format time,
- + so we don't do it here. When the amiga backend someday doesn't
- + keep more info than needed in memory, this will have to be fixed. */
- + }
- +
- + unsigned int
- + amiga_get_symtab_upper_bound (abfd)
- + bfd *abfd;
- + {
- + amiga_slurp_symbol_table (abfd);
- + return (abfd->symcount != 0) ?
- + (abfd->symcount+1) * (sizeof (amiga_symbol_type *)) : 0;
- + }
- +
- + unsigned int
- + amiga_get_symtab (abfd, location)
- + bfd *abfd;
- + asymbol **location;
- + {
- + amiga_symbol_type *symp;
- +
- + if (abfd->symcount)
- + {
- + int i = 0;
- +
- + amiga_slurp_symbol_table (abfd);
- +
- + for (symp = AMIGA_DATA(abfd)->external_symbols;
- + symp != (amiga_symbol_type *) NULL;
- + symp = symp->next)
- + {
- + location[i++] = &symp->symbol;
- + }
- + for (symp = AMIGA_DATA(abfd)->external_references;
- + symp != (amiga_symbol_type *) NULL;
- + symp = symp->next)
- + {
- + location[i++] = &symp->symbol;
- + }
- + }
- + return abfd->symcount;
- + }
- +
- + asymbol *
- + amiga_make_empty_symbol (abfd)
- + bfd *abfd;
- + {
- + amiga_symbol_type *new =
- + (amiga_symbol_type *) bfd_zalloc (abfd, sizeof (amiga_symbol_type));
- + new->symbol.the_bfd = abfd;
- + return &new->symbol;
- + }
- +
- + void
- + amiga_get_symbol_info (ignore_abfd, symbol, ret)
- + bfd *ignore_abfd;
- + asymbol *symbol;
- + symbol_info *ret;
- + {
- + bfd_symbol_info (symbol, ret);
- + if (symbol->name[0] == ' ')
- + ret->name = "* empty table entry ";
- + if (!symbol->section)
- + ret->type = (symbol->flags & BSF_LOCAL) ? 'a' : 'A';
- + }
- +
- + void
- + amiga_print_symbol (ignore_abfd, afile, symbol, how)
- + bfd *ignore_abfd;
- + PTR afile;
- + asymbol *symbol;
- + bfd_print_symbol_type how;
- + {
- + FILE *file = (FILE *)afile;
- +
- + switch (how) {
- + case bfd_print_symbol_name:
- + fprintf(file, "%s", symbol->name);
- + break;
- + case bfd_print_symbol_more:
- + /* fixme: adapt for amiga */
- + BFD_FAIL();
- + break;
- + case bfd_print_symbol_all:
- + {
- + CONST char *section_name = (symbol->section == (asection *)NULL)
- + ? (CONST char *)"*abs" : symbol->section->name;
- + if (symbol->name[0] == ' ')
- + {
- + fprintf(file, "* empty table entry ");
- + }
- + else
- + {
- + bfd_print_symbol_vandf ((PTR)file, symbol);
- +
- + fprintf(file," %-5s %04x %02x %s",
- + section_name,
- + amiga_symbol(symbol)->hunk_number, /* ->desc */
- + (unsigned) 0, /* ->other */
- + /* type */
- + symbol->name); /* ->name */
- + }
- + }
- + break;
- + }
- + }
- +
- + static unsigned int
- + amiga_get_reloc_upper_bound (abfd, asect)
- + bfd *abfd;
- + sec_ptr asect;
- + {
- + if (bfd_get_format (abfd) != bfd_object)
- + {
- + bfd_error = invalid_operation;
- + return 0;
- + }
- + return sizeof (arelent *) * (asect->reloc_count + 1);
- + }
- +
- + unsigned int
- + amiga_canonicalize_reloc (abfd, section, relptr, symbols)
- + bfd *abfd;
- + sec_ptr section;
- + arelent **relptr;
- + asymbol **symbols;
- + {
- + amiga_reloc_type *src = (amiga_reloc_type *) section->relocation;
- + int i = 0;
- +
- + while (src != (amiga_reloc_type *) 0)
- + {
- + if (src->symbol_number == -1)
- + src->relent.sym_ptr_ptr =
- + &(amiga_get_section_by_hunk_number(abfd,src->target_hunk))->symbol;
- + else
- + src->relent.sym_ptr_ptr = symbols + i++;
- + *relptr++ = &src->relent;
- + src = src->next;
- + }
- + *relptr = (arelent *) 0;
- +
- + return section->reloc_count;
- + }
- +
- + static boolean
- + amiga_set_section_contents (abfd, section, location, offset, count)
- + bfd *abfd;
- + sec_ptr section;
- + unsigned char *location;
- + file_ptr offset;
- + int count;
- + {
- + /* fixme */
- + return true;
- + }
- +
- + static boolean
- + amiga_set_arch_mach (abfd, arch, machine)
- + bfd *abfd;
- + enum bfd_architecture arch;
- + unsigned long machine;
- + {
- + bfd_default_set_arch_mach(abfd, arch, machine);
- +
- + if (arch == bfd_arch_m68k)
- + {
- + switch (machine)
- + {
- + case 68000:
- + case 68008:
- + case 68010:
- + case 68020:
- + case 68030:
- + case 68040:
- + case 68070:
- + case 0:
- + return true;
- + default:
- + return false;
- + }
- + }
- + return false;
- + }
- +
- + static int
- + DEFUN(amiga_sizeof_headers,(ignore_abfd, ignore),
- + bfd *ignore_abfd AND
- + boolean ignore)
- + {
- + /* The amiga hunk format doesn't have headers. */
- + return 0;
- + }
- +
- + /* Provided a BFD, a section and an offset into the section, calculate
- + and return the name of the source file and the line nearest to the
- + wanted location. */
- + boolean
- + amiga_find_nearest_line(abfd, section, symbols, offset, filename_ptr,
- + functionname_ptr, line_ptr)
- + bfd *abfd;
- + asection *section;
- + asymbol **symbols;
- + bfd_vma offset;
- + char **filename_ptr;
- + char **functionname_ptr;
- + int *line_ptr;
- + {
- + /* fixme (see aoutx.h, for example) */
- + return false;
- + }
- +
- + static const struct reloc_howto_struct *
- + amiga_bfd_reloc_type_lookup (abfd, code)
- + bfd *abfd;
- + bfd_reloc_code_real_type code;
- + {
- + switch (code)
- + {
- + case BFD_RELOC_8_PCREL: return &howto_hunk_reloc8;
- + case BFD_RELOC_16_PCREL: return &howto_hunk_reloc16;
- + case BFD_RELOC_32_PCREL: return &howto_hunk_reloc32;
- + case BFD_RELOC_8: return &howto_hunk_drel8;
- + case BFD_RELOC_16: return &howto_hunk_drel16;
- + case BFD_RELOC_32: return &howto_hunk_drel32;
- + default: return 0;
- + }
- + }
- +
- +
- + /* We don't have core files. */
- + #define amiga_core_file_failing_command _bfd_dummy_core_file_failing_command
- + #define amiga_core_file_failing_signal _bfd_dummy_core_file_failing_signal
- + #define amiga_core_file_matches_executable_p _bfd_dummy_core_file_matches_executable_p
- +
- + /* We use BSD-Unix generic archive files (fixme: test that this actually works). */
- + #define amiga_openr_next_archived_file bfd_generic_openr_next_archived_file
- + #define amiga_generic_stat_arch_elt bfd_generic_stat_arch_elt
- + #define amiga_slurp_armap bfd_slurp_bsd_armap
- + #define amiga_slurp_extended_name_table bfd_true
- + #define amiga_write_armap bsd_write_armap
- + #define amiga_truncate_arname bfd_bsd_truncate_arname
- +
- + #define amiga_bfd_debug_info_start bfd_void
- + #define amiga_bfd_debug_info_end bfd_void
- + #define amiga_bfd_debug_info_accumulate (PROTO(void,(*),(bfd*, struct sec *))) bfd_void
- +
- + /* fixme: (when everything else has been done) a tailor-made
- + amiga_get_relocated_section_contents would probably be faster
- + than the generic routine. */
- + #define amiga_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
- + #define amiga_bfd_relax_section bfd_generic_relax_section
- + #define amiga_get_lineno (struct lineno_cache_entry *(*)())bfd_nullvoidptr
- + #define amiga_close_and_cleanup bfd_generic_close_and_cleanup
- + #define amiga_bfd_make_debug_symbol \
- + ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
- + #define amiga_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
- + #define amiga_bfd_link_add_symbols _bfd_generic_link_add_symbols
- + #define amiga_bfd_final_link _bfd_generic_final_link
- +
- + #if defined (amiga)
- + /* So that the JUMP_TABLE() macro below can work. */
- + #undef amiga
- + #endif
- +
- + bfd_target amiga_vec =
- + {
- + "amiga", /* name */
- + bfd_target_amiga_flavour,
- + true, /* data byte order is little */
- + true, /* header byte order is little */
- + HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT, /* object flags */
- + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC, /* section flags */
- + '_', /* symbol leading char */
- + ' ', /* ar_pad_char */
- + 31, /* ar_max_namelen */
- + 2, /* minimum align */
- + bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32,
- + bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
- + bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32,
- + bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
- + {
- + /* bfd_check_format */
- + _bfd_dummy_target,
- + amiga_object_p,
- + bfd_generic_archive_p,
- + _bfd_dummy_target
- + },
- + {
- + /* bfd_set_format */
- + bfd_false,
- + amiga_mkobject,
- + _bfd_generic_mkarchive,
- + bfd_false
- + },
- + {
- + /* bfd_write_contents */
- + bfd_false,
- + amiga_write_object_contents,
- + _bfd_write_archive_contents,
- + bfd_false
- + },
- + JUMP_TABLE(amiga),
- + (PTR) 0
- + #if 0
- + /* fixme: no longer in use? */
- + /* How applications can find out about amiga relocation types (see
- + documentation on reloc types). */
- + amiga_reloc_type_lookup
- + #endif
- + };
- diff -rc --new-file gdb-4.12/bfd/bfd-in2.h /gnu/src/amiga/gdb-4.12/bfd/bfd-in2.h
- *** gdb-4.12/bfd/bfd-in2.h Thu Feb 3 17:00:58 1994
- --- /gnu/src/amiga/gdb-4.12/bfd/bfd-in2.h Fri Jun 17 07:33:36 1994
- ***************
- *** 1737,1742 ****
- --- 1737,1743 ----
- struct sgi_core_struct *sgi_core_data;
- struct lynx_core_struct *lynx_core_data;
- struct osf_core_struct *osf_core_data;
- + struct amiga_data_struct *amiga_data;
- PTR any;
- } tdata;
-
- ***************
- *** 1861,1867 ****
- bfd_target_oasys_flavour,
- bfd_target_tekhex_flavour,
- bfd_target_srec_flavour,
- ! bfd_target_som_flavour};
-
- /* Forward declaration. */
- typedef struct bfd_link_info _bfd_link_info;
- --- 1862,1869 ----
- bfd_target_oasys_flavour,
- bfd_target_tekhex_flavour,
- bfd_target_srec_flavour,
- ! bfd_target_som_flavour,
- ! bfd_target_amiga_flavour};
-
- /* Forward declaration. */
- typedef struct bfd_link_info _bfd_link_info;
- diff -rc --new-file gdb-4.12/bfd/bfd.c /gnu/src/amiga/gdb-4.12/bfd/bfd.c
- *** gdb-4.12/bfd/bfd.c Thu Feb 3 16:46:42 1994
- --- /gnu/src/amiga/gdb-4.12/bfd/bfd.c Fri Jun 17 07:33:37 1994
- ***************
- *** 168,173 ****
- --- 168,174 ----
- . struct sgi_core_struct *sgi_core_data;
- . struct lynx_core_struct *lynx_core_data;
- . struct osf_core_struct *osf_core_data;
- + . struct amiga_data_struct *amiga_data;
- . PTR any;
- . } tdata;
- .
- diff -rc --new-file gdb-4.12/bfd/config/amigados.mh /gnu/src/amiga/gdb-4.12/bfd/config/amigados.mh
- *** gdb-4.12/bfd/config/amigados.mh Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/bfd/config/amigados.mh Fri Jun 17 07:33:38 1994
- ***************
- *** 0 ****
- --- 1,6 ----
- + # Host makefile fragment for Commodore Amiga running AmigaDOS
- +
- + # Use the GNU C compiler.
- + CC=gcc
- + # Don't use -g, it doesn't do anything useful yet. Optimize though.
- + CFLAGS=-O
- diff -rc --new-file gdb-4.12/bfd/config/amigados.mt /gnu/src/amiga/gdb-4.12/bfd/config/amigados.mt
- *** gdb-4.12/bfd/config/amigados.mt Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/bfd/config/amigados.mt Fri Jun 17 07:33:38 1994
- ***************
- *** 0 ****
- --- 1,3 ----
- + # Target config file for Commodore Amiga running AmigaDOS
- + DEFAULT_VECTOR=amiga_vec
- + SELECT_ARCHITECTURES=bfd_m68k_arch
- diff -rc --new-file gdb-4.12/bfd/config.bfd /gnu/src/amiga/gdb-4.12/bfd/config.bfd
- *** gdb-4.12/bfd/config.bfd Thu Feb 3 17:01:00 1994
- --- /gnu/src/amiga/gdb-4.12/bfd/config.bfd Fri Jun 17 07:33:39 1994
- ***************
- *** 63,68 ****
- --- 63,69 ----
- m68*-*-vxworks*) bfd_name=m68k-aout ;;
- m68*-ericsson-*) bfd_name=m68k-aout ;;
- m68*-netx-*) bfd_name=m68k-aout ;;
- + m68*-cbm-amigados*) bfd_name=amigados ;;
-
- m88*-*-sysv4*) bfd_name=m88k-elf ;;
- # DGUX used to use COFF, but now (Jan 94) I believe it uses ELF by default.
- diff -rc --new-file gdb-4.12/bfd/configure.in /gnu/src/amiga/gdb-4.12/bfd/configure.in
- *** gdb-4.12/bfd/configure.in Thu Feb 3 17:00:54 1994
- --- /gnu/src/amiga/gdb-4.12/bfd/configure.in Fri Jun 17 22:20:21 1994
- ***************
- *** 137,142 ****
- --- 137,143 ----
- # with the two vector lists in targets.c.
- a29kcoff_big_vec) tb="$tb coff-a29k.o" ;;
- a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o stab-syms.o" ;;
- + amiga_vec) tb="$tb amiga.o" ;;
- aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
- aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
- apollocoff_vec) tb="$tb coff-apollo.o" ;;
- ***************
- *** 261,270 ****
-
- test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
-
- echo "TDEFAULTS = \
- ! ${defvec+-DDEFAULT_VECTOR=$defvec} \
- ! ${selvecs+-DSELECT_VECS='$selvecs'} \
- ! ${selarchs+-DSELECT_ARCHITECTURES='$selarchs'}" \
- >> Makefile.2
-
- cat Makefile.tmp >> Makefile.2
- --- 262,273 ----
-
- test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
-
- + # Because of a bug in pdksh on the Amiga, the -D args in the TDEFAULTS
- + # line are preexpanded to the appropriate Amiga args.
- echo "TDEFAULTS = \
- ! -DDEFAULT_VECTOR=amiga_vec \
- ! -DSELECT_VECS='&amiga_vec' \
- ! -DSELECT_ARCHITECTURES=bfd_m68k_arch" \
- >> Makefile.2
-
- cat Makefile.tmp >> Makefile.2
- diff -rc --new-file gdb-4.12/bfd/hosts/amigados.h /gnu/src/amiga/gdb-4.12/bfd/hosts/amigados.h
- *** gdb-4.12/bfd/hosts/amigados.h Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/bfd/hosts/amigados.h Fri Jun 17 07:33:40 1994
- ***************
- *** 0 ****
- --- 1,8 ----
- + /* Host configuration for AmigaDOS */
- +
- + #ifndef hosts_amigados_h
- + #define hosts_amigados_h
- +
- + #include "hosts/std-host.h"
- +
- + #endif /* hosts_amigados_h */
- diff -rc --new-file gdb-4.12/bfd/libamiga.h /gnu/src/amiga/gdb-4.12/bfd/libamiga.h
- *** gdb-4.12/bfd/libamiga.h Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/bfd/libamiga.h Fri Jun 17 07:33:41 1994
- ***************
- *** 0 ****
- --- 1,149 ----
- + /* BFD back-end data structures for AmigaOS.
- + Copyright (C) 1992-1994 Free Software Foundation, Inc.
- + Contributed by Leonard Norrgard.
- +
- + This file is part of BFD, the Binary File Descriptor library.
- +
- + This program is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 2 of the License, or
- + (at your option) any later version.
- +
- + This program is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + GNU General Public License for more details.
- +
- + You should have received a copy of the GNU General Public License
- + along with this program; if not, write to the Free Software
- + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
- +
- + #ifdef __STDC__
- + #define CAT3(a,b,c) a##b##c
- + #else
- + #define CAT3(a,b,c) a/**/b/**/c
- + #endif
- +
- + #define GET_WORD bfd_h_get_32
- + #define GET_SWORD (int32_type)GET_WORD
- + #define PUT_WORD bfd_h_put_32
- + #define NAME(x,y) CAT3(x,_32_,y)
- + #define JNAME(x) CAT(x,_32)
- + #define BYTES_IN_WORD 4
- +
- + /* Hunk ID numbers. */
- + #define HUNK_UNIT 999
- + #define HUNK_NAME 1000
- + #define HUNK_CODE 1001
- + #define HUNK_DATA 1002
- + #define HUNK_BSS 1003
- + #define HUNK_RELOC32 1004
- + #define HUNK_RELOC16 1005
- + #define HUNK_RELOC8 1006
- + #define HUNK_EXT 1007
- + #define HUNK_SYMBOL 1008
- + #define HUNK_DEBUG 1009
- + #define HUNK_END 1010
- + #define HUNK_HEADER 1011
- + #define HUNK_OVERLAY 1013
- + #define HUNK_BREAK 1014
- + #define HUNK_DREL32 1015
- + #define HUNK_DREL16 1016
- + #define HUNK_DREL8 1017
- + #define HUNK_LIB 1018
- + #define HUNK_INDEX 1019
- +
- + /* The hunk ID part. */
- + #define HUNK_VALUE(hunk_id) ((hunk_id) & 0x3fffffff)
- +
- + /* Attributes of a hunk. */
- + #define HUNK_ATTRIBUTE(hunk_id) ((hunk_id) >> 30)
- + #define HUNK_ATTR_CHIP 0x01 /* Hunk contents must go into chip (graphics) memory. */
- +
- +
- + /* HUNK_EXT sub-types. */
- + #define EXT_SYMB 0 /* Symbol table. */
- + #define EXT_DEF 1 /* Relocatable definition. */
- + #define EXT_ABS 2 /* Absolute definition. */
- + #define EXT_RES 3 /* Obsolete. */
- + #define EXT_REF32 129 /* 32 bit reference to symbol. */
- + #define EXT_COMMON 130 /* 32 bit reference to COMMON block. */
- + #define EXT_REF16 131 /* 16 bit reference to symbol. */
- + #define EXT_REF8 132 /* 8 bit reference to symbol. */
- + #define EXT_DEXT32 133 /* 32 bit data releative reference. */
- + #define EXT_DEXT16 134 /* 16 bit data releative reference. */
- + #define EXT_DEXT8 135 /* 8 bit data releative reference. */
- +
- +
- + typedef struct amiga_reloc {
- + arelent relent;
- + struct amiga_reloc *next;
- + int symbol_number;
- + unsigned int target_hunk;
- + } amiga_reloc_type;
- +
- + typedef struct amiga_symbol {
- + asymbol symbol;
- + struct amiga_symbol *next;
- + unsigned long hunk_number;
- + unsigned long value;
- + unsigned char type;
- + } amiga_symbol_type;
- +
- + typedef struct amiga_per_section
- + {
- + amiga_reloc_type *reloc_tail_ptr;
- + } amiga_per_section_type;
- + #define amiga_per_section(x) ((amiga_per_section_type *)((x)->used_by_bfd))
- +
- + /* The `tdata' struct for all a.out-like object file formats.
- + Various things depend on this struct being around any time an a.out
- + file is being handled. An example is dbxread.c in GDB. */
- +
- + struct amiga_data {
- + struct internal_exec *hdr; /* exec file header */
- + amiga_symbol_type *symbols; /* symtab for input bfd */
- +
- + /* Filler, so we can pretend to be an a.out to GDB. */
- + asection *dummy_1_textsec;
- + asection *dummy_2_datasec;
- + asection *dummy_3_bsssec;
- +
- + /* The positions of the string table and symbol table. */
- + file_ptr sym_filepos;
- + file_ptr str_filepos;
- +
- + unsigned int n_symbols; /* number of symbols */
- +
- + /* Size of a relocation entry in external form */
- + unsigned dummy_reloc_entry_size;
- +
- + /* Size of a symbol table entry in external form */
- + unsigned symbol_entry_size;
- +
- + unsigned exec_bytes_size;
- + unsigned vma_adjusted : 1;
- + };
- +
- + typedef struct amiga_data_struct {
- + struct amiga_data a;
- +
- + unsigned long symtab_size;
- + unsigned long stringtab_size;
- +
- + unsigned long *first_byte;
- + unsigned long *file_end;
- + unsigned long *file_pointer;
- + amiga_symbol_type *external_symbols;
- + amiga_symbol_type *external_references;
- + amiga_symbol_type **symbol_tail_ptr;
- + } amiga_data_type;
- +
- + #define adata(bfd) ((bfd)->tdata.amiga_data->a)
- +
- + /* We take the address of the first element of an asymbol to ensure that the
- + macro is only ever applied to an asymbol */
- + #define amiga_symbol(asymbol) ((amiga_symbol_type *)(&(asymbol)->the_bfd))
- +
- + #define AMIGA_DATA(abfd) ((abfd)->tdata.amiga_data)
- +
- diff -rc --new-file gdb-4.12/bfd/targets.c /gnu/src/amiga/gdb-4.12/bfd/targets.c
- *** gdb-4.12/bfd/targets.c Thu Feb 3 17:00:59 1994
- --- /gnu/src/amiga/gdb-4.12/bfd/targets.c Fri Jun 17 07:33:42 1994
- ***************
- *** 129,135 ****
- . bfd_target_oasys_flavour,
- . bfd_target_tekhex_flavour,
- . bfd_target_srec_flavour,
- ! . bfd_target_som_flavour};
- .
- .{* Forward declaration. *}
- .typedef struct bfd_link_info _bfd_link_info;
- --- 129,136 ----
- . bfd_target_oasys_flavour,
- . bfd_target_tekhex_flavour,
- . bfd_target_srec_flavour,
- ! . bfd_target_som_flavour,
- ! . bfd_target_amiga_flavour};
- .
- .{* Forward declaration. *}
- .typedef struct bfd_link_info _bfd_link_info;
- ***************
- *** 339,344 ****
- --- 340,346 ----
- we can't intermix extern's and initializers. */
- extern bfd_target a29kcoff_big_vec;
- extern bfd_target a_out_adobe_vec;
- + extern bfd_target amiga_vec;
- extern bfd_target aout_mips_big_vec;
- extern bfd_target aout_mips_little_vec;
- extern bfd_target apollocoff_vec;
- ***************
- *** 430,435 ****
- --- 432,438 ----
- it wasn't omitted by mistake. */
- &a29kcoff_big_vec,
- &a_out_adobe_vec,
- + &amiga_vec,
- #if 0 /* No one seems to use this. */
- &aout_mips_big_vec,
- #endif
- diff -rc --new-file gdb-4.12/config/mh-amigados /gnu/src/amiga/gdb-4.12/config/mh-amigados
- *** gdb-4.12/config/mh-amigados Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/config/mh-amigados Fri Jun 17 07:33:43 1994
- ***************
- *** 0 ****
- --- 1,6 ----
- + # Host makefile fragment for Commodore Amiga running AmigaDOS.
- +
- + # There is no standard system compiler. Assume use GNU C.
- + CC = gcc
- + # There is no support for -g yet. But use -O instead.
- + CFLAGS = -O
- diff -rc --new-file gdb-4.12/configure /gnu/src/amiga/gdb-4.12/configure
- *** gdb-4.12/configure Thu Feb 3 17:27:16 1994
- --- /gnu/src/amiga/gdb-4.12/configure Fri Jun 17 19:26:30 1994
- ***************
- *** 33,43 ****
- # config.status is removed.
- #
-
- export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0 $argv; kill $$)
-
- remove=rm
- ! hard_link=ln
- ! symbolic_link='ln -s'
-
- #for Test
- #remove="echo rm"
- --- 33,46 ----
- # config.status is removed.
- #
-
- + # In places where the argument to echo may start with a '-', use /bin/echo
- + # since the AmigaDOS pdksh builtin echo botches this case.
- +
- export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0 $argv; kill $$)
-
- remove=rm
- ! hard_link=cp
- ! symbolic_link=cp
-
- #for Test
- #remove="echo rm"
- ***************
- *** 68,74 ****
- next_tmpdir=
- norecursion=
- package_makefile_frag=
- ! prefix=/usr/local
- progname=
- program_prefix=
- program_prefixoption=
- --- 71,80 ----
- next_tmpdir=
- norecursion=
- package_makefile_frag=
- ! # This is a hack so we don't have to remember to always configure using
- ! # the "--prefix=/gnu" option. Personally I feel this should be settable
- ! # in a config file. -fnf
- ! prefix=/gnu
- progname=
- program_prefix=
- program_prefixoption=
- ***************
- *** 105,113 ****
- ## path. Since PATH might include "." we also add `pwd` to the end of PATH.
- ##
-
- ! progname=$0
- # if PWD already has a value, it is probably wrong.
- ! if [ -n "$PWD" ]; then PWD=`pwd`; fi
-
- case "${progname}" in
- /*) ;;
- --- 111,122 ----
- ## path. Since PATH might include "." we also add `pwd` to the end of PATH.
- ##
-
- ! # For some reason, the value of $0 in AmigaDOS pdksh ends up with a
- ! # trailing '/' that needs to be stripped.
- ! progname=`/bin/echo $0 | sed 's:/$::'`
- # if PWD already has a value, it is probably wrong.
- ! # The AmigaDOS pksh can't change the value of PWD, it's readonly.
- ! #if [ -n "$PWD" ]; then PWD=`pwd`; fi
-
- case "${progname}" in
- /*) ;;
- ***************
- *** 127,133 ****
- next_exec_prefix=
- elif [ -n "${next_site}" ] ; then site=${arg} ; site_option=-site=${site} ; next_site=
- # remove any possible trailing slash from srcdir. See note below.
- ! elif [ -n "${next_srcdir}" ] ; then srcdir=`echo ${arg} | sed -e 's:/$::'` ; next_srcdir=
- elif [ -n "${next_program_prefix}" ] ; then
- program_prefix=${arg}
- program_prefixoption="-program_prefix=${program_prefix}"
- --- 136,142 ----
- next_exec_prefix=
- elif [ -n "${next_site}" ] ; then site=${arg} ; site_option=-site=${site} ; next_site=
- # remove any possible trailing slash from srcdir. See note below.
- ! elif [ -n "${next_srcdir}" ] ; then srcdir=`/bin/echo ${arg} | sed -e 's:/$::'` ; next_srcdir=
- elif [ -n "${next_program_prefix}" ] ; then
- program_prefix=${arg}
- program_prefixoption="-program_prefix=${program_prefix}"
- ***************
- *** 139,145 ****
- elif [ -n "${next_program_transform_name}" ] ; then
- # Double any backslashes or dollar signs in the argument
- if [ -n "${arg}" ] ; then
- ! program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
- fi
- program_transform_nameoption="${program_transform_nameoption} --program-transform-name='${arg}'"
- next_program_transform_name=
- --- 148,154 ----
- elif [ -n "${next_program_transform_name}" ] ; then
- # Double any backslashes or dollar signs in the argument
- if [ -n "${arg}" ] ; then
- ! program_transform_name="${program_transform_name} -e `/bin/echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
- fi
- program_transform_nameoption="${program_transform_nameoption} --program-transform-name='${arg}'"
- next_program_transform_name=
- ***************
- *** 185,191 ****
- case ${arg} in
- -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
- case "${build_alias}" in
- ! "") build_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`" ;;
- *)
- echo '***' Can only configure for one build machine at a time. 1>&2
- fatal=yes
- --- 194,200 ----
- case ${arg} in
- -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
- case "${build_alias}" in
- ! "") build_alias="`/bin/echo ${arg} | sed 's/^[-a-z]*=//'`" ;;
- *)
- echo '***' Can only configure for one build machine at a time. 1>&2
- fatal=yes
- ***************
- *** 196,202 ****
- next_build=yes
- ;;
- -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=* | -exec-prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* )
- ! exec_prefix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
- exec_prefixoption=${arg}
- ;;
- -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e | -exec-prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec-)
- --- 205,211 ----
- next_build=yes
- ;;
- -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=* | -exec-prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* )
- ! exec_prefix=`/bin/echo ${arg} | sed 's/^[-a-z_]*=//'`
- exec_prefixoption=${arg}
- ;;
- -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e | -exec-prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec-)
- ***************
- *** 211,217 ****
- -host=* | --host=* | --hos=* | --ho=*)
- case "${host_alias}" in
- "")
- ! host_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`"
- ;;
- *)
- echo '***' Can only configure for one host at a time. 1>&2
- --- 220,226 ----
- -host=* | --host=* | --hos=* | --ho=*)
- case "${host_alias}" in
- "")
- ! host_alias="`/bin/echo ${arg} | sed 's/^[-a-z]*=//'`"
- ;;
- *)
- echo '***' Can only configure for one host at a time. 1>&2
- ***************
- *** 237,243 ****
- norecursion=true
- ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=*)
- ! prefix=`echo ${arg} | sed 's/^[-a-z]*=//'`
- prefixoption=${arg}
- ;;
- -prefix | --prefix | --prefi | --pref | --pre)
- --- 246,252 ----
- norecursion=true
- ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=*)
- ! prefix=`/bin/echo ${arg} | sed 's/^[-a-z]*=//'`
- prefixoption=${arg}
- ;;
- -prefix | --prefix | --prefi | --pref | --pre)
- ***************
- *** 245,268 ****
- ;;
- -rm | --rm) removing=${arg} ;;
- -program_prefix=* | --program_prefix=* | --program_prefi=* | --program_pref=* | --program_pre=* | --program_pr=* | --program_p=* | -program-prefix=* | --program-prefix=* | --program-prefi=* | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- ! program_prefix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
- program_prefixoption=${arg}
- ;;
- -program_prefix | --program_prefix | --program_prefi | --program_pref | --program_pre | --program_pr | --program_p | -program-prefix | --program-prefix | --program-prefi | --program-pref | --program-pre | --program-pr | --program-p)
- next_program_prefix=yes
- ;;
- -program_suffix=* | --program_suffix=* | --program_suffi=* | --program_suff=* | --program_suf=* | --program_su=* | --program_s=* | -program-suffix=* | --program-suffix=* | --program-suffi=* | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- ! program_suffix=`echo ${arg} | sed 's/^[-a-z_]*=//'`
- program_suffixoption=${arg}
- ;;
- -program_suffix | --program_suffix | --program_suffi | --program_suff | --program_suf | --program_su | --program_s |-program-suffix | --program-suffix | --program-suffi | --program-suff | --program-suf | --program-su | --program-s)
- next_program_suffix=yes
- ;;
- -program_transform_name=* | --program_transform_name=* | --program_transform_nam=* | --program_transform_na=* | --program_transform_n=* | --program_transform_=* | --program_transform=* | --program_transfor=* | --program_transfo=* | --program_transf=* | --program_trans=* | --program_tran=* | --program_tra=* | --program_tr=* | --program_t=* | -program-transform-name=* | --program-transform-name=* | --program-transform-nam=* | --program-transform-na=* | --program-transform-n=* | --program-transform-=* | --program-transform=* | --program-transfor=* | --program-transfo=* | --program-transf=* | --program-trans=* | --program-tran=* | --program-tra=* | --program-tr=* | --program-t=*)
- ! arg=`echo ${arg} | sed -e 's/^[-a-z_]*=//'`
- # Double any \ or $ in the argument
- if [ -n "${arg}" ] ; then
- ! program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
- fi
- program_transform_nameoption="${program_transform_nameoption} --program-transform-name='${arg}'"
- ;;
- --- 254,277 ----
- ;;
- -rm | --rm) removing=${arg} ;;
- -program_prefix=* | --program_prefix=* | --program_prefi=* | --program_pref=* | --program_pre=* | --program_pr=* | --program_p=* | -program-prefix=* | --program-prefix=* | --program-prefi=* | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- ! program_prefix=`/bin/echo ${arg} | sed 's/^[-a-z_]*=//'`
- program_prefixoption=${arg}
- ;;
- -program_prefix | --program_prefix | --program_prefi | --program_pref | --program_pre | --program_pr | --program_p | -program-prefix | --program-prefix | --program-prefi | --program-pref | --program-pre | --program-pr | --program-p)
- next_program_prefix=yes
- ;;
- -program_suffix=* | --program_suffix=* | --program_suffi=* | --program_suff=* | --program_suf=* | --program_su=* | --program_s=* | -program-suffix=* | --program-suffix=* | --program-suffi=* | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- ! program_suffix=`/bin/echo ${arg} | sed 's/^[-a-z_]*=//'`
- program_suffixoption=${arg}
- ;;
- -program_suffix | --program_suffix | --program_suffi | --program_suff | --program_suf | --program_su | --program_s |-program-suffix | --program-suffix | --program-suffi | --program-suff | --program-suf | --program-su | --program-s)
- next_program_suffix=yes
- ;;
- -program_transform_name=* | --program_transform_name=* | --program_transform_nam=* | --program_transform_na=* | --program_transform_n=* | --program_transform_=* | --program_transform=* | --program_transfor=* | --program_transfo=* | --program_transf=* | --program_trans=* | --program_tran=* | --program_tra=* | --program_tr=* | --program_t=* | -program-transform-name=* | --program-transform-name=* | --program-transform-nam=* | --program-transform-na=* | --program-transform-n=* | --program-transform-=* | --program-transform=* | --program-transfor=* | --program-transfo=* | --program-transf=* | --program-trans=* | --program-tran=* | --program-tra=* | --program-tr=* | --program-t=*)
- ! arg=`/bin/echo ${arg} | sed -e 's/^[-a-z_]*=//'`
- # Double any \ or $ in the argument
- if [ -n "${arg}" ] ; then
- ! program_transform_name="${program_transform_name} -e `/bin/echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
- fi
- program_transform_nameoption="${program_transform_nameoption} --program-transform-name='${arg}'"
- ;;
- ***************
- *** 271,277 ****
- ;;
- -site=* | --site=* | --sit=* | --si=*)
- site_option=${arg}
- ! site=`echo ${arg} | sed 's/^[-a-z]*=//'`
- ;;
- -site | --site | --sit)
- next_site=yes
- --- 280,286 ----
- ;;
- -site=* | --site=* | --sit=* | --si=*)
- site_option=${arg}
- ! site=`/bin/echo ${arg} | sed 's/^[-a-z]*=//'`
- ;;
- -site | --site | --sit)
- next_site=yes
- ***************
- *** 281,294 ****
- # it. Ordinarily this is ok, but emacs takes double slash to
- # mean "forget the first part".
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- ! srcdir=`echo ${arg} | sed 's/^[-a-z]*=//' | sed -e 's:/$::'`
- ;;
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- next_srcdir=yes
- ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=*)
- case "${target_alias}" in
- ! "") target_alias="`echo ${arg} | sed 's/^[-a-z]*=//'`" ;;
- *)
- echo '***' Can only configure for one target at a time. 1>&2
- fatal=yes
- --- 290,303 ----
- # it. Ordinarily this is ok, but emacs takes double slash to
- # mean "forget the first part".
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- ! srcdir=`/bin/echo ${arg} | sed 's/^[-a-z]*=//' | sed -e 's:/$::'`
- ;;
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- next_srcdir=yes
- ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=*)
- case "${target_alias}" in
- ! "") target_alias="`/bin/echo ${arg} | sed 's/^[-a-z]*=//'`" ;;
- *)
- echo '***' Can only configure for one target at a time. 1>&2
- fatal=yes
- ***************
- *** 300,311 ****
- ;;
- -tmpdir=* | --tmpdir=* | --tmpdi=* | --tmpd=* | --tmp=* | --tm=*)
- tmpdiroption=${arg}
- ! TMPDIR=`echo ${arg} | sed 's/^[-a-z]*=//'`
- ;;
- -tmpdir | --tmpdir | --tmpdi | --tmpd | --tmp | --tm)
- next_tmpdir=yes
- ;;
- ! -v | -verbose | --v)
- redirect=
- verbose=-v
- ;;
- --- 309,320 ----
- ;;
- -tmpdir=* | --tmpdir=* | --tmpdi=* | --tmpd=* | --tmp=* | --tm=*)
- tmpdiroption=${arg}
- ! TMPDIR=`/bin/echo ${arg} | sed 's/^[-a-z]*=//'`
- ;;
- -tmpdir | --tmpdir | --tmpdi | --tmpd | --tmp | --tm)
- next_tmpdir=yes
- ;;
- ! -v | -verbose | --v | --verb*)
- redirect=
- verbose=-v
- ;;
- ***************
- *** 314,331 ****
- exit 0
- ;;
- -with*=* | --with*=*)
- ! withopt=`echo ${arg} | sed 's:^-*\(with[^=]*\)=.*$:\1:;s/-/_/g'`
- ! withval=`echo ${arg} | sed 's:^-*with[^=]*=\(.*\)$:\1:'`
- eval $withopt="$withval"
- withoptions="$withoptions $arg"
- ;;
- -without* | --without*)
- ! withopt=`echo ${arg} | sed 's:^-*without:with:;s/-/_/g'`
- eval $withopt=no
- withoutoptions="$withoutoptions $arg"
- ;;
- -with* | --with*)
- ! withopt=`echo ${arg} | sed 's:^-*with:with:;s/-/_/g'`
- eval $withopt=yes
- withoptions="$withoptions $arg"
- ;;
- --- 323,340 ----
- exit 0
- ;;
- -with*=* | --with*=*)
- ! withopt=`/bin/echo ${arg} | sed 's:^-*\(with[^=]*\)=.*$:\1:;s/-/_/g'`
- ! withval=`/bin/echo ${arg} | sed 's:^-*with[^=]*=\(.*\)$:\1:'`
- eval $withopt="$withval"
- withoptions="$withoptions $arg"
- ;;
- -without* | --without*)
- ! withopt=`/bin/echo ${arg} | sed 's:^-*without:with:;s/-/_/g'`
- eval $withopt=no
- withoutoptions="$withoutoptions $arg"
- ;;
- -with* | --with*)
- ! withopt=`/bin/echo ${arg} | sed 's:^-*with:with:;s/-/_/g'`
- eval $withopt=yes
- withoptions="$withoptions $arg"
- ;;
- ***************
- *** 549,573 ****
- *)
- result=`${configsub} ${build_alias}`
- buildopt="--build=${build_alias}"
- ! build_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! build_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! build_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- build=${build_cpu}-${build_vendor}-${build_os}
- ;;
- esac
-
- result=`${configsub} ${host_alias}`
- ! host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- host=${host_cpu}-${host_vendor}-${host_os}
-
- . ${tmpfile}.hst
-
- result=`${configsub} ${target_alias}`
- ! target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- target=${target_cpu}-${target_vendor}-${target_os}
-
- . ${tmpfile}.tgt
- --- 558,582 ----
- *)
- result=`${configsub} ${build_alias}`
- buildopt="--build=${build_alias}"
- ! build_cpu=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! build_vendor=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! build_os=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- build=${build_cpu}-${build_vendor}-${build_os}
- ;;
- esac
-
- result=`${configsub} ${host_alias}`
- ! host_cpu=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! host_vendor=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! host_os=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- host=${host_cpu}-${host_vendor}-${host_os}
-
- . ${tmpfile}.hst
-
- result=`${configsub} ${target_alias}`
- ! target_cpu=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
- ! target_vendor=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
- ! target_os=`/bin/echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
- target=${target_cpu}-${target_vendor}-${target_os}
-
- . ${tmpfile}.tgt
- ***************
- *** 851,857 ****
- # make sure that some sort of reasonable default exists for these
- # two variables
- CXX=${CXX-"g++ -O"}
- ! CC=${CC-cc}
-
- # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
- # remove any form feeds.
- --- 860,866 ----
- # make sure that some sort of reasonable default exists for these
- # two variables
- CXX=${CXX-"g++ -O"}
- ! CC=${CC-gcc}
-
- # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
- # remove any form feeds.
- ***************
- *** 988,993 ****
- --- 997,1003 ----
-
- ### The recursion line is here.
- if [ ! -z "${recprog}" ] ; then
- + echo ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} ${prefixoption} ${tmpdiroption} ${exec_prefixoption} ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${removing} ${redirect}
- if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} \
- ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
- ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${removing} ${redirect} ; then
- diff -rc --new-file gdb-4.12/configure.in /gnu/src/amiga/gdb-4.12/configure.in
- *** gdb-4.12/configure.in Thu Feb 3 17:27:17 1994
- --- /gnu/src/amiga/gdb-4.12/configure.in Fri Jun 17 07:33:46 1994
- ***************
- *** 108,113 ****
- --- 108,114 ----
- cross_only="xiberty" ;;
- *-*-sysv4*) host_makefile_frag=config/mh-sysv4 ;;
- *-*-sysv*) host_makefile_frag=config/mh-sysv ;;
- + *-*-amigados*) host_makefile_frag=config/mh-amigados ;;
- esac
-
- # per-target:
- diff -rc --new-file gdb-4.12/gdb/Makefile.in /gnu/src/amiga/gdb-4.12/gdb/Makefile.in
- *** gdb-4.12/gdb/Makefile.in Thu Feb 3 16:45:29 1994
- --- /gnu/src/amiga/gdb-4.12/gdb/Makefile.in Fri Jun 17 07:33:48 1994
- ***************
- *** 70,77 ****
- srcdir = .
-
- # If you use bison instead of yacc, it needs to include the "-y" argument.
- ! #BISON=bison -y
- ! BISON=yacc
- YACC=$(BISON)
-
- # where to find makeinfo, preferably one designed for texinfo-2
- --- 70,77 ----
- srcdir = .
-
- # If you use bison instead of yacc, it needs to include the "-y" argument.
- ! BISON=bison -y
- ! #BISON=yacc
- YACC=$(BISON)
-
- # where to find makeinfo, preferably one designed for texinfo-2
- ***************
- *** 310,316 ****
- mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c parse.c \
- printcmd.c remote.c source.c stabsread.c stack.c symfile.c symmisc.c \
- symtab.c target.c thread.c typeprint.c utils.c valarith.c valops.c \
- ! valprint.c values.c serial.c ser-unix.c mdebugread.c
-
- # Files that are not source code, but need to go into
- # gdb-$(VERSION).tar.Z.
- --- 310,316 ----
- mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c parse.c \
- printcmd.c remote.c source.c stabsread.c stack.c symfile.c symmisc.c \
- symtab.c target.c thread.c typeprint.c utils.c valarith.c valops.c \
- ! valprint.c values.c serial.c ser-unix.c mdebugread.c amigaread.c
-
- # Files that are not source code, but need to go into
- # gdb-$(VERSION).tar.Z.
- ***************
- *** 443,449 ****
- dwarfread.o mipsread.o stabsread.o core.o c-lang.o ch-lang.o m2-lang.o \
- complaints.o typeprint.o c-typeprint.o ch-typeprint.o m2-typeprint.o \
- c-valprint.o cp-valprint.o ch-valprint.o m2-valprint.o nlmread.o \
- ! serial.o mdebugread.o
-
- RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
-
- --- 443,449 ----
- dwarfread.o mipsread.o stabsread.o core.o c-lang.o ch-lang.o m2-lang.o \
- complaints.o typeprint.o c-typeprint.o ch-typeprint.o m2-typeprint.o \
- c-valprint.o cp-valprint.o ch-valprint.o m2-valprint.o nlmread.o \
- ! serial.o mdebugread.o amigaread.o
-
- RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
-
- ***************
- *** 870,876 ****
- ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
- 29k-share/udi/udi2go32.c \
- a29k-pinsn.c a29k-tdep.c a68v-nat.c alpha-nat.c alpha-tdep.c \
- ! altos-xdep.c arm-convert.s \
- arm-pinsn.c arm-tdep.c arm-xdep.c coff-solib.c convex-pinsn.c \
- convex-tdep.c \
- convex-xdep.c core-svr4.c coredep.c corelow.c dcache.c delta68-nat.c \
- --- 870,876 ----
- ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
- 29k-share/udi/udi2go32.c \
- a29k-pinsn.c a29k-tdep.c a68v-nat.c alpha-nat.c alpha-tdep.c \
- ! altos-xdep.c amigaread.c arm-convert.s \
- arm-pinsn.c arm-tdep.c arm-xdep.c coff-solib.c convex-pinsn.c \
- convex-tdep.c \
- convex-xdep.c core-svr4.c coredep.c corelow.c dcache.c delta68-nat.c \
- ***************
- *** 1074,1079 ****
- --- 1074,1081 ----
- $(inferior_h) $(symtab_h) $(dis-asm.h)
-
- altos-xdep.o: altos-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
- + amigaread.o: amigaread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
- + gdb-stabs.h objfiles.h symfile.h $(symtab_h)
- arm-pinsn.o: arm-pinsn.c $(OP_INCLUDE)/arm.h $(defs_h) $(symtab_h)
-
- blockframe.o: blockframe.c $(defs_h) $(gdbcore_h) $(inferior_h) \
- diff -rc --new-file gdb-4.12/gdb/amigaread.c /gnu/src/amiga/gdb-4.12/gdb/amigaread.c
- *** gdb-4.12/gdb/amigaread.c Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/gdb/amigaread.c Fri Jun 17 07:33:49 1994
- ***************
- *** 0 ****
- --- 1,256 ----
- + /* Read Amigados object files for GDB.
- + Copyright 1991, 1992, 1994 Free Software Foundation, Inc.
- + Converted to Amigados format files by Leonard Norrgard. Original
- + was paread.c by Fred Fish.
- +
- + This file is part of GDB.
- +
- + This program is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 2 of the License, or
- + (at your option) any later version.
- +
- + This program is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + GNU General Public License for more details.
- +
- + You should have received a copy of the GNU General Public License
- + along with this program; if not, write to the Free Software
- + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
- +
- + #include "defs.h"
- + #include "bfd.h"
- + #include <time.h> /* For time_t in libbfd.h. */
- + #include <sys/types.h> /* For time_t, if not in time.h. */
- + #include "libbfd.h"
- + #include "libamiga.h"
- + #include "symtab.h"
- + #include "symfile.h"
- + #include "objfiles.h"
- + #include "buildsym.h"
- + #include "stabsread.h"
- + #include "gdb-stabs.h"
- + #include "complaints.h"
- + #include <string.h>
- + #include "demangle.h"
- + #include <sys/file.h>
- +
- + #include "aout/aout64.h"
- +
- + /* Various things we might complain about... */
- +
- + static void
- + amiga_symfile_init PARAMS ((struct objfile *));
- +
- + static void
- + amiga_new_init PARAMS ((struct objfile *));
- +
- + extern void
- + amiga_symfile_read PARAMS ((struct objfile *, struct section_offsets *, int));
- +
- + static void
- + amiga_symfile_finish PARAMS ((struct objfile *));
- +
- + static void
- + free_amigainfo PARAMS ((PTR));
- +
- + static struct section_offsets *
- + amiga_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
- +
- + static void
- + record_minimal_symbol PARAMS ((char *, CORE_ADDR,
- + enum minimal_symbol_type,
- + struct objfile *));
- +
- + static void
- + record_minimal_symbol (name, address, ms_type, objfile)
- + char *name;
- + CORE_ADDR address;
- + enum minimal_symbol_type ms_type;
- + struct objfile *objfile;
- + {
- + name = obsavestring (name, strlen (name), &objfile -> symbol_obstack);
- + prim_record_minimal_symbol (name, address, ms_type, objfile);
- + }
- +
- + /* This cleans up the objfile's sym_stab_info pointer, and the chain of
- + stab_section_info's, that might be dangling from it. */
- +
- + static void
- + free_amigainfo (objp)
- + PTR objp;
- + {
- + struct objfile *objfile = (struct objfile *)objp;
- + struct dbx_symfile_info *dbxinfo = (struct dbx_symfile_info *)
- + objfile->sym_stab_info;
- + struct stab_section_info *ssi, *nssi;
- +
- + ssi = dbxinfo->stab_section_info;
- + while (ssi)
- + {
- + nssi = ssi->next;
- + mfree (objfile->md, ssi);
- + ssi = nssi;
- + }
- +
- + dbxinfo->stab_section_info = 0; /* Just say No mo info about this. */
- + }
- +
- + /* Initialize anything that needs initializing when a completely new symbol
- + file is specified (not just adding some symbols from another file, e.g. a
- + shared library).
- +
- + We reinitialize buildsym, since we may be reading stabs from an amigados file. */
- +
- + static void
- + amiga_new_init (ignore)
- + struct objfile *ignore;
- + {
- + stabsread_new_init ();
- + buildsym_new_init ();
- + }
- +
- + /* Perform any local cleanups required when we are done with a particular
- + objfile. I.E, we are in the process of discarding all symbol information
- + for an objfile, freeing up all memory held for it, and unlinking the
- + objfile struct from the global list of known objfiles. */
- +
- + static void
- + amiga_symfile_finish (objfile)
- + struct objfile *objfile;
- + {
- + if (objfile -> sym_stab_info != NULL)
- + {
- + mfree (objfile -> md, objfile -> sym_stab_info);
- + }
- + }
- +
- + /* Amigados specific initialization routine for reading symbols.
- +
- + It is passed a pointer to a struct sym_fns which contains, among other
- + things, the BFD for the file whose symbols are being read, and a slot for
- + a pointer to "private data" which we can fill with goodies.
- +
- + This routine is almost a complete ripoff of dbx_symfile_init. The
- + common parts of these routines should be extracted and used instead of
- + duplicating this code. FIXME. */
- +
- + static void
- + amiga_symfile_init (objfile)
- + struct objfile *objfile;
- + {
- + int val;
- + bfd *sym_bfd = objfile->obfd;
- + char *name = bfd_get_filename (sym_bfd);
- +
- + /* Allocate struct to keep track of the symfile */
- + objfile->sym_stab_info = (PTR)
- + xmmalloc (objfile -> md, sizeof (struct dbx_symfile_info));
- + memset ((PTR) objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info));
- +
- + /* FIXME POKING INSIDE BFD DATA STRUCTURES */
- + #define STRING_TABLE_OFFSET adata(sym_bfd).str_filepos
- + #define SYMBOL_TABLE_OFFSET adata(sym_bfd).sym_filepos
- +
- + /* FIXME POKING INSIDE BFD DATA STRUCTURES */
- +
- + DBX_SYMFILE_INFO (objfile)->stab_section_info = NULL;
- + DBX_TEXT_SECT (objfile) = bfd_get_section_by_name (sym_bfd, ".text");
- + if (!DBX_TEXT_SECT (objfile))
- + error ("Can't find .text section in symbol file");
- +
- + /* FIXME: I suspect this should be external_nlist. The size of host
- + types like long and bfd_vma should not affect how we read the
- + file. */
- + DBX_SYMBOL_SIZE (objfile) = sizeof (struct internal_nlist);
- + DBX_SYMCOUNT (objfile) = AMIGA_DATA(sym_bfd)->symtab_size
- + / DBX_SYMBOL_SIZE (objfile);
- + DBX_SYMTAB_OFFSET (objfile) = SYMBOL_TABLE_OFFSET;
- +
- + /* Read the string table and stash it away in the psymbol_obstack. It is
- + only needed as long as we need to expand psymbols into full symbols,
- + so when we blow away the psymbol the string table goes away as well.
- + Note that gdb used to use the results of attempting to malloc the
- + string table, based on the size it read, as a form of sanity check
- + for botched byte swapping, on the theory that a byte swapped string
- + table size would be so totally bogus that the malloc would fail. Now
- + that we put in on the psymbol_obstack, we can't do this since gdb gets
- + a fatal error (out of virtual memory) if the size is bogus. We can
- + however at least check to see if the size is zero or some negative
- + value. */
- +
- + DBX_STRINGTAB_SIZE (objfile) = AMIGA_DATA (sym_bfd)->stringtab_size;
- +
- + if (DBX_SYMCOUNT (objfile) == 0
- + || DBX_STRINGTAB_SIZE (objfile) == 0)
- + return;
- +
- + if (DBX_STRINGTAB_SIZE (objfile) <= 0
- + || DBX_STRINGTAB_SIZE (objfile) > bfd_get_size (sym_bfd))
- + error ("ridiculous string table size (%d bytes).",
- + DBX_STRINGTAB_SIZE (objfile));
- +
- + DBX_STRINGTAB (objfile) =
- + (char *) obstack_alloc (&objfile -> psymbol_obstack,
- + DBX_STRINGTAB_SIZE (objfile));
- +
- + /* Now read in the string table in one big gulp. */
- +
- + val = bfd_seek (sym_bfd, STRING_TABLE_OFFSET, L_SET);
- + if (val < 0)
- + perror_with_name (name);
- + val = bfd_read (DBX_STRINGTAB (objfile), DBX_STRINGTAB_SIZE (objfile), 1,
- + sym_bfd);
- + if (val == 0)
- + error ("End of file reading string table");
- + else if (val < 0)
- + /* It's possible bfd_read should be setting bfd_error, and we should be
- + checking that. But currently it doesn't set bfd_error. */
- + perror_with_name (name);
- + else if (val != DBX_STRINGTAB_SIZE (objfile))
- + error ("Short read reading string table");
- + }
- +
- + /* Amiga specific parsing routine for section offsets.
- +
- + Plain and simple for now. */
- +
- + static struct section_offsets *
- + amiga_symfile_offsets (objfile, addr)
- + struct objfile *objfile;
- + CORE_ADDR addr;
- + {
- + struct section_offsets *section_offsets;
- + int i;
- +
- + objfile->num_sections = SECT_OFF_MAX;
- + section_offsets = (struct section_offsets *)
- + obstack_alloc (&objfile -> psymbol_obstack,
- + sizeof (struct section_offsets)
- + + sizeof (section_offsets->offsets) * (SECT_OFF_MAX-1));
- +
- + for (i = 0; i < SECT_OFF_MAX; i++)
- + ANOFFSET (section_offsets, i) = addr;
- +
- + return section_offsets;
- + }
- +
- + /* Register that we are able to handle Amigados object file formats. */
- +
- + static struct sym_fns amiga_sym_fns =
- + {
- + bfd_target_amiga_flavour,
- + amiga_new_init, /* sym_new_init: init anything gbl to entire symtab */
- + amiga_symfile_init, /* sym_init: read initial info, setup for sym_read() */
- + amiga_symfile_read, /* sym_read: read a symbol file into symtab */
- + amiga_symfile_finish, /* sym_finish: finished with file, cleanup */
- + amiga_symfile_offsets,/* sym_offsets: Translate ext. to int. relocation */
- + NULL /* next: pointer to next struct sym_fns */
- + };
- +
- + void
- + _initialize_amigaread ()
- + {
- + add_symtab_fns (&amiga_sym_fns);
- + }
- diff -rc --new-file gdb-4.12/gdb/config/m68k/amigados.mh /gnu/src/amiga/gdb-4.12/gdb/config/m68k/amigados.mh
- *** gdb-4.12/gdb/config/m68k/amigados.mh Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/gdb/config/m68k/amigados.mh Fri Jun 17 07:33:50 1994
- ***************
- *** 0 ****
- --- 1,14 ----
- + # Host: Commodore Amiga running AmigaDOS.
- + NAT_FILE= nm-amigados.h
- + NATDEPFILES=
- + XDEPFILES=
- + XM_FILE= xm-amigados.h
- + REGEX=regex.o
- + REGEX1=regex.o
- + # Use GNU C compiler
- + CC = gcc
- + # Use GNU install
- + INSTALL = /bin/install -c
- + # Don't use the mmalloc library, there is no sbrk() or mmap().
- + MMALLOC=
- + MMALLOC_DISABLE = -DNO_MMALLOC
- diff -rc --new-file gdb-4.12/gdb/config/m68k/amigados.mt /gnu/src/amiga/gdb-4.12/gdb/config/m68k/amigados.mt
- *** gdb-4.12/gdb/config/m68k/amigados.mt Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/gdb/config/m68k/amigados.mt Fri Jun 17 07:33:51 1994
- ***************
- *** 0 ****
- --- 1,3 ----
- + # Target: Commodore Amiga running AmigaDOS
- + TDEPFILES= m68k-pinsn.o exec.o m68k-tdep.o
- + TM_FILE= tm-amigados.h
- diff -rc --new-file gdb-4.12/gdb/config/m68k/nm-amigados.h /gnu/src/amiga/gdb-4.12/gdb/config/m68k/nm-amigados.h
- *** gdb-4.12/gdb/config/m68k/nm-amigados.h Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/gdb/config/m68k/nm-amigados.h Fri Jun 17 07:33:52 1994
- ***************
- *** 0 ****
- --- 1,26 ----
- + /* Native-dependent definitions for Commodore Amiga running AmigaDOS.
- + Copyright 1994 Free Software Foundation, Inc.
- + Written by Fred Fish (fnf@cygnus.com)
- +
- + This file is part of GDB.
- +
- + This program is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 2 of the License, or
- + (at your option) any later version.
- +
- + This program is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + GNU General Public License for more details.
- +
- + You should have received a copy of the GNU General Public License
- + along with this program; if not, write to the Free Software
- + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
- +
- + #ifndef NM_AMIGADOS_H
- + #define NM_AMIGADOS_H
- +
- + /* Stuff goes here... */
- +
- + #endif /* NM_AMIGADOS_H */
- diff -rc --new-file gdb-4.12/gdb/config/m68k/tm-amigados.h /gnu/src/amiga/gdb-4.12/gdb/config/m68k/tm-amigados.h
- *** gdb-4.12/gdb/config/m68k/tm-amigados.h Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/gdb/config/m68k/tm-amigados.h Fri Jun 17 07:33:53 1994
- ***************
- *** 0 ****
- --- 1,64 ----
- + /* Macro definitions for GDB on a Commodore Amiga running AmigaDOS.
- + Copyright (C) 1994, Free Software Foundation, Inc.
- + Written by Fred Fish at Cygnus Support (fnf@cygnus.com)
- +
- + This file is part of GDB.
- +
- + This program is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 2 of the License, or
- + (at your option) any later version.
- +
- + This program is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + GNU General Public License for more details.
- +
- + You should have received a copy of the GNU General Public License
- + along with this program; if not, write to the Free Software
- + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
- +
- + /* Define BPT_VECTOR if it is different than the default.
- + This is the vector number used by traps to indicate a breakpoint. */
- +
- + #define BPT_VECTOR 0x1
- +
- + /* How much to decrement the PC after a trap. Depends on kernel. */
- +
- + #define DECR_PC_AFTER_BREAK 0 /* No decrement required */
- +
- + /* Use the alternate method of determining valid frame chains. */
- +
- + #define FRAME_CHAIN_VALID_ALTERNATE
- +
- + #include "m68k/tm-m68k.h"
- +
- + /* Offsets (in target ints) into jmp_buf. Not defined in any system header
- + file, so we have to step through setjmp/longjmp with a debugger and figure
- + them out. As a double check, note that <setjmp> defines _JBLEN as 13,
- + which matches the number of elements we see saved by setjmp(). */
- +
- + #define JB_ELEMENT_SIZE sizeof(int) /* jmp_buf[_JBLEN] is array of ints */
- +
- + #define JB_D2 0
- + #define JB_D3 1
- + #define JB_D4 2
- + #define JB_D5 3
- + #define JB_D6 4
- + #define JB_D7 5
- + #define JB_A1 6
- + #define JB_A2 7
- + #define JB_A3 8
- + #define JB_A4 9
- + #define JB_A5 10
- + #define JB_A6 11
- + #define JB_A7 12
- +
- + #define JB_PC JB_A1 /* Setjmp()'s return PC saved in A1 */
- +
- + /* Figure out where the longjmp will land. Slurp the args out of the stack.
- + We expect the first arg to be a pointer to the jmp_buf structure from which
- + we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
- + This routine returns true on success */
- +
- + #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
- diff -rc --new-file gdb-4.12/gdb/config/m68k/xm-amigados.h /gnu/src/amiga/gdb-4.12/gdb/config/m68k/xm-amigados.h
- *** gdb-4.12/gdb/config/m68k/xm-amigados.h Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/gdb/config/m68k/xm-amigados.h Fri Jun 17 07:33:53 1994
- ***************
- *** 0 ****
- --- 1,23 ----
- + /* Macro definitions for GDB on a Commodore Amiga running AmigaDOS.
- + Copyright 1994 Free Software Foundation, Inc.
- + Written by Fred Fish at Cygnus Support (fnf@cygnus.com)
- +
- + This file is part of GDB.
- +
- + This program is free software; you can redistribute it and/or modify
- + it under the terms of the GNU General Public License as published by
- + the Free Software Foundation; either version 2 of the License, or
- + (at your option) any later version.
- +
- + This program is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + GNU General Public License for more details.
- +
- + You should have received a copy of the GNU General Public License
- + along with this program; if not, write to the Free Software
- + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
- +
- + /* Pick up most of what we need from the generic m68k host include file. */
- +
- + #include "m68k/xm-m68k.h"
- diff -rc --new-file gdb-4.12/gdb/configure.in /gnu/src/amiga/gdb-4.12/gdb/configure.in
- *** gdb-4.12/gdb/configure.in Thu Feb 3 17:05:09 1994
- --- /gnu/src/amiga/gdb-4.12/gdb/configure.in Fri Jun 17 07:33:54 1994
- ***************
- *** 68,73 ****
- --- 68,74 ----
- m68*-apollo*-bsd*) gdb_host=apollo68b ;;
- m68*-att-*) gdb_host=3b1 ;;
- m68*-bull*-sysv*) gdb_host=dpx2 ;;
- + m68*-cbm-amigados*) gdb_host=amigados ;;
- m68*-cbm-sysv4*) gdb_host=amix ;;
- m68*-hp-bsd*) gdb_host=hp300bsd ;;
- m68*-hp-hpux*) gdb_host=hp300hpux ;;
- ***************
- *** 221,226 ****
- --- 222,228 ----
- m68000-*-sunos3*) gdb_target=sun2os3 ;;
- m68000-*-sunos4*) gdb_target=sun2os4 ;;
-
- + m68*-cbm-amigados*) gdb_target=amigados ;;
- m68*-cbm-sysv4*) gdb_target=amix ;;
- m68*-bull-sysv*) gdb_target=dpx2 ;;
- m68*-hp-bsd*) gdb_target=hp300bsd ;;
- diff -rc --new-file gdb-4.12/gdb/dbxread.c /gnu/src/amiga/gdb-4.12/gdb/dbxread.c
- *** gdb-4.12/gdb/dbxread.c Thu Feb 3 16:41:07 1994
- --- /gnu/src/amiga/gdb-4.12/gdb/dbxread.c Fri Jun 17 07:33:55 1994
- ***************
- *** 2146,2151 ****
- --- 2146,2161 ----
- dbx_symfile_read (objfile, section_offsets, mainline);
- }
-
- + /* Called from amigaread.c */
- + void
- + amiga_symfile_read (objfile, section_offsets, mainline)
- + struct objfile *objfile;
- + struct section_offsets *section_offsets;
- + int mainline;
- + {
- + dbx_symfile_read (objfile, section_offsets, mainline);
- + }
- +
- /* Parse the user's idea of an offset for dynamic linking, into our idea
- of how to represent it for fast symbol reading. */
-
- diff -rc --new-file gdb-4.12/libiberty/config/mh-amigados /gnu/src/amiga/gdb-4.12/libiberty/config/mh-amigados
- *** gdb-4.12/libiberty/config/mh-amigados Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/libiberty/config/mh-amigados Fri Jun 17 07:33:56 1994
- ***************
- *** 0 ****
- --- 1,6 ----
- + # Host makefile fragment for Commodore Amiga running AmigaDOS.
- +
- + # Use GNU C. There is no default system compiler.
- + CC=gcc
- + # Don't use -g since we don't really support it yet. Use -O instead though.
- + CFLAGS=-O
- diff -rc --new-file gdb-4.12/libiberty/config.table /gnu/src/amiga/gdb-4.12/libiberty/config.table
- *** gdb-4.12/libiberty/config.table Thu Feb 3 16:48:12 1994
- --- /gnu/src/amiga/gdb-4.12/libiberty/config.table Fri Jun 17 07:33:57 1994
- ***************
- *** 19,22 ****
- --- 19,23 ----
- *-*-solaris2*) frag=mh-sysv4 ;;
- *-*-sysv4*) frag=mh-sysv4 ;;
- *-*-sysv*) frag=mh-sysv ;;
- + *-*-amigados*) frag=mh-amigados ;;
- esac
- diff -rc --new-file gdb-4.12/mmalloc/config/mh-amigados /gnu/src/amiga/gdb-4.12/mmalloc/config/mh-amigados
- *** gdb-4.12/mmalloc/config/mh-amigados Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/mmalloc/config/mh-amigados Fri Jun 17 07:33:58 1994
- ***************
- *** 0 ****
- --- 1,7 ----
- + # Host configuration for Commodore Amiga running AmigaDOS.
- + # We don't actually use libmmalloc.a, since there is no sbrk(),
- + # but this allows us to compile it (and then ignore it).
- +
- + CC=gcc
- + # We don't need -g yet, so do -O instead.
- + CFLAGS=-O
- diff -rc --new-file gdb-4.12/mmalloc/configure.in /gnu/src/amiga/gdb-4.12/mmalloc/configure.in
- *** gdb-4.12/mmalloc/configure.in Thu Feb 3 16:48:23 1994
- --- /gnu/src/amiga/gdb-4.12/mmalloc/configure.in Fri Jun 17 07:33:59 1994
- ***************
- *** 15,20 ****
- --- 15,21 ----
- *-*-solaris2*) host_makefile_frag=config/mh-sysv4 ;;
- *-*-sunos4*) host_makefile_frag=config/mh-sunos4 ;;
- *-*-sysv4*) host_makefile_frag=config/mh-sysv4 ;;
- + *-*-amigados*) host_makefile_frag=config/mh-amigados ;;
- esac
-
- # per-target:
- diff -rc --new-file gdb-4.12/readline/config/mh-amigados /gnu/src/amiga/gdb-4.12/readline/config/mh-amigados
- *** gdb-4.12/readline/config/mh-amigados Thu Jan 1 00:00:00 1970
- --- /gnu/src/amiga/gdb-4.12/readline/config/mh-amigados Fri Jun 17 07:34:00 1994
- ***************
- *** 0 ****
- --- 1,10 ----
- + # Host makefile fragment for Commodore Amiga running AmigaDOS.
- + # Use the GNU C compiler.
- + CC=gcc
- + # Don't use -g for now, it isn't useful and may just bloat the
- + # executable. But do optimize.
- + CFLAGS=-O
- + # Use the GNU install program.
- + INSTALL_PROG = /bin/install -c
- + # The system doesn't distinguish users.
- + H_CFLAGS = -DNOT_MULTIUSER
- diff -rc --new-file gdb-4.12/readline/configure.in /gnu/src/amiga/gdb-4.12/readline/configure.in
- *** gdb-4.12/readline/configure.in Thu Feb 3 16:47:47 1994
- --- /gnu/src/amiga/gdb-4.12/readline/configure.in Fri Jun 17 07:34:00 1994
- ***************
- *** 28,33 ****
- --- 28,34 ----
- i[34]86-*-sco*) host_makefile_frag=config/mh-sco; files=sysdep-sco.h ;;
- i[34]86-*-isc*) host_makefile_frag=config/mh-isc ;;
- m68k-apollo-sysv*) host_makefile_frag=config/mh-apollo68v ;;
- + m68k-cbm-amigados*) host_makefile_frag=config/mh-amigados ;;
- *-*-sysv*) host_makefile_frag=config/mh-sysv ;;
- *-*-m88kbcs*) host_makefile_frag=config/mh-sysv ;;
- i[34]86-*-linux*) host_makefile_frag=config/mh-posix ;;
- diff -rc --new-file gdb-4.12/readline/readline.c /gnu/src/amiga/gdb-4.12/readline/readline.c
- *** gdb-4.12/readline/readline.c Thu Feb 3 16:47:49 1994
- --- /gnu/src/amiga/gdb-4.12/readline/readline.c Fri Jun 17 07:34:02 1994
- ***************
- *** 180,185 ****
- --- 180,190 ----
- #include <pwd.h>
- #endif /* __MSDOS__ */
-
- + #ifdef amigados
- + #define tcflow(a,b) /* Hack, this is missing from ixemul.library */
- + #define tcsetattr(a,b,c) /* But this isn't? */
- + #endif
- +
- #if defined (USG) && !defined (isc386) && !defined (sgi)
- struct passwd *getpwuid (), *getpwent ();
- #endif
- ***************
- *** 4135,4141 ****
- int state;
- char *text;
- {
- ! #ifdef __GO32__
- return (char *)NULL;
- #else /* !__GO32__ */
- static char *username = (char *)NULL;
- --- 4140,4146 ----
- int state;
- char *text;
- {
- ! #if defined (__GO32__) || defined (NOT_MULTIUSER)
- return (char *)NULL;
- #else /* !__GO32__ */
- static char *username = (char *)NULL;
-