Commit Graph

105 Commits

Author SHA1 Message Date
Kevin Buettner 077276e87b Add a limit parameter for scanning the prologue. 2000-10-05 01:13:53 +00:00
Peter Schauer 582236304c * rs6000-tdep.c (rs6000_pop_frame): Use PC_IN_CALL_DUMMY to test
for call dummy instead of accessing stop_stack_dummy, which does
	not work if we `return' from a stop in a call dummy.
	(rs6000_gdbarch_init):  Use generic_save_dummy_frame_tos for
	dummy_frame_tos function to make PC_IN_CALL_DUMMY work.
2000-09-24 09:58:16 +00:00
Kevin Buettner 9aa1e687a2 Make GNU/Linux/PPC work again. 2000-07-31 20:56:44 +00:00
Kevin Buettner fba45db2fa Protoization. 2000-07-30 01:48:28 +00:00
Nicholas Duffek fe794dc69d * ppcbug-rom.c (ppcbug_regnames[]): Make array size implicit.
* 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.
2000-07-14 22:17:33 +00:00
Nicholas Duffek 470d566602 * xcoffread.c (read_symbol_nvalue): Return CORE_ADDR.
* rs6000-tdep.c (rs6000_pop_frame): Make addr CORE_ADDR type.
2000-07-07 22:00:09 +00:00
Nicholas Duffek 7a78ae4e6b * rs6000-tdep.c: Changes throughout for multi-arch 64-bit
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.
2000-06-16 21:02:22 +00:00
Kevin Buettner 507f3c78fb Eliminate PARAMS from function pointer declarations. 2000-06-04 00:41:10 +00:00
Kevin Buettner a14ed312fd PARAMS removal. 2000-05-28 01:12:42 +00:00
Kevin Buettner ddb20c56a3 Changes to skip_prologue for PPC architecture. 2000-02-26 09:30:30 +00:00
Kevin Buettner 482ca3f5dc Shared library, function calling fixes for GNU/Linux PPC port. 2000-02-24 23:06:48 +00:00
Kevin Buettner c877c8e605 Changes for GNU/Linux PPC native port of gdb. 2000-02-22 01:20:32 +00:00
Kevin Buettner f6077098c9 AIX 4.3 changes. 2000-02-15 21:17:04 +00:00
Jason Molenda 2acceee218 import gdb-1999-10-04 snapshot 1999-10-05 23:13:56 +00:00
Stan Shebs d4f3574e77 import gdb-1999-09-08 snapshot 1999-09-09 00:02:17 +00:00
Jason Molenda c5aa993b1f import gdb-1999-07-07 post reformat 1999-07-07 20:19:36 +00:00
Jason Molenda 0f71a2f66f import gdb-1999-06-14 snapshot 1999-06-14 18:08:47 +00:00
Jason Molenda cce74817d9 import gdb-1999-06-07 snapshot 1999-06-07 19:19:32 +00:00
Jason Molenda 392a587b05 import gdb-1999-05-25 snapshot 1999-05-25 18:09:09 +00:00
Stan Shebs b83266a0e1 import gdb-19990504 snapshot 1999-05-05 14:45:51 +00:00
Stan Shebs 7a292a7adf import gdb-19990422 snapshot 1999-04-26 18:34:20 +00:00
Stan Shebs c906108c21 Initial creation of sourceware repository 1999-04-16 01:35:26 +00:00
Stan Shebs 071ea11e85 Initial creation of sourceware repository 1999-04-16 01:34:07 +00:00
Jim Blandy 2ac058fda9 Allow PPC users to select which PPC/RS6000 variant they're debugging
at run-time.  At the moment, the only thing this affects is the
set of registers visible.
* config/rs6000/tm-rs6000.h (REGISTER_NAME): Define this as a call
to the function rs6000_register_name.
(rs6000_register_name): Include extern decl.
(NUM_REGS): Bump to 183.  What's the right way to do this?
(FIRST_UISA_SP_REGNUM, LAST_UISA_SP_REGNUM): Renamed from
FIRST_SP_REGNUM, LAST_SP_REGNUM.
(REGISTER_BYTES): Recompute this.
* rs6000-tdep.c: Renamed all uses of FIRST_SP_REGNUM and
LAST_SP_REGNUM to FIRST_UISA_SP_REGNUM and LAST_UISA_SP_REGNUM, with
some concomitant formatting changes.
#include "gdbcmd.h", so we can define commands here.
(struct variant): New structure.
(COMMON_UISA_REG_NAMES, PPC_UISA_SPR_NAMES, PPC_SEGMENT_REG_NAMES,
PPC_32_OEA_SPR_NAMES, num_registers): New macros.
(register_names_rs6000, register_names_uisa, register_names_403,
register_names_403GC, register_names_505, register_names_860,
register_names_601, register_names_602, register_names_603,
register_names_604, register_names_750, variants): New variables.
(rs6000_register_name, install_variant, find_variant_by_name,
install_variant_by_name, list_variants, show_current_variant,
set_processor, show_processor): New functions.
(_initialize_rs6000_tdep): Define new commands `set processor' and
`show processor', and call install_variant_by_name to set the
default variant.
* rs6000-nat.c: Renamed all uses of FIRST_SP_REGNUM and
LAST_SP_REGNUM to FIRST_UISA_SP_REGNUM and LAST_UISA_SP_REGNUM, with
some concomitant formatting changes.
* configure.in: Accept the `--with-cpu' flag, to specify a default
processor variant.
* acconfig.h: Provide a blurb for TARGET_CPU_DEFAULT, which is set
by configure's `--with-cpu' flag.
* config.in, configure: Regenerated.
1999-02-01 21:17:19 +00:00
Andrew Cagney 86a51f415d CARP: Mechanism to replace EXTRA_FRAME_INFO.
Add two pointers (saved_regs, extra_info) to struct frame_info.
Introduce new macro FRAME_INIT_SAVED_REGS which replaces
FRAME_FIND_SAVED_REGS.

