Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/nathanw_sa]: src/gnu/dist/toolchain/gdb Add ignore case for N_WARNING [a...



details:   https://anonhg.NetBSD.org/src/rev/fd336a12aee2
branches:  nathanw_sa
changeset: 504703:fd336a12aee2
user:      tv <tv%NetBSD.org@localhost>
date:      Thu May 31 16:59:16 2001 +0000

description:
Add ignore case for N_WARNING [adapted from gwr].

diffstat:

 gnu/dist/toolchain/gdb/dbxread.c |  2759 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 2759 insertions(+), 0 deletions(-)

diffs (truncated from 2763 to 300 lines):

diff -r 43e056431c19 -r fd336a12aee2 gnu/dist/toolchain/gdb/dbxread.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/gnu/dist/toolchain/gdb/dbxread.c  Thu May 31 16:59:16 2001 +0000
@@ -0,0 +1,2759 @@
+/* Read dbx symbol tables and convert to internal format, for GDB.
+   Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+   Free Software Foundation, Inc.
+
+   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., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* This module provides three functions: dbx_symfile_init,
+   which initializes to read a symbol file; dbx_new_init, which 
+   discards existing cached information when all symbols are being
+   discarded; and dbx_symfile_read, which reads a symbol table
+   from a file.
+
+   dbx_symfile_read only does the minimum work necessary for letting the
+   user "name" things symbolically; it does not read the entire symtab.
+   Instead, it reads the external and static symbols and puts them in partial
+   symbol tables.  When more extensive information is requested of a
+   file, the corresponding partial symbol table is mutated into a full
+   fledged symbol table by going back and reading the symbols
+   for real.  dbx_psymtab_to_symtab() is the function that does this */
+
+#include "defs.h"
+#include "gdb_string.h"
+
+#if defined(USG) || defined(__CYGNUSCLIB__)
+#include <sys/types.h>
+#include <fcntl.h>
+#endif
+
+#include "obstack.h"
+#include "gdb_stat.h"
+#include <ctype.h>
+#include "symtab.h"
+#include "breakpoint.h"
+#include "command.h"
+#include "target.h"
+#include "gdbcore.h"           /* for bfd stuff */
+#include "libaout.h"           /* FIXME Secret internal BFD stuff for a.out */
+#include "symfile.h"
+#include "objfiles.h"
+#include "buildsym.h"
+#include "stabsread.h"
+#include "gdb-stabs.h"
+#include "demangle.h"
+#include "language.h"          /* Needed inside partial-stab.h */
+#include "complaints.h"
+
+#include "aout/aout64.h"
+#include "aout/stab_gnu.h"     /* We always use GNU stabs, not native, now */
+
+
+/* This macro returns the size field of a minimal symbol, which is normally
+   stored in the "info" field.  The macro can be overridden for specific
+   targets (e.g. MIPS16) that use the info field for other purposes.  */
+#ifndef MSYMBOL_SIZE
+#define MSYMBOL_SIZE(msym) ((long) MSYMBOL_INFO (msym))
+#endif
+
+
+/* We put a pointer to this structure in the read_symtab_private field
+   of the psymtab.  */
+
+struct symloc
+  {
+
+    /* Offset within the file symbol table of first local symbol for this
+       file.  */
+
+    int ldsymoff;
+
+    /* Length (in bytes) of the section of the symbol table devoted to
+       this file's symbols (actually, the section bracketed may contain
+       more than just this file's symbols).  If ldsymlen is 0, the only
+       reason for this thing's existence is the dependency list.  Nothing
+       else will happen when it is read in.  */
+
+    int ldsymlen;
+
+    /* The size of each symbol in the symbol file (in external form).  */
+
+    int symbol_size;
+
+    /* Further information needed to locate the symbols if they are in
+       an ELF file.  */
+
+    int symbol_offset;
+    int string_offset;
+    int file_string_offset;
+  };
+
+#define LDSYMOFF(p) (((struct symloc *)((p)->read_symtab_private))->ldsymoff)
+#define LDSYMLEN(p) (((struct symloc *)((p)->read_symtab_private))->ldsymlen)
+#define SYMLOC(p) ((struct symloc *)((p)->read_symtab_private))
+#define SYMBOL_SIZE(p) (SYMLOC(p)->symbol_size)
+#define SYMBOL_OFFSET(p) (SYMLOC(p)->symbol_offset)
+#define STRING_OFFSET(p) (SYMLOC(p)->string_offset)
+#define FILE_STRING_OFFSET(p) (SYMLOC(p)->file_string_offset)
+
+
+/* Remember what we deduced to be the source language of this psymtab. */
+
+static enum language psymtab_language = language_unknown;
+
+/* Nonzero means give verbose info on gdb action.  From main.c.  */
+
+extern int info_verbose;
+
+/* The BFD for this file -- implicit parameter to next_symbol_text.  */
+
+static bfd *symfile_bfd;
+
+/* The size of each symbol in the symbol file (in external form).
+   This is set by dbx_symfile_read when building psymtabs, and by
+   dbx_psymtab_to_symtab when building symtabs.  */
+
+static unsigned symbol_size;
+
+/* This is the offset of the symbol table in the executable file. */
+
+static unsigned symbol_table_offset;
+
+/* This is the offset of the string table in the executable file. */
+
+static unsigned string_table_offset;
+
+/* For elf+stab executables, the n_strx field is not a simple index
+   into the string table.  Instead, each .o file has a base offset in
+   the string table, and the associated symbols contain offsets from
+   this base.  The following two variables contain the base offset for
+   the current and next .o files. */
+
+static unsigned int file_string_table_offset;
+static unsigned int next_file_string_table_offset;
+
+/* .o and NLM files contain unrelocated addresses which are based at
+   0.  When non-zero, this flag disables some of the special cases for
+   Solaris elf+stab text addresses at location 0. */
+
+static int symfile_relocatable = 0;
+
+/* If this is nonzero, N_LBRAC, N_RBRAC, and N_SLINE entries are
+   relative to the function start address.  */
+
+static int block_address_function_relative = 0;
+
+/* The lowest text address we have yet encountered.  This is needed
+   because in an a.out file, there is no header field which tells us
+   what address the program is actually going to be loaded at, so we
+   need to make guesses based on the symbols (which *are* relocated to
+   reflect the address it will be loaded at).  */
+
+static CORE_ADDR lowest_text_address;
+
+/* Non-zero if there is any line number info in the objfile.  Prevents
+   end_psymtab from discarding an otherwise empty psymtab.  */
+
+static int has_line_numbers;
+
+/* Complaints about the symbols we have encountered.  */
+
+struct complaint lbrac_complaint =
+{"bad block start address patched", 0, 0};
+
+struct complaint string_table_offset_complaint =
+{"bad string table offset in symbol %d", 0, 0};
+
+struct complaint unknown_symtype_complaint =
+{"unknown symbol type %s", 0, 0};
+
+struct complaint unknown_symchar_complaint =
+{"unknown symbol descriptor `%c'", 0, 0};
+
+struct complaint lbrac_rbrac_complaint =
+{"block start larger than block end", 0, 0};
+
+struct complaint lbrac_unmatched_complaint =
+{"unmatched N_LBRAC before symtab pos %d", 0, 0};
+
+struct complaint lbrac_mismatch_complaint =
+{"N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d", 0, 0};
+
+struct complaint repeated_header_complaint =
+{"\"repeated\" header file %s not previously seen, at symtab pos %d", 0, 0};
+
+struct complaint unclaimed_bincl_complaint =
+{"N_BINCL %s not in entries for any file, at symtab pos %d", 0, 0};
+
+/* find_text_range --- find start and end of loadable code sections
+
+   The find_text_range function finds the shortest address range that
+   encloses all sections containing executable code, and stores it in
+   objfile's text_addr and text_size members.
+
+   dbx_symfile_read will use this to finish off the partial symbol
+   table, in some cases.  */
+
+static void
+find_text_range (bfd * sym_bfd, struct objfile *objfile)
+{
+  asection *sec;
+  int found_any = 0;
+  CORE_ADDR start, end;
+
+  for (sec = sym_bfd->sections; sec; sec = sec->next)
+    if (bfd_get_section_flags (sym_bfd, sec) & SEC_CODE)
+      {
+       CORE_ADDR sec_start = bfd_section_vma (sym_bfd, sec);
+       CORE_ADDR sec_end = sec_start + bfd_section_size (sym_bfd, sec);
+
+       if (found_any)
+         {
+           if (sec_start < start)
+             start = sec_start;
+           if (sec_end > end)
+             end = sec_end;
+         }
+       else
+         {
+           start = sec_start;
+           end = sec_end;
+         }
+
+       found_any = 1;
+      }
+
+  if (!found_any)
+    error ("Can't find any code sections in symbol file");
+
+  DBX_TEXT_ADDR (objfile) = start;
+  DBX_TEXT_SIZE (objfile) = end - start;
+}
+
+
+
+/* During initial symbol readin, we need to have a structure to keep
+   track of which psymtabs have which bincls in them.  This structure
+   is used during readin to setup the list of dependencies within each
+   partial symbol table. */
+
+struct header_file_location
+{
+  char *name;                  /* Name of header file */
+  int instance;                        /* See above */
+  struct partial_symtab *pst;  /* Partial symtab that has the
+                                  BINCL/EINCL defs for this file */
+};
+
+/* The actual list and controling variables */
+static struct header_file_location *bincl_list, *next_bincl;
+static int bincls_allocated;
+
+/* Local function prototypes */
+
+extern void _initialize_dbxread PARAMS ((void));
+
+static void
+process_now PARAMS ((struct objfile *));
+
+static void
+free_header_files PARAMS ((void));
+
+static void
+init_header_files PARAMS ((void));
+
+static void
+read_ofile_symtab PARAMS ((struct partial_symtab *));
+
+static void
+dbx_psymtab_to_symtab PARAMS ((struct partial_symtab *));
+
+static void
+dbx_psymtab_to_symtab_1 PARAMS ((struct partial_symtab *));
+
+static void
+read_dbx_dynamic_symtab PARAMS ((struct objfile * objfile));
+
+static void
+read_dbx_symtab PARAMS ((struct objfile *));
+
+static void
+free_bincl_list PARAMS ((struct objfile *));
+



Home | Main Index | Thread Index | Old Index