Commit Graph

106 Commits

Author SHA1 Message Date
Andrew Cagney 14a5e76714 * language.c (local_hex_string_custom): Simplify. Do not depend
on PRINTF_HAS_LONG_LONG or CC_HAS_LONG_LONG.

* memattr.c (mem_info_command): Replace calls to
longest_local_hex_string and longest_local_hex_string_custom.
* buildsym.c (make_blockvector): Ditto.
* solib.c (info_sharedlibrary_command): Ditto.
* tracepoint.c (tracepoints_info): Ditto.
* symtab.c (print_msymbol_info): Ditto.

* language.c (local_hex_string): Delete.
(local_hex_string_custom): Delete.
(longest_local_hex_string): Rename to local_hex_string.
(longest_local_hex_string_custom): Rename to
local_hex_string_custom.
* language.h (local_hex_string): Change parameter type to LONGEST.
(local_hex_string_custom): Ditto.
(longest_local_hex_string): Delete declaration.
(longest_local_hex_string_custom): Ditto.

* solib.c: Update copyright.
* memattr.c: Update copyright.
2002-05-12 04:20:06 +00:00
Andrew Cagney 5ba2abebe7 * cli/cli-decode.c (set_cmd_completer): New function.
* command.h (set_cmd_completer): Declare.
* cli/cli-decode.h (set_cmd_completer): Ditto.

* breakpoint.c (_initialize_breakpoint): Use set_cmd_completer.
* cli/cli-cmds.c (init_cli_cmds): Ditto.
* win32-nat.c (_initialize_inftarg): Ditto.
* remote-rdi.c (_initialize_remote_rdi): Ditto.
* proc-api.c (_initialize_proc_api): Ditto.
* hppa-tdep.c (_initialize_hppa_tdep): Ditto.
* source.c (_initialize_source): Ditto.
* exec.c (_initialize_exec): Ditto.
* solib.c (_initialize_solib): Ditto.
* top.c (init_main): Ditto.
* tracepoint.c (_initialize_tracepoint): Ditto.
* symfile.c (_initialize_symfile): Ditto.
* printcmd.c (_initialize_printcmd): Ditto.
* infcmd.c (_initialize_infcmd): Ditto.
* corefile.c (_initialize_core): Ditto.
2002-03-06 06:28:35 +00:00
Andrew Cagney 81a9a963a1 * memattr.c (mem_command): Eliminate ``true'' and ``false''.
* osfsolib.c (solib_map_sections): Ditto.
* irix5-nat.c (solib_map_sections): Ditto.
* corelow.c (gdb_check_format): Ditto.
* symfile.c (symfile_bfd_open): Ditto.
* solib.c (solib_map_sections): Ditto.
Partially fix PR gdb/354.
2002-02-27 01:40:36 +00:00
Michael Snyder c7cccb7613 2002-01-07 Michael Snyder <msnyder@redhat.com>
* solib.c (info_sharedlibrary_command): Use TARGET_PTR_BIT
	instead of bfd_get_arch_size.  Don't bail out just because
	there's no exec_bfd.
2002-01-08 18:55:26 +00:00
Orjan Friberg ba5f0d88f3 2001-12-04 Orjan Friberg <orjanf@axis.com>
* solib.c (solib_open): Make path relative if search for absolute path
	failed.  If search for relative path in solib_search_path failed, fall
	back to search for basename only.