Document.

Use in mn10300 and rs6000 targets. Fix side effects on ALPHA, MIPS,
Z8K and SPARC targets.
1998-12-12 02:50:39 +00:00
Jim Blandy 63d7a4f12e * rs6000-tdep.c (pop_frame): Correctly find the registers saved in
the stack frame.  Their offset from the previous stack frame is in
fdata.gpr_offset and fdata.fpr_offset, not fdata.offset.
(gdb.base/return.exp)
* config/rs6000/tm-rs6000.h: Doc fixes.
1998-12-07 20:28:54 +00:00
Andrew Cagney 0233186932 CARP:
STEP_SKIPS_DELAY - add STEP_SKIPS_DELAY_P and rewrite use removing
  #ifdef's.
NO_SINGLE_STEP - replace with SOFTWARE_SINGLE_STEP_P +
  SOFTWARE_SINGLE_STEP.  Replace global variable one_stepped with static
  singlestep_breakpoints_inserted_p.  Cleanup infrun.c (scary!).
1998-11-27 23:35:08 +00:00
Andrew Cagney 07137a112d * rs6000-tdep.c (rs6000_breakpoint_from_pc): Change big_breakpoint
and little_breakpoint to char[] from char*.
* remote-array.c (array_insert_breakpoint): Change bp_addr to
CORE_ADDR type.
1998-11-26 10:36:45 +00:00
Andrew Cagney afcad54a90 CARP: *BREAKPOINT*
Convert mn10300, MIPS and powerpc/rs6000 targets to use
BREAKPOINT_FROM_PC
Delete global variable memory_breakpoint_size.  Use BREAKPOINT_FROM_PC
instead.
1998-11-24 13:49:00 +00:00
Mark Alexander c6d28b22da * rs6000-tdep.c: Don't include tm.h twice. 1998-10-10 01:17:07 +00:00
Mark Alexander 70423641d9 * rs6000-tdep.c (get_saved_register): Define only if
USE_GENERIC_DUMMY_FRAMES is defined.
1998-10-08 15:59:23 +00:00
Mark Alexander 0ec1e44d3d Patch from Dawn Perchik <dawn@cygnus.com>:
* rs6000-tdep.c (pop_frame): Handle generic dummy frames.
	(push_arguments): Likewise.
	(frame_saved_pc): Likewise.
	(rs6000_frame_chain): Likewise.
	(ppc_push_return_address): New function.
	(get_saved_register): New function.
	* config/powerpc/tm-ppc-eabi.h: Add generic dummy frame macros.
