* d10v-tdep.c (d10v_frame_chain_valid): Remove unnecessary tests.
* hppa-tdep.c (hppa_frame_chain_valid): Remove unnecessary test.
* blockframe.c: Include "gdbcmd.h" and "command.h".
(backtrace_below_main): New variable.
(file_frame_chain_valid, func_frame_chain_valid)
(nonnull_frame_chain_valid, generic_file_frame_chain_valid)
(generic_func_frame_chain_valid): Remove functions.
(frame_chain_valid, do_flush_frames_sfunc): New functions.
(_initialize_blockframe): New function.
* Makefile.in (blockframe.o): Update dependencies.
* frame.c (frame_saved_regs_id_unwind, get_prev_frame): Remove FIXME
comment. Call frame_chain_valid ().
* frame.h: Remove old prototypes. Add prototype for
frame_chain_valid and update comments to match.
* gdbarch.sh: Change FRAME_CHAIN_VALID into a predicated function.
Remove old comment.
* gdbarch.h: Regenerated.
* gdbarch.c: Regenerated.
Plus updates to all other targets not to provide a FRAME_CHAIN_VALID.
* blockframe.c (find_frame_addr_in_frame_chain): Move function
from here ...
* varobj.c (find_frame_addr_in_frame_chain): ... to here.
(varobj_create): Note that frame ID should be used.
* frame.h (find_frame_addr_in_frame_chain): Delete declaration.
* blockframe.c (sigtramp_saved_pc): Use
builtin_type_void_code_ptr, not builtin_type_void_data_ptr (we are
extracting the PC). Use TYPE_LENGTH (builtin_type_void_code_ptr)
instead of (TARGET_PTR_BIT / TARGET_CHAR_BIT).
* findvar.c (read_memory_typed_address): New function.
* gdbcore.h (read_memory_typed_address): Add prototype.
* blockframe.c (sigtramp_saved_pc): Use read_memory_typed_address
to read a value destined for a CORE_ADDR, not read_memory_integer.
* f-valprint.c (f77_get_dynamic_upperbound): Ditto.
(f77_get_dynamic_lowerbound): Ditto.
* blockframe.c (frame_address_in_block): New function extracted
from get_frame_block().
(get_frame_block): Use frame_address_in_block().
(block_innermost_frame): Use frame_address_in_block() to match
the frame pc address against the block boundaries rather than
the frame pc directly. This prevents a failure when a frame pc
is actually a return-address pointing immediately after the end
of the given block.
``struct regcache''.
(struct dummy_frame): Replace field ``registers'' with regcache, a
struct regcache object.
(generic_find_dummy_frame): Update.
(generic_push_dummy_frame): Update. Use regcache_xfree,
regcache_xmalloc and regcache_cpy.
(generic_pop_dummy_frame): Update. Use regcache_cpy and
regcache_xfree.
(deprecated_generic_find_dummy_frame): Update.
(generic_read_register_dummy): Update. Use
regcache_read_as_address.
(generic_call_dummy_register_unwind): Update. Use regcache_read.
(generic_get_saved_register): Update. Use regcache_read.
saved_regs. Mention when the SP is on the stack or in a register.
* frame.h (frame_register_unwind_ftype): Define. Document.
(struct frame_info): Add field register_unwind and
register_unwind_cache.
(frame_register_unwind): Declare.
(generic_unwind_get_saved_register): Declare.
* frame.c (frame_register_unwind): New function.
(generic_unwind_get_saved_register): New function.
* blockframe.c (generic_call_dummy_register_unwind): New function.
(frame_saved_regs_register_unwind): New function.
(set_unwind_by_pc): New function.
(create_new_frame): New function.
(get_prev_frame): New function.
generic_save_call_dummy_addr.
* frame.h (generic_save_call_dummy_addr): Declare.
* blockframe.c (struct dummy_frame): Add fields call_lo and
call_hi.
(generic_find_dummy_frame): Check for PC in range call_lo to
call_hi instead of entry_point_address.
(generic_pc_in_call_dummy): Search the dummy frames for a PC in
the call_lo to call_hi range. Allow for DECR_PC_AFTER_BREAK.
(generic_save_call_dummy_addr): New function.
specified level are as expected.
* blockframe.c (get_prev_frame): Set the `level' from next_frame.
Update copyright.
* frame.h (struct frame_info): Add field `level'. Update
copyright.
Work-in-progress PR gdb/464.
* stack.c (get_selected_block): Add new argument `addr_in_block',
used to return the exact code address we used to select the block,
not just the block.
* blockframe.c (get_frame_block, get_current_block): Same.
* frame.h (get_frame_block, get_current_block,
get_selected_block): Update declarations.
* linespec.c, stack.c, blockframe.c, breakpoint.c, findvar.c,
linespec.c, varobj.c, printcmd.c, symtab.c: Callers changed.
gdb/mi/ChangeLog:
* mi-cmd-stack.c (list_args_or_locals): Pass new arg to
get_frame_block. (See entry in gdb/ChangeLog.)
functions which architectures can redefine, defaulting to
generic_pointer_to_address and generic_address_to_pointer.
* findvar.c (extract_typed_address, store_typed_address,
generic_pointer_to_address, generic_address_to_pointer): New
functions.
(POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): Provide default
definitions.
(extract_address, store_address): Doc fixes.
* values.c (value_as_pointer): Doc fix.
(value_from_pointer): New function.
* defs.h (extract_typed_address, store_typed_address): New
declarations.
* inferior.h (generic_address_to_pointer,
generic_pointer_to_address): New declarations.
* value.h (value_from_pointer): New declaration.
* ax-gdb.c (const_var_ref): Use value_from_pointer, not
value_from_longest.
* blockframe.c (generic_push_dummy_frame): Use read_pc and
read_sp, not read_register.
* c-valprint.c (c_val_print): Use extract_typed_address instead of
extract_address to extract vtable entries and references.
* cp-valprint.c (cp_print_value_fields): Use value_from_pointer
instead of value_from_longest to extract the vtable's address.
* eval.c (evaluate_subexp_standard): Use value_from_pointer
instead of value_from_longest to compute `this', and for doing
pointer-to-member dereferencing.
* findvar.c (read_register): Use extract_unsigned_integer, not
extract_address.
(read_var_value): Use store_typed_address instead of store_address
for building label values.
(locate_var_value): Use value_from_pointer instead of
value_from_longest.
* hppa-tdep.c (find_stub_with_shl_get): Use value_from_pointer,
instead of value_from_longest, to build arguments to __d_shl_get.
* printcmd.c (set_next_address): Use value_from_pointer, not
value_from_longest.
(x_command): Use value_from_pointer, not value_from_longest.
* tracepoint.c (set_traceframe_context): Use value_from_pointer,
not value_from_longest.
* valarith.c (value_add, value_sub): Use value_from_pointer, not
value_from_longest.
* valops.c (find_function_in_inferior, value_coerce_array,
value_coerce_function, value_addr, hand_function_call): Same.
* value.h (COERCE_REF): Use unpack_pointer, not unpack_long.
* values.c (unpack_long): Use extract_typed_address to produce
addresses from pointers and references, not extract_address.
(value_from_longest): Use store_typed_address instead of
store_address to produce pointer and reference values.
* blockframe.c (find_pc_sect_partial_function): Add braces to avoid
possible nested-if confusion.
* breakpoint.c (breakpoint_here_p): Ditto.
(breakpoint_inserted_here_p): Ditto.
(breakpoint_thread_match): Ditto.
* gnu-regex.c: Define _REGEX_RE_COMP only if it isn't already defined.
* gnu-regex.h: Define _REGEX_RE_COMP to pick up old compatability
prototypes.
* symtab.h: Add prototype for _initialize_source.
* value.h: Add prototype for _initialize_value.
* defs.h: Include sys/types.h or stddef.h to get size_t.
(make_cleanup): Add make_cleanup_func typedef and switch to using
a prototype for this function.
(mfree): Add prototypes for mmalloc, mrealloc, mfree if we aren't
using mmalloc.
* ax-gdb.c breakpoint.c coffread.c corelow.c dbxread.c dwarf2read.c
dwarfread.c elfread.c eval.c exec.c gdbtk-cmds.c gdbtk.c infcmd.c
infrun.c mipsread.c nlmread.c os9kread.c parse.c printcmd.c symfile.c
symmisc.c symtab.c thread.c top.c tracepoint.c typeprint.c valops.c:
Cast parameters passed to make_cleanup to use the new
make_cleanup_func typedef.
More warning cleanups. There are still a bunch of places where the first
argument to make_cleanup is not cast to (make_cleanup_func); these are
either due to the function fitting the make_cleanup_func specification
already (e.g. free()) or they are in files that weren't compiled when
I did my make on a Linux native system. Bwahahaha. You can see them
like this:
grep make_cleanup\ * | grep -v make_cleanup_func
I'll surely go back and clean up the remaining suspicious calls in
GDB one of these days. :-)
* blockframe.c(find_pc_sect_partial_function): look for min syms in
the same section when trying to guess the end of a function.
* symfile.c(list_overlays_command): use print_address_numeric
* remote-sim.c: export simulator_command
* tm-r5900.h: add COP0 registers
* txvu-tdep.c: printvector and printvector-order commands
* tm-txvu.h: add COP0 registers
* mips-tdep.c: use NUM_CORE_REGS
Added some generic target-independant code for managing call-dummy frames.
Wed Nov 27 10:32:14 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
* breakpoint.c: DELETE command will not delete CALL_DUMMY breakpoint.
* blockframe.c: Add target-independant support for managing
CALL_DUMMY frames on the host side.
* frame.h: Declarations for generic CALL_DUMMY frame support.
* h8300-tdep.c: Add target function calls using generic frame support.
* config/h8300/tm-h8300.h: config for generic target function calls.
start-sanitize-m32r
* m32r-tdep.c: Add target function calls using generic frame support.
* config/m32r/tm-m32r.h: config for generic target function calls.
end-sanitize-m32r
* sh-tdep.c: Add target function calls using generic frame support.
* config/sh/tm-sh.h: config for generic target function calls.
start-sanitize-v850
* v850-tdep.c: Add target function calls using generic frame support.
* config/v850/tm-v850.h: config for generic target function calls.
end-sanitize-v850
* valops.c: ADD PUSH_RETURN_ADDRESS so that it doesn't have to be
done by PUSH_ARGUMENTS when there's no CALL_DUMMY.
and stack pointer during stepping, to speed things up.
A. Changes to not select a frame until we need a selected frame:
* blockframe.c (flush_cached_frames): Call select_frame (NULL, -1).
* infrun.c (wait_for_inferior): Move call to select_frame back to
normal_stop. This reverts a change of 13 Apr 94 (it says Jeff
Law, but the change was my idea); the only reason for that change
was so we could save and restore the selected frame in
wait_for_inferior, and now that flush_cached frames clears the
selected frame, that should work OK now.
B. Changes to not create a current_frame until we need one:
* blockframe.c (get_current_frame): If current_frame is NULL, try
to create an innermost frame.
* sparc-tdep.c (sparc_pop_frame), infcmd.c (run-stack_dummy),
infrun.c (wait_for_inferior), thread.c (thread_switch),
convex-tdep.c (set_thread_command), a29k-tdep.c (pop_frame),
alpha-tdep.c (alpha_pop_frame), convex-xdep.c (core_file_command),
h8300-tdep.c (h8300_pop_frame), h8500-tdep.c (h8300_pop_frame),
hppa-tdep.c (hppa_pop_frame), i386-tdep.c (i386_pop_frame),
i960-tdep.c (pop_frame), m68k-tdep.c
(m68k_pop_frame), mips-tdep.c (mips_pop_frame), rs6000-tdep.c
(push_dummy_frame, pop_dummy_frame, pop_frame), sh-tdep.c
(pop_frame), config/arm/tm-arm.h (POP_FRAME),
config/convex/tm-convex.h (POP_FRAME), config/gould/tm-pn.h
(POP_FRAME), config/ns32k/tm-merlin.h (POP_FRAME),
config/ns32k/tm-umax.h (POP_FRAME), config/tahoe/tm-tahoe.h
(POP_FRAME), config/vax/tm-vax.h (POP_FRAME): Don't
call create_new_frame.
* corelow.c (core_open), altos-xdep.c (core_file_command),
arm-xdep.c (core_file_command), gould-xdep.c (core_file_command),
m3-nat.c (select_thread), sun386-nat.c (core_file_command),
umax-xdep.c (core_file_command): Don't call create_new_frame; do
call flush_cached_frames.
* blockframe.c (reinit_frame_cache): Don't call create_new_frame
or select_frame.
C. Changes to get rid of stop_frame_address and instead only
fetch the frame pointer when we need it.
* breakpoint.c (bpstat_stop_status): Remove argument
frame_address; use FRAME_FP (get_current_frame ()).
* infrun.c (wait_for_inferior): Don't pass frame pointer to
bpstat_stop_status.
* infrun.c (wait_for_inferior): Use FRAME_FP (get_current_frame
()) instead of stop_frame_address.
* infrun.c (save_inferior_status, restore_inferior_status),
inferior.h (struct inferior_status): Don't save and restore
stop_frame_address.
* inferior.h, infcmd.c, thread.c (thread_switch), m3-nat.c
(select_thread): Remove stop_frame_address and uses thereof.
D. Same thing for the stack pointer.
* infrun.c (wait_for_inferior): Remove stop_sp and replace
uses thereof with read_sp ().
E. Change to eliminate one nasty little spot where we were
wanting to know the frame pointer from before the current step
(idea from GDB 3.5, which saved my ass, because my other ideas of
how to fix it were very baroque).
* infrun.c: Remove prev_frame_address.
* infrun.c (wait_for_inferior, step_over_function): Use
step_frame_address instead of prev_frame_address.
F. Same basic idea for the stack pointer.
* inferior.h, infcmd.c: New variable step_sp.
* infcmd.c (step_1, until_next_command): Set it.
* infrun.c: Remove prev_sp and replace uses by step_sp.
* infrun.c (wait_for_inferior): If we get out of the step
range, then set step_sp to the current stack pointer before we
start going again.
the same as --annotate=1.
(command_line_input): Print annotatation before and after prompt.
* blockframe.c (flush_cached_frames): Print annotation.
* Rename frame_file_full_name to annotation_level and move it from
symtab.h to defs.h.
* source.c (identify_source_line): If annotation_level > 1,
change output format.
* breakpoint.c: Print annotation whenever a breakpoint changes.
* main.c: New variable server_command.
(command_line_input): Parse "server " and set server_command.
(dont_repeat): Check server_command.
bp_watchpoint_scope breakpoints.
(struct breakpoint): Add val_chain and related_breakpoint fields
for use by watchpoints.
* breakpoint.c (within_scope): Delete. No longer used.
(TARGET_CAN_USE_HARDWARE_WATCHPOINT): Provide default definition.
(target_{remove,insert}_watchpoint): Likewise.
(can_use_hardware_watchpoint): New function.
(remove_breakpoint): New function to remove a single breakpoint
or hardware watchpoint.
(insert_breakpoints): Handle insertion of hardware watchpoints.
Store a copy of the value chain derived from the watchpoint
expression.
(remove_breakpoints): Simplify by using remove_breakpoint.
(delete_breakpoint): Likewise.
(watchpoint_check): Delete the watchpoint and watchpoint scope
breakpoints when the watchpoint goes out of scope. Save & restore
the current frame after checking watchpoints.
(breakpoint_init_inferior): Likewise (restarting the program
makes all local watchpoints go out of scope).
(bpstat_stop_status): Handle hardware watchpoints much like normal
watchpoints. Delete the watchpoint and watchpoint scope breakpoint
when the watchpoint goes out of scope. Remove and reinsert all
breakpoints before returning if we stopped when a hardware watchpoint
fired.
(watch_command): Use a hardware watchpoint when possible. If
watching a local expression, build a scope breakpoint too.
(map_breakpoint_numbers): Also call given function for any
related breakpoints.
(disable_breakpoint): Never disable a scope breakpoint.
(enable_breakpoint): Handle hardware breakpoints much like normal
breakpoints, but recompute the watchpoint_scope breakpoint's
frame and address (if we have an associated scope breakpoint).
(read_memory_nobpt): Handle hardware watchpoints like normal
watchpoints. When necessary handle watchpoint_scope breakpoints.
(print_it_normal, bpstat_what, breakpoint_1, mention): Likewise.
(clear_command, breakpoint_re_set_one, enable_command): Likewise.
(disable_command): Likewise.
* blockframe.c (find_frame_addr_in_frame_chain): New function.
Extern prototype added to frame.h
* infrun.c (wait_for_inferior): Set current_frame and select
a frame before checking if we stopped due to a hardare watchpoint
firing. Handle stepping over hardware watchpoints.
(normal_stop): Remove unnecessary call to select_frame.
* value.h (value_release_to_mark): Declare.
* values.c (value_release_to_mark): New function.
* procfs.c (procfs_wait): Add cases for hardware watchpoints.
(procfs_set_watchpoint, procfs_stopped_by_watchpoint): New functions.
* hppab-nat.c (hppa_set_watchpoint): New function.
* config/pa/nm-hppab.h (STOPPED_BY_WATCHPOINT): Define.
(HAVE_STEPPABLE_WATCHPOINT): Define.
(TARGET_CAN_USE_HARDWARE_WATCHPOINT): Define.
(target_{insert,delete}_watchpoint): Define.
PSYMTAB_TO_SYMTAB, call target_terminal_ours_for_output first.
This is needed now that wait_for_inferior passes in endaddr.
* infrun.c: Move call to target_terminal_inferior from proceed
to resume.
beyond the end of the last function in an objfile.
* coff-solib.c (coff_solib_add): Use BFD to get fields from .lib
section.
* infrun.c (wait_for_inferior): Modify test for subroutine entry
to include pc out of bounds of the previous function.
* remote.c (remote_wait): Use strtoul for parsing 'N' message.
Add code to relocate symfile_objfile->sections.
* alpha-nat.c, alpha-tdep.c, config/alpha/alpha-osf1.mt,
config/alpha/nm-alpha.h, config/alpha/tm-alpha.h, osfsolib.c:
New files.
* Makefile.in: Add new files and dependencies.
* configure.in: Add alpha target.
* config/alpha/alpha-osf1.mh (NATDEPFILES): Add osfsolib.o
* config/alpha/alpha-osf1.mh (MH_CFLAGS): Remove, we can handle
shared libraries now.
* config/alpha/xm-alpha.h: Cleanup, get MAKEVA_* defines right.
* defs.h (CORE_ADDR): Make its type overridable via CORE_ADDR_TYPE,
provide `unsigned int' default.
* breakpoint.c (breakpoint_auto_delete): Delete only if we really
stopped for the breakpoint.
* stabsread.c, stabsread.h (define_symbol): Change valu parameter
to a CORE_ADDR.
* stabsread.c (read_range_type): Handle the case where the lower
bound overflows and the upper doesn't and the range is legal.
* infrun.c (resume): Do not step a breakpoint instruction if
CANNOT_STEP_BREAKPOINT is defined.
* inferior.h (CALL_DUMMY_LOCATION): New variant AT_ENTRY_POINT.
Now that we have the bp_call_dummy breakpoint the call dummy code
is no longer needed. PUSH_DUMMY_FRAME, PUSH_ARGUMENTS and
FIX_CALL_DUMMY can be used to set up everything for the dummy.
The breakpoint for the dummy is set at the entry point and thats it.
* blockframe.c (inside_entry_file, inside_entry_func): Do not stop
backtraces if pc is in the call dummy at the entry point.
* infcmd.c (run_stack_dummy): Handle AT_ENTRY_POINT case. Use
the expected breakpoint pc when setting up the frame for
set_momentary_breakpoint.
* symfile.c (entry_point_address): New function for AT_ENTRY_POINT
support.
* valops.c (call_function_by_hand): Handle AT_ENTRY_POINT case.
instead of doing it ourself.
* blockframe.c (reinit_frame_cache): Use code which was in
generic_mourn_inferior so we can use this function even when
we have switched targets.
* corelow.c (core_detach): Call reinit_frame_cache.
* target.c (target_detach): Don't call generic_mourn_inferior
(revert yesterday's change, now handled by core_detach).
* objfiles.c (free_objfile): Detach any core file if we call
SOLIB_CLEAR. #include target.h.
the saved pc from sigcontext on the stack for BSD signal handling.
* config/i386/tm-i386bsd.h (SIGTRAMP_START, SIGTRAMP_END, FRAME_CHAIN,
FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC, SIGCONTEXT_PC_OFFSET):
Define to make backtracing through sigtramp work.
* config/vax/tm-vax.h (SIGTRAMP_START, SIGTRAMP_END, TARGET_UPAGES,
FRAME_SAVED_PC, SIGCONTEXT_PC_OFFSET): Ditto.
config/gould/tmp-{pn,np1}.h,
config/{sparc/tm-sparc.h,pyr/tm-pyr.h,vax/tm-vax.h}: Remove field
next_frame from struct frame_info. It has no purpose beyond
->next->frame and is an artifact from GDB 2.8.
calling SKIP_PROLOGUE_FRAMELESS_P if it's defined.
* tm-sparc.h (SKIP_PROLOGUE, SKIP_PROLOGUE_FRAMELESS_P):
Define two variants, one faster.
* sparc-tdep.c (sparc_frame_chain): Use target_read_memory
and return zero, rather than giving an error.
(setup_arbitrary_frame): Initialize the PC in the new frame.
(skip_prologue): Add a second arg saying whether we're just
checking for a frameless function or not.