2001-12-04 09:34:56 +00:00
Fred Fish 990f9fe3aa Approved by kev@cygnus.com
ChangeLog entry:

	2001-11-01  Fred Fish  <fnf@redhat.com>

	* coff-solib.c (coff_solib_add): Add new readsyms arg.
	* irix5-nat.c (solib_add): Ditto.
	* osfsolib.c (solib_add): Ditto.
	* pa64solib.c (pa64_solib_add): Ditto.
	* pa64solib.c (add_to_solist): Ditto.
	* pa64solib.c (read_dld_descriptor): Ditto.
	* solib.c (solib_add): Ditto.
	* somsolib.c (som_solib_add): Ditto.
	* win32-nat.c (child_solib_add): Ditto.
	* xcoffsolib.c (solib_add): Ditto.

	* coff-solib.h (coff_solib_add): Add new readsyms arg to prototype.
	* pa64solib.c (add_to_solist): Ditto.
	* pa64solib.c (read_dld_descriptor): Ditto.
	* pa64solib.h (pa64_solib_add): Ditto.
	* solib.h (solib_add): Ditto.
	* somsolib.h (som_solib_add): Ditto.
	* config/i386/tm-cygwin.h (child_solib_add): Ditto.

	* coff-solib.c (coff_solib_add):  If readsyms is zero don't read
	symbols but do any other needed work for shared libs.
	* irix5-nat.c: Ditto.
	* osfsolib.c (solib_add): Ditto.
	* solib.c (solib_add): Ditto.
	* win32-nat.c (child_solib_add): Ditto.
	* xcoffsolib.c (solib_add): Ditto.

	* irix5-nat.c (sharedlibrary_command): Pass 1 as readsyms to
	solib_add to force reading of shared library symbols.
	* osfsolib.c (sharedlibrary_command;): Ditto.
	* pa64solib.c (pa64_solib_sharedlibrary_command): Ditto.
	* solib.c (sharedlibrary_command): Ditto.
	* somsolib.c (som_solib_sharedlibrary_command): Ditto.
	* xcoffsolib.c (sharedlibrary_command): Ditto.

	* coff-solib.c (coff_solib_create_inferior_hook): Call solib_add
	unconditionally with auto_solib_add.
	* irix5-nat.c (solib_create_inferior_hook): Ditto.
	* osfsolib.c (solib_create_inferior_hook): Ditto.
	* solib.c (solib_create_inferior_hook): Ditto.
	* solib-osf.c (osf_solib_create_inferior_hook): Ditto.
	* solib-svr4.c (enable_break): Ditto.
	* solib-sunos.c (sunos_solib_create_inferior_hook): Ditto.

	* corelow.c (solib_add_stub): Add auto_solib_add to args passed
	via SOLIB_ADD.
	* sol-thread.c (sol_thread_attach): Ditto.
	* config/rs6000/nm-rs6000.h (SOLIB_ADD): Ditto.

	* infcmd.c (attach_command): Remove auto_solib_add decl.
	Call SOLIB_ADD directly with auto_solib_add.
	* infrun.c (handle_inferior_event): Ditto.

	* coff-solib.h (SOLIB_ADD): Add readsyms arg.
	* pa64solib.h (SOLIB_ADD): Ditto.
	* solib.h (SOLIB_ADD): Ditto.
	* somsolib.h (SOLIB_ADD): Ditto.
	* config/i386/tm-cygwin.h (SOLIB_ADD): Ditto.

	* fork-child.c (clone_and_follow_inferior): Remove unused
	auto_solib_add decl.

	* pa64solib.c (pa64_solib_add): Call add_to_solist with readsyms.
	(read_dld_descriptor): Ditto.
	(pa64_solib_add): Call read_dld_descriptor with	readsyms.
	(pa64_solib_in_dynamic_linker): Ditto.

	* corelow.c (symfile.h): Need this for auto_solib_add declaration.
	* sol-thread.c (symfile.h): Ditto.

Approved by eliz@is.elta.co.il
doc/ChangeLog entry:

	2001-11-01  Fred Fish  <fnf@redhat.com>

	* gdbint.texinfo (SOLIB_ADD): Document additional new
	"readsyms" arg.