1998-09-23 05:41:38 +00:00
Michael Snyder 75621b2b2c Tue Jun 23 17:32:26 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
* rs6000-tdep.c (pop_dummy_frame): use memcpy.
        (push_arguments): use memset.
        (various other places): fix up indentation and long lines.
1998-06-24 00:37:49 +00:00
Peter Schauer 0c6c5eebf4 * mips-tdep.c (mips_push_arguments): Tweak alignment of register
value if the remaining length of a non-integral argument is smaller
	than the register size for big-endian non-EABI mode.

	* rs6000-tdep.c (branch_dest):  Handle return from signal
	handler function via sigreturn kernel call.
1997-09-23 07:10:51 +00:00
Peter Schauer 05d52ace86 * infrun.c (wait_for_inferior): Add the symbols for any
newly loaded objects upon a TARGET_WAITKIND_LOADED event.

	Rewrite code which determines the TOC address for calling functions
	in the inferior under AIX.
	* rs6000-nat.c (find_toc_address):  New function to determine
	the required TOC address from a function address.
	(_initialize_core_rs6000):  Set up find_toc_address_hook to point
	to find_toc_address.
	(xcoff_relocate_symtab, xcoff_relocate_core):  Remove
	add_text_to_loadinfo calls.
	(exec_one_dummy_insn):  Change pid and status to int to get rid of
	compiler warnings.
	(xcoff_relocate_symtab):  Cast ldi to `int *' when passing it to
	ptrace to get rid of compiler warnings.
	* rs6000-tdep.c:  Add definition for find_toc_address_hook.
	(rs6000_fix_call_dummy):  If find_toc_address_hook is non zero,
	patch TOC address load code in the call dummy with the value
	returned from find_toc_address_hook.
	(struct loadinfo, loadinfo, loadinfolen,
	loadinfotextindex, xcoff_init_loadinfo, free_loadinfo,
	xcoff_add_toc_to_loadinfo, add_text_to_loadinfo, find_toc_address):
	Remove.
	(_initialize_rs6000_tdep):  Remove initialization of
	coff_add_toc_to_loadinfo_hook and xcoff_init_loadinfo_hook.
	* xcoffread.c (coff_add_toc_to_loadinfo_hook,
	xcoff_init_loadinfo_hook):  Remove.
	(struct coff_symfile_info):  Add toc_offset field.
	(scan_xcoff_symtab):  Record toc_offset value in toc_offset field
	instead of calling xcoff_add_toc_to_loadinfo_hook.
	(get_toc_offset):  New function to return the value of the
	toc_offset field for an object file.
	(xcoff_initial_scan):  Remove call of xcoff_init_loadinfo_hook.
	* xcoffsolib.h (add_text_to_loadinfo):  Remove declaration.
	* config/rs6000/tm-rs6000.h:  Add declarations for
	find_toc_address_hook and get_toc_offset.
1997-08-15 21:10:32 +00:00
Peter Schauer 4cc5671656 * config/rs6000/tm-rs6000.h (SIG_FRAME_LR_OFFSET): Define.
* rs6000-tdep.c (frameless_function_invocation):  Mark frames
	with a zero PC as frameless to improve backtraces from core dumps
	caused by dereferencing a NULL function pointer.
	(frameless_function_invocation, frame_saved_pc, rs6000_frame_chain):
	Handle frameless functions interrupted by a signal.

	* sparc-tdep.c (sparc_init_extra_frame_info, sparc_frame_saved_pc):
	Handle frameless functions interrupted by a signal.
1997-05-15 15:01:54 +00:00
Peter Schauer 211b564e41 * config/powerpc/tm-ppc-aix4.h, config/rs6000/tm-rs6000-aix4.h
(DONT_RELOCATE_SYMFILE_OBJFILE):  Removed.
	* xcoffsolib.h (struct vmap):  Add new members tvma, toffs and dvma,
	remove tadj.
	* exec.c (bfdsec_to_vmap):  Initialize new vmap members, initialize
	tstart and dstart with section VMA.
	* rs6000-nat.c (vmap_symtab):  Relocate relative to the VMA in the
	object file.
	(vmap_ldinfo, xcoff_relocate_core):  Adjust tstart by section offset
	of the text section, remove DONT_RELOCATE_SYMFILE_OBJFILE hack.
	(vmap_exec):  Relocate relative to the VMA in the object file,
	relocate .bss section as well.
	(xcoff_relocate_core):  No longer adjust section addresses by VMA.
	* rs6000-tdep.c (find_toc_address):  Change type of tocbase
	to CORE_ADDR.
	* xcoffread.c (secnum_to_bfd_section):  New routine to get
	BFD section from CS section number.
	(scan_xcoff_symtab):  Make toc_offset section relative.

	* symtab.c (total_number_of_methods):  Avoid core dump if
	baseclass type is still undefined.
1997-04-19 08:52:17 +00:00
Fred Fish 94b4f75666 * rs6000-tdep.c: Fix typo in comment.
* valops.c (call_function_by_hand): Set using_gcc to 2
	for code compiled without -g, per comment in code.
	* config/a29k/tm-a29k.h (STACK_ALIGN): Add comment.
	* config/sparc/tm-sparc.h (STACK_ALIGN): Add comment.
	* config/sparc/tm-sp64.h (STACK_ALIGN): Add comment.
	* config/pyr/tm-pyr.h (STACK_ALIGN): Add comment.
	* config/m88k/tm-m88k.h (STACK_ALIGN): Add comment.
	* config/pa/tm-hppa.h (PUSH_ARGUMENTS): Enclose args in ()'s.
	(STACK_ALIGN): Add comment, move to be with other associated
 	macros, and document.
	* config/mips/tm-mips.h (PUSH_ARGUMENTS): Enclose args in ()'s.
	(STACK_ALIGN): Remove completely, handled by PUSH_ARGUMENTS.
	* config/alpha/tm-alpha.h (PUSH_ARGUMENTS): Enclose args in ()'s.
	* config/rs6000/tm-rs6000.h (STACK_ALIGN): Remove completely,
	handled by PUSH_ARGUMENTS.
	(PUSH_ARGUMENTS): Enclose args in ()'s.
1996-08-25 07:17:22 +00:00
Stan Shebs 2f163bc3c8 * rs6000-tdep.c (rs6000_fix_call_dummy): Add full set of arguments.
* config/rs6000/tm-rs6000.h (FIX_CALL_DUMMY): Pass all arguments
	to function, declare function correctly.
1996-08-17 00:57:52 +00:00
Fred Fish 368f1e773b * rs6000-tdep.c (push_arguments): Remove unused variable "pc".
(branch_dest): Remove unused variable "offset".
	(pop_dummy_frame): Add prototype and make static.
	(push_arguments): Guard against using len uninitialized.
	(push_arguments): Guard against using arg uninitialized.
	(frame_saved_pc): Remove unused variable "frameless".
	(free_loadinfo): Ifdef out unused function.
1996-07-30 07:24:22 +00:00
Fred Fish 58b4fad226 * rs6000-tdep.c (skip_prologue): Add missing parens around
operands of logical-or so that first operand does not bind
	to previous logical-and.
1996-07-30 05:12:07 +00:00
Fred Fish b607efe714 See gdb ChangeLog entry with header:
Thu Jul 25 19:41:31 1996  Fred Fish  <fnf@cygnus.com>

for a rather huge set of changes.  I was going to put them here, but it
made cvs dump core.  :-(
1996-07-26 03:01:51 +00:00
Michael Meissner 8678180e14 Do not do XCOFF hoooks for ELF systems 1996-05-06 11:56:56 +00:00
Fred Fish 062cb0d30d * Makefile.in (rs6000-nat.o): Dependant on xcoffsolib.h.
* config/rs6000/rs6000.mh (NATDEPFILES): Move xcoffread.o ...
	* config/rs6000/rs6000.mt (TDEPFILES): ... to here
	* xcoffsolib.c (xcoff_relocate_symtab_hook): Define and initialize.
	(solib_info): Call xcoff_relocate_symtab via the hook.
	(sharedlibrary_command): Ditto.
	* xcoffread.c: Remove all FAKING_RS6000 comments and defines.
	(xcoff_add_toc_to_loadinfo_hook): Define and initialize here.
	(xcoff_init_loadinfo_hook): Define and initialize here.
	(scan_xcoff_symtab): Call xcoff_add_toc_to_loadinfo via the hook.
	(xcoff_initial_scan): Call xcoff_init_loadinfo via the hook.
	* xcoffsolib.h (xcoff_relocate_symtab_hook): Declare extern func.
	* rs6000-tdep.c (_initialize_rs6000_tdep): Add initializations
	of xcoff_add_toc_to_loadinfo_hook and xcoff_init_loadinfo_hook.
	* rs6000-nat.c (_initialize_core_rs6000): Add initialization
	of xcoff_relocate_symtab_hook.
1996-05-02 01:32:41 +00:00
Michael Meissner 59c8431852 fix typo 1995-12-01 12:21:03 +00:00
Per Bothner 940d596798 * alpha-tdep.c, c-exp.y, h8500-tdep.c, f-exp.y, f-valprint.c,
findvar.c, hppa-tdep.c, infcmd.c, language.c, printcmd.c,
 	rs6000-tdep.c, symmisc.c, symtab.c:
	Add check_typedef/CHECK_TYPEDEF as needed.
1995-11-30 01:43:37 +00:00
Stan Shebs cd8a3d845b * rs6000-tdep.c: Don't include a.out.h, improve some formatting. 1995-10-15 23:23:01 +00:00
Peter Schauer 4f8710e6ff * rs6000-tdep.c (push_dummy_frame): Handle lr_offset of zero
correctly.
1995-09-23 13:30:04 +00:00
Michael Tiemann 3a4f97862f Sun Sep 10 10:24:48 1995 Michael Tiemann <tiemann@axon.cygnus.com>
* tm-ppc-eabi.h (PC_IN_CALL_DUMMY): Redefine this to work with the
	simulator.  FIXME.

	* rs6000-tdep.c (push_dummy_frame): Calculate the correct link
	register offset from the current frame (don't assume it is always 8).
	(push_dummy_frame): Add comment about having only 4096 bytes of
	stack space in the simulator (by default).

	* remote-sim.c (gdbsim_create_inferior): Call
	`add_text_to_loadinfo' so that gdb can find TOC entries when
	calling functions in the inferior.

