(fetch_register): New function, uses some of the guts of
go32_fetch_registers and i387_supply_register.
(go32_fetch_registers): Most of the code moved into
fetch_register. Use i387_supply_fsave.
(store_register): Use i387_fill_fsave instead of custom code.
(go32_store_registers): Use i387_fill_fsave.
* Makefile.in (go32-nat.o): Depend on i387-nat.h.
* config/i386/go32.mh (NATDEPFILES): Add i387-nat.o.
* xcoffsolib.c (xcoff_solib_address): Renamed from
pc_load_segment_name. Return NULL if address is not in a shared
library. Cleanup shared library name construction, using xasprintf.
Format shared library member names consistent with format in exec.c.
(solib_info): Format shared library member names consistent with
format in exec.c.
* config/rs6000/nm-rs6000.h: Replace PC_LOAD_SEGMENT with PC_SOLIB,
using xcoff_solib_address for PC_SOLIB definition.
* stack.c (print_frame): Remove PC_LOAD_SEGMENT code, no longer
needed.
Submitted by Paul Hilfinger (hilfingr@gnat.com)
and Andrei Petrov (and@genesyslab.com).
* findvar.c: Buffers of size MAX_REGISTER_RAW_SIZE or REGISTER_BYTES
must be allocated dynamically, since these are no longer constants.
* infcmd.c: Ditto.
* regcache.c: Ditto.
* remote.c: Ditto.
* sol-thread.c: Ditto.
* valops.c: Ditto.
* config/sparc/sun4sol2.mh (MH_CFLAGS): Add -I/usr/include/v9, as a
work-around for a missing Sun header file in solaris for sparc64.
(USE_STRUCT_CONVENTION): Define in terms of
alphabsd_use_struct_convention.
* config/alpha/fbsd.mt (TDEPFILES): Add alphafbsd-tdep.c.
* alphafbsd-tdep.c: New file.
* config/ns32k/tm-umax.h (FRAME_FIND_SAVED_REGS): Restore. It
appears to have been inadvertantly removed sometime in May 1999.
* Revert 2000-11-09 changes where shared library objects were
moved from NATDEPFILES to TDEPFILES on NetBSD targets. While
we'd like to be able to debug dynamically linked executables,
this makes it impossible to build a cross debugger on a many
hosts.
* config/i386/nbsd.mt: Remove solib.o, solib-svr4.o from TDEPFILES.
* config/i386/nbsdelf.mt: Likewise.
* config/m68k/nbsd.mt: Likewise.
* config/ns32k/nbsd.mt: Likewise.
* config/powerpc/nbsd.mt: Likewise.
* config/sparc/nbsd.mt: Likewise.
* config/sparc/nbsdelf.mt: Likewise.
* config/i386/nbsd.mh: Add solib.o, solib-svr4.o to NATDEPFILES.
* config/i386/nbsdelf.mh: Likewise.
* config/m68k/nbsd.mh: Likewise.
* config/ns32k/nbsd.mh: Likewise.
* config/powerpc/nbsd.mh: Likewise.
* config/sparc/nbsd.mh: Likewise.
(i386_extract_return_value): Return directly after issuing the
warning and filling *VALBUF with zeroes if we cannot get at the
floating-point registers.
(i386_store_return_value): New function.
* config/i386/tm-i386.h (STORE_RETURN_VALUE): Simply call
i386_store_return_value.
Add prototype for i386_store_return_value.
* sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh3e_show_regs,
sh3_dsp_show_regs, sh4_show_regs, sh_dsp_show_regs): SR_REGNUM is
now part of gdbarch_tdep structure.
(sh_gdbarch_init): Initialize SR_REGNUM.
* config/sh/tm-sh.h (struct gdbarch_tdep): Add field SR_REGNUM.
* config/sh/tm-sh.h (struct gdbarch_tdep): Rename fields
{FP15,DR14,FV12}_REGNUM to {FP,DR,FV}_LAST_REGNUM.
* sh-tdep.c (sh_sh3e_register_virtual_type,
sh_sh4_register_virtual_type, sh_do_registers_info,
sh_gdbarch_init, sh_sh4_register_byte, sh_sh4_register_raw_size,
sh_sh4_register_convertible, sh_sh4_register_convert_to_virtual,
sh_sh4_register_convert_to_raw, sh_fetch_pseudo_register,
sh_store_pseudo_register, sh_do_pseudo_register): Ditto.
* sh-tdep.c (sh_gdbarch_init): Use a function pointer to set the
disassembly print function.
(_initialize_sh_tdep): Initialize tm_print_insn using the function
pointer.
* config/sh/tm-sh.h (struct gdbarch_tdep): Get rid of
DR{2,4,6,8,10,12}_REGNUM, FV{4,8}_REGNUM, they are not used
anywhere.
* sh-tdep.c (sh_gdbarch_init): Don't initialize
DR{2,4,6,8,10,12}_REGNUM, FV{4,8}_REGNUM.
SOLIB_SYMBOLS_MANUAL code, cleanup of AIX shared library handling code.
* rs6000-nat.c (vmap_symtab): Do not try to modify offsets
if symbols are not yet loaded.
(vmap_add_symbols): New function to add symbols for a vmap entry.
(add_vmap): Turn errors into warnings, return NULL vmap upon
failure. Add symbols via vmap_add_symbols only if requested.
(xcoff_relocate_core): Allow debugging of core files without an
executable file. Handle NULL returns from add_vmap gracefully.
* xcoffsolib.c (solib_add): Remove, no longer needed.
(solib_info): Do not check for new shared libraries if there is no
inferior process.
(sharedlibrary_command): Made static.
Do not check for new shared libraries if there is no inferior process.
Add symbols for requested shared libraries via vmap_add_symbols.
(_initialize_solib): Add `set auto-solib-add' command.
* xcoffsolib.h (vmap_add_symbols): Add prototype declaration.
* config/rs6000/tm-rs6000.h (PC_LOAD_SEGMENT): Move from here ...
* config/rs6000/nm-rs6000.h: ... to here, this is an AIX native
feature.
* config/powerpc/tm-macos.h, config/powerpc/tm-ppc-eabi.h,
config/powerpc/tm-ppc-nw.h, config/rs6000/tm-rs6000ly.h:
Remove #undef PC_LOAD_SEGMENT.
* config/powerpc/aix.mt, config/rs6000/aix4.mt, config/rs6000/rs6000.mt
(TDEPFILES): Move xcoffsolib.o from here ...
* config/powerpc/aix.mh, config/rs6000/aix4.mh, config/rs6000/rs6000.mh
(NATDEPFILES): ... to here, xcoffsolib.o contains AIX native code
only.
* rs6000-tdep.c: Remove #include xcoffsolib.h, no longer needed.
* xcoffsolib.h (xcoff_relocate_symtab_hook): Remove declaration.
* rs6000-nat.c (_initialize_core_rs6000): Remove setting of
xcoff_relocate_symtab_hook, no longer needed.
* xcoffsolib.c (solib_info, sharedlibrary_command): Remove
xcoff_relocate_symtab_hook indirection, call xcoff_relocate_symtab
directly, as xcoffsolib.c is now compiled in native AIX configurations
only.
* Makefile.in: Update dependencies for rs6000-tdep.o, rs6000-nat.o
and xcoffsolib.o.
* config/sh/tm-linux.h: New file. Include generic tm-linux.h,
plus tm-sh.h, then define SVR4_FETCH_LINK_MAP_OFFSETS to use
the sh target function instead of the default link map offsets.
* config/sh/sh.mt: Add solib.o and solib-svr4.o to TDEPFILES.
Use sh/tm-linux.h instead of sh/tm-sh.h.
* sh-tdep.c (sh_linux_svr4_fetch_link_map_offsets):
New function. Construct target-specific link map offsets.
* i386-linux-tdep.c (i386_linux_svr4_fetch_link_map_offsets:
New function. Construct target-specific link map offsets.
* config/i386/tm-linux.h: Use above function instead of default.
2000-10-30 Michael Snyder <msnyder@cleaver.cygnus.com>
* config/i386/tm-linux.h: Remove definition of SVR4_SHARED_LIBS,
and inclusion of solib.h. Move up into ../tm-linux.h.
config/tm-linux.h: Define SVR4_SHARED_LIBS, include solib.h.
OLD_CANNOT_FETCH_REGISTER): New definitions for accessible registers
when accessing the registers via the U area.
(fetch_register, store_register): Use them.
(cannot_fetch_register, cannot_store_register): New functions,
all registers should be accessible if we have GETREGS support.
* config/i386/nm-linux.h: Use cannot_fetch/store_register for
CANNOT_FETCH/STORE_REGISTER definitions.
* i386nbsd-nat.c (i386nbsd_use_struct_convention): Moved from here.
* i386nbsd-tdep.c (i386nbsd_use_struct_convention): To here.
* i386nbsd-tdep.c: New file.
GET_THREAD_SIGNALS): New defines.
* config/i386/linux.mh (NATDEPFILES): Remove lin-thread.o and
linux-threads.o. Add proc-service.o, thread-db.o and lin-lwp.o.
* proc-service.c: New file.
* thread-db.c: New file.
* lin-lwp.c: New file.
argument if it is missing an extension.
* corelow.c: Define O_BINARY if it isn't defined.
(core_open): Open core file in binary mode.
* config/i386/tm-cygwin.h (child_clear_solibs): Rename from child_clear_solib.
* config/i386/cygwin.mh: Add dependency from corelow.o.
* win32-nat.c (register_loaded_dll): New function. Add dll to the list of
currently loaded dlls.
(handle_load_dll): Use register_loaded_dll.
(child_solib_add): Distinguish between active process and core targets.
(solib_symbols_add): Load symbols from loaded dll.
(core_dll_symbols_add): New function. Load symbols from dll referenced in
core.
(core_section_load_dll_symbols): New function.
(dll_code_sections_add): New function.
(map_single_dll_code_section): New function.
(fetch_elf_core_registers): New function.
(_initialize_core_win32): New function.
* i386-linux-nat.c: Various doc fixes. Include "i387-nat.h".
(GETFPXREGS_SUPPLIES): Renamed from GETXFPREGS_SUPPLIES.
(have_ptrace_getfpxregs): Renamed from have_ptrace_getxfpregs.
(convert_to_gregset): Removed. Moved logic to ...
(fill_gregset): ... here. Simplified function.
(fetch_regs): Use perror_with_name for error reporting.
(store_regs): Add `regno' parameter. Use perror_with_name for
error reporting. Call fill_gregset instead of convert_to_gregset.
(FPREG_ADDR): Remove.
(supply_fpregset): Implement by calling i387_supply_fsave.
(convert_to_fpregset): Remove.
(fill_fpregset): Implement by calling i387_fill_fsave.
(fetch_fpregs): Use perror_with_name fro error reporting.
(store_fpregs) Add `regno' parameter. Use perror_with_name fro
error reporting. Call fill_fpregset instead of
convert_to_fpregset.
(supply_xfpregset, convert_to_xfpregset): Removed.
(supply_fpxregset, fill_fpxregset): New functions.
(fetch_fpxregs): Renamed from fetch_xfpregs. Use perror_with_name
for error reporting. Call supply_fpxregset instead of
supply_xfpregset.
(store_xfpregs): Removed.
(store_fpxregs): New function.
(fetch_inferior_registers): Adjust for xfp -> fpx change. Tweak
message in call to internal_error.
(store_inferior_registers): Adjust for xfp ->fpx change. Pass
REGNO to store_regs, store_fpregs and store_fpxregs.
(fetch_core_registers): Adjust for xfp -> fpx change.
* acconfig.h (HAVE_PTRACE_GETFPXREGS): Renamed from
HAVE_PTRACE_GETXFPREGS.
* config.in: Regenerated.
* configure.in: Replace check for PTRACE_GETXFPREGS with check for
PTRACE_GETFPXREGS. Remove comment about Cygnus SSE extensions.
* configure: Regenerated.
* config/i386/linux.mh (NATDEPFILES): Add i387-nat.o.
* config/i386/tm-linux.h: Base definition of HAVE_SSE_REGS on
HAVE_PTRACE_GETFPXREGS instead of HAVE_PTRACE_GETXFPREGS.
(safe_symbol_file_add_cleanup): Reset stdout to saved stdout, not stderr.
(dll_symbol_command): Pass OBJF_USERLOADED to safe_symbol_file_add.
(get_child_debug_event): Always reset last_sig. Always reset inferior pid
appropriately.
(do_initial_child_stuff): New function. Called when attaching or starting a
new inferior process.
(child_attach): Use do_initial_child_stuff.
(child_create_inferior): Ditto.
* config/i386/cygwin.mh (NAT_FILE): Set to modern location.
* config/i386/tm-cygwin.h: Define ATTACH_NO_WAIT.
* configure.tgt: Recognize the 68hc11.
* m68hc11-tdep.c: New file for 68hc11 target.
* config/m68hc11/m68hc11.mt: New file for 68hc11 port.
* configure.tgt: When 68hc11, set gdb_multi_arch.
* sh-tdep.c (sh_sh4_register_name, sh_sh4_register_byte,
sh_sh4_register_raw_size, sh_sh4_register_virtual_type,
sh_fetch_pseudo_register, sh_store_pseudo_register,
sh_do_pseudo_register, sh_gdbarch_init): Fix names for pseudoregs,
they should be numbered as drx fvy where x and y are multiples of
2 and 4 respectively.
* config/sh/tm-sh.h: Fix names of pseudo regs.
* config/sh/tm-sh.h (struct gdbarch_tdep): Add sh4 specific
pseudo registers.
(DO_REGISTERS_INFO): Define.
* sh-tdep.c (sh_sh4_register_name): New function.
(sh_generic_show_regs, sh3_show_regs, sh3e_show_regs,
sh3_dsp_show_regs, sh4_show_regs, sh_dsp_show_regs): Update
signature.
(sh_show_regs_command): New function. Actual function called by
the 'regs' command.
(sh_register_byte): Rename to...
(sh_default_register_byte): ...New function.
(sh_sh4_register_byte): New function.
(sh_register_raw_size): Rename to...
(sh_default_register_raw_size): ...New function.
(sh_sh4_register_raw_size): New function.
(sh_sh4_register_virtual_type): New function.
(sh_sh4_build_float_register_type): New function.
(sh_fetch_pseudo_register, sh_store_pseudo_register): New
functions.
(fv_reg_base_num, dr_reg_base_num): New functions.
(do_fv_register_info, do_dr_register_info, sh_do_pseudo_register,
sh_do_fp_register, sh_do_register, sh_print_register,
sh_do_registers_info): New functions.
(sh_gdbarch_init): Initialize sh4 pseudo registers to -1. Update
architecture specific parts.
(_initialize_sh_tdep): Use sh_show_regs_command for 'regs' command.
* config/i386/tm-i386.h: treat PC and FP as unsigned.
(SAVED_PC_AFTER_CALL): Use read_memory_unsigned_integer.
(FRAME_SAVED_PC): Ditto.
(FRAME_CHAIN): Ditto.
* rs6000-tdep.c (DEFAULT_LR_SAVE): Move to config/*/tm-*.h.
(rs6000_gdbarch_init): Use generic_pc_in_call_dummy instead of
rs6000_pc_in_call_dummy.
* config/rs6000/tm-rs6000.h (DEFAULT_LR_SAVE): Move here from
rs6000-tdep.c.
* config/powerpc/tm-ppc-eabi.h: Remove various definitions
handled by multi-arched rs6000-tdep.c.
* config/sh/tm-sh.h (STORE_RETURN_VALUE): Redefine as
sh_store_return_value().
* sh-tdep.c (sh_store_return_value): New function. Store the
value returned by a function into the appropriate register.
2000-07-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* sh-tdep.c (sh_skip_prologue): Before looking at the actual
instructions, try to see if the symbol table can be of help, by
calling after_prologue(). If this doesn't work, call
skip_prologue_hard_way().
(skip_prologue_hard_way): Renamed from sh_skip_prologue. Add some
more instruction pattern matching for pushing of arguments, and
manipulation of r14.
(after_prologue): New function. Use symbol table info to determine
the end of the prologue, if possible.
support. Incorporate most of tm-rs6000.h.
(find_toc_address_hook): Rename to rs6000_find_toc_address_hook.
(rs6000_set_host_arch_hook): Declare.
(read_memory_addr): Define.
(pop_frame): Rename to rs6000_pop_frame.
(rs6000_pop_frame, rs6000_fix_call_dummy, rs6000_push_arguments,
rs6000_frame_saved_pc, rs6000_frame_chain): Remove non-generic
dummy frame handling.
(branch_dest, rs6000_pop_frame, rs6000_skip_trampoline_code,
rs6000_frame_saved_pc, frame_get_saved_regs,
frame_initial_stack_address, rs6000_frame_chain,
rs6000_convert_from_func_ptr_addr): Call read_memory_addr instead
of read_memory_integer.
(branch_dest, rs6000_pop_frame, rs6000_push_arguments,
rs6000_skip_trampoline_code, rs6000_frame_saved_pc,
frame_get_saved_regs, frame_initial_stack_address,
rs6000_frame_chain): Replace 4 with TDEP->wordsize.
(skip_prologue): Recognize some 64-bit stack adjustments.
(push_dummy_frame, pop_dummy_frame, set_processor,
show_processor): Delete.
(frame_get_saved_regs): Manipulate saved register addresses using
CORE_ADDR instead of int.
(rs6000_create_inferior): New function.
(register_names_*[]): Change to struct reg registers_*[].
(variants[]): Assimilate into multi-arch approach.
(register_names_*[], variants[]): Refer to pre-PowerPC
architectures as POWER instead of RS6000.
* rs6000-nat.c: Ubiquitous changes for 64-bit support.
(vmap_secs, xcoff_relocate_symtab): Cast addresses
to unsigned long to avoid sign-extension errors.
(set_host_arch): New function.
(xcoff_relocate_symtab): Try disabling usleep(36000) workaround.
(rs6000_core_fns): Use new bfd_target_xcoff_flavour.
(_initialize_core_rs6000): Initialize rs6000_set_host_arch_hook.
* symfile.c (find_sym_fns): Remove special xcoff kludge.
* xcoffread.c (secnum_to_bfd_section): Initialize args.objfile.
(process_linenos): Query line struct size from coff
backend instead of using compile-time constant.
(enter_line_range): Likewise.
(read_xcoff_symtab): Pass "XCOFF64" instead of "XCOFF" to
record_debugformat() if appropriate.
(process_xcoff_symbol): Access symbol addresses using
SYMBOL_VALUE_ADDRESS instead of SYMBOL_VALUE.
(read_symbol_lineno): Retrieve XCOFF64 symbol names from strtbl.
(scan_xcoff_symtab): Likewise. Query syment struct size from
coff backend instead of using compile-time constant.
(xcoff_sym_fns): Set flavour to bfd_target_xcoff_flavour.
* Makefile.in (INTERNAL_LDFLAGS): Add $(MH_LDFLAGS) to list of flags
that this Makefile variable get set to. (From Kevin Buettner.)
* config/powerpc/aix.mh (MH_LDFLAGS): Add linker flags so that
the TOC doesn't overflow. (From Kevin Buettner.)
* config/powerpc/tm-ppc-aix.h: Move config decisions to
multi-arched rs6000-tdep.c.
* config/rs6000/tm-rs6000.h: Likewise.
(GDB_MULTI_ARCH): Define.
(skip_trampoline_code): Rename to rs6000_skip_trampoline_code.
(is_magic_function_pointer): Replace with
rs6000_convert_from_func_ptr_addr.
(TARGET_CREATE_INFERIOR_HOOK): Define.
(find_toc_address_hook): Rename to rs6000_find_toc_address_hook.
(rs6000_set_host_arch_hook): Declare.
* config/rs6000/nm-rs6000.h (CHILD_XFER_MEMORY): Define.
(FIX_CALL_DUMMY): Redefined to call i386_fix_call_dummy.
(i386_fix_call_dummy): Add prototype.
* i386-tdep.c (i386_fix_call_dummy): New function based on the
code from the old FIX_CALL_DUMMY macro.
* config/i386/tm-embed.h: New file. Specific for embedded targets
like i386-elf, i386-coff and i386-aout.
* config/i386/embed.mt (): Specify tm-embed.h instead of the System V
header file.
before deleting and restoring it.
(safe_symbol_file_add): Ensure that gdb_stderr is flushed before reassigning
it.
(handle_load_dll): Split into two functions so that WFI can handle shared
library events.
(child_solib_loaded_library_pathname): New function.
(child_clear_solibs): New function. Clears shared library list.
(child_solib_add): New function. Adds shared library symbols.
(dll_symbol_command): New function. Handles "dll-symbol" command.
(info_dll_command): New function. Handles info "sharedlibrary" command.
(handle_exceptions): Eliminate 'ignore_trap' argument.
(get_child_debug_event): Eliminate two arguments. Return "pid" when
appropriate. Break out on most events to allow WFI to handle stuff.
(child_wait): Accomodate get_child_debug_event changes.
(child_attach): Clear thread list and list of loaded dlls.
(child_create_inferior): Clear list of loaded dlls. Use wait_for_inferior in a
loop to look for first "trap".
(child_resume): Avoid accessing a possibly-freed thread pointer.
(_initialize_inftarg): Add "dll-symbols", "sharedlibrary", and "info
dll", and "info sharedlibrary" commands.
* config/i386/tm-cygwin.h: Add some shared library (aka DLL) hooks.
* config/i386/nbsdelf.mt: New file.
* config/i386/tm-nbsdelf.h: New file.
* config/i386/tm-nbsd.h: change include of tm-nbsd.h to
the more explicit config/tm-nbsd.h.
and i[3456]86-*-netbsdelf*.
* config/i386/nm-nbsdelf.h: New file.
* config/i386/nbsdelf.mh: New file.
* config/i386/nm-nbsd.h: change include of nm-nbsd.h to
the more explicit config/nm-nbsd.h.
* config/i386/tm-nbsd.h: change include of tm-i386bsd.h to
tm-i386.h.
(SIGTRAMP_START, SIGTRAMP_END, SIGCONTEXT_PC_OFFSET): Define.
-------------------------------------------------------------------
* gregset.h: New file. Typedefs for gdb_gregset_t and
gdb_fpregset_t, prototypes for supply_gregset and friends.
* procfs.c: Include gregset.h. Delete local prototypes for
supply_gregset etc., and local typedef gdb_gregset_t etc.
* sol-thread.c: Include gregset.h, delete local prototypes,
add appropriate casts to gdb_gregset_t.
* uw-thread.c, lin-thread.c, core-sol2.c, core-regset.c,
sparc-tdep.c, ptx4-nat.c, ppc-linux-nat.c, mipsv4-nat.c,
m88k-nat.c, m68klinux-nat.c, m68k-tdep.c, irix5-nat.c,
irix4-nat.c, ia64-linux-nat.c, i386v4-nat.c, cxux-nat.c,
arm-linux-nat.c, alpha-nat.c: Include gregset.h.
* config/nm-linux.h: Define GDB_GREGSET_T, GDB_FPREGET_T.
* config/sparc/tm-sun4sol2.h: Ditto.