2001-11-01 16:17:08 +00:00
Fred Fish b7209cb4ed Changes approved by kev@cygnus.com, ezannoni@cygnus.com, eliz@is.elta.co.il.
Changelog:

	2001-10-27  Fred Fish  <fnf@redhat.com>

	* symfile.c (auto_solib_add): Update comment to note that
	this variable is now just used as a boolean to control shlib
	autoloading, and clarify when it is used.
	* symfile.h (auto_solib_add): Ditto.

	* symfile.c (auto_solib_limit): New variable that holds the
	autoloading threshold instead of overloading auto_solib_add.
	* symfile.h (auto_solib_limit): Ditto.

	* irix5-nat.c (_initialize_solib): Change auto-solib-add
	variable from var_zinteger to var_boolean and update help.
	* osfsolib.c (_initialize_solib): Ditto.
	* pa64solib.c (_initialize_pa64_solib): Ditto.
	* solib.c (_initialize_solib): Ditto.
	* somsolib.c (_initialize_som_solib): Ditto.
	* xcoffsolib.c (_initialize_solib): Ditto.

	* pa64solib.c (pa64_solib_total_st_size): Update comment to
	note that the new auto_solib_limit variable is used instead
	of overloading auto_solib_add variable.
	(_initialize_pa64_solib): Ditto.
	* somsolib.c (som_solib_total_st_size): Ditto.
	(_initialize_som_solib): Ditto.

	* pa64solib.c (_initialize_pa64_solib): Add new set/show
	commands for auto-solib-limit variable.
	* somsolib.c (_initialize_som_solib): Ditto

	* pa64solib.c (add_to_solist): Check that auto_solib_add is
	set and use auto_solib_limit as the threshold size instead
	of auto_solib_add.
	* somsolib.c (som_solib_add): Ditto, and also change warning
	text about size threshold exceeded.

  doc/ChangeLog:

	2001-10-28  Fred Fish  <fnf@redhat.com>

	* gdb.texinfo (auto-solib-add): Change docs to match
	implementation change.
	(auto-solib-limit): Add docs for new variable.
2001-10-30 04:05:36 +00:00
Kevin Buettner 2069d78d3c Commit Ilya Golubev's clear_solib() fixes. 2001-09-14 00:40:29 +00:00
Eli Zaretskii fe4e3eb861 * source.c (mod_path, openp): Use HAVE_DOS_BASED_FILE_SYSTEM
instead of system-specific define's like _WIN32 and __MSDOS__.
	Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH instead of SLASH_P and
	ROOTED_P.
	(top-level): #include "filenames.h".

	* solib.c (solib_open): Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH
	instead of SLASH_CHAR, ROOTED_P and SLASH_P.
	(top-level): #include "filenames.h".

	* defs.h (SLASH_P, SLASH_CHAR, ROOTED_P): Remove definitions.
	(SLASH_STRING): Define only for _WIN32.

	* completer.c: Use HAVE_DOS_BASED_FILE_SYSTEM instead of
	__MSDOS_.

	* cli/cli-cmds.c (cd_command): Use IS_DIR_SEPARATOR and
	IS_ABSOLUTE_PATH instead of SLASH_P and ROOTED_P.  Replace
	system-specific ifdefs with HAVE_DOS_BASED_FILE_SYSTEM.
	(top-level): #include "filenames.h".
2001-06-04 07:45:08 +00:00
Nicholas Duffek b41be06e3b * solib.c (update_solib_list): Move target_resize_to_sections()
into solib_map_sections() loop.
	(info_sharedlibrary_command): Try bfd_arch_bits_per_address() if
	bfd_get_arch_size() fails.
2001-05-26 00:55:11 +00:00
Michael Snyder cb0ba49e37 2001-05-14 Michael Snyder <msnyder@redhat.com>
* solib.c, solib.h: Add comment for function no_shared_libraries.
2001-05-14 18:45:45 +00:00
Michael Snyder e89a47777f Fix thinko. 2001-04-17 23:22:52 +00:00
Michael Snyder c60a7562e3 2001-04-17 Michael Snyder <msnyder@redhat.com>
* solib.c (no_shared_libraries): New function.  Discard all symbols
	from shared libraries.
	(_initialize_solib): Add command "nosharedlibrary" as complement
	to the command "sharedlibrary".  Unloads symbols for all solibs.
2001-04-17 23:21:48 +00:00
Kevin Buettner b6ba6518e9 Update/correct copyright notices. 2001-03-06 08:22:02 +00:00
Kevin Buettner d7fa2ae254 Made changes to shared library support and added more of the support needed
for AIX/IA-64.
2001-02-22 03:01:27 +00:00
Martin Hunt a43ad351c8 2001-02-20 Martin M. Hunt <hunt@redhat.com>
* solib.c (info_sharedlibrary_command): Don't assume pointers
	are the same size of long, call	longest_local_hex_string_custom().
