X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fcoff-solib.c;h=64dca7bbefd3eaf53ca9673a14cb9f480031fc86;hb=7d97d5e2b81a23dd6ce2376094f8c7fe574693a8;hp=6be68697928f14ac2ebba7d7128db5cc6a287449;hpb=1996fae84682e8ddd146215dd2959ad1ec924c09;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/coff-solib.c b/gdb/coff-solib.c index 6be6869792..64dca7bbef 100644 --- a/gdb/coff-solib.c +++ b/gdb/coff-solib.c @@ -1,21 +1,22 @@ /* Handle COFF SVR3 shared libraries for GDB, the GNU Debugger. - Copyright 1993 Free Software Foundation, Inc. - -This file is part of GDB. + Copyright 1993, 1994, 1998, 1999, 2000 Free Software Foundation, Inc. -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 file is part of GDB. -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. + 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. -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 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. */ #include "defs.h" @@ -24,36 +25,38 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "gdbcore.h" #include "symtab.h" +#include "symfile.h" +#include "objfiles.h" /* -GLOBAL FUNCTION + GLOBAL FUNCTION - coff_solib_add -- add a shared library files to the symtab list. We - examine the `.lib' section of the exec file and determine the names of - the shared libraries. + coff_solib_add -- add a shared library files to the symtab list. We + examine the `.lib' section of the exec file and determine the names of + the shared libraries. - This function is responsible for discovering those names and - addresses, and saving sufficient information about them to allow - their symbols to be read at a later time. + This function is responsible for discovering those names and + addresses, and saving sufficient information about them to allow + their symbols to be read at a later time. -SYNOPSIS + SYNOPSIS - void coff_solib_add (char *arg_string, int from_tty, - struct target_ops *target) + void coff_solib_add (char *arg_string, int from_tty, + struct target_ops *target, int readsyms) -DESCRIPTION + DESCRIPTION -*/ + */ void -coff_solib_add (arg_string, from_tty, target) - char *arg_string; - int from_tty; - struct target_ops *target; -{ +coff_solib_add (char *arg_string, int from_tty, struct target_ops *target, int readsyms) +{ asection *libsect; + if (!readsyms) + return; + libsect = bfd_get_section_by_name (exec_bfd, ".lib"); if (libsect) @@ -79,7 +82,7 @@ coff_solib_add (arg_string, from_tty, target) int len, nameoffset; char *filename; - ent = (struct libent *)lib; + ent = (struct libent *) lib; len = bfd_get_32 (exec_bfd, ent->len); @@ -88,47 +91,44 @@ coff_solib_add (arg_string, from_tty, target) if (len <= 0) break; - filename = (char *)ent + nameoffset * 4; + filename = (char *) ent + nameoffset * 4; objfile = symbol_file_add (filename, from_tty, - 0, /* addr */ - 0, /* not mainline */ - 0, /* not mapped */ - 0, /* Not readnow */ - 0, /* Not user loaded */ - 1); /* Is a solib */ + NULL, /* no offsets */ + 0, /* not mainline */ + OBJF_SHARED); /* flags */ libsize -= len * 4; lib += len * 4; } /* Getting new symbols may change our opinion about what is - frameless. */ + frameless. */ reinit_frame_cache (); } } /* - -GLOBAL FUNCTION - - coff_solib_create_inferior_hook -- shared library startup support - -SYNOPSIS - - void coff_solib_create_inferior_hook() - -DESCRIPTION - - When gdb starts up the inferior, the kernel maps in the shared - libraries. We get here with the target stopped at it's first - instruction, and the libraries already mapped. At this point, this - function gets called via expansion of the macro - SOLIB_CREATE_INFERIOR_HOOK. - */ - -void -coff_solib_create_inferior_hook() + + GLOBAL FUNCTION + + coff_solib_create_inferior_hook -- shared library startup support + + SYNOPSIS + + void coff_solib_create_inferior_hook() + + DESCRIPTION + + When gdb starts up the inferior, the kernel maps in the shared + libraries. We get here with the target stopped at it's first + instruction, and the libraries already mapped. At this point, this + function gets called via expansion of the macro + SOLIB_CREATE_INFERIOR_HOOK. + */ + +void +coff_solib_create_inferior_hook (void) { - coff_solib_add ((char *) 0, 0, (struct target_ops *) 0); + coff_solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add); }