aboutsummaryrefslogtreecommitdiff
path: root/gdb/paread.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1993-01-15 00:06:50 +0000
committerStu Grossman <grossman@cygnus>1993-01-15 00:06:50 +0000
commitfa9265e55deac681e0664cbea1c4367f81cadc68 (patch)
tree9ffbeea1837f03eb79e4fbf80ed448b7d7ff91a0 /gdb/paread.c
parent30ea4a2d918f78e39ce54619fe08d1f26909e10a (diff)
downloadgdb-fa9265e55deac681e0664cbea1c4367f81cadc68.zip
gdb-fa9265e55deac681e0664cbea1c4367f81cadc68.tar.gz
gdb-fa9265e55deac681e0664cbea1c4367f81cadc68.tar.bz2
* hppa-pinsn.c (print_insn): Use read_memory_integer, instead of
read_memory to get byte order right. * hppah-tdep.c (find_unwind_info): Don't read in unwind info anymore. This is done in paread.c now. We expect unwind info to hang off of objfiles, and search all of the objfiles when until we find a match. * (skip_trampoline_code): Cast arg to target_read_memory. * objfiles.h (struct objfile): Add new field obj_private to hold per object file private data (unwind info in this case). * paread.c (read_unwind_info): New routine to read unwind info for the objfile. This data is hung off of obj_private. * tm-hppa.h: Define struct obj_unwind_info, to hold pointers to the unwind info for this objfile. Also define OBJ_UNWIND_INFO to make this easier to access.
Diffstat (limited to 'gdb/paread.c')
-rw-r--r--gdb/paread.c57
1 files changed, 43 insertions, 14 deletions
diff --git a/gdb/paread.c b/gdb/paread.c
index afab674..46a6e3d 100644
--- a/gdb/paread.c
+++ b/gdb/paread.c
@@ -18,20 +18,6 @@ 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. */
-/************************************************************************
- * *
- * NOTICE *
- * *
- * This file is still under construction. When it is complete, this *
- * notice will be removed. Until then, direct any questions or changes *
- * to Fred Fish at Cygnus Support (fnf@cygnus.com) *
- * *
- * FIXME Still needs support for shared libraries. *
- * FIXME Still needs support for core files. *
- * FIXME The ".debug" and ".line" section names are hardwired. *
- * *
- ************************************************************************/
-
#include "defs.h"
#include "bfd.h"
#include "libbfd.h"
@@ -57,6 +43,9 @@ static void
pa_new_init PARAMS ((struct objfile *));
static void
+read_unwind_info PARAMS ((struct objfile *));
+
+static void
pa_symfile_read PARAMS ((struct objfile *, struct section_offsets *, int));
static void
@@ -174,6 +163,44 @@ pa_symtab_read (abfd, addr, objfile)
install_minimal_symbols (objfile);
}
+/* Read in the backtrace information stored in the `$UNWIND_START$' section of
+ the object file. This info is used mainly by find_unwind_entry() to find
+ out the stack frame size and frame pointer used by procedures. We put
+ everything on the psymbol obstack in the objfile so that it automatically
+ gets freed when the objfile is destroyed. */
+
+static void
+read_unwind_info (objfile)
+ struct objfile *objfile;
+{
+ asection *unwind_sec;
+ struct obj_unwind_info *ui;
+
+ ui = obstack_alloc (&objfile->psymbol_obstack,
+ sizeof (struct obj_unwind_info));
+
+ ui->table = NULL;
+ ui->cache = NULL;
+ ui->last = -1;
+
+ unwind_sec = bfd_get_section_by_name (objfile->obfd,
+ "$UNWIND_START$");
+ if (unwind_sec)
+ {
+ int size;
+ int i, *ip;
+
+ size = bfd_section_size (objfile->obfd, unwind_sec);
+ ui->table = obstack_alloc (&objfile->psymbol_obstack, size);
+ ui->last = size / sizeof (struct unwind_table_entry) - 1;
+
+ bfd_get_section_contents (objfile->obfd, unwind_sec, ui->table,
+ 0, size);
+
+ OBJ_UNWIND_INFO (objfile) = ui;
+ }
+}
+
/* Scan and build partial symbols for a symbol file.
We have been initialized by a call to pa_symfile_init, which
currently does nothing.
@@ -230,6 +257,8 @@ pa_symfile_read (objfile, section_offsets, mainline)
pastab_build_psymtabs (objfile, section_offsets, mainline);
+ read_unwind_info(objfile);
+
do_cleanups (back_to);
}