2001-02-20 18:07:17 +00:00
Eli Zaretskii fa58ee1196 * demangle.c (demangling_style_names): New variable.
(_initialize_demangler): Fill demangling_style_names with the
	names of known demangling styles from libiberty_demanglers[].  Use
	add_set_enum_cmd instead of add_set_cmd, to get completion on
	demangling style names.

	* proc-api.c (_initialize_proc_api): Make `procfs-file' use
	file-name completion.

	* remote-rdi.c (_initialize_remote_rdi): Ditto for `rdilogfile'.

	* solib.c (_initialize_solib): Ditto for `solib-search-path' and
	`solib-absolute-prefix'.

	* tracepoint.c (_initialize_tracepoint): Ditto for
	`save-tracepoints'.

	* win32-nat.c (_initialize_inftarg): Ditto for `dll-symbols'.

	* cli/cli-cmds.c (init_cli_cmds): Make `shell' and `make' use
	file-name completion.

	* infcmd.c (_initialize_infcmd): Make the following commands use
	the file-name completer: `tty', `args', `path', `paths', and
	`run'.
2001-02-19 11:47:16 +00:00
Andrew Cagney 8e65ff28b0 Add __FILE__ and __LINE__ parameter to internal_error() /
internal_verror().
2001-02-08 06:03:54 +00:00
Andrew Cagney 4fcf66da88 Replace strsave() with xstrdup(). 2001-01-31 01:24:03 +00:00
Mark Kettenis b21f0843bf * solib.c (solib_open): If path is relative, look for it
literally.  This matches the behaviour of the GNU dynamic linker
more closely.
2000-12-23 00:27:20 +00:00
Kevin Buettner b8c9b27d1e Replace free() with xfree(). 2000-12-15 01:01:51 +00:00
Andrew Cagney 7f7e9482db * remote.c (remote_write_bytes): Add default case to switch
initializing ``todo''. Ditto for ``nr_bytes''.
* top.c (catch_errors): Always initialize ``val''.
* solib.c (info_sharedlibrary_command): Handle bfd_get_arch_size
returning an unknown size.
* gdbtypes.c (count_virtual_fns): Always initialize ``vfuncs''.
* breakpoint.c (break_at_finish_at_depth_command_1): Initialise
extra_args to NULL.
(break_at_finish_command_1): Ditto.
2000-11-27 02:18:44 +00:00
Kevin Buettner a7ec76fe2f * solib.c (solib_open): Handle the case where
solib_absolute_prefix is NULL.
2000-11-21 09:23:32 +00:00
Michael Snyder e4f7b8c818 2000-11-20 Michael Snyder <msnyder@cleaver.cygnus.com>
* solist.h: Declare new function solib_open.
        * solib.c (solib_open): New function.  Abstracts some of the
        code from solib_map_sections, for finding the binary solib file.
        (solib_map_sections): Call solib_open.
        * solib-svr4.c (enable_break): Call solib_open.
2000-11-21 01:09:54 +00:00
Kevin Buettner 749499cbc4 solib.c relocation improvements 2000-10-30 23:31:17 +00:00
Kevin Buettner 13437d4b4b Reorganize solib.c. 2000-10-24 20:05:36 +00:00
Andrew Cagney 55e0deaaae * solib.c (open_symbol_file_object): Update function signature to
match catch_errors function argument.
2000-10-24 14:42:21 +00:00
Kevin Buettner 7ff096288f Protoization. 2000-10-20 00:44:49 +00:00
Kevin Buettner 359431fb6d Rename bfd_elf_get_arch_size to bfd_get_arch_size(). 2000-08-31 00:39:10 +00:00
Michael Snyder 23e049712d 2000-08-29 Michael Snyder <msnyder@seadog.cygnus.com>
* valops.c (value_cast): Indentation fix-up.
        * acconfig.h (HAVE_PRGREGSET32_T, HAVE_PRFPREGSET32_T,
        HAVE_STRUCT_LINK_MAP32): New configure macros.
        * config.in: Ditto.
        * configure.in: Test for the above new macros.
        * breakpoint.c: Update copyright date.
        * core-sol2.c: Include v9/sys/privregs.h directly to
        work around a bug in Sun's Solaris 8 header files.
        (fetch_core_registers): Use the above new configure macros to
        handle cross-debugging of 32-bit core files on a 64-bit host.
        * sol-thread.c (ps_pdmodel) New function.
        (rw_common): For debugging of 32-bit apps on a 64-bit host,
        truncate addresses to 32 bits.
        * solib.c (solib_extract_address): Functionize.  Make 32/64 aware.
        (LM_ADDR, LM_NEXT, LM_NAME): Ditto.
        (IGNORE_FIRST_LINK_MAP): Ditto.
        (first_link_map_member): Make 32/64 aware.
        (open_symbol_file_object): Ditto.
        (current_sos): Ditto.