With this changes, it is now possible to correctly call inferior
functions in the PPC simulator.
1995-09-10 17:37:22 +00:00
Jeff Law 65eaea2742 * configure.in: Recognize aix4 specially as some aspects
of aix4 need different handling than aix3.
        * configure: Updated.
        * config/powerpc/{aix4.mh,aix4.mt,tm-ppc-aix4.h}: New files
        specific to aix4 support on the power pc.
        * config/powerpc/tm-ppc-aix.h (DONT_RELOCATE_SYMFILE_OBJFILE): Do
        not defined.  The aix4 specific target files will do that.
        * config/rs6000/{aix4,mh,aix4,mt,tm-rs6000-aix4.h}: New files
        specific to aix4 support on the rs6000.

        * config/rs6000/tm-rs6000.h (CONVERT_FROM_FUNC_PTR_ADDR): Don't
        do the conversion if the pointer is not a magic aix function
        pointer.
        * rs6000-tdep.c: Include objfiles.h and symtab.h.
        (is_magic_function_pointer): New function.

        * rs6000-tdep.c (skip_prologue): Refine check for frameless
        functions.  Handle b .+4 emitted by aix4 compilers.  Only
        allow one load of a minimal toc pointer.  Handle aix4 compiler's
        code for alloca.

        * rs6000-tdep.c (find_toc_address): Report an error if no toc was
        found rather than possibly core dumping.

        * partial-stab.h: Handle extra field generated by the aix4 compiler
        for enumerations.
        * stabsread.c (read_enum_type): Likewise.
1995-08-12 22:50:04 +00:00