2000-08-30 00:58:58 +00:00
Michael Snyder 35fc82857e 2000-08-09 Michael Snyder <msnyder@cleaver.cygnus.com>
* blockframe.c (sigtramp_saved_pc): Use dynamic allocation,
        since TARGET_PTR_BIT is no longer a constant (MULTI_ARCH).
        * irix4-nat.c (get_longjmp_target): Ditto.
        * irix5-nat.c (get_longjmp_target): Ditto.
        * jv-valprint.c (java_value_print): Ditto.
        * m3-nat.c (get_cprocs):            Ditto.
        * m68k-tdep.c (get_longjmp_target): Ditto.
        * mips-nat.c  (get_longjmp_target): Ditto.
        * mipsv4-nat.c(get_longjmp_target): Ditto.
        * pa64solib.c (read_dynamic_info):  Ditto.
        * solib.c (elf_locate_base):        Ditto.
2000-08-09 20:09:01 +00:00
Mark Kettenis 8554b7d530 * solib.c (bfd_lookup_symbol): Fall back on the dynamic symbol
table if the symbol couldn't be found in the normal symbol table
(i.e. if the shared object in question was stripped).
2000-08-07 10:56:22 +00:00
Kevin Buettner fba45db2fa Protoization. 2000-07-30 01:48:28 +00:00
Andrew Cagney 6ceadee453 * solib.c (elf_locate_base, info_sharedlibrary_command): Rename
bfd_elf_get_arch_size to bfd_get_arch_size.
2000-07-19 02:55:55 +00:00
Kevin Buettner a14ed312fd PARAMS removal. 2000-05-28 01:12:42 +00:00
Andrew Cagney 74b7792f0f Purge (almost) make_cleanup_func. 2000-05-22 09:02:23 +00:00
Andrew Cagney 56e290f494 Cleanup discard_minimal_symbols cleanup. 2000-05-16 04:07:39 +00:00
Elena Zannoni 9e12421610 2000-05-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* solib.c (symbol_add_stub): Remember the index and the name of
        the section with the lowest address. Use this data (instead of
        data from .text) to pass info into symbol_file_add.

        * elfread.c (record_minimal_symbol_and_info): Use the section
        where the symbol lives to get the index, instead of guessing.
2000-05-11 00:36:17 +00:00
Michael Snyder f5b8946ca6 2000-05-03 Michael Snyder <msnyder@seadog.cygnus.com>
* solib.c (elf_locate_base, info_sharedlibrary_command):
        Look at the bfd to determine if it is elf32 or elf64, rather
        than using an ifdef.  This makes it runtime teststable and
        multi-arch.
2000-05-05 18:14:27 +00:00
Elena Zannoni e7cf9df194 2000-04-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* symfile.h (struct section_addr_info ): Remove fields for special
 	treatment of .text, .data and .bss sections.

	* solib.c (symbol_add_stub): The special field text_addr is not
 	available anymore. Search for the .text field the hard way.

	* symfile.c (build_section_addr_info_from_section_table): Don't
 	fill in {text, data, bss}_addr any more.
	(default_symfile_offsets): Don't use {text, data, bss}_addr fields
 	to fill in section_offsets for objfile.
	(syms_from_objfile): Don't deal with {text, data, bss}_addr as a
 	special case anymore.
        (add_symbol_file_command): Ditto.
2000-04-17 16:09:04 +00:00
Jim Blandy 105b175f27 * solib.c (update_solib_list): New function.
(solib_add): Call update_solib_list, and then read symbols.
(info_sharedlibrary_command): Call update_solib_list, not
solib_add.
2000-04-05 20:40:22 +00:00
H.J. Lu 8898755195 2000-04-03 H.J. Lu <hjl@gnu.org>
* gdb_regex.h: New. Include "regex.h" if USE_INCLUDED_REGEX
	is defined and <regex.h> otherwise.

        * irix5-nat.c: Include "gdb_regex.h" instead of "gnu-regex.h".
	* monitor.c: Likewise.
	* osfsolib.c: Likewise.
	* solib.c: Likewise.
	* source.c: Likewise.
	* symtab.c: Likewise.

	* Makefile.in (REGEX): Changed to @REGEX@.
	(REGEX_CFLAGS): New.
	(REGEX1): Removed.
	(ADD_DEPS): Use $(REGEX) instead of $(REGEX1).
	(INTERNAL_WARN_CFLAGS): Add $(REGEX_CFLAGS).

	* configure.in (--with-included-regex): New switch.
	(REGEX): New. Subsstitue @REGEX@ in Makefile.in.
	(REGEX_CFLAGS): New. Subsstitue @REGEX_CFLAGS@ in Makefile.in.
	* configure: Regenerated.
2000-04-04 02:08:52 +00:00
Jim Blandy e8930304b2 * solib.c (solib_add): Move all the code for loading symbol tables
below the code to sort out additions and removals.  That way, we
always catch all loaded shared libraries whose symbols we haven't
grabbed yet.

* solib.c (solib_add): Don't try to free a shared object's objfile
if it doesn't have one.  Duh.

* solib.c (solib_add): If a pattern was given, but it doesn't
match any currently loaded shared libraries, print a message;
don't just be silent.
2000-04-03 17:45:17 +00:00
Michael Snyder 9452d09b0d 2000-03-23 Michael Snyder <msnyder@cleaver.cygnus.com>
* solib.c (open_symbol_file_object): to sneak an int argument
        past catch_errors, instead of casting it to a pointer, simply
        pass it by address.
2000-03-24 23:49:10 +00:00
Kevin Buettner 62557bbcee Make sure section addresses from a shared object are correctly set in
a new struct objfile.
2000-03-21 22:37:42 +00:00
Jim Blandy c2d3b4ed35 * solib.c (solib_add): Delete debugging code. 2000-03-17 20:12:23 +00:00
Jim Blandy 15588ebb21 * solib.c (current_sos): Be more careful about freeing the new
so_list node if an error occurs.
2000-03-16 23:12:42 +00:00
Jim Blandy 07cd4b9723 Deal with the inferior unloading shared objects.
* solib.c (current_sos): New function, replacing find_solib.
(find_solib): Deleted.
(free_so): New function.
(clear_solib): Call free_so, instead of writing it out.
(solib_add): Rewritten: compare the inferior's current list of
shared objects with GDB's list, and do the required loads and
unloads.
(info_sharedlibrary_command, solib_address): Don't use find_solib
to walk the list of shared libraries: call solib_add, and then
walk the list at so_list_head normally.
* objfiles.c (free_objfile): Don't call CLEAR_SOLIB, and don't
detach the core target.  These tasks are taken care of elsewhere.
* target.c (remove_target_sections): New function.
* target.h (remove_target_sections): New declaration.

* solib.c (symbol_add_stub): Check whether we've already created
an objfile for this shared object first, before doing all that
work to compute section addresses, etc.

* objfiles.c (unlink_objfile): Report an internal error if objfile
doesn't occur in the object_files list.

* solib.c (special_symbol_handling): Delete argument; it's not
used.

* solib.c (SOLIB_EXTRACT_ADDRESS):  New macro to extract addresses
from solib structures. Use it throughout solib.c, get rid of all
CORE_ADDR casts.
(struct so_list):  Change type of lmaddr to CORE_ADDR.
(first_link_map_member):  Change return value type to CORE_ADDR,
update callers.
(solib_add_common_symbols):  Change parameter type to CORE_ADDR,
update callers.
(open_symbol_file_object, find_solib):  Change type of lm variable
to CORE_ADDR.
2000-03-15 16:55:07 +00:00
Jim Blandy 9ddea9f1c1 Doc fix. 2000-03-06 18:04:56 +00:00
Jason Molenda 4ce44c668d import gdb-1999-11-16 snapshot 1999-11-17 02:31:06 +00:00