import gdb-1999-06-14 snapshot

This commit is contained in:
Jason Molenda 1999-06-14 18:08:47 +00:00
parent 308b1ffded
commit 0f71a2f66f
37 changed files with 5858 additions and 2631 deletions

View File

@ -1,3 +1,267 @@
1999-06-14 Stan Shebs <shebs@andros.cygnus.com>
* MAINTAINERS: Add Jimmy Guo and Jim Blandy as HP testsuite and
SVR4 solib maintainers, respectively.
1999-06-14 Michael Snyder <msnyder@cleaver.cygnus.com>
Add parameters to the gdb prompt.
* top.c (prompt): Rename to gdb_prompt_string for clarity.
(command_line_input): rename "prrompt" to prompt_arg for clarity.
(gdb_readline): rename "prrompt" to prompt_arg for clarity.
(read_command_lines): rename "prompt" to prompt_arg for clarity.
(stop_sig): call get_prompt instead of reading prompt string directly.
(command_loop): ditto.
(simplified_command_loop): ditto.
(gdb_prompt_escape): New variable. Esc char for prompt parameters.
(get_prompt_1): New function, workhorse for get_prompt.
(get_prompt): Completely rewrite. Add functionality for a
parameterized prompt, ie. the displayed prompt can change according
to the value of one or more expressions given as parameters in the
prompt string.
(init_main): use renamed variable gdb_prompt_string. Add new
command "set prompt-escape-char" to set gdb_prompt_escape.
Sun Jun 13 10:44:13 1999 Andrew Cagney <cagney@b1.cygnus.com>
* defs.h (gdb_stdlog), main.c: Declare.
* main.c (main): Initialize.
* gdbarch.c: Write trace messages to the log file.
* remote.c: Update any debug/log prints.
1999-06-11 Michael Snyder <msnyder@cleaver.cygnus.com>
* remote.c (remote_wait): Clean up new thread handling.
(record_currthread): Announce new threads.
1999-06-11 Jim Blandy <jimb@zwingli.cygnus.com>
* partial-stab.h (case N_LSYM, 'T' descriptor): Don't create
partial symbol table entries for nameless enums, even if the type
name is " ". (We still pick up the enum elements, though.)
* partial-stab.h: Remove #if 0'd sections, dating back to 1992,
which set a variable which exists nowhere else in the source.
Please examine your test suite output carefully, and report any
problems to me.
1999-06-11 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* event-top.c (setup_event_loop): Change name to start_event_loop.
Move the intialization of event-loop variables to
_initialize_event_loop.
(_initialize_event_loop): New function. Called at init time, to
set up important event-loop variables.
* event-loop.h: setup_event_loop is now start_event_loop.
* main.c (main): Ditto.
Fri Jun 11 18:34:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
* defs.h (gdb_file_rewind_ftype, gdb_file_rewind,
set_gdb_file_rewind, gdb_file_put_ftype, gdb_file_put,
set_gdb_file_put): Declare.
* utils.c (gdb_file_new): Initialize ``rewind'' and ``put''.
(struct gdb_file): Add to_rewind and to_put.
(null_file_put, null_file_rewind, gdb_file_put, gdb_file_rewind,
set_gdb_file_put, set_gdb_file_rewind): New functions.
(tui_file_rewind, tui_file_put): New functions.
(tui_file_new): Add rewind and put.
Fri Jun 11 15:10:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
* d10v-tdep.c (d10v_push_arguments): Fix order of arguments passed
to store_address.
Fri Jun 11 10:31:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
* remote.c (tty_input): Change array to pointer.
(_initialize_remote): Call build_remote_gdbarch_data.
(build_remote_gdbarch_data): New function. Allocate space for
tty_input.
(readsocket, readtty): Delete extern declaration of tty_input.
1999-06-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* event-top.c (gdb_readline2): Call the command handling function
via the input_handler pointer.
(change_line_handler): When turning off editing, set input_handler
as well.
* utils.c (prompt_for_continue): If running asynchronously, call
async_request_quit, instead of request_quit.
* tracepoint.c (read_actions): If running asynchronously, set the
signal handler for STOP_SIGNAL to handle_stop_sig.
* top.h: (source_line_number, source_file_name, source_error,
source_pre_error, history_expansion_p, server_command): export for
use of event-top.c.
* event-top.c: Include top.h and terminal.h.
(instream): Remove extern declaration.
(handle_sigint, handle_sigquit, handle_sighup, handle_sigfpe,
handle_sigwinch, async_do_nothing, async_disconnect,
async_float_handler, async_stop_sig): Make static.
(async_request_quit, async_do_nothing, async_disconnect,
async_float_handler, async_stop_sig): Add gdb_glient_data
argument.
(handle_stop_sig): New function.
(sigtstp_token): New variable.
(sigint_token, sigquit_token, sigfpe_token, sigwinch_token):
Change their type tp PTR.
(mark_async_signal_handler_wrapper): New function.
(setup_event_loop): Initialize all the variables used by readline
only if not already done while reading the .gdbinit file. Display
the initial gdb prompt, if .gdbinit took care of setting things up
for readline.
(change_line_handler): When turning on the use of readline,
initialize input_handler as well.
(command_line_handler): Set up the signal handler for STOP_SIGNAL
to be handle_stop_sig.
(async_init_signals): Remove coercion of signal handlers in calls
to create_async_signal_handler. Initialize token for stop signal.
(handle_sigint): Call async_request_quit using one argument.
(handle_sigint, handle_sigquit, handle_sighup, handle_sigfpe,
handle_sigwinch): Call mark_async_signal_handler_wrapper instead
of mark_async_signal_handler.
* event-loop.h: Add extern declarations for handle_stop_sig,
async_command_editing_p, async_annotation_suffix,
new_async_prompt, the_prompts.
* top.c (command_line_input): Set the signal handler to be
handle_stop_sig, in case gdb is running asynchronously.
(get_prompt): Return the top of the prompt stack if running
asynchronously.
(set_prompt): Set the top of the prompt stack if running
asynchronously.
(init_main): Move ``extern'' vars from here to event-loop.h.
1999-06-10 Michael Snyder <msnyder@cleaver.cygnus.com>
* values.c (value_from_string): new function. Make a value_ptr
from a string, with storage in local GDB memory (not in inferior).
* value.h (value_from_string): add prototype.
* remote.c (remote_cisco_ops): New remote target, "target cisco".
(init_remote_cisco_ops): New function, initialize new target.
(remote_cisco_mourn, remote_cisco_wait, remote_cisco_open,
remote_cisco_close): New functions, implement new target cisco.
(minitelnet, readtty, readsocket) New functions, implement the
I/O pass-through mode for target cisco.
(remote_wait): Detect special enhanced version of the 'S' packet
for target cisco.
(remote_cisco_expand): Perform Cisco variant of RLL decoding.
1999-06-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* event-loop.c (gdb_wait_for_event): Initialize num_found to 0.
* top.c (print_prompt): Delete this function.
From: Andrew Cagney <cagney@b1.cygnus.com>
* event-top.c (async_hook): Delete extern declaration.
* defs.h: Replace ``async_hook'' with ``async_p''.
* top.c (gdb_init, init_main, init_main, init_main, init_main):
Replace ``async_hook'' with ``async_p''.
* main.c: Rename ``async'' to ``async_p''.
(main): Add --noasync option.
(main): Hook in the asynchronous event-loop based CLI using
command_loop_hook instead of async_hook. Delete call to
async_hook().
Thu Jun 10 21:14:16 1999 Andrew Cagney <cagney@b1.cygnus.com>
* mn10300-tdep.c (mn10300_store_return_value,
mn10300_extract_struct_value_address,
mn10300_extract_return_value), config/mn10300/tm-mn10300.h: New
functions.
* config/mn10300/tm-mn10300.h (EXTRACT_STRUCT_VALUE_ADDRESS,
STORE_RETURN_VALUE, EXTRACT_RETURN_VALUE): Update.
(TARGET_MN10300): Delete macro. Not used.
Thu Jun 10 20:04:02 1999 Andrew Cagney <cagney@b1.cygnus.com>
* mn10300-tdep.c (mn10300_register_names): Make static.
(STORE_STRUCT_RETURN): Do not modify SP.
* config/mn10300/tm-mn10300.h(mn10300_register_name),
mn10300-tdep.c : New function.
* config/mn10300/tm-mn10300.h (REGISTER_NAME): Update.
* config/mn10300/tm-mn10300.h (mn10300_saved_pc_after_call),
mn10300-tdep.c: New function.
* config/mn10300/tm-mn10300.h (SAVED_PC_AFTER_CALL): Update.
1999-06-09 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* rs6000-tdep.c (skip_prologue): Don't mistake a branch for a
subroutine call.
1999-06-08 Michael Snyder <msnyder@cleaver.cygnus.com>
* remote.c (remote_wait): Add 'N' response packet, which is a
stop with signal number plus section offsets for .text, .data and
.bss. This is used by Cisco to indicate relocation offsets.
(remote_cisco_section_offsets, remote_cisco_objfile_relocate):
new files to support 'N' packet.
(remote_info_process): New function. Implements the
"info remote-process" command, by means of which the remote target
can report anything it wants to about the remote process/app being
debugged.
(_initialize_remote): add info remote-proc command.
(remote_threads_info): New function for "info threads" command.
Attempts to use new query "qfThreadInfo" instead of the old
undocumented query.
* exec.c (exec_set_section_offsets) new files to support 'N' packet.
Tue Jun 8 13:33:42 1999 Andrew Cagney <cagney@amy.cygnus.com>
* inferior.h (generic_target_read_pc, generic_target_write_pc,
generic_target_read_fp, generic_target_write_fp,
generic_target_read_sp, generic_target_write_sp): Declare new
functions.
* findvar.c (generic_target_read_pc, generic_target_write_pc,
generic_target_read_fp, generic_target_write_fp,
generic_target_read_sp, generic_target_write_sp): New functions.
(TARGET_READ_PC, TARGET_WRITE_PC, TARGET_READ_FP, TARGET_WRITE_FP,
TARGET_READ_SP, TARGET_WRITE_SP): Default to corresponding generic
function.
(write_pc_pid, write_pc_pid, read_sp, write_sp, read_fp,
write_fp): Simplify.
* gdbarch.c (verify_gdbarch): Always verify TARGET_PTR_BIT,
TARGET_SHORT_BIT, TARGET_INT_BIT, TARGET_LONG_BIT,
TARGET_LONG_LONG_BIT, TARGET_FLOAT_BIT, TARGET_DOUBLE_BIT,
TARGET_LONG_DOUBLE_BIT, TARGET_READ_PC, TARGET_WRITE_PC,
TARGET_READ_FP, TARGET_WRITE_FP, TARGET_READ_SP, TARGET_WRITE_SP,
USE_GENERIC_DUMMY_FRAMES, CALL_DUMMY_BREAKPOINT_OFFSET_P,
CALL_DUMMY_P, CALL_DUMMY_STACK_ADJUST_P, GET_SAVED_REGISTER,
REGISTER_CONVERTIBLE, PUSH_ARGUMENTS, PUSH_RETURN_ADDRESS,
FRAME_CHAIN_VALID.
(GET_GDBARCH, SET_GDBARCH): Delete macros. Implement functions
directly.
* gdbarch.h, gdbarch.c: Call fatal() instead of abort(). Identify
the function / macro with a problem. Always verify a architecture
attribute before returning it.
* gdbarch.h, gdbarch.c (generic_register_convertible_not): New
function.
* mips-tdep.c (mips_push_return_address): New function.
* config/mips/tm-mips.h (PUSH_RETURN_ADDRESS): Define.
* mips-tdep.c (mips_gdbarch_init): Initialize short_bit,
double_bit, long_double_bit, read_pc, write_pc, read_fp, write_fp,
read_sp, write_sp, frame_chain_valid, get_saved_register,
push_arguments, push_return_address, register_convertible,
call_dummy_p, use_generic_dummy_frames,
call_dummy_breakpoint_offset_p, call_dummy_stack_adjust_p,
call_dummy_words and sizeof_call_dummy_words.
* config/mips/tm-mips.h: Don't define CALL_DUMMY when multi-arch.
1999-06-07 Keith Seitz <keiths@cygnus.com>
* v850ice.c (init_hidden_window): Do not rely on the existence of
@ -52,6 +316,8 @@ Sun Jun 6 11:09:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
* remote.c (PBUFSIZ): Re-define so that value is computed at
run-time.
(MAXBUFBYTES): Re-define as a macro function.
* gdbarch.h, gdbarch.c: Add multi-arch support for REGISTER_BYTES.
* d10v-tdep.c, config/d10v/tm-d10v.h: Update.
1999-06-05 Fernando Nasser <fnasser@totem.to.cygnus.com>
@ -83,6 +349,11 @@ Fri Jun 4 17:10:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
* parser-defs.h (std_regs): Replace array with pointer.
* parse.c (build_parse): Build the std_regs table according to the
standard registers available.
(_initialize_parse): Register std_regs and num_std_regs as
architecture specific.
* gdbarch.h, gdbarch.c: Add multi-arch support for SP_REGNUM,
FP_REGNUM, PC_REGNUM, NUM_REGS, REGISTER_NAME.
* d10v-tdep.c, config/d10v/tm-d10v.h: Update.
1999-06-03 Michael Snyder <msnyder@cleaver.cygnus.com>
@ -110,6 +381,8 @@ Fri Jun 4 17:10:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
* parse.c: Ditto.
* somread.c: Ditto.
* gdbarch.h: Forward decl of struct value.
Thu Jun 3 10:12:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
* d10v-tdep.c (do_d10v_pop_frame): Rename d10v_pop_frame. Make
@ -118,6 +391,16 @@ Thu Jun 3 10:12:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
function. Call generic_pop_current_frame.
* config/d10v/tm-d10v.h (POP_FRAME): Update.
* gdbarch.h, gdbarch.c (frame_num_args_unknown): New function.
* gdbarch.h, gdbarch.c: Add multi-arch support for POP_FRAME,
SKIP_PROLOGUE, INNER_THAN, DECR_PC_AFTER_BREAK,
FUNCTION_START_OFFSET, REMOTE_TRANSLATE_XFER_ADDRESS, FRAME_CHAIN,
FRAME_CHAIN_VALID, FRAME_SAVED_PC, FRAME_ARGS_ADDRESS,
FRAME_LOCALS_ADDRESS, FRAME_ARGS_SKIP,
FRAMELESS_FUNCTION_INVOCATION, REGISTER_BYTE, REGISTER_RAW_SIZE,
REGISTER_VIRTUAL_SIZE, REGISTER_VIRTUAL_TYPE, SAVED_PC_AFTER_CALL,
FRAME_NUM_ARGS, MAX_REGISTER_RAW_SIZE, MAX_REGISTER_VIRTUAL_SIZE,
REGISTER_SIZE.
* d10v-tdep.c, config/d10v/tm-d10v.h: Update.
* config/d10v/tm-d10v.h (DMEM_START, IMEM_START, STACK_START,
ARG1_REGNUM, ARGN_REGNUM, RET1_REGNUM): Move definitions from
here.
@ -189,16 +472,29 @@ Wed Jun 2 17:37:03 1999 Jeffrey A Law (law@cygnus.com)
Wed Jun 2 16:10:08 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h, gdbarch.c: Add multi-arch support for
STORE_STRUCT_RETURN, STORE_RETURN_VALUE,
EXTRACT_STRUCT_VALUE_ADDRESS, USE_STRUCT_CONVENTION,
FRAME_INIT_SAVED_REGS and INIT_EXTRA_FRAME_INFO.
* d10v-tdep.c, config/d10v/tm-d10v.h: Update.
* config/d10v/tm-d10v.h (FRAME_INIT_SAVED_REGS): Replace
FRAME_FIND_SAVED_REGS.
(d10v_frame_init_saved_regs): Replace d10v_frame_find_saved_regs.
* d10v-tdep.c (d10v_pop_frame, d10v_frame_chain,
d10v_frame_init_saved_regs): Update.
* gdbarch.h: Disallow FRAME_FIND_SAVED_REGS when multi-arch.
* gdbarch.h, gdbarch.c: Add multi-arch support for
D10V_MAKE_DADDR, D10V_MAKE_IADDR, D10V_DADDR_P, D10V_IADDR_P,
D10V_CONVERT_DADDR_TO_RAW and D10V_CONVERT_IADDR_TO_RAW.
* d10v-tdep.c, config/d10v/tm-d10v.h: Update.
* config/d10v/tm-d10v.h (EXTRA_FRAME_INFO): Delete.
* d10v-tdep.c (struct frame_extra_info): Define.
(d10v_init_extra_frame_info, d10v_pop_frame, d10v_frame_chain,
d10v_frame_find_saved_regs): Update.
* gdbarch.h: Disallow EXTRA_FRAME_INFO when multi-arch.
Tue Jun 1 13:36:31 1999 Philippe De Muyter <phdm@macqel.be>
@ -209,18 +505,66 @@ Tue Jun 1 13:36:31 1999 Philippe De Muyter <phdm@macqel.be>
Wed Jun 2 11:18:37 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h, gdbarch.c: Add multi-arch support for
EXTRACT_RETURN_VALUE, PUSH_ARGUMENTS, PUSH_DUMMY_FRAME,
PUSH_RETURN_ADDRESS, POP_FRAME, FRAME_FIND_SAVED_REGS.
* d10v-tdep.c, config/d10v/tm-d10v.h: Update.
* gdbarch.h, gdbarch.c: Add multi-arch support for
REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL,
REGISTER_CONVERT_TO_RAW.
* config/d10v/tm-d10v.h, d10v-tdep.c (d10v_gdbarch_init): Update.
* defs.h (REGISTER_NAME): Move compatibility definition from here.
* gdbarch.h: To here.
* frame.h, blockframe.c (generic_fix_call_dummy): New
stub function.
* gdbarch.h, gdbarch.c: Add multi-arch support for FIX_CALL_DUMMY.
* config/d10v/tm-d10v.h, d10v-tdep.c (d10v_gdbarch_init): Update.
Tue Jun 1 20:06:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
* d10v-tdep.c (d10v_gdbarch_init): Set get_saved_register.
* config/d10v/tm-d10v.h: Update.
Tue Jun 1 19:50:05 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h, gdbarch.c: Add multi-arch support for TARGET_READ_PC,
TARGET_WRITE_PC, TARGET_READ_FP, TARGET_WRITE_FP, TARGET_READ_SP
and TARGET_WRITE_SP.
* config/d10v/tm-d10v.h, d10v-tdep.c (d10v_gdbarch_init): Update.
Tue Jun 1 19:19:02 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.c (default_gdbarch): Set field GET_SAVED_REGISTER to
generic_get_saved_register.
* gdbarch.c: Change update dispatch functions so that they check
for a NULL function pointer.
Tue Jun 1 19:19:02 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h, gdbarch.c: Add multi-arch support for TARGET_INT_BIT,
TARGET_CHAR_BIT, TARGET_SHORT_BIT, TARGET_FLOAT_BIT,
TARGET_DOUBLE_BIT and TARGET_LONG_DOUBLE_BIT.
* config/d10v/tm-d10v.h, d10v-tdep.c (d10v_gdbarch_init): Update.
Tue Jun 1 18:47:54 1999 Andrew Cagney <cagney@b1.cygnus.com>
* parse.c (build_parse): New function. Initialize
msym_text_symbol_type, msym_data_symbol_type and
msym_unknown_symbol_type.
(_initialize_parse): Call build_parse.
(_initialize_parse): Register variables msym_text_symbol_type,
msym_data_symbol_type as msym_unknown_symbol_type as
per-architecture.
Tue Jun 1 11:30:09 1999 Andrew Cagney <cagney@b1.cygnus.com>
* d10v-tdep.c (_initialize_d10v_tdep): Register d10v as an
architecture.
(d10v_gdbarch_init): New function.
* confg/d10v/tm-d10v.h (GDB_MULTI_ARCH): Define.
Tue Jun 1 10:45:24 1999 Andrew Cagney <cagney@b1.cygnus.com>
@ -406,6 +750,11 @@ Tue May 25 12:23:39 1999 Andrew Cagney <cagney@amy.cygnus.com>
(java_rerun_cleanup): Add extern declaration for this stub
function.
Tue May 25 12:06:29 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h: When multi-arch, check that REGISTER_NAMES was not
defined.
Mon May 24 16:16:29 1999 Andrew Cagney <cagney@amy.cygnus.com>
* inflow.c (_initialize_inflow), annotate.c
@ -865,6 +1214,15 @@ Mon Apr 26 08:55:46 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h, gdbarch.c: More format cleanups.
Sun Apr 25 18:54:51 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h (CALL_DUMMY_STACK_ADJUST_P): Replace
SIZEOF_CALL_DUMMY_STACK_ADJUST_P.
(CALL_DUMMY_STACK_ADJUST): Replace
SIZEOF_CALL_DUMMY_STACK_ADJUST_P.
* gdbarch.c (gdbarch_call_dummy_stack_adjust,
set_gdbarch_call_dummy_stack_adjust): Define.
Fri Apr 23 15:00:25 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.c (arch_ok): New function. Fix logic test for a valid
@ -878,6 +1236,11 @@ Fri Apr 23 15:00:25 1999 Andrew Cagney <cagney@b1.cygnus.com>
Thu Apr 22 21:02:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h, gdbarch.c (GET_SAVED_REGISTER, get_saved_register):
Add.
(struct gdbarch, verify_gdbarch, gdbarch_alloc, gdbarch_dump,
default_gdbarch): Update.
* value.h (get_saved_register): Cleanup prototype.
* findvar.c (default_get_saved_register): Rename function
get_saved_register.
@ -902,8 +1265,19 @@ Thu Apr 22 21:02:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
mn10200-tdep.c, m32r-tdep.c, h8300-tdep.c, rs6000-tdep.c: Delete
function get_saved_register.
Thu Apr 22 13:32:23 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.c: Cleanup. Re-order the definition of the ``struct
gdbarch'' initialization functions so that maintenance is more
straightforward.
Thu Apr 22 11:07:21 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h, gdbarch.c (use_generic_dummy_frames,
USE_GENERIC_DUMMY_FRAMES): Add.
(struct gdbarch, verify_gdbarch, gdbarch_alloc, gdbarch_dump,
default_gdbarch): Update.
* config/v850/tm-v850.h, config/tic80/tm-tic80.h,
config/sh/tm-sh.h, config/powerpc/tm-ppc-eabi.h,
config/mn10300/tm-mn10300.h, config/mn10200/tm-mn10200.h,
@ -928,13 +1302,32 @@ Thu Apr 22 11:07:21 1999 Andrew Cagney <cagney@b1.cygnus.com>
runtime test.
(get_saved_register): Always define.
Wed Apr 21 17:15:52 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.c (gdbarch_dump): Fix robustness check on
BELIEVE_PCC_PROMOTION_TYPE.
Wed Apr 21 15:39:27 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h (TARGET_BYTE_ORDER_SELECTABLE_P): When multi-arch,
force selectable byte order.
(CALL_DUMMY): Check for CALL_DUMMY definition when multi-arch. Are
incompatible.
* gdbarch.c (verify_gdbarch): Check call_dummy_stack_adjust.
Wed Apr 21 14:45:44 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.c (gdbarch_update): Move dump-arch code from here.
(gdbarch_dump): To here. Make more robust.
* gdbarch.h (gdbarch_dump): Add prototype.
* gdbarch.c (enum set_arch): Declare.
(set_arch): Add type parameter. Only disable
``target_architecture_auto'' when set_arch_manual.
(set_architecture, set_architecture_from_arch_mach,
set_architecture_from_file): Update.
(set_arch): When ``gdbarch_debug'', gdbarch_dump() the current
architecture.
Wed Apr 21 10:48:53 1999 Andrew Cagney <cagney@b1.cygnus.com>
@ -963,6 +1356,17 @@ Tue Apr 20 12:15:45 1999 Andrew Cagney <cagney@b1.cygnus.com>
* values.c (unpack_long): Ditto.
* printcmd.c (print_frame_args): Ditto.
Sat Apr 17 15:39:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h: Cleanup multi-arch comments.
Fri Apr 16 15:39:10 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h: Provide definition if GDB_MULTI_ARCH > 1 or
GDB_MULTI_ARCH > 0 and no previous definition.
* gdbarch.c (verify_gdbarch): Only verify a full multi-arch
target.
1999-04-15 Stan Shebs <shebs@andros.cygnus.com>
* infrun.c (wait_for_inferior) [HAVE_STEPPABLE_WATCHPOINT,
@ -985,6 +1389,13 @@ Tue Apr 20 12:15:45 1999 Andrew Cagney <cagney@b1.cygnus.com>
Wed Apr 14 11:09:45 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h (BELIEVE_PCC_PROMOTION_TYPE, BELIEVE_PCC_PROMOTION):
Add multi-arch definitions.
* gdbarch.c (gdbarch_believe_pcc_promotion,
gdbarch_believe_pcc_promotion_type): New functions.
(gdbarch_update): Update
(struct gdbarch default_gdbarch): Update.
* stabsread.c (BELIEVE_PCC_PROMOTION_TYPE): Provide default.
(define_symbol): Change #if BELIEVE_PCC_PROMOTION_TYPE and #if
BELIEVE_PCC_PROMOTION to if().
@ -995,6 +1406,19 @@ Wed Apr 14 11:09:45 1999 Andrew Cagney <cagney@b1.cygnus.com>
on a Solaris host (of any architecture).
* configure: Regenerated.
Wed Apr 14 08:23:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.c (SET_GDBARCH, GET_GDBARCH, FSET_GDBARCH): New macros.
(gdbarch_byte_order, gdbarch_long_bit, gdbarch_long_long_bit,
gdbarch_ptr_bit, gdbarch_call_dummy_location,
gdbarch_call_dummy_address, gdbarch_call_dummy_address,
gdbarch_call_dummy_breakpoint_offset,
gdbarch_call_dummy_breakpoint_offset, gdbarch_call_dummy_length,
gdbarch_pc_in_call_dummy, dbarch_call_dummy_breakpoint_offset_p,
dbarch_call_dummy_p, dbarch_call_dummy_words,
dbarch_sizeof_call_dummy_words, dbarch_call_dummy_stack_adjust,
dbarch_call_dummy_stack_adjust_p): Define using new macros.
1999-04-13 Jason Molenda (jsm@bugshack.cygnus.com)
* rom68k-rom.c (init_rom68k_cmds): Fix an accidental substitution
@ -1043,6 +1467,16 @@ Mon Apr 12 15:57:16 1999 Andrew Cagney <cagney@b1.cygnus.com>
* valops.c (hand_function_call): Replace #ifdef
CALL_DUMMY_STACK_ADJUST with if (CALL_DUMMY_STACK_ADJUST_P).
* gdbarch.h (SIZEOF_CALL_DUMMY_STACK_ADJUST,
(SIZEOF_CALL_DUMMY_STACK_ADJUST_P): Define
* gdbarch.c (struct gdbarch): Add call_dummy_stack_adjust,
call_dummy_stack_adjust_p.
(gdbarch_call_dummy_stack_adjust,
set_gdbarch_call_dummy_stack_adjust,
gdbarch_call_dummy_stack_adjust_p,
set_gdbarch_call_dummy_stack_adjust_p): New functions.
(default_gdbarch): Update.
1999-04-09 Jim Blandy <jimb@zwingli.cygnus.com>
* ax-gdb.c, ax-gdb.h, ax-general.c, ax.h: Remove RCS Id strings.
@ -1068,6 +1502,15 @@ Thu Apr 8 16:04:34 1999 Andrew Cagney <cagney@b1.cygnus.com>
*dummy1 using alloca.
* breakpoint.c (frame_in_dummy): Update.
* gdbarch.h (CALL_DUMMY_P, CALL_DUMMY_WORDS,
SIZEOF_CALL_DUMMY_WORDS): Define.
* gdbarch.c (gdbarch_call_dummy_p, set_gdbarch_call_dummy_p,
gdbarch_call_dummy_words, set_gdbarch_call_dummy_words,
gdbarch_sizeof_call_dummy_words,
set_gdbarch_sizeof_call_dummy_words): New functions.
(gdbarch_alloc, verify_gdbarch, gdbarch_update, struct
default_gdbarch): Update.
1999-04-08 Jason Molenda (jsm@bugshack.cygnus.com)
* monitor.c (monitor_read_memory): If a MO_GETMEM_NEEDS_RANGE
@ -1094,6 +1537,12 @@ Thu Apr 8 14:13:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
(run_stack_dummy): Update.
* infrun.c (wait_for_inferior): Update
* gdbarch.h (CALL_DUMMY_BREAKPOINT_OFFSET_P): New macro.
* gdbarch.c (set_gdbarch_call_dummy_breakpoint_offset_p,
gdbarch_call_dummy_breakpoint_offset_p): New functions.
(struct gdbarch, gdbarch_alloc, default_gdbarch, gdbarch_update):
Update.
1999-04-07 Stan Shebs <shebs@andros.cygnus.com>
* MAINTAINERS: Mark Alexander can no longer maintain
@ -1275,6 +1724,13 @@ Fri Mar 26 17:27:27 1999 Andrew Cagney <cagney@b1.cygnus.com>
Thu Mar 25 19:30:02 1999 Andrew Cagney <cagney@amy.cygnus.com>
* gdbarch.c: Include all headers.
(struct gdbarch), gdbarch.h (CALL_DUMMY_LOCATION,
CALL_DUMMY_ADDRESS, CALL_DUMMY_START_OFFSET,
CALL_DUMMY_BREAKPOINT_OFFSET, CALL_DUMMY_LENGTH,
PC_IN_CALL_DUMMY): Add ``call_dummy_location'',
``call_dummy_length'', ``pc_in_call_dummy'',
``call_dummy_start_offset'', ``call_dummy_breakpoint_offset'' to
multi-arch framework.
* inferior.h, blockframe.c (pc_in_call_dummy_before_text_end,
pc_in_call_dummy_after_text_end, pc_in_call_dummy_on_stack,
@ -1527,6 +1983,8 @@ Wed Mar 10 21:20:25 1999 Andrew Cagney <cagney@b1.cygnus.com>
(build_findvar): New function. Allocate space for REGISTERS and
REGISTER_VALID.
(_initialize_findvar): Call build_findvar.
(_initialize_findvar): Register REGISTERS and REGISTER_VALID as
arch dependant.
* inferior.h (registers, register_valid): Replace array with
pointer.
@ -1546,6 +2004,7 @@ Wed Mar 10 21:20:25 1999 Andrew Cagney <cagney@b1.cygnus.com>
* infrun.c (stop_registers): Update.
(build_infrun): Initialize stop_registers.
(_initialize_infrun): Call build_infrun.
(_initialize_infrun): Register ``stop_registers'' as arch dependant.
Wed Mar 10 14:50:42 1999 Andrew Cagney <cagney@amy.cygnus.com>

View File

@ -3355,11 +3355,62 @@ Fri Dec 18 14:23:34 1998 Andrew Cagney <cagney@chook>
(mips_push_arguments, mips_push_dummy_frame, mips_pop_frame,
mips_extract_return_value): Update.
Fri Dec 18 12:56:56 1998 Andrew Cagney <cagney@chook>
* gdbarch.h (gdbarch_init_ftype): Pass struct gdbarch_info
by-value.
(struct gdbarch_info): Add struct gdbarch_tdep_info *tdep_info.
* gdbarch.c (gdbarch_update): Update.
* gdbarch.c (gdbarch_update): Add more tracing.
Thu Dec 17 02:15:40 1998 Andrew Cagney <cagney@chook.cygnus.com>
* configure.tgt (gdb_target): Identify mips64*vr4100*-*-elf* as
vr4100.
Thu Dec 17 02:01:58 1998 Andrew Cagney <cagney@chook>
* gdbtypes.c (_initialize_gdbtypes): Register all builtin types
with gdbarch so that they are updated whenever the architecture is
changed.
Thu Dec 17 01:58:16 1998 Andrew Cagney <cagney@chook>
* gdbarch.h (GDB_MULTI_ARCH): New macro, default to zero.
(current_gdbarch): Current architecture pointer.
* gdbarch.c (struct gdbarch): Define.
* gdbarch.h (TARGET_ARCHITECTURE, TARGET_BYTE_ORDER,
TARGET_LONG_BIT, TARGET_LONG_LONG_BIT, TARGET_PTR_BIT): When
multi-arch force definition.
* gdbarch.h, gdbarch.c (gdbarch_tdep, gdbarch_bfd_arch_info,
gdbarch_byte_order, {set,}gdbarch_long_bit,
{set,}gdbarch_long_long_bit, {set,}gdbarch_ptr_bit): Corresponding
functions.
* gdbarch.h (struct gdbarch_list, struct gdbarch_info,
gdbarch_init_ftype), gdbarch.c (register_gdbarch_init): Mechanism
for registering an architecture with GDB.
(gdbarch_list_lookup_by_info, gdbarch_alloc, gdbarch_update,
verify_gdbarch): Support functions.
* gdbarch.h (gdbarch_data_ftype), gdbarch.c
(register_gdbarch_data, gdbarch_data): Mechanism for maintaining
per-architecture pointers.
(init_gdbarch_data): Support functions.
* gdbarch.h (gdbarch_swap_ftype), gdbarch.c
(register_gdbarch_swap): Ditto for swapped memory regions.
(init_gdbarch_swap, swapout_gdbarch_swap, swapin_gdbarch_swap):
Support functions.
* gdbarch.c (set_endian_big, set_endian_little, set_architecture,
info_architecture, set_gdbarch_from_file): Hook in multi-arch
code by calling gdbarch_update.
(default_gdbarch): Default multi-arch vector. Use host's type
system for values.
Thu Dec 17 01:34:36 1998 Andrew Cagney <cagney@chook>
* gdbtypes.c (build_gdbtypes): New function.
@ -4402,6 +4453,11 @@ Thu Oct 8 08:40:42 1998 Mark Alexander <marka@cygnus.com>
* rs6000-tdep.c (get_saved_register): Define only if
USE_GENERIC_DUMMY_FRAMES is defined.
Tue Oct 6 21:35:10 1998 Andrew Cagney <cagney@b1.cygnus.com>
* Makefile.in (DEPFILES): Add TARGET_OBS.
(TARGET_OBS): Defined by configure.
1998-10-06 Jason Molenda (jsm@bugshack.cygnus.com)
Eliminate a few warnings from the compiler.

View File

@ -1,3 +1,4 @@
hp testsuite (gdb.hp) Jimmy Guo adl-debugger-wdb-merge-guru@cup.hp.com
d10v target Andrew Cagney cagney@cygnus.com
d30v target Andrew Cagney cagney@cygnus.com
mips target Andrew Cagney cagney@cygnus.com
@ -17,6 +18,7 @@ elf reader Jim Blandy jimb@cygnus.com
stabs reader Jim Blandy jimb@cygnus.com
x86 linux native Jim Blandy jimb@cygnus.com
Scheme support Jim Blandy jimb@cygnus.com
svr4 shlibs (solib.c) Jim Blandy jimb@cygnus.com
hurd native Mark Kettenis kettenis@wins.va.nl
hpux, hp pa native Jeff Law law@cygnus.com
m32r target Michael Snyder msnyder@cygnus.com

View File

@ -219,7 +219,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \
ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
VERSION = 19990607
VERSION = 19990614
DIST=gdb
LINT=/usr/5bin/lint

View File

@ -19,11 +19,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Contributed by Martin Hunt, hunt@cygnus.com */
#define GDB_MULTI_ARCH 1
/* #define GDB_TARGET_IS_D10V - moved to gdbarch.h */
/* Define the bit, byte, and word ordering of the machine. */
#if !GDB_MULTI_ARCH
#define TARGET_BYTE_ORDER BIG_ENDIAN
/* Offset from address of function to start of its code.
@ -53,6 +56,8 @@ extern char *d10v_register_name PARAMS ((int reg_nr));
#define NUM_REGS 37
#endif /* GDB_MULTI_ARCH */
/* Register numbers of various important registers.
Note that some of these values are "real" register numbers,
and correspond to the general registers of the machine,
@ -64,15 +69,19 @@ extern char *d10v_register_name PARAMS ((int reg_nr));
#define R0_REGNUM 0
#define LR_REGNUM 13
#if !GDB_MULTI_ARCH
#define SP_REGNUM 15
#define FP_REGNUM 11
#define PC_REGNUM 18
#endif
#define PSW_REGNUM 16
#define IMAP0_REGNUM 32
#define IMAP1_REGNUM 33
#define DMAP_REGNUM 34
#define A0_REGNUM 35
#if !GDB_MULTI_ARCH
/* ??? */
#define REGISTER_SIZE 2
@ -298,3 +307,4 @@ extern void remote_d10v_translate_xfer_address PARAMS ((CORE_ADDR gdb_addr, int
#define REMOTE_TRANSLATE_XFER_ADDRESS(GDB_ADDR, GDB_LEN, REM_ADDR, REM_LEN) \
remote_d10v_translate_xfer_address ((GDB_ADDR), (GDB_LEN), (REM_ADDR), (REM_LEN))
#endif

View File

@ -386,10 +386,12 @@ extern void mips_find_saved_regs PARAMS ((struct frame_info *));
function calls. We don't need STACK_ALIGN, PUSH_ARGUMENTS will
handle it. */
extern CORE_ADDR mips_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
(mips_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
extern CORE_ADDR
mips_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
extern CORE_ADDR mips_push_return_address PARAMS ((CORE_ADDR pc, CORE_ADDR sp));
#define PUSH_RETURN_ADDRESS(PC, SP) (mips_push_return_address ((PC), (SP)))
/* Push an empty stack frame, to record the current PC, etc. */

View File

@ -37,8 +37,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define REGISTER_BYTES (NUM_REGS * REGISTER_SIZE)
extern char **mn10300_register_names;
#define REGISTER_NAME(i) mn10300_register_names[i]
extern char *mn10300_register_name PARAMS ((int regnr));
#define REGISTER_NAME(i) (mn10300_register_name (i))
#define D2_REGNUM 2
#define D3_REGNUM 3
@ -65,8 +65,9 @@ extern breakpoint_from_pc_fn mn10300_breakpoint_from_pc;
#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
extern CORE_ADDR mn10300_saved_pc_after_call PARAMS ((struct frame_info *frame));
#define SAVED_PC_AFTER_CALL(frame) \
read_memory_integer (read_register (SP_REGNUM), 4)
mn10300_saved_pc_after_call (frame)
#ifdef __STDC__
struct frame_info;
@ -92,25 +93,20 @@ extern CORE_ADDR mn10300_frame_saved_pc PARAMS ((struct frame_info *));
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. */
extern void mn10300_extract_return_value PARAMS ((struct type *type, char *regbuf, char *valbuf));
#define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
if (TYPE_CODE (TYPE) == TYPE_CODE_PTR) \
memcpy (VALBUF, REGBUF + REGISTER_BYTE (4), TYPE_LENGTH (TYPE)); \
else \
memcpy (VALBUF, REGBUF + REGISTER_BYTE (0), TYPE_LENGTH (TYPE));
mn10300_extract_return_value (TYPE, REGBUF, VALBUF)
CORE_ADDR mn10300_extract_struct_value_address PARAMS ((char *regbuf));
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
extract_address (REGBUF + REGISTER_BYTE (4), \
REGISTER_RAW_SIZE (4))
mn10300_extract_struct_value_address (REGBUF)
void mn10300_store_return_value PARAMS ((struct type *type, char *valbuf));
#define STORE_RETURN_VALUE(TYPE, VALBUF) \
if (TYPE_CODE (TYPE) == TYPE_CODE_PTR) \
write_register_bytes(REGISTER_BYTE (4), VALBUF, TYPE_LENGTH (TYPE)); \
else \
write_register_bytes(REGISTER_BYTE (0), VALBUF, TYPE_LENGTH (TYPE));
mn10300_store_return_value (TYPE, VALBUF)
#define STORE_STRUCT_RETURN(STRUCT_ADDR, SP) \
(SP) = mn10300_store_struct_return (STRUCT_ADDR, SP)
(mn10300_store_struct_return (STRUCT_ADDR, SP))
extern CORE_ADDR mn10300_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(pc) (mn10300_skip_prologue (pc))
@ -160,7 +156,3 @@ extern use_struct_convention_fn mn10300_use_struct_convention;
extern void mn10300_virtual_frame_pointer PARAMS ((CORE_ADDR, long *, long *));
#define TARGET_VIRTUAL_FRAME_POINTER(PC, REGP, OFFP) \
mn10300_virtual_frame_pointer ((PC), (REGP), (OFFP))
/* Define this for Wingdb */
#define TARGET_MN10300

View File

@ -924,7 +924,7 @@ d10v_push_arguments (nargs, args, sp, struct_return, struct_addr)
{
char ptr[2];
/* arg will go onto stack */
store_address (ptr, val & 0xffff, 2);
store_address (ptr, 2, val & 0xffff);
si = push_stack_item (si, ptr, 2);
}
}
@ -1322,12 +1322,122 @@ display_trace (low, high)
}
static gdbarch_init_ftype d10v_gdbarch_init;
static struct gdbarch *
d10v_gdbarch_init (info, arches)
struct gdbarch_info info;
struct gdbarch_list *arches;
{
static LONGEST d10v_call_dummy_words[] = { 0 };
struct gdbarch *gdbarch;
int d10v_num_regs = 37;
/* there is only one d10v architecture */
if (arches != NULL)
return arches->gdbarch;
gdbarch = gdbarch_alloc (&info, NULL);
set_gdbarch_read_pc (gdbarch, d10v_read_pc);
set_gdbarch_write_pc (gdbarch, d10v_write_pc);
set_gdbarch_read_fp (gdbarch, d10v_read_fp);
set_gdbarch_write_fp (gdbarch, d10v_write_fp);
set_gdbarch_read_sp (gdbarch, d10v_read_sp);
set_gdbarch_write_sp (gdbarch, d10v_write_sp);
set_gdbarch_num_regs (gdbarch, d10v_num_regs);
set_gdbarch_sp_regnum (gdbarch, 15);
set_gdbarch_fp_regnum (gdbarch, 11);
set_gdbarch_pc_regnum (gdbarch, 18);
set_gdbarch_register_name (gdbarch, d10v_register_name);
set_gdbarch_register_size (gdbarch, 2);
set_gdbarch_register_bytes (gdbarch, (d10v_num_regs - 2) * 2 + 16);
set_gdbarch_register_byte (gdbarch, d10v_register_byte);
set_gdbarch_register_raw_size (gdbarch, d10v_register_raw_size);
set_gdbarch_max_register_raw_size (gdbarch, 8);
set_gdbarch_register_virtual_size (gdbarch, d10v_register_virtual_size);
set_gdbarch_max_register_virtual_size (gdbarch, 8);
set_gdbarch_register_virtual_type (gdbarch, d10v_register_virtual_type);
set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT);
set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_long_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_double_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
set_gdbarch_call_dummy_length (gdbarch, 0);
set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT);
set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
set_gdbarch_call_dummy_start_offset (gdbarch, 0);
set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy);
set_gdbarch_call_dummy_words (gdbarch, d10v_call_dummy_words);
set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (d10v_call_dummy_words));
set_gdbarch_call_dummy_p (gdbarch, 1);
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
set_gdbarch_register_convertible (gdbarch, d10v_register_convertible);
set_gdbarch_register_convert_to_virtual (gdbarch, d10v_register_convert_to_virtual);
set_gdbarch_register_convert_to_raw (gdbarch, d10v_register_convert_to_raw);
set_gdbarch_extract_return_value (gdbarch, d10v_extract_return_value);
set_gdbarch_push_arguments (gdbarch, d10v_push_arguments);
set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
set_gdbarch_push_return_address (gdbarch, d10v_push_return_address);
set_gdbarch_d10v_make_daddr (gdbarch, d10v_make_daddr);
set_gdbarch_d10v_make_iaddr (gdbarch, d10v_make_iaddr);
set_gdbarch_d10v_daddr_p (gdbarch, d10v_daddr_p);
set_gdbarch_d10v_iaddr_p (gdbarch, d10v_iaddr_p);
set_gdbarch_d10v_convert_daddr_to_raw (gdbarch, d10v_convert_daddr_to_raw);
set_gdbarch_d10v_convert_iaddr_to_raw (gdbarch, d10v_convert_iaddr_to_raw);
set_gdbarch_store_struct_return (gdbarch, d10v_store_struct_return);
set_gdbarch_store_return_value (gdbarch, d10v_store_return_value);
set_gdbarch_extract_struct_value_address (gdbarch, d10v_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, d10v_use_struct_convention);
set_gdbarch_frame_init_saved_regs (gdbarch, d10v_frame_init_saved_regs);
set_gdbarch_init_extra_frame_info (gdbarch, d10v_init_extra_frame_info);
set_gdbarch_pop_frame (gdbarch, d10v_pop_frame);
set_gdbarch_skip_prologue (gdbarch, d10v_skip_prologue);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_decr_pc_after_break (gdbarch, 4);
set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_breakpoint_from_pc (gdbarch, d10v_breakpoint_from_pc);
set_gdbarch_remote_translate_xfer_address (gdbarch, remote_d10v_translate_xfer_address);
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue);
set_gdbarch_frame_chain (gdbarch, d10v_frame_chain);
set_gdbarch_frame_chain_valid (gdbarch, d10v_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, d10v_frame_saved_pc);
set_gdbarch_frame_args_address (gdbarch, d10v_frame_args_address);
set_gdbarch_frame_locals_address (gdbarch, d10v_frame_locals_address);
set_gdbarch_saved_pc_after_call (gdbarch, d10v_saved_pc_after_call);
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
return gdbarch;
}
extern void (*target_resume_hook) PARAMS ((void));
extern void (*target_wait_loop_hook) PARAMS ((void));
void
_initialize_d10v_tdep ()
{
register_gdbarch_init (bfd_arch_d10v, d10v_gdbarch_init);
tm_print_insn = print_insn_d10v;
target_resume_hook = d10v_eva_prepare_to_trace;

View File

@ -359,8 +359,15 @@ struct tui_stream
struct gdb_file;
typedef struct gdb_file GDB_FILE; /* deprecated */
/* Normal results */
extern GDB_FILE *gdb_stdout;
/* Serious error notifications */
extern GDB_FILE *gdb_stderr;
/* Log/debug/trace messages that should bypass normal stdout/stderr
filtering. For momement, always call this stream using
*_unfiltered. In the very near future that restriction shall be
removed - either call shall be unfiltered. (cagney 1999-06-13). */
extern GDB_FILE *gdb_stdlog;
#if defined(TUI)
#include "tui.h"
@ -382,6 +389,12 @@ extern void set_gdb_file_fputs PARAMS ((struct gdb_file *stream, gdb_file_fputs_
typedef int (gdb_file_isatty_ftype) PARAMS ((struct gdb_file *stream));
extern void set_gdb_file_isatty PARAMS ((struct gdb_file *stream, gdb_file_isatty_ftype *isatty));
typedef void (gdb_file_rewind_ftype) PARAMS ((struct gdb_file *stream));
extern void set_gdb_file_rewind PARAMS ((struct gdb_file *stream, gdb_file_rewind_ftype *rewind));
typedef void (gdb_file_put_ftype) PARAMS ((struct gdb_file *stream, struct gdb_file *dest));
extern void set_gdb_file_put PARAMS ((struct gdb_file *stream, gdb_file_put_ftype *put));
typedef void (gdb_file_delete_ftype) PARAMS ((struct gdb_file *stream));
extern void set_gdb_file_data PARAMS ((struct gdb_file *stream, void *data, gdb_file_delete_ftype *delete));
@ -389,6 +402,11 @@ extern struct gdb_file *gdb_file_new PARAMS ((void));
extern void gdb_file_delete PARAMS ((struct gdb_file *stream));
extern void gdb_file_rewind PARAMS ((struct gdb_file *stream));
/* NOTE: copies left to right */
extern void gdb_file_put PARAMS ((struct gdb_file *src, struct gdb_file *dest));
extern void *gdb_file_data PARAMS ((struct gdb_file *file));
/* Open the specified FILE as a gdb_file. */
@ -1068,13 +1086,15 @@ extern CORE_ADDR push_word PARAMS ((CORE_ADDR, ULONGEST));
extern int watchdog;
/* Hooks for alternate command interfaces. */
#ifdef __STDC__
struct target_waitstatus;
struct cmd_list_element;
#endif
extern void (*async_hook) PARAMS ((void));
/* Should the asynchronous variant of the interpreter (using the
event-loop) be enabled? */
extern int async_p;
extern void (*init_ui_hook) PARAMS ((char *argv0));
extern void (*command_loop_hook) PARAMS ((void));
extern void (*fputs_unfiltered_hook) PARAMS ((const char *linebuffer,

View File

@ -1398,6 +1398,15 @@ detect that GCC compiled the file. The default symbols are
@code{gcc_compiled.} and @code{gcc2_compiled.}, respectively. (Currently
only defined for the Delta 68.)
@item GDB_MULTI_ARCH
If defined and non-zero, enables suport for multiple architectures
within GDB.
The support can be enabled at two levels. At level one, only
definitions for previously undefined macros are provided; at level two,
a multi-arch definition of all architecture dependant macros will be
defined.
@item GDB_TARGET_IS_HPPA
This determines whether horrible kludge code in dbxread.c and
partial-stab.h is used to mangle multiple-symbol-table files from

View File

@ -531,7 +531,8 @@ gdb_wait_for_event ()
{
file_handler *file_ptr;
gdb_event *file_event_ptr;
int num_found, i;
int num_found = 0;
int i;
#ifndef HAVE_POLL
int mask, bit, index;

View File

@ -233,6 +233,8 @@ struct prompts
#define PREFIX(X) the_prompts.prompt_stack[the_prompts.top + X].prefix
#define SUFFIX(X) the_prompts.prompt_stack[the_prompts.top + X].suffix
/* Exported functions from event-top.c */
extern void delete_file_handler PARAMS ((int));
extern void
create_file_handler PARAMS ((int, int, file_handler_func, gdb_client_data));
@ -240,14 +242,19 @@ extern int gdb_do_one_event PARAMS ((void));
extern void mark_async_signal_handler PARAMS ((async_signal_handler *));
extern async_signal_handler *
create_async_signal_handler PARAMS ((async_handler_func *, gdb_client_data));
extern void delete_async_signal_handler PARAMS ((async_signal_handler *async_handler_ptr));
extern void display_gdb_prompt PARAMS ((char*));
extern void setup_event_loop PARAMS ((void));
extern void start_event_loop PARAMS ((void));
extern void async_init_signals PARAMS ((void));
extern void set_async_editing_command PARAMS ((char *, int, struct cmd_list_element *));
extern void set_async_annotation_level PARAMS ((char *, int, struct cmd_list_element *));
extern void set_async_prompt PARAMS ((char *, int, struct cmd_list_element *));
extern void handle_stop_sig PARAMS ((int));
/* Exported variables from event-top.c */
extern int async_command_editing_p;
extern char *async_annotation_suffix;
extern char *new_async_prompt;
extern struct prompts the_prompts;

View File

@ -20,10 +20,12 @@
#include "defs.h"
#include "event-loop.h"
#include "top.h"
#ifdef HAVE_POLL
#include <sys/poll.h>
#endif
#include "inferior.h"
#include "terminal.h" /* for job_control*/
/* readline include files */
#include <readline/readline.h>
@ -32,7 +34,7 @@
/* readline defines this. */
#undef savestring
extern FILE *instream;
extern void _initialize_event_loop (void);
static void command_line_handler PARAMS ((char *));
static void gdb_readline2 PARAMS ((void));
@ -43,32 +45,26 @@ static void change_annotation_level PARAMS ((void));
static void command_handler PARAMS ((char *));
/* Signal handlers. */
void handle_sigint PARAMS ((int));
void handle_sigquit PARAMS ((int));
void handle_sighup PARAMS ((int));
void handle_sigfpe PARAMS ((int));
void handle_sigwinch PARAMS ((int));
static void handle_sigint PARAMS ((int));
static void handle_sigquit PARAMS ((int));
static void handle_sighup PARAMS ((int));
static void handle_sigfpe PARAMS ((int));
static void handle_sigwinch PARAMS ((int));
/* Signal to catch ^Z typed while reading a command: SIGTSTP or SIGCONT. */
#ifndef STOP_SIGNAL
#ifdef SIGTSTP
#define STOP_SIGNAL SIGTSTP
void handle_stop_sig PARAMS ((int));
#endif
#endif
/* Functions to be invoked by the event loop in response to
signals. */
void async_request_quit PARAMS ((void));
void async_do_nothing PARAMS ((void));
void async_disconnect PARAMS ((void));
void async_float_handler PARAMS ((void));
/* Functions from top.c. */
extern void command_loop_marker PARAMS ((int));
extern int quit_cover PARAMS ((PTR));
extern void quit_command PARAMS ((char *, int));
extern void execute_command PARAMS ((char *, int));
/* Variables from top.c. */
extern int source_line_number;
extern char *source_file_name;
extern char *source_error;
extern char *source_pre_error;
extern int history_expansion_p;
extern int server_command;
void async_request_quit PARAMS ((gdb_client_data));
static void async_do_nothing PARAMS ((gdb_client_data));
static void async_disconnect PARAMS ((gdb_client_data));
static void async_float_handler PARAMS ((gdb_client_data));
static void async_stop_sig PARAMS ((gdb_client_data));
/* If this definition isn't overridden by the header files, assume
that isatty and fileno exist on this system. */
@ -76,9 +72,6 @@ extern int server_command;
#define ISATTY(FP) (isatty (fileno (FP)))
#endif
/* Hook for alternate command interface. */
void (*async_hook) PARAMS ((void));
/* Readline offers an alternate interface, via callback
functions. These are all included in the file callback.c in the
readline distribution. This file provides (mainly) a function, which
@ -106,7 +99,7 @@ void (*call_readline) PARAMS ((void));
/* This is used to determine if GDB is using the readline library or
its own simplified form of readline. It is used by the asynchronous
form of the set editing command.
form of the set editing command.
ezannoni: as of 1999-04-29 I expect that this
variable will not be used after gdb is changed to use the event
loop as default engine, and event-top.c is merged into top.c. */
@ -135,15 +128,20 @@ struct prompts the_prompts;
handlers mark these functions as ready to be executed and the event
loop, in a later iteration, calls them. See the function
invoke_async_signal_handler. */
async_signal_handler *sigint_token;
PTR sigint_token;
#ifdef SIGHUP
async_signal_handler *sighup_token;
PTR sighup_token;
#endif
async_signal_handler *sigquit_token;
async_signal_handler *sigfpe_token;
PTR sigquit_token;
PTR sigfpe_token;
#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
async_signal_handler *sigwinch_token;
PTR sigwinch_token;
#endif
#ifdef STOP_SIGNAL
PTR sigtstp_token;
#endif
void mark_async_signal_handler_wrapper PARAMS ((void *));
/* Structure to save a partially entered command. This is used when
the user types '\' at the end of a command line. This is necessary
@ -163,46 +161,27 @@ readline_input_state;
/* Initialize all the necessary variables, start the event loop,
register readline, and stdin. */
void
setup_event_loop ()
start_event_loop ()
{
int length = strlen (PREFIX (0)) + strlen (PROMPT (0)) + strlen (SUFFIX (0)) + 1;
char *a_prompt = (char *) xmalloc (length);
int length;
char *a_prompt;
/* Set things up for readline to be invoked via the alternate
interface, i.e. via a callback function (rl_callback_read_char). */
call_readline = rl_callback_read_char;
/* When readline has read an end-of-line character, it passes the
complete line to gdb for processing. command_line_handler is the
function that does this. */
input_handler = command_line_handler;
/* Tell readline what the prompt to display is and what function it
will need to call after a whole line is read. */
strcpy (a_prompt, PREFIX (0));
strcat (a_prompt, PROMPT (0));
strcat (a_prompt, SUFFIX (0));
rl_callback_handler_install (a_prompt, input_handler);
/* Tell readline to use the same input stream that gdb uses. */
rl_instream = instream;
/* Get a file descriptor for the input stream, so that we can
register it with the event loop. */
input_fd = fileno (instream);
/* Now we need to create the event sources for the input file descriptor. */
/* At this point in time, this is the only event source that we
register with the even loop. Another source is going to be the
target program (inferior), but that must be registered only when
it actually exists (I.e. after we say 'run' or after we connect
to a remote target. */
#ifdef HAVE_POLL
create_file_handler (input_fd, POLLIN,
(file_handler_func *) call_readline, 0);
#else
create_file_handler (input_fd, GDB_READABLE,
(file_handler_func *) call_readline, 0);
#endif
/* If we are using readline, set things up and display the first
prompt, otherwise just print the prompt. */
if (async_command_editing_p)
{
/* Tell readline what the prompt to display is and what function it
will need to call after a whole line is read. This also displays
the first prompt.*/
length = strlen (PREFIX (0)) + strlen (PROMPT (0)) + strlen (SUFFIX (0)) + 1;
a_prompt = (char *) xmalloc (length);
strcpy (a_prompt, PREFIX (0));
strcat (a_prompt, PROMPT (0));
strcat (a_prompt, SUFFIX (0));
rl_callback_handler_install (a_prompt, input_handler);
}
else
display_gdb_prompt (0);
/* Loop until there is something to do. This is the entry point to
the event loop engine. gdb_do_one_event will process one event
@ -229,12 +208,17 @@ change_line_handler ()
{
/* Turn on editing by using readline. */
call_readline = rl_callback_read_char;
input_handler = command_line_handler;
}
else
{
/* Turn off editing by using gdb_readline2. */
rl_callback_handler_remove ();
call_readline = gdb_readline2;
/* Set up the command handler as well, in case we are called as
first thing from .gdbinit. */
input_handler = command_line_handler;
}
/* To tell the event loop to change the handler associated with the
@ -255,12 +239,12 @@ change_line_handler ()
top of the prompt stack, if the argument NEW_PROMPT is
0. Otherwise, it displays whatever NEW_PROMPT is. This is used
after each gdb command has completed, and in the following cases:
1. when the user enters a command line which is ended by '\'
indicating that the command will continue on the next line.
1. when the user enters a command line which is ended by '\'
indicating that the command will continue on the next line.
In that case the prompt that is displayed is the empty string.
2. When the user is entering 'commands' for a breakpoint, or
actions for a tracepoint. In this case the prompt will be '>'
3. Other????
2. When the user is entering 'commands' for a breakpoint, or
actions for a tracepoint. In this case the prompt will be '>'
3. Other????
FIXME: 2. & 3. not implemented yet for async. */
void
display_gdb_prompt (new_prompt)
@ -521,7 +505,7 @@ command_line_handler (rl)
#ifdef STOP_SIGNAL
if (job_control)
signal (STOP_SIGNAL, stop_sig);
signal (STOP_SIGNAL, handle_stop_sig);
#endif
/* Make sure that all output has been output. Some machines may let
@ -726,7 +710,7 @@ gdb_readline2 ()
we'll return NULL then. */
break;
free (result);
command_line_handler (0);
(*input_handler) (0);
}
if (c == '\n')
@ -749,7 +733,7 @@ gdb_readline2 ()
}
result[input_index++] = '\0';
command_line_handler (result);
(*input_handler) (result);
}
@ -767,10 +751,10 @@ gdb_readline2 ()
as the default for gdb. */
void
async_init_signals ()
{
{
signal (SIGINT, handle_sigint);
sigint_token =
create_async_signal_handler ((async_handler_func *) async_request_quit, NULL);
create_async_signal_handler (async_request_quit, NULL);
/* If SIGTRAP was set to SIG_IGN, then the SIG_IGN will get passed
to the inferior and breakpoints will be ignored. */
@ -788,29 +772,41 @@ async_init_signals ()
to SIG_DFL for us. */
signal (SIGQUIT, handle_sigquit);
sigquit_token =
create_async_signal_handler ((async_handler_func *) async_do_nothing, NULL);
create_async_signal_handler (async_do_nothing, NULL);
#ifdef SIGHUP
if (signal (SIGHUP, handle_sighup) != SIG_IGN)
sighup_token =
create_async_signal_handler ((async_handler_func *) async_disconnect, NULL);
create_async_signal_handler (async_disconnect, NULL);
else
sighup_token =
create_async_signal_handler ((async_handler_func *) async_do_nothing, NULL);
create_async_signal_handler (async_do_nothing, NULL);
#endif
signal (SIGFPE, handle_sigfpe);
sigfpe_token =
create_async_signal_handler ((async_handler_func *) async_float_handler, NULL);
create_async_signal_handler (async_float_handler, NULL);
#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
signal (SIGWINCH, handle_sigwinch);
sigwinch_token =
create_async_signal_handler ((async_handler_func *) SIGWINCH_HANDLER, NULL);
create_async_signal_handler (SIGWINCH_HANDLER, NULL);
#endif
#ifdef STOP_SIGNAL
sigtstp_token =
create_async_signal_handler (async_stop_sig, NULL);
#endif
}
void
mark_async_signal_handler_wrapper (token)
void *token;
{
mark_async_signal_handler ((async_signal_handler *) token);
}
/* Tell the event loop what to do if SIGINT is received.
See event-signal.c. */
void
static void
handle_sigint (sig)
int sig;
{
@ -824,16 +820,17 @@ handle_sigint (sig)
that point, though, the command that we want to interrupt needs to
finish first, which is unacceptable. */
if (immediate_quit)
async_request_quit ();
async_request_quit (0);
else
/* If immediate quit is not set, we process SIGINT the next time
through the loop, which is fine. */
mark_async_signal_handler (sigint_token);
mark_async_signal_handler_wrapper (sigint_token);
}
/* Do the quit. All the checks have been done by the caller. */
void
async_request_quit ()
async_request_quit (arg)
gdb_client_data arg;
{
quit_flag = 1;
#ifdef REQUEST_QUIT
@ -845,17 +842,18 @@ async_request_quit ()
/* Tell the event loop what to do if SIGQUIT is received.
See event-signal.c. */
void
static void
handle_sigquit (sig)
int sig;
{
mark_async_signal_handler (sigquit_token);
mark_async_signal_handler_wrapper (sigquit_token);
signal (sig, handle_sigquit);
}
/* Called by the event loop in response to a SIGQUIT. */
void
async_do_nothing ()
static void
async_do_nothing (arg)
gdb_client_data arg;
{
/* Empty function body. */
}
@ -863,17 +861,18 @@ async_do_nothing ()
#ifdef SIGHUP
/* Tell the event loop what to do if SIGHUP is received.
See event-signal.c. */
void
static void
handle_sighup (sig)
int sig;
{
mark_async_signal_handler (sighup_token);
mark_async_signal_handler_wrapper (sighup_token);
signal (sig, handle_sighup);
}
/* Called by the event loop to process a SIGHUP. */
void
async_disconnect ()
/* Called by the event loop to process a SIGHUP */
static void
async_disconnect (arg)
gdb_client_data arg;
{
catch_errors (quit_cover, NULL,
"Could not kill the program being debugged",
@ -883,19 +882,49 @@ async_disconnect ()
}
#endif
#ifdef STOP_SIGNAL
void handle_stop_sig (sig)
int sig;
{
mark_async_signal_handler_wrapper (sigtstp_token);
signal (sig, handle_stop_sig);
}
static void
async_stop_sig (arg)
gdb_client_data arg;
{
char *prompt = PROMPT (0);
#if STOP_SIGNAL == SIGTSTP
signal (SIGTSTP, SIG_DFL);
sigsetmask (0);
kill (getpid (), SIGTSTP);
signal (SIGTSTP, handle_stop_sig);
#else
signal (STOP_SIGNAL, handle_stop_sig);
#endif
printf_unfiltered ("%s", prompt);
gdb_flush (gdb_stdout);
/* Forget about any previous command -- null line now will do nothing. */
dont_repeat ();
}
#endif /* STOP_SIGNAL */
/* Tell the event loop what to do if SIGFPE is received.
See event-signal.c. */
void
static void
handle_sigfpe (sig)
int sig;
{
mark_async_signal_handler (sigfpe_token);
mark_async_signal_handler_wrapper (sigfpe_token);
signal (sig, handle_sigfpe);
}
/* Event loop will call this functin to process a SIGFPE. */
void
async_float_handler ()
static void
async_float_handler (arg)
gdb_client_data arg;
{
/* This message is based on ANSI C, section 4.7. Note that integer
divide by zero causes this, so "float" is a misnomer. */
@ -905,11 +934,11 @@ async_float_handler ()
/* Tell the event loop what to do if SIGWINCH is received.
See event-signal.c. */
#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
void
static void
handle_sigwinch (sig)
int sig;
{
mark_async_signal_handler (sigwinch_token);
mark_async_signal_handler_wrapper (sigwinch_token);
signal (sig, handle_sigwinch);
}
#endif
@ -948,6 +977,40 @@ set_async_prompt (args, from_tty, c)
PROMPT (0) = savestring (new_async_prompt, strlen (new_async_prompt));
}
/* Set things up for readline to be invoked via the alternate
interface, i.e. via a callback function (rl_callback_read_char),
and hook up instream to the event loop.*/
void
_initialize_event_loop ()
{
/* When a character is detected on instream by select or poll, readline
will be invoked via this callback function. */
call_readline = rl_callback_read_char;
/* When readline has read an end-of-line character, it passes the
complete line to gdb for processing. command_line_handler is the
function that does this. */
input_handler = command_line_handler;
/* Tell readline to use the same input stream that gdb uses. */
rl_instream = instream;
/* Get a file descriptor for the input stream, so that we can
register it with the event loop. */
input_fd = fileno (instream);
/* Now we need to create the event sources for the input file descriptor. */
/* At this point in time, this is the only event source that we
register with the even loop. Another source is going to be the
target program (inferior), but that must be registered only when
it actually exists (I.e. after we say 'run' or after we connect
to a remote target. */
#ifdef HAVE_POLL
create_file_handler (input_fd, POLLIN,
(file_handler_func *) call_readline, 0);
#else
create_file_handler (input_fd, GDB_READABLE,
(file_handler_func *) call_readline, 0);
#endif
}

View File

@ -641,6 +641,44 @@ exec_files_info (t)
}
}
/* msnyder 5/21/99:
exec_set_section_offsets sets the offsets of all the sections
in the exec objfile. */
void
exec_set_section_offsets (text_off, data_off, bss_off)
bfd_signed_vma text_off;
bfd_signed_vma data_off;
bfd_signed_vma bss_off;
{
struct section_table *sect;
for (sect = exec_ops.to_sections;
sect < exec_ops.to_sections_end;
sect++)
{
flagword flags;
flags = bfd_get_section_flags (exec_bfd, sect->the_bfd_section);
if (flags & SEC_CODE)
{
sect->addr += text_off;
sect->endaddr += text_off;
}
else if (flags & (SEC_DATA | SEC_LOAD))
{
sect->addr += data_off;
sect->endaddr += data_off;
}
else if (flags & SEC_ALLOC)
{
sect->addr += bss_off;
sect->endaddr += bss_off;
}
}
}
static void
set_section_command (args, from_tty)
char *args;

View File

@ -998,7 +998,34 @@ supply_register (regno, val)
/* This routine is getting awfully cluttered with #if's. It's probably
time to turn this into READ_PC and define it in the tm.h file.
Ditto for write_pc. */
Ditto for write_pc.
1999-06-08: The following were re-written so that it assumes the
existance of a TARGET_READ_PC et.al. macro. A default generic
version of that macro is made available where needed.
Since the ``TARGET_READ_PC'' et.al. macro is going to be controlled
by the multi-arch framework, it will eventually be possible to
eliminate the intermediate read_pc_pid(). The client would call
TARGET_READ_PC directly. (cagney). */
#ifndef TARGET_READ_PC
#define TARGET_READ_PC generic_target_read_pc
#endif
CORE_ADDR
generic_target_read_pc (pid)
{
#ifdef PC_REGNUM
if (PC_REGNUM >= 0)
{
CORE_ADDR pc_val = ADDR_BITS_REMOVE ((CORE_ADDR) read_register_pid (PC_REGNUM, pid));
return pc_val;
}
#endif
fatal ("generic_target_read_pc");
return 0;
}
CORE_ADDR
read_pc_pid (pid)
@ -1011,11 +1038,7 @@ read_pc_pid (pid)
saved_inferior_pid = inferior_pid;
inferior_pid = pid;
#ifdef TARGET_READ_PC
pc_val = TARGET_READ_PC (pid);
#else
pc_val = ADDR_BITS_REMOVE ((CORE_ADDR) read_register_pid (PC_REGNUM, pid));
#endif
inferior_pid = saved_inferior_pid;
return pc_val;
@ -1027,6 +1050,31 @@ read_pc ()
return read_pc_pid (inferior_pid);
}
#ifndef TARGET_WRITE_PC
#define TARGET_WRITE_PC generic_target_write_pc
#endif
void
generic_target_write_pc (pc, pid)
CORE_ADDR pc;
int pid;
{
#ifdef PC_REGNUM
if (PC_REGNUM >= 0)
write_register_pid (PC_REGNUM, pc, pid);
#ifdef NPC_REGNUM
if (NPC_REGNUM >= 0)
write_register_pid (NPC_REGNUM, pc + 4, pid);
#ifdef NNPC_REGNUM
if (NNPC_REGNUM >= 0)
write_register_pid (NNPC_REGNUM, pc + 8, pid);
#endif
#endif
#else
fatal ("generic_target_write_pc");
#endif
}
void
write_pc_pid (pc, pid)
CORE_ADDR pc;
@ -1038,17 +1086,7 @@ write_pc_pid (pc, pid)
saved_inferior_pid = inferior_pid;
inferior_pid = pid;
#ifdef TARGET_WRITE_PC
TARGET_WRITE_PC (pc, pid);
#else
write_register_pid (PC_REGNUM, pc, pid);
#ifdef NPC_REGNUM
write_register_pid (NPC_REGNUM, pc + 4, pid);
#ifdef NNPC_REGNUM
write_register_pid (NNPC_REGNUM, pc + 8, pid);
#endif
#endif
#endif
inferior_pid = saved_inferior_pid;
}
@ -1062,46 +1100,94 @@ write_pc (pc)
/* Cope with strage ways of getting to the stack and frame pointers */
#ifndef TARGET_READ_SP
#define TARGET_READ_SP generic_target_read_sp
#endif
CORE_ADDR
generic_target_read_sp ()
{
#ifdef SP_REGNUM
if (SP_REGNUM >= 0)
return read_register (SP_REGNUM);
#endif
fatal ("generic_target_read_sp");
}
CORE_ADDR
read_sp ()
{
#ifdef TARGET_READ_SP
return TARGET_READ_SP ();
#else
return read_register (SP_REGNUM);
}
#ifndef TARGET_WRITE_SP
#define TARGET_WRITE_SP generic_target_write_sp
#endif
void
generic_target_write_sp (val)
CORE_ADDR val;
{
#ifdef SP_REGNUM
if (SP_REGNUM >= 0)
{
write_register (SP_REGNUM, val);
return;
}
#endif
fatal ("generic_target_write_sp");
}
void
write_sp (val)
CORE_ADDR val;
{
#ifdef TARGET_WRITE_SP
TARGET_WRITE_SP (val);
#else
write_register (SP_REGNUM, val);
}
#ifndef TARGET_READ_FP
#define TARGET_READ_FP generic_target_read_fp
#endif
CORE_ADDR
generic_target_read_fp ()
{
#ifdef FP_REGNUM
if (FP_REGNUM >= 0)
return read_register (FP_REGNUM);
#endif
fatal ("generic_target_read_fp");
}
CORE_ADDR
read_fp ()
{
#ifdef TARGET_READ_FP
return TARGET_READ_FP ();
#else
return read_register (FP_REGNUM);
}
#ifndef TARGET_WRITE_FP
#define TARGET_WRITE_FP generic_target_write_fp
#endif
void
generic_target_write_fp (val)
CORE_ADDR val;
{
#ifdef FP_REGNUM
if (FP_REGNUM >= 0)
{
write_register (FP_REGNUM, val);
return;
}
#endif
fatal ("generic_target_write_fp");
}
void
write_fp (val)
CORE_ADDR val;
{
#ifdef TARGET_WRITE_FP
TARGET_WRITE_FP (val);
#else
write_register (FP_REGNUM, val);
#endif
}
/* Will calling read_var_value or locate_var_value on SYM end
@ -1640,4 +1726,8 @@ void
_initialize_findvar ()
{
build_findvar ();
register_gdbarch_swap (&registers, sizeof (registers), NULL);
register_gdbarch_swap (&register_valid, sizeof (register_valid), NULL);
register_gdbarch_swap (NULL, 0, build_findvar);
}

File diff suppressed because it is too large Load Diff

View File

@ -26,6 +26,901 @@ struct value;
enum lval_type;
#endif
#ifndef GDB_MULTI_ARCH
#define GDB_MULTI_ARCH 0
#endif
extern struct gdbarch *current_gdbarch;
/* See gdb/doc/gdbint.texi for a discussion of the GDB_MULTI_ARCH
macro */
/* If any of the following are defined, the target wasn't correctly
converted. */
#if GDB_MULTI_ARCH
#if defined (CALL_DUMMY)
#error "CALL_DUMMY: replaced by CALL_DUMMY_WORDS/SIZEOF_CALL_DUMMY_WORDS"
#endif
#endif
#if GDB_MULTI_ARCH
#if defined (REGISTER_NAMES)
#error "REGISTER_NAMES: replaced by REGISTER_NAME"
#endif
#endif
#if GDB_MULTI_ARCH
#if defined (EXTRA_FRAME_INFO)
#error "EXTRA_FRAME_INFO: replaced by struct frame_extra_info"
#endif
#endif
#if GDB_MULTI_ARCH
#if defined (FRAME_FIND_SAVED_REGS)
#error "FRAME_FIND_SAVED_REGS: replaced by FRAME_INIT_SAVED_REGS"
#endif
#endif
/* The following are pre-initialized by GDBARCH. */
extern const struct bfd_arch_info * gdbarch_bfd_arch_info PARAMS ((struct gdbarch *gdbarch));
/* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_ARCHITECTURE)
#define TARGET_ARCHITECTURE (gdbarch_bfd_arch_info (current_gdbarch))
#endif
#endif
extern int gdbarch_byte_order PARAMS ((struct gdbarch *gdbarch));
/* set_gdbarch_byte_order() - not applicable - pre-initialized. */
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_BYTE_ORDER)
#define TARGET_BYTE_ORDER (gdbarch_byte_order (current_gdbarch))
#endif
#endif
/* The following are initialized by the target dependant code. */
extern int gdbarch_ptr_bit PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_ptr_bit PARAMS ((struct gdbarch *gdbarch, int ptr_bit));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_PTR_BIT)
#define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch))
#endif
#endif
extern int gdbarch_short_bit PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_short_bit PARAMS ((struct gdbarch *gdbarch, int short_bit));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_SHORT_BIT)
#define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch))
#endif
#endif
extern int gdbarch_int_bit PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_int_bit PARAMS ((struct gdbarch *gdbarch, int int_bit));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_INT_BIT)
#define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch))
#endif
#endif
extern int gdbarch_long_bit PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_long_bit PARAMS ((struct gdbarch *gdbarch, int long_bit));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_LONG_BIT)
#define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch))
#endif
#endif
extern int gdbarch_long_long_bit PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_long_long_bit PARAMS ((struct gdbarch *gdbarch, int long_long_bit));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_LONG_LONG_BIT)
#define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch))
#endif
#endif
extern int gdbarch_float_bit PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_float_bit PARAMS ((struct gdbarch *gdbarch, int float_bit));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_FLOAT_BIT)
#define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch))
#endif
#endif
extern int gdbarch_double_bit PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_double_bit PARAMS ((struct gdbarch *gdbarch, int double_bit));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_DOUBLE_BIT)
#define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch))
#endif
#endif
extern int gdbarch_long_double_bit PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_long_double_bit PARAMS ((struct gdbarch *gdbarch, int long_double_bit));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_LONG_DOUBLE_BIT)
#define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch))
#endif
#endif
typedef CORE_ADDR (gdbarch_read_pc_ftype) PARAMS ((int pid));
extern CORE_ADDR gdbarch_read_pc PARAMS ((struct gdbarch *gdbarch, int pid));
extern void set_gdbarch_read_pc PARAMS ((struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_READ_PC)
#define TARGET_READ_PC(pid) (gdbarch_read_pc (current_gdbarch, pid))
#endif
#endif
typedef void (gdbarch_write_pc_ftype) PARAMS ((CORE_ADDR val, int pid));
extern void gdbarch_write_pc PARAMS ((struct gdbarch *gdbarch, CORE_ADDR val, int pid));
extern void set_gdbarch_write_pc PARAMS ((struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_WRITE_PC)
#define TARGET_WRITE_PC(val, pid) (gdbarch_write_pc (current_gdbarch, val, pid))
#endif
#endif
typedef CORE_ADDR (gdbarch_read_fp_ftype) PARAMS ((void));
extern CORE_ADDR gdbarch_read_fp PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_read_fp PARAMS ((struct gdbarch *gdbarch, gdbarch_read_fp_ftype *read_fp));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_READ_FP)
#define TARGET_READ_FP() (gdbarch_read_fp (current_gdbarch))
#endif
#endif
typedef void (gdbarch_write_fp_ftype) PARAMS ((CORE_ADDR val));
extern void gdbarch_write_fp PARAMS ((struct gdbarch *gdbarch, CORE_ADDR val));
extern void set_gdbarch_write_fp PARAMS ((struct gdbarch *gdbarch, gdbarch_write_fp_ftype *write_fp));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_WRITE_FP)
#define TARGET_WRITE_FP(val) (gdbarch_write_fp (current_gdbarch, val))
#endif
#endif
typedef CORE_ADDR (gdbarch_read_sp_ftype) PARAMS ((void));
extern CORE_ADDR gdbarch_read_sp PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_read_sp PARAMS ((struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_READ_SP)
#define TARGET_READ_SP() (gdbarch_read_sp (current_gdbarch))
#endif
#endif
typedef void (gdbarch_write_sp_ftype) PARAMS ((CORE_ADDR val));
extern void gdbarch_write_sp PARAMS ((struct gdbarch *gdbarch, CORE_ADDR val));
extern void set_gdbarch_write_sp PARAMS ((struct gdbarch *gdbarch, gdbarch_write_sp_ftype *write_sp));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (TARGET_WRITE_SP)
#define TARGET_WRITE_SP(val) (gdbarch_write_sp (current_gdbarch, val))
#endif
#endif
extern int gdbarch_num_regs PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_num_regs PARAMS ((struct gdbarch *gdbarch, int num_regs));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (NUM_REGS)
#define NUM_REGS (gdbarch_num_regs (current_gdbarch))
#endif
#endif
extern int gdbarch_sp_regnum PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_sp_regnum PARAMS ((struct gdbarch *gdbarch, int sp_regnum));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (SP_REGNUM)
#define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch))
#endif
#endif
extern int gdbarch_fp_regnum PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_fp_regnum PARAMS ((struct gdbarch *gdbarch, int fp_regnum));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (FP_REGNUM)
#define FP_REGNUM (gdbarch_fp_regnum (current_gdbarch))
#endif
#endif
extern int gdbarch_pc_regnum PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_pc_regnum PARAMS ((struct gdbarch *gdbarch, int pc_regnum));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (PC_REGNUM)
#define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch))
#endif
#endif
typedef char * (gdbarch_register_name_ftype) PARAMS ((int regnr));
extern char * gdbarch_register_name PARAMS ((struct gdbarch *gdbarch, int regnr));
extern void set_gdbarch_register_name PARAMS ((struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_NAME)
#define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr))
#endif
#endif
extern int gdbarch_register_size PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_register_size PARAMS ((struct gdbarch *gdbarch, int register_size));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_SIZE)
#define REGISTER_SIZE (gdbarch_register_size (current_gdbarch))
#endif
#endif
extern int gdbarch_register_bytes PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_register_bytes PARAMS ((struct gdbarch *gdbarch, int register_bytes));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_BYTES)
#define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch))
#endif
#endif
typedef int (gdbarch_register_byte_ftype) PARAMS ((int reg_nr));
extern int gdbarch_register_byte PARAMS ((struct gdbarch *gdbarch, int reg_nr));
extern void set_gdbarch_register_byte PARAMS ((struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_BYTE)
#define REGISTER_BYTE(reg_nr) (gdbarch_register_byte (current_gdbarch, reg_nr))
#endif
#endif
typedef int (gdbarch_register_raw_size_ftype) PARAMS ((int reg_nr));
extern int gdbarch_register_raw_size PARAMS ((struct gdbarch *gdbarch, int reg_nr));
extern void set_gdbarch_register_raw_size PARAMS ((struct gdbarch *gdbarch, gdbarch_register_raw_size_ftype *register_raw_size));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_RAW_SIZE)
#define REGISTER_RAW_SIZE(reg_nr) (gdbarch_register_raw_size (current_gdbarch, reg_nr))
#endif
#endif
extern int gdbarch_max_register_raw_size PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_max_register_raw_size PARAMS ((struct gdbarch *gdbarch, int max_register_raw_size));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (MAX_REGISTER_RAW_SIZE)
#define MAX_REGISTER_RAW_SIZE (gdbarch_max_register_raw_size (current_gdbarch))
#endif
#endif
typedef int (gdbarch_register_virtual_size_ftype) PARAMS ((int reg_nr));
extern int gdbarch_register_virtual_size PARAMS ((struct gdbarch *gdbarch, int reg_nr));
extern void set_gdbarch_register_virtual_size PARAMS ((struct gdbarch *gdbarch, gdbarch_register_virtual_size_ftype *register_virtual_size));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_VIRTUAL_SIZE)
#define REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_register_virtual_size (current_gdbarch, reg_nr))
#endif
#endif
extern int gdbarch_max_register_virtual_size PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_max_register_virtual_size PARAMS ((struct gdbarch *gdbarch, int max_register_virtual_size));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (MAX_REGISTER_VIRTUAL_SIZE)
#define MAX_REGISTER_VIRTUAL_SIZE (gdbarch_max_register_virtual_size (current_gdbarch))
#endif
#endif
typedef struct type * (gdbarch_register_virtual_type_ftype) PARAMS ((int reg_nr));
extern struct type * gdbarch_register_virtual_type PARAMS ((struct gdbarch *gdbarch, int reg_nr));
extern void set_gdbarch_register_virtual_type PARAMS ((struct gdbarch *gdbarch, gdbarch_register_virtual_type_ftype *register_virtual_type));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_VIRTUAL_TYPE)
#define REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_register_virtual_type (current_gdbarch, reg_nr))
#endif
#endif
extern int gdbarch_use_generic_dummy_frames PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_use_generic_dummy_frames PARAMS ((struct gdbarch *gdbarch, int use_generic_dummy_frames));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (USE_GENERIC_DUMMY_FRAMES)
#define USE_GENERIC_DUMMY_FRAMES (gdbarch_use_generic_dummy_frames (current_gdbarch))
#endif
#endif
extern int gdbarch_call_dummy_location PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_call_dummy_location PARAMS ((struct gdbarch *gdbarch, int call_dummy_location));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_LOCATION)
#define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch))
#endif
#endif
typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) PARAMS ((void));
extern CORE_ADDR gdbarch_call_dummy_address PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_call_dummy_address PARAMS ((struct gdbarch *gdbarch, gdbarch_call_dummy_address_ftype *call_dummy_address));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_ADDRESS)
#define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch))
#endif
#endif
extern CORE_ADDR gdbarch_call_dummy_start_offset PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_call_dummy_start_offset PARAMS ((struct gdbarch *gdbarch, CORE_ADDR call_dummy_start_offset));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_START_OFFSET)
#define CALL_DUMMY_START_OFFSET (gdbarch_call_dummy_start_offset (current_gdbarch))
#endif
#endif
extern CORE_ADDR gdbarch_call_dummy_breakpoint_offset PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_call_dummy_breakpoint_offset PARAMS ((struct gdbarch *gdbarch, CORE_ADDR call_dummy_breakpoint_offset));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET)
#define CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_call_dummy_breakpoint_offset (current_gdbarch))
#endif
#endif
extern int gdbarch_call_dummy_breakpoint_offset_p PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_call_dummy_breakpoint_offset_p PARAMS ((struct gdbarch *gdbarch, int call_dummy_breakpoint_offset_p));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET_P)
#define CALL_DUMMY_BREAKPOINT_OFFSET_P (gdbarch_call_dummy_breakpoint_offset_p (current_gdbarch))
#endif
#endif
extern int gdbarch_call_dummy_length PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_call_dummy_length PARAMS ((struct gdbarch *gdbarch, int call_dummy_length));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_LENGTH)
#define CALL_DUMMY_LENGTH (gdbarch_call_dummy_length (current_gdbarch))
#endif
#endif
typedef int (gdbarch_pc_in_call_dummy_ftype) PARAMS ((CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address));
extern int gdbarch_pc_in_call_dummy PARAMS ((struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address));
extern void set_gdbarch_pc_in_call_dummy PARAMS ((struct gdbarch *gdbarch, gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (PC_IN_CALL_DUMMY)
#define PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address))
#endif
#endif
extern int gdbarch_call_dummy_p PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_call_dummy_p PARAMS ((struct gdbarch *gdbarch, int call_dummy_p));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_P)
#define CALL_DUMMY_P (gdbarch_call_dummy_p (current_gdbarch))
#endif
#endif
extern LONGEST * gdbarch_call_dummy_words PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_call_dummy_words PARAMS ((struct gdbarch *gdbarch, LONGEST * call_dummy_words));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_WORDS)
#define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch))
#endif
#endif
extern int gdbarch_sizeof_call_dummy_words PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_sizeof_call_dummy_words PARAMS ((struct gdbarch *gdbarch, int sizeof_call_dummy_words));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (SIZEOF_CALL_DUMMY_WORDS)
#define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch))
#endif
#endif
extern int gdbarch_call_dummy_stack_adjust_p PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_call_dummy_stack_adjust_p PARAMS ((struct gdbarch *gdbarch, int call_dummy_stack_adjust_p));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_STACK_ADJUST_P)
#define CALL_DUMMY_STACK_ADJUST_P (gdbarch_call_dummy_stack_adjust_p (current_gdbarch))
#endif
#endif
extern int gdbarch_call_dummy_stack_adjust PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_call_dummy_stack_adjust PARAMS ((struct gdbarch *gdbarch, int call_dummy_stack_adjust));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_STACK_ADJUST)
#define CALL_DUMMY_STACK_ADJUST (gdbarch_call_dummy_stack_adjust (current_gdbarch))
#endif
#endif
typedef void (gdbarch_fix_call_dummy_ftype) PARAMS ((char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p));
extern void gdbarch_fix_call_dummy PARAMS ((struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p));
extern void set_gdbarch_fix_call_dummy PARAMS ((struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (FIX_CALL_DUMMY)
#define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p))
#endif
#endif
extern int gdbarch_believe_pcc_promotion PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_believe_pcc_promotion PARAMS ((struct gdbarch *gdbarch, int believe_pcc_promotion));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (BELIEVE_PCC_PROMOTION)
#define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch))
#endif
#endif
extern int gdbarch_believe_pcc_promotion_type PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_believe_pcc_promotion_type PARAMS ((struct gdbarch *gdbarch, int believe_pcc_promotion_type));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (BELIEVE_PCC_PROMOTION_TYPE)
#define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch))
#endif
#endif
typedef void (gdbarch_get_saved_register_ftype) PARAMS ((char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval));
extern void gdbarch_get_saved_register PARAMS ((struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval));
extern void set_gdbarch_get_saved_register PARAMS ((struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (GET_SAVED_REGISTER)
#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval))
#endif
#endif
typedef int (gdbarch_register_convertible_ftype) PARAMS ((int nr));
extern int gdbarch_register_convertible PARAMS ((struct gdbarch *gdbarch, int nr));
extern void set_gdbarch_register_convertible PARAMS ((struct gdbarch *gdbarch, gdbarch_register_convertible_ftype *register_convertible));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_CONVERTIBLE)
#define REGISTER_CONVERTIBLE(nr) (gdbarch_register_convertible (current_gdbarch, nr))
#endif
#endif
typedef void (gdbarch_register_convert_to_virtual_ftype) PARAMS ((int regnum, struct type *type, char *from, char *to));
extern void gdbarch_register_convert_to_virtual PARAMS ((struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to));
extern void set_gdbarch_register_convert_to_virtual PARAMS ((struct gdbarch *gdbarch, gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_CONVERT_TO_VIRTUAL)
#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_register_convert_to_virtual (current_gdbarch, regnum, type, from, to))
#endif
#endif
typedef void (gdbarch_register_convert_to_raw_ftype) PARAMS ((struct type *type, int regnum, char *from, char *to));
extern void gdbarch_register_convert_to_raw PARAMS ((struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to));
extern void set_gdbarch_register_convert_to_raw PARAMS ((struct gdbarch *gdbarch, gdbarch_register_convert_to_raw_ftype *register_convert_to_raw));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_CONVERT_TO_RAW)
#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_register_convert_to_raw (current_gdbarch, type, regnum, from, to))
#endif
#endif
typedef void (gdbarch_extract_return_value_ftype) PARAMS ((struct type *type, char *regbuf, char *valbuf));
extern void gdbarch_extract_return_value PARAMS ((struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf));
extern void set_gdbarch_extract_return_value PARAMS ((struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (EXTRACT_RETURN_VALUE)
#define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regbuf, valbuf))
#endif
#endif
typedef CORE_ADDR (gdbarch_push_arguments_ftype) PARAMS ((int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr));
extern CORE_ADDR gdbarch_push_arguments PARAMS ((struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr));
extern void set_gdbarch_push_arguments PARAMS ((struct gdbarch *gdbarch, gdbarch_push_arguments_ftype *push_arguments));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (PUSH_ARGUMENTS)
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr))
#endif
#endif
typedef void (gdbarch_push_dummy_frame_ftype) PARAMS ((void));
extern void gdbarch_push_dummy_frame PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_push_dummy_frame PARAMS ((struct gdbarch *gdbarch, gdbarch_push_dummy_frame_ftype *push_dummy_frame));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (PUSH_DUMMY_FRAME)
#define PUSH_DUMMY_FRAME (gdbarch_push_dummy_frame (current_gdbarch))
#endif
#endif
typedef CORE_ADDR (gdbarch_push_return_address_ftype) PARAMS ((CORE_ADDR pc, CORE_ADDR sp));
extern CORE_ADDR gdbarch_push_return_address PARAMS ((struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp));
extern void set_gdbarch_push_return_address PARAMS ((struct gdbarch *gdbarch, gdbarch_push_return_address_ftype *push_return_address));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (PUSH_RETURN_ADDRESS)
#define PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_push_return_address (current_gdbarch, pc, sp))
#endif
#endif
typedef void (gdbarch_pop_frame_ftype) PARAMS ((void));
extern void gdbarch_pop_frame PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_pop_frame PARAMS ((struct gdbarch *gdbarch, gdbarch_pop_frame_ftype *pop_frame));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (POP_FRAME)
#define POP_FRAME (gdbarch_pop_frame (current_gdbarch))
#endif
#endif
typedef CORE_ADDR (gdbarch_d10v_make_daddr_ftype) PARAMS ((CORE_ADDR x));
extern CORE_ADDR gdbarch_d10v_make_daddr PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x));
extern void set_gdbarch_d10v_make_daddr PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_make_daddr_ftype *d10v_make_daddr));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (D10V_MAKE_DADDR)
#define D10V_MAKE_DADDR(x) (gdbarch_d10v_make_daddr (current_gdbarch, x))
#endif
#endif
typedef CORE_ADDR (gdbarch_d10v_make_iaddr_ftype) PARAMS ((CORE_ADDR x));
extern CORE_ADDR gdbarch_d10v_make_iaddr PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x));
extern void set_gdbarch_d10v_make_iaddr PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (D10V_MAKE_IADDR)
#define D10V_MAKE_IADDR(x) (gdbarch_d10v_make_iaddr (current_gdbarch, x))
#endif
#endif
typedef int (gdbarch_d10v_daddr_p_ftype) PARAMS ((CORE_ADDR x));
extern int gdbarch_d10v_daddr_p PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x));
extern void set_gdbarch_d10v_daddr_p PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_daddr_p_ftype *d10v_daddr_p));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (D10V_DADDR_P)
#define D10V_DADDR_P(x) (gdbarch_d10v_daddr_p (current_gdbarch, x))
#endif
#endif
typedef int (gdbarch_d10v_iaddr_p_ftype) PARAMS ((CORE_ADDR x));
extern int gdbarch_d10v_iaddr_p PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x));
extern void set_gdbarch_d10v_iaddr_p PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (D10V_IADDR_P)
#define D10V_IADDR_P(x) (gdbarch_d10v_iaddr_p (current_gdbarch, x))
#endif
#endif
typedef CORE_ADDR (gdbarch_d10v_convert_daddr_to_raw_ftype) PARAMS ((CORE_ADDR x));
extern CORE_ADDR gdbarch_d10v_convert_daddr_to_raw PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x));
extern void set_gdbarch_d10v_convert_daddr_to_raw PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (D10V_CONVERT_DADDR_TO_RAW)
#define D10V_CONVERT_DADDR_TO_RAW(x) (gdbarch_d10v_convert_daddr_to_raw (current_gdbarch, x))
#endif
#endif
typedef CORE_ADDR (gdbarch_d10v_convert_iaddr_to_raw_ftype) PARAMS ((CORE_ADDR x));
extern CORE_ADDR gdbarch_d10v_convert_iaddr_to_raw PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x));
extern void set_gdbarch_d10v_convert_iaddr_to_raw PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (D10V_CONVERT_IADDR_TO_RAW)
#define D10V_CONVERT_IADDR_TO_RAW(x) (gdbarch_d10v_convert_iaddr_to_raw (current_gdbarch, x))
#endif
#endif
typedef void (gdbarch_store_struct_return_ftype) PARAMS ((CORE_ADDR addr, CORE_ADDR sp));
extern void gdbarch_store_struct_return PARAMS ((struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp));
extern void set_gdbarch_store_struct_return PARAMS ((struct gdbarch *gdbarch, gdbarch_store_struct_return_ftype *store_struct_return));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (STORE_STRUCT_RETURN)
#define STORE_STRUCT_RETURN(addr, sp) (gdbarch_store_struct_return (current_gdbarch, addr, sp))
#endif
#endif
typedef void (gdbarch_store_return_value_ftype) PARAMS ((struct type *type, char *valbuf));
extern void gdbarch_store_return_value PARAMS ((struct gdbarch *gdbarch, struct type *type, char *valbuf));
extern void set_gdbarch_store_return_value PARAMS ((struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (STORE_RETURN_VALUE)
#define STORE_RETURN_VALUE(type, valbuf) (gdbarch_store_return_value (current_gdbarch, type, valbuf))
#endif
#endif
typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) PARAMS ((char *regbuf));
extern CORE_ADDR gdbarch_extract_struct_value_address PARAMS ((struct gdbarch *gdbarch, char *regbuf));
extern void set_gdbarch_extract_struct_value_address PARAMS ((struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_extract_struct_value_address (current_gdbarch, regbuf))
#endif
#endif
typedef int (gdbarch_use_struct_convention_ftype) PARAMS ((int gcc_p, struct type *value_type));
extern int gdbarch_use_struct_convention PARAMS ((struct gdbarch *gdbarch, int gcc_p, struct type *value_type));
extern void set_gdbarch_use_struct_convention PARAMS ((struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (USE_STRUCT_CONVENTION)
#define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type))
#endif
#endif
typedef void (gdbarch_frame_init_saved_regs_ftype) PARAMS ((struct frame_info *frame));
extern void gdbarch_frame_init_saved_regs PARAMS ((struct gdbarch *gdbarch, struct frame_info *frame));
extern void set_gdbarch_frame_init_saved_regs PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (FRAME_INIT_SAVED_REGS)
#define FRAME_INIT_SAVED_REGS(frame) (gdbarch_frame_init_saved_regs (current_gdbarch, frame))
#endif
#endif
typedef void (gdbarch_init_extra_frame_info_ftype) PARAMS ((int fromleaf, struct frame_info *frame));
extern void gdbarch_init_extra_frame_info PARAMS ((struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame));
extern void set_gdbarch_init_extra_frame_info PARAMS ((struct gdbarch *gdbarch, gdbarch_init_extra_frame_info_ftype *init_extra_frame_info));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (INIT_EXTRA_FRAME_INFO)
#define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (gdbarch_init_extra_frame_info (current_gdbarch, fromleaf, frame))
#endif
#endif
typedef CORE_ADDR (gdbarch_skip_prologue_ftype) PARAMS ((CORE_ADDR ip));
extern CORE_ADDR gdbarch_skip_prologue PARAMS ((struct gdbarch *gdbarch, CORE_ADDR ip));
extern void set_gdbarch_skip_prologue PARAMS ((struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (SKIP_PROLOGUE)
#define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip))
#endif
#endif
typedef int (gdbarch_inner_than_ftype) PARAMS ((CORE_ADDR lhs, CORE_ADDR rhs));
extern int gdbarch_inner_than PARAMS ((struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs));
extern void set_gdbarch_inner_than PARAMS ((struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (INNER_THAN)
#define INNER_THAN(lhs, rhs) (gdbarch_inner_than (current_gdbarch, lhs, rhs))
#endif
#endif
typedef unsigned char * (gdbarch_breakpoint_from_pc_ftype) PARAMS ((CORE_ADDR *pcptr, int *lenptr));
extern unsigned char * gdbarch_breakpoint_from_pc PARAMS ((struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr));
extern void set_gdbarch_breakpoint_from_pc PARAMS ((struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (BREAKPOINT_FROM_PC)
#define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr))
#endif
#endif
extern CORE_ADDR gdbarch_decr_pc_after_break PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_decr_pc_after_break PARAMS ((struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (DECR_PC_AFTER_BREAK)
#define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch))
#endif
#endif
extern CORE_ADDR gdbarch_function_start_offset PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_function_start_offset PARAMS ((struct gdbarch *gdbarch, CORE_ADDR function_start_offset));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (FUNCTION_START_OFFSET)
#define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch))
#endif
#endif
typedef void (gdbarch_remote_translate_xfer_address_ftype) PARAMS ((CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len));
extern void gdbarch_remote_translate_xfer_address PARAMS ((struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len));
extern void set_gdbarch_remote_translate_xfer_address PARAMS ((struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (REMOTE_TRANSLATE_XFER_ADDRESS)
#define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (gdbarch_remote_translate_xfer_address (current_gdbarch, gdb_addr, gdb_len, rem_addr, rem_len))
#endif
#endif
extern CORE_ADDR gdbarch_frame_args_skip PARAMS ((struct gdbarch *gdbarch));
extern void set_gdbarch_frame_args_skip PARAMS ((struct gdbarch *gdbarch, CORE_ADDR frame_args_skip));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (FRAME_ARGS_SKIP)
#define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch))
#endif
#endif
typedef int (gdbarch_frameless_function_invocation_ftype) PARAMS ((struct frame_info *fi));
extern int gdbarch_frameless_function_invocation PARAMS ((struct gdbarch *gdbarch, struct frame_info *fi));
extern void set_gdbarch_frameless_function_invocation PARAMS ((struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (FRAMELESS_FUNCTION_INVOCATION)
#define FRAMELESS_FUNCTION_INVOCATION(fi) (gdbarch_frameless_function_invocation (current_gdbarch, fi))
#endif
#endif
typedef CORE_ADDR (gdbarch_frame_chain_ftype) PARAMS ((struct frame_info *frame));
extern CORE_ADDR gdbarch_frame_chain PARAMS ((struct gdbarch *gdbarch, struct frame_info *frame));
extern void set_gdbarch_frame_chain PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_chain_ftype *frame_chain));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (FRAME_CHAIN)
#define FRAME_CHAIN(frame) (gdbarch_frame_chain (current_gdbarch, frame))
#endif
#endif
typedef int (gdbarch_frame_chain_valid_ftype) PARAMS ((CORE_ADDR chain, struct frame_info *thisframe));
extern int gdbarch_frame_chain_valid PARAMS ((struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe));
extern void set_gdbarch_frame_chain_valid PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_chain_valid_ftype *frame_chain_valid));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (FRAME_CHAIN_VALID)
#define FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_frame_chain_valid (current_gdbarch, chain, thisframe))
#endif
#endif
typedef CORE_ADDR (gdbarch_frame_saved_pc_ftype) PARAMS ((struct frame_info *fi));
extern CORE_ADDR gdbarch_frame_saved_pc PARAMS ((struct gdbarch *gdbarch, struct frame_info *fi));
extern void set_gdbarch_frame_saved_pc PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_saved_pc_ftype *frame_saved_pc));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (FRAME_SAVED_PC)
#define FRAME_SAVED_PC(fi) (gdbarch_frame_saved_pc (current_gdbarch, fi))
#endif
#endif
typedef CORE_ADDR (gdbarch_frame_args_address_ftype) PARAMS ((struct frame_info *fi));
extern CORE_ADDR gdbarch_frame_args_address PARAMS ((struct gdbarch *gdbarch, struct frame_info *fi));
extern void set_gdbarch_frame_args_address PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (FRAME_ARGS_ADDRESS)
#define FRAME_ARGS_ADDRESS(fi) (gdbarch_frame_args_address (current_gdbarch, fi))
#endif
#endif
typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) PARAMS ((struct frame_info *fi));
extern CORE_ADDR gdbarch_frame_locals_address PARAMS ((struct gdbarch *gdbarch, struct frame_info *fi));
extern void set_gdbarch_frame_locals_address PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (FRAME_LOCALS_ADDRESS)
#define FRAME_LOCALS_ADDRESS(fi) (gdbarch_frame_locals_address (current_gdbarch, fi))
#endif
#endif
typedef CORE_ADDR (gdbarch_saved_pc_after_call_ftype) PARAMS ((struct frame_info *frame));
extern CORE_ADDR gdbarch_saved_pc_after_call PARAMS ((struct gdbarch *gdbarch, struct frame_info *frame));
extern void set_gdbarch_saved_pc_after_call PARAMS ((struct gdbarch *gdbarch, gdbarch_saved_pc_after_call_ftype *saved_pc_after_call));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (SAVED_PC_AFTER_CALL)
#define SAVED_PC_AFTER_CALL(frame) (gdbarch_saved_pc_after_call (current_gdbarch, frame))
#endif
#endif
typedef int (gdbarch_frame_num_args_ftype) PARAMS ((struct frame_info *frame));
extern int gdbarch_frame_num_args PARAMS ((struct gdbarch *gdbarch, struct frame_info *frame));
extern void set_gdbarch_frame_num_args PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args));
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > 1) || !defined (FRAME_NUM_ARGS)
#define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame))
#endif
#endif
extern struct gdbarch_tdep *gdbarch_tdep PARAMS ((struct gdbarch *gdbarch));
/* Mechanism for co-ordinating the selection of a specific
architecture.
GDB targets (*-tdep.c) can register an interest in a specific
architecture. Other GDB components can register a need to maintain
per-architecture data.
The mechanisms below ensures that there is only a loose connection
between the set-architecture command and the various GDB
components. Each component can independantly register their need
to maintain architecture specific data with gdbarch.
Pragmatics:
Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It
didn't scale.
The more traditional mega-struct containing architecture specific
data for all the various GDB components was also considered. Since
GDB is built from a variable number of (fairly independant)
components it was determined that the global aproach was not
applicable. */
/* Register a new architectural family with GDB.
Register support for the specified ARCHITECTURE with GDB. When
gdbarch determines that the specified architecture has been
selected, the corresponding INIT function is called.
--
The INIT function takes two parameters: INFO which contains the
information available to gdbarch about the (possibly new)
architecture; ARCHES which is a list of the previously created
``struct gdbarch'' for this architecture.
The INIT function parameter INFO shall, as far as possible, be
pre-initialized with information obtained from INFO.ABFD or
previously selected architecture (if similar). INIT shall ensure
that the INFO.BYTE_ORDER is non-zero.
The INIT function shall return any of: NULL - indicating that it
doesn't reconize the selected architecture; an existing ``struct
gdbarch'' from the ARCHES list - indicating that the new
architecture is just a synonym for an earlier architecture (see
gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch''
- that describes the selected architecture (see
gdbarch_alloc()). */
struct gdbarch_list
{
struct gdbarch *gdbarch;
struct gdbarch_list *next;
};
struct gdbarch_info
{
/* Use default: bfd_arch_unknown (ZERO). */
enum bfd_architecture bfd_architecture;
/* Use default: NULL (ZERO). */
const struct bfd_arch_info *bfd_arch_info;
/* Use default: 0 (ZERO). */
int byte_order;
/* Use default: NULL (ZERO). */
bfd *abfd;
/* Use default: NULL (ZERO). */
struct gdbarch_tdep_info *tdep_info;
};
typedef struct gdbarch *(gdbarch_init_ftype) PARAMS ((struct gdbarch_info info, struct gdbarch_list *arches));
extern void register_gdbarch_init PARAMS ((enum bfd_architecture architecture, gdbarch_init_ftype *));
/* Helper function. Search the list of ARCHES for a GDBARCH that
matches the information provided by INFO. */
extern struct gdbarch_list *gdbarch_list_lookup_by_info PARAMS ((struct gdbarch_list *arches, const struct gdbarch_info *info));
/* Helper function. Create a preliminary ``struct gdbarch''. Perform
basic initialization using values obtained from the INFO andTDEP
parameters. set_gdbarch_*() functions are called to complete the
initialization of the object. */
extern struct gdbarch *gdbarch_alloc PARAMS ((const struct gdbarch_info *info, struct gdbarch_tdep *tdep));
/* Helper function. Force an update of the current architecture. Used
by legacy targets that have added their own target specific
architecture manipulation commands.
The INFO parameter shall be fully initialized (``memset (&INFO,
sizeof (info), 0)'' set relevant fields) before gdbarch_update() is
called. gdbarch_update() shall initialize any ``default'' fields
using information obtained from the previous architecture or
INFO.ABFD (if specified) before calling the corresponding
architectures INIT function. */
extern int gdbarch_update PARAMS ((struct gdbarch_info info));
/* Register per-architecture data-pointer.
Reserve space for a per-architecture data-pointer. An identifier
for the reserved data-pointer is returned. That identifer should
be saved in a local static.
When a new architecture is selected, INIT() is called. When a
previous architecture is re-selected, the per-architecture
data-pointer for that previous architecture is restored (INIT() is
not called).
INIT() shall return the initial value for the per-architecture
data-pointer for the current architecture.
Multiple registrarants for any architecture are allowed (and
strongly encouraged). */
typedef void *(gdbarch_data_ftype) PARAMS ((void));
extern struct gdbarch_data *register_gdbarch_data PARAMS ((gdbarch_data_ftype *init));
/* Return the value of the per-architecture data-pointer for the
current architecture. */
extern void *gdbarch_data PARAMS ((struct gdbarch_data*));
/* Register per-architecture memory region.
Provide a memory-region swap mechanism. Per-architecture memory
region are created. These memory regions are swapped whenever the
architecture is changed. For a new architecture, the memory region
is initialized with zero (0) and the INIT function is called.
Memory regions are swapped / initialized in the order that they are
registered. NULL DATA and/or INIT values can be specified.
New code should use register_gdbarch_data(). */
typedef void (gdbarch_swap_ftype) PARAMS ((void));
extern void register_gdbarch_swap PARAMS ((void *data, unsigned long size, gdbarch_swap_ftype *init));
/* The target-system-dependant byte order is dynamic */
/* TARGET_BYTE_ORDER_SELECTABLE_P determines if the target endianness
@ -34,6 +929,11 @@ enum lval_type;
target_byte_order should be auto-detected (from the program image
say). */
#if GDB_MULTI_ARCH
/* Multi-arch GDB is always bi-endian. */
#define TARGET_BYTE_ORDER_SELECTABLE_P 1
#endif
#ifndef TARGET_BYTE_ORDER_SELECTABLE_P
/* compat - Catch old targets that define TARGET_BYTE_ORDER_SLECTABLE
when they should have defined TARGET_BYTE_ORDER_SELECTABLE_P 1 */
@ -110,10 +1010,10 @@ extern disassemble_info tm_print_insn_info;
#define GDB_TARGET_IS_D10V (TARGET_ARCHITECTURE->arch == bfd_arch_d10v)
#ifndef D10V_MAKE_DADDR
#define D10V_MAKE_DADDR(X) (abort (), 0)
#define D10V_MAKE_DADDR(X) (fatal ("gdbarch: D10V_MAKE_DADDR"), 0)
#endif
#ifndef D10V_MAKE_IADDR
#define D10V_MAKE_IADDR(X) (abort (), 0)
#define D10V_MAKE_IADDR(X) (fatal ("gdbarch: D10V_MAKE_IADDR"), 0)
#endif
@ -124,6 +1024,7 @@ extern disassemble_info tm_print_insn_info;
/* Fallback definition of REGISTER_CONVERTIBLE etc */
extern int generic_register_convertible_not PARAMS ((int reg_nr));
#ifndef REGISTER_CONVERTIBLE
#define REGISTER_CONVERTIBLE(x) (0)
#endif
@ -138,7 +1039,7 @@ extern disassemble_info tm_print_insn_info;
/* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */
#ifndef EXTRACT_STRUCT_VALUE_ADDRESS
#define EXTRACT_STRUCT_VALUE_ADDRESS_P (0)
#define EXTRACT_STRUCT_VALUE_ADDRESS(X) (abort (), 0)
#define EXTRACT_STRUCT_VALUE_ADDRESS(X) (fatal ("gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
#else
#ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P
#define EXTRACT_STRUCT_VALUE_ADDRESS_P (1)
@ -175,4 +1076,6 @@ extern int frame_num_args_unknown PARAMS ((struct frame_info *fi));
/* gdbarch trace variable */
extern int gdbarch_debug;
extern void gdbarch_dump PARAMS ((void));
#endif

View File

@ -2897,4 +2897,35 @@ void
_initialize_gdbtypes ()
{
build_gdbtypes ();
/* FIXME - For the moment, handle types by swapping them in and out.
Should be using the per-architecture data-pointer and a large
struct. */
register_gdbarch_swap (&builtin_type_void, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_char, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_short, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_int, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_long, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_long_long, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_signed_char, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_unsigned_char, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_unsigned_short, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_unsigned_int, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_unsigned_long, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_unsigned_long_long, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_float, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_double, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_long_double, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_complex, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_double_complex, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_string, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_int8, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_uint8, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_int16, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_uint16, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_int32, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_uint32, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_int64, sizeof (struct type*), NULL);
register_gdbarch_swap (&builtin_type_uint64, sizeof (struct type*), NULL);
register_gdbarch_swap (NULL, 0, build_gdbtypes);
}

View File

@ -122,18 +122,30 @@ extern CORE_ADDR read_pc PARAMS ((void));
extern CORE_ADDR read_pc_pid PARAMS ((int));
extern CORE_ADDR generic_target_read_pc PARAMS ((int));
extern void write_pc PARAMS ((CORE_ADDR));
extern void write_pc_pid PARAMS ((CORE_ADDR, int));
extern void generic_target_write_pc PARAMS ((CORE_ADDR, int));
extern CORE_ADDR read_sp PARAMS ((void));
extern CORE_ADDR generic_target_read_sp PARAMS ((void));
extern void write_sp PARAMS ((CORE_ADDR));
extern void generic_target_write_sp PARAMS ((CORE_ADDR));
extern CORE_ADDR read_fp PARAMS ((void));
extern CORE_ADDR generic_target_read_fp PARAMS ((void));
extern void write_fp PARAMS ((CORE_ADDR));
extern void generic_target_write_fp PARAMS ((CORE_ADDR));
extern void wait_for_inferior PARAMS ((void));
extern void init_wait_for_inferior PARAMS ((void));
@ -435,24 +447,32 @@ extern int sizeof_call_dummy_words;
/* Are we in a call dummy? */
extern int pc_in_call_dummy_before_text_end PARAMS ((CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address));
#if !GDB_MULTI_ARCH
#if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == BEFORE_TEXT_END
#define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_before_text_end (pc, sp, frame_address)
#endif /* Before text_end. */
#endif
extern int pc_in_call_dummy_after_text_end PARAMS ((CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address));
#if !GDB_MULTI_ARCH
#if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == AFTER_TEXT_END
#define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_after_text_end (pc, sp, frame_address)
#endif
#endif
extern int pc_in_call_dummy_on_stack PARAMS ((CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address));
#if !GDB_MULTI_ARCH
#if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == ON_STACK
#define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_on_stack (pc, sp, frame_address)
#endif
#endif
extern int pc_in_call_dummy_at_entry_point PARAMS ((CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address));
#if !GDB_MULTI_ARCH
#if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == AT_ENTRY_POINT
#define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_at_entry_point (pc, sp, frame_address)
#endif
#endif
/* It's often not enough for our clients to know whether the PC is merely
somewhere within the call dummy. They may need to know whether the

View File

@ -3784,6 +3784,9 @@ _initialize_infrun ()
build_infrun ();
register_gdbarch_swap (&stop_registers, sizeof (stop_registers), NULL);
register_gdbarch_swap (NULL, 0, build_infrun);
add_info ("signals", signals_info,
"What debugger does when program gets various signals.\n\
Specify a signal as argument to print info on that signal only.");

View File

@ -48,7 +48,7 @@ int display_space;
invoked on the command line with the -nw --async options. In this
version, the usual command_loop is substituted by and event loop which
processes UI events asynchronously. */
int async = 0;
int async_p = 0;
/* Whether this is the command line version or not */
int tui_version = 0;
@ -61,6 +61,7 @@ int dbx_commands = 0;
GDB_FILE *gdb_stdout;
GDB_FILE *gdb_stderr;
GDB_FILE *gdb_stdlog;
/* Whether to enable writing into executable and core files */
extern int write_files;
@ -161,9 +162,11 @@ main (argc, argv)
/* not yet */
gdb_stdout = stdio_fileopen (stdout);
gdb_stderr = stdio_fileopen (stderr);
gdb_stdlog = gdb_stderr; /* for moment */
#else
gdb_stdout = tui_fileopen (stdout);
gdb_stderr = tui_fileopen (stderr);
gdb_stdlog = gdb_stdout; /* for moment */
#endif
/* Parse arguments and options. */
@ -174,7 +177,8 @@ main (argc, argv)
with no equivalent). */
static struct option long_options[] =
{
{"async", no_argument, &async, 1},
{"async", no_argument, &async_p, 1},
{"noasync", no_argument, &async_p, 0},
#if defined(TUI)
{"tui", no_argument, &tui_version, 1},
#endif
@ -388,12 +392,16 @@ main (argc, argv)
/* Get ready to invoke the event loop instead of the
command_loop. See event-loop.h for more details.*/
if (async)
async_hook = setup_event_loop;
if (async_p)
command_loop_hook = start_event_loop;
#if defined(TUI)
/* Should this be moved to tui-top.c:_initialize_tui()? */
if (tui_version)
init_ui_hook = tuiInit;
#endif
/* Initialize all files. Give the interpreter a chance to take
control of the console via the init_ui_hook()) */
gdb_init (argv[0]);
/* Do these (and anything which might call wrap_here or *_filtered)
@ -617,12 +625,6 @@ main (argc, argv)
#endif
}
/* Call the event loop, if gdb was invoked with the --async
option. Control will never get back to this file, if the event
loop is invoked. See the files event-*.[ch] for details. */
if (async_hook)
async_hook();
/* The default command loop.
The WIN32 Gui calls this main to set up gdb's state, and
has its own command loop. */
@ -642,7 +644,6 @@ main (argc, argv)
quit_command ((char *)0, instream == stdin);
}
}
/* No exit -- exit is through quit_command. */
#endif
@ -660,6 +661,9 @@ print_gdb_help (stream)
This is the GNU debugger. Usage:\n\n\
gdb [options] [executable-file [core-file or process-id]]\n\n\
Options:\n\n\
", stream);
fputs_unfiltered ("\
--[no]async Enable (disable) asynchronous version of CLI\n\
", stream);
fputs_unfiltered ("\
-b BAUDRATE Set serial port baud rate used for remote debugging.\n\

View File

@ -2020,11 +2020,18 @@ mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
}
}
/* Return adjusted stack pointer. */
return sp;
}
CORE_ADDR
mips_push_return_address (pc, sp)
CORE_ADDR pc;
CORE_ADDR sp;
{
/* Set the return address register to point to the entry
point of the program, where a breakpoint lies in wait. */
write_register (RA_REGNUM, CALL_DUMMY_ADDRESS());
/* Return adjusted stack pointer. */
return sp;
}

View File

@ -28,14 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdbcore.h"
#include "symfile.h"
static char *mn10300_generic_register_names[] =
{ "d0", "d1", "d2", "d3", "a0", "a1", "a2", "a3",
"sp", "pc", "mdr", "psw", "lir", "lar", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "fp" };
char **mn10300_register_names = mn10300_generic_register_names;
static CORE_ADDR mn10300_analyze_prologue PARAMS ((struct frame_info *fi,
CORE_ADDR pc));
@ -47,6 +39,60 @@ struct frame_extra_info
int stack_size;
};
static char *mn10300_generic_register_names[] =
{ "d0", "d1", "d2", "d3", "a0", "a1", "a2", "a3",
"sp", "pc", "mdr", "psw", "lir", "lar", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "fp" };
static char **mn10300_register_names = mn10300_generic_register_names;
char *
mn10300_register_name (i)
int i;
{
return mn10300_register_names[i];
}
CORE_ADDR
mn10300_saved_pc_after_call (fi)
struct frame_info *fi;
{
return read_memory_integer (read_register (SP_REGNUM), 4);
}
void
mn10300_extract_return_value (type, regbuf, valbuf)
struct type *type;
char *regbuf;
char *valbuf;
{
if (TYPE_CODE (type) == TYPE_CODE_PTR)
memcpy (valbuf, regbuf + REGISTER_BYTE (4), TYPE_LENGTH (type));
else
memcpy (valbuf, regbuf + REGISTER_BYTE (0), TYPE_LENGTH (type));
}
CORE_ADDR
mn10300_extract_struct_value_address (regbuf)
char *regbuf;
{
return extract_address (regbuf + REGISTER_BYTE (4),
REGISTER_RAW_SIZE (4));
}
void
mn10300_store_return_value (type, valbuf)
struct type *type;
char *valbuf;
{
if (TYPE_CODE (type) == TYPE_CODE_PTR)
write_register_bytes (REGISTER_BYTE (4), valbuf, TYPE_LENGTH (type));
else
write_register_bytes (REGISTER_BYTE (0), valbuf, TYPE_LENGTH (type));
}
static struct frame_info *analyze_dummy_frame PARAMS ((CORE_ADDR, CORE_ADDR));
static struct frame_info *
analyze_dummy_frame (pc, frame)

View File

@ -1360,6 +1360,17 @@ _initialize_parse ()
build_parse ();
/* FIXME - For the moment, handle types by swapping them in and out.
Should be using the per-architecture data-pointer and a large
struct. */
register_gdbarch_swap (&msym_text_symbol_type, sizeof (msym_text_symbol_type), NULL);
register_gdbarch_swap (&msym_data_symbol_type, sizeof (msym_data_symbol_type), NULL);
register_gdbarch_swap (&msym_unknown_symbol_type, sizeof (msym_unknown_symbol_type), NULL);
register_gdbarch_swap (&num_std_regs, sizeof (std_regs), NULL);
register_gdbarch_swap (&std_regs, sizeof (std_regs), NULL);
register_gdbarch_swap (NULL, 0, build_parse);
add_show_from_set (
add_set_cmd ("expressiondebug", class_maintenance, var_zinteger,
(char *)&expressiondebug,

View File

@ -441,7 +441,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
continue;
case 'T':
if (p != namestring) /* a name is there, not just :T... */
/* When a 'T' entry is defining an anonymous enum, it
may have a name which is the empty string, or a
single space. Since they're not really defining a
symbol, those shouldn't go in the partial symbol
table. We do pick up the elements of such enums at
'check_enum:', below. */
if (p >= namestring + 2
|| (p == namestring + 1
&& namestring[0] != ' '))
{
add_psymbol_to_list (namestring, p - namestring,
STRUCT_NAMESPACE, LOC_TYPEDEF,
@ -579,10 +587,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
find_stab_function_addr (namestring, pst, objfile);
textlow_not_set = 0;
}
#endif
#if 0
if (startup_file_end == 0)
startup_file_end = CUR_SYMBOL_VALUE;
#endif
/* End kludge. */
@ -626,10 +630,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
find_stab_function_addr (namestring, pst, objfile);
textlow_not_set = 0;
}
#endif
#if 0
if (startup_file_end == 0)
startup_file_end = CUR_SYMBOL_VALUE;
#endif
/* End kludge. */
/* In reordered executables this function may lie outside

View File

@ -141,6 +141,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
targets.
or... XAA The process terminated with signal
AA.
or (obsolete) NAA;tttttttt;dddddddd;bbbbbbbb
AA = signal number
tttttttt = address of symbol "_start"
dddddddd = base of data section
bbbbbbbb = base of bss section.
Note: only used by Cisco Systems
targets. The difference between this
reply and the "qOffsets" query is that
the 'N' packet may arrive spontaneously
whereas the 'qOffsets' is a query
initiated by the host debugger.
or... OXX..XX XX..XX is hex encoding of ASCII data. This
can happen at any time while the
program is running and the debugger
@ -213,6 +224,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Prototypes for local functions */
static void build_remote_gdbarch_data PARAMS ((void));
static int remote_write_bytes PARAMS ((CORE_ADDR memaddr,
char *myaddr, int len));
@ -291,6 +304,10 @@ static void init_remote_ops PARAMS ((void));
static void init_extended_remote_ops PARAMS ((void));
static void init_remote_cisco_ops PARAMS ((void));
static struct target_ops remote_cisco_ops;
static void remote_stop PARAMS ((void));
static int ishex PARAMS ((int ch, int *val));
@ -366,6 +383,10 @@ static int remote_break;
starts. */
static serial_t remote_desc = NULL;
/* This is set by the target (thru the 'S' message)
to denote that the target is in kernel mode. */
static int cisco_kernel_mode = 0;
/* This variable (available to the user via "set remotebinarydownload")
dictates whether downloads are sent in binary (via the 'X' packet).
We assume that the stub can, and attempt to do it. This will be cleared if
@ -451,7 +472,10 @@ record_currthread (currthread)
/* If this is a new thread, add it to GDB's thread list.
If we leave it up to WFI to do this, bad things will happen. */
if (!in_thread_list (currthread))
add_thread (currthread);
{
add_thread (currthread);
printf_filtered ("[New %s]\n", target_pid_to_str (currthread));
}
}
#define MAGIC_NULL_PID 42000
@ -1264,6 +1288,35 @@ remote_find_new_threads ()
inferior_pid = remote_current_thread (inferior_pid);
}
static void
remote_threads_info (void)
{
char buf[PBUFSIZ], *bufp;
int tid;
if (remote_desc == 0) /* paranoia */
error ("Command can only be used when connected to the remote target.");
putpkt ("qfThreadInfo");
getpkt (bufp = buf, 0);
if (bufp[0] == '\0') /* q packet not recognized! */
{ /* try old jmetzler method */
remote_find_new_threads ();
return;
}
else /* try new 'q' method */
while (*bufp++ == 'm') /* reply contains one or more TID */
{
do {
tid = strtol(bufp, &bufp, 16);
if (tid != 0 && !in_thread_list (tid))
add_thread (tid);
} while (*bufp++ == ','); /* comma-separated list */
putpkt ("qsThreadInfo");
getpkt (bufp = buf, 0);
}
}
/* Restart the remote side; this is an extended protocol operation. */
@ -1381,8 +1434,141 @@ get_offsets ()
objfile_relocate (symfile_objfile, offs);
}
/*
* Cisco version of section offsets:
*
* Instead of having GDB query the target for the section offsets,
* Cisco lets the target volunteer the information! It's also in
* a different format, so here are the functions that will decode
* a section offset packet from a Cisco target.
*/
/*
* Function: remote_cisco_section_offsets
*
* Returns: zero for success, non-zero for failure
*/
static int
remote_cisco_section_offsets (text_addr, data_addr, bss_addr,
text_offs, data_offs, bss_offs)
bfd_vma text_addr;
bfd_vma data_addr;
bfd_vma bss_addr;
bfd_signed_vma * text_offs;
bfd_signed_vma * data_offs;
bfd_signed_vma * bss_offs;
{
bfd_vma text_base, data_base, bss_base;
struct minimal_symbol *start;
asection *sect;
bfd * abfd;
int len;
char *p;
if (symfile_objfile == NULL)
return -1; /* no can do nothin' */
start = lookup_minimal_symbol ("_start", NULL, NULL);
if (start == NULL)
return -1; /* Can't find "_start" symbol */
data_base = bss_base = 0;
text_base = SYMBOL_VALUE_ADDRESS (start);
abfd = symfile_objfile->obfd;
for (sect = abfd->sections;
sect != 0;
sect = sect->next)
{
p = (unsigned char *) bfd_get_section_name (abfd, sect);
len = strlen (p);
if (strcmp (p + len - 4, "data") == 0) /* ends in "data" */
if (data_base == 0 ||
data_base > bfd_get_section_vma (abfd, sect))
data_base = bfd_get_section_vma (abfd, sect);
if (strcmp (p + len - 3, "bss") == 0) /* ends in "bss" */
if (bss_base == 0 ||
bss_base > bfd_get_section_vma (abfd, sect))
bss_base = bfd_get_section_vma (abfd, sect);
}
*text_offs = text_addr - text_base;
*data_offs = data_addr - data_base;
*bss_offs = bss_addr - bss_base;
if (remote_debug)
{
char tmp[128];
sprintf (tmp, "VMA: text = 0x");
sprintf_vma (tmp + strlen (tmp), text_addr);
sprintf (tmp + strlen (tmp), " data = 0x");
sprintf_vma (tmp + strlen (tmp), data_addr);
sprintf (tmp + strlen (tmp), " bss = 0x");
sprintf_vma (tmp + strlen (tmp), bss_addr);
fprintf_filtered (gdb_stdlog, tmp);
fprintf_filtered (gdb_stdlog,
"Reloc offset: text = 0x%x data = 0x%x bss = 0x%x\n",
(long) *text_offs, (long) *data_offs, (long) *bss_offs);
}
return 0;
}
/*
* Function: remote_cisco_objfile_relocate
*
* Relocate the symbol file for a remote target.
*/
static void
remote_cisco_objfile_relocate (text_off, data_off, bss_off)
bfd_signed_vma text_off;
bfd_signed_vma data_off;
bfd_signed_vma bss_off;
{
struct section_offsets *offs;
if (text_off != 0 || data_off != 0 || bss_off != 0)
{
/* FIXME: This code assumes gdb-stabs.h is being used; it's
broken for xcoff, dwarf, sdb-coff, etc. But there is no
simple canonical representation for this stuff. */
offs = ((struct section_offsets *)
alloca (sizeof (struct section_offsets)
+ (symfile_objfile->num_sections
* sizeof (offs->offsets))));
memcpy (offs, symfile_objfile->section_offsets,
(sizeof (struct section_offsets)
+ (symfile_objfile->num_sections
* sizeof (offs->offsets))));
ANOFFSET (offs, SECT_OFF_TEXT) = text_off;
ANOFFSET (offs, SECT_OFF_DATA) = data_off;
ANOFFSET (offs, SECT_OFF_BSS) = bss_off;
/* First call the standard objfile_relocate. */
objfile_relocate (symfile_objfile, offs);
/* Now we need to fix up the section entries already attached to
the exec target. These entries will control memory transfers
from the exec file. */
exec_set_section_offsets (text_off, data_off, bss_off);
}
}
/* Stub for catch_errors. */
static int
remote_start_remote_dummy (dummy)
char *dummy;
{
start_remote (); /* Initialize gdb process mechanisms */
return 1;
}
static int
remote_start_remote (dummy)
PTR dummy;
@ -1402,8 +1588,7 @@ remote_start_remote (dummy)
putpkt ("?"); /* initiate a query from remote machine */
immediate_quit = 0;
start_remote (); /* Initialize gdb process mechanisms */
return 1;
return remote_start_remote_dummy (dummy);
}
/* Open a connection to a remote debugger.
@ -1629,7 +1814,7 @@ remote_interrupt (signo)
signal (signo, remote_interrupt_twice);
if (remote_debug)
printf_unfiltered ("remote_interrupt called\n");
fprintf_unfiltered (gdb_stdlog, "remote_interrupt called\n");
target_stop ();
}
@ -1653,7 +1838,7 @@ remote_stop ()
{
/* Send a break or a ^C, depending on user preference. */
if (remote_debug)
printf_unfiltered ("remote_stop called\n");
fprintf_unfiltered (gdb_stdlog, "remote_stop called\n");
if (remote_break)
SERIAL_SEND_BREAK (remote_desc);
@ -1701,9 +1886,10 @@ remote_console_output (msg)
}
}
/* Wait until the remote machine stops, then return, storing status in
STATUS just as `wait' would. Returns "pid" (though it's not clear
what, if anything, that means in the case of this target). */
/* Wait until the remote machine stops, then return,
storing status in STATUS just as `wait' would.
Returns "pid", which in the case of a multi-threaded
remote OS, is the thread-id. */
static int
remote_wait (pid, status)
@ -1808,7 +1994,72 @@ Packet: '%s'\n",
status->value.sig = (enum target_signal)
(((fromhex (buf[1])) << 4) + (fromhex (buf[2])));
if (buf[3] == 'p')
{
/* Export Cisco kernel mode as a convenience variable
(so that it can be used in the GDB prompt if desired). */
if (cisco_kernel_mode == 1)
set_internalvar (lookup_internalvar ("cisco_kernel_mode"),
value_from_string ("PDEBUG-"));
cisco_kernel_mode = 0;
thread_num = strtol ((const char *) &buf[4], NULL, 16);
record_currthread (thread_num);
}
else if (buf[3] == 'k')
{
/* Export Cisco kernel mode as a convenience variable
(so that it can be used in the GDB prompt if desired). */
if (cisco_kernel_mode == 1)
set_internalvar (lookup_internalvar ("cisco_kernel_mode"),
value_from_string ("KDEBUG-"));
cisco_kernel_mode = 1;
}
goto got_status;
case 'N': /* Cisco special: status and offsets */
{
bfd_vma text_addr, data_addr, bss_addr;
bfd_signed_vma text_off, data_off, bss_off;
unsigned char *p1;
status->kind = TARGET_WAITKIND_STOPPED;
status->value.sig = (enum target_signal)
(((fromhex (buf[1])) << 4) + (fromhex (buf[2])));
if (symfile_objfile == NULL)
{
warning ("Relocation packet recieved with no symbol file. \
Packet Dropped");
goto got_status;
}
/* Relocate object file. Buffer format is NAATT;DD;BB
* where AA is the signal number, TT is the new text
* address, DD * is the new data address, and BB is the
* new bss address. */
p = &buf[3];
text_addr = strtoul (p, (char **) &p1, 16);
if (p1 == p || *p1 != ';')
warning ("Malformed relocation packet: Packet '%s'", buf);
p = p1 + 1;
data_addr = strtoul (p, (char **) &p1, 16);
if (p1 == p || *p1 != ';')
warning ("Malformed relocation packet: Packet '%s'", buf);
p = p1 + 1;
bss_addr = strtoul (p, (char **) &p1, 16);
if (p1 == p)
warning ("Malformed relocation packet: Packet '%s'", buf);
if (remote_cisco_section_offsets (text_addr, data_addr, bss_addr,
&text_off, &data_off, &bss_off)
== 0)
if (text_off != 0 || data_off != 0 || bss_off != 0)
remote_cisco_objfile_relocate (text_off, data_off, bss_off);
goto got_status;
}
case 'W': /* Target exited */
{
/* The remote process exited. */
@ -1851,15 +2102,6 @@ Packet: '%s'\n",
got_status:
if (thread_num != -1)
{
/* Initial thread value can only be acquired via wait, so deal with
this marker which is used before the first thread value is
acquired. */
if (inferior_pid == MAGIC_NULL_PID)
{
inferior_pid = thread_num;
if (!in_thread_list (inferior_pid))
add_thread (inferior_pid);
}
return thread_num;
}
return inferior_pid;
@ -1901,7 +2143,8 @@ remote_fetch_registers (regno)
&& buf[0] != 'x') /* New: unavailable register value */
{
if (remote_debug)
printf_unfiltered ("Bad register packet; fetching a new packet\n");
fprintf_unfiltered (gdb_stdlog,
"Bad register packet; fetching a new packet\n");
getpkt (buf, 0);
}
@ -2138,9 +2381,11 @@ check_binary_download (addr)
if (remote_debug)
{
if (remote_binary_download)
printf_unfiltered ("binary downloading suppported by target\n");
fprintf_unfiltered (gdb_stdlog,
"binary downloading suppported by target\n");
else
printf_unfiltered ("binary downloading NOT suppported by target\n");
fprintf_unfiltered (gdb_stdlog,
"binary downloading NOT suppported by target\n");
}
}
@ -2566,8 +2811,8 @@ putpkt_binary (buf, cnt)
if (remote_debug)
{
*p = '\0';
printf_unfiltered ("Sending packet: %s...", buf2);
gdb_flush (gdb_stdout);
fprintf_unfiltered (gdb_stdlog, "Sending packet: %s...", buf2);
gdb_flush (gdb_stdlog);
}
if (SERIAL_WRITE (remote_desc, buf2, p - buf2))
perror_with_name ("putpkt: write failed");
@ -2596,7 +2841,7 @@ putpkt_binary (buf, cnt)
{
case '+':
if (remote_debug)
printf_unfiltered ("Ack\n");
fprintf_unfiltered (gdb_stdlog, "Ack\n");
return 1;
case SERIAL_TIMEOUT:
tcount ++;
@ -2618,9 +2863,9 @@ putpkt_binary (buf, cnt)
if (!started_error_output)
{
started_error_output = 1;
printf_unfiltered ("putpkt: Junk: ");
fprintf_unfiltered (gdb_stdlog, "putpkt: Junk: ");
}
putchar_unfiltered (ch & 0177);
fputc_unfiltered (ch & 0177, gdb_stdlog);
}
continue;
}
@ -2642,6 +2887,32 @@ putpkt_binary (buf, cnt)
}
}
static int remote_cisco_mode;
static void remote_cisco_expand (src, dest)
char *src;
char *dest;
{
int i;
int repeat;
do {
if (*src == '*')
{
repeat = (fromhex (src[1]) << 4) + fromhex (src[2]);
for (i = 0; i < repeat; i++)
{
*dest++ = *(src-1);
}
src += 2;
}
else
{
*dest++ = *src;
}
} while (*src++);
}
/* Come here after finding the start of the frame. Collect the rest
into BUF, verifying the checksum, length, and handling run-length
compression. Returns 0 on any error, 1 on success. */
@ -2665,11 +2936,12 @@ read_frame (buf)
{
case SERIAL_TIMEOUT:
if (remote_debug)
puts_filtered ("Timeout in mid-packet, retrying\n");
fputs_filtered ("Timeout in mid-packet, retrying\n", gdb_stdlog);
return 0;
case '$':
if (remote_debug)
puts_filtered ("Saw new packet start in middle of old one\n");
fputs_filtered ("Saw new packet start in middle of old one\n",
gdb_stdlog);
return 0; /* Start a new packet, count retries */
case '#':
{
@ -2681,37 +2953,49 @@ read_frame (buf)
pktcsum |= fromhex (readchar (remote_timeout));
if (csum == pktcsum)
return 1;
{
if (remote_cisco_mode) /* variant run-length-encoding */
{
char tmp_buf[PBUFSIZ];
remote_cisco_expand (buf, tmp_buf);
strcpy (buf, tmp_buf);
}
return 1;
}
if (remote_debug)
{
printf_filtered ("Bad checksum, sentsum=0x%x, csum=0x%x, buf=",
pktcsum, csum);
puts_filtered (buf);
puts_filtered ("\n");
fprintf_filtered (gdb_stdlog,
"Bad checksum, sentsum=0x%x, csum=0x%x, buf=",
pktcsum, csum);
fputs_filtered (buf, gdb_stdlog);
fputs_filtered ("\n", gdb_stdlog);
}
return 0;
}
case '*': /* Run length encoding */
csum += c;
c = readchar (remote_timeout);
csum += c;
c = c - ' ' + 3; /* Compute repeat count */
if (c > 0 && c < 255 && bp + c - 1 < buf + PBUFSIZ - 1)
if (remote_cisco_mode == 0) /* variant run-length-encoding */
{
memset (bp, *(bp - 1), c);
bp += c;
continue;
csum += c;
c = readchar (remote_timeout);
csum += c;
c = c - ' ' + 3; /* Compute repeat count */
if (c > 0 && c < 255 && bp + c - 1 < buf + PBUFSIZ - 1)
{
memset (bp, *(bp - 1), c);
bp += c;
continue;
}
*bp = '\0';
printf_filtered ("Repeat count %d too large for buffer: ", c);
puts_filtered (buf);
puts_filtered ("\n");
return 0;
}
*bp = '\0';
printf_filtered ("Repeat count %d too large for buffer: ", c);
puts_filtered (buf);
puts_filtered ("\n");
return 0;
/* else fall thru to treat like default */
default:
if (bp < buf + PBUFSIZ - 1)
{
@ -2779,7 +3063,7 @@ getpkt (buf, forever)
error ("Watchdog has expired. Target detached.\n");
}
if (remote_debug)
puts_filtered ("Timed out.\n");
fputs_filtered ("Timed out.\n", gdb_stdlog);
goto retry;
}
}
@ -2792,7 +3076,7 @@ getpkt (buf, forever)
if (val == 1)
{
if (remote_debug)
fprintf_unfiltered (gdb_stdout, "Packet received: %s\n", buf);
fprintf_unfiltered (gdb_stdlog, "Packet received: %s\n", buf);
SERIAL_WRITE (remote_desc, "+", 1);
return;
}
@ -3390,7 +3674,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
remote_ops.to_load = generic_load;
remote_ops.to_mourn_inferior = remote_mourn;
remote_ops.to_thread_alive = remote_thread_alive;
remote_ops.to_find_new_threads = remote_find_new_threads;
remote_ops.to_find_new_threads = remote_threads_info;
remote_ops.to_stop = remote_stop;
remote_ops.to_query = remote_query;
remote_ops.to_stratum = process_stratum;
@ -3411,21 +3695,425 @@ init_extended_remote_ops ()
{
extended_remote_ops = remote_ops;
extended_remote_ops.to_shortname = "extended-remote";
extended_remote_ops.to_shortname = "extended-remote";
extended_remote_ops.to_longname =
"Extended remote serial target in gdb-specific protocol";
extended_remote_ops.to_doc =
"Use a remote computer via a serial line, using a gdb-specific protocol.\n\
Specify the serial device it is connected to (e.g. /dev/ttya).",
extended_remote_ops.to_open = extended_remote_open;
extended_remote_ops.to_open = extended_remote_open;
extended_remote_ops.to_create_inferior = extended_remote_create_inferior;
extended_remote_ops.to_mourn_inferior = extended_remote_mourn;
}
}
/*
* Command: info remote-process
*
* This implements Cisco's version of the "info proc" command.
*
* This query allows the target stub to return an arbitrary string
* (or strings) giving arbitrary information about the target process.
* This is optional; the target stub isn't required to implement it.
*
* Syntax: qfProcessInfo request first string
* qsProcessInfo request subsequent string
* reply: 'O'<hex-encoded-string>
* 'l' last reply (empty)
*/
static void
remote_info_process (args, from_tty)
char *args;
int from_tty;
{
char buf[PBUFSIZ];
if (remote_desc == 0)
error ("Command can only be used when connected to the remote target.");
putpkt ("qfProcessInfo");
getpkt (buf, 0);
if (buf[0] == 0)
return; /* Silently: target does not support this feature. */
if (buf[0] == 'E')
error ("info proc: target error.");
while (buf[0] == 'O') /* Capitol-O packet */
{
remote_console_output (&buf[1]);
putpkt ("qsProcessInfo");
getpkt (buf, 0);
}
}
/*
* Target Cisco
*/
static void
remote_cisco_open (name, from_tty)
char *name;
int from_tty;
{
if (name == 0)
error (
"To open a remote debug connection, you need to specify what \n\
device is attached to the remote system (e.g. host:port).");
target_preopen (from_tty);
unpush_target (&remote_cisco_ops);
remote_dcache = dcache_init (remote_read_bytes, remote_write_bytes);
remote_desc = SERIAL_OPEN (name);
if (!remote_desc)
perror_with_name (name);
/*
* If a baud rate was specified on the gdb command line it will
* be greater than the initial value of -1. If it is, use it otherwise
* default to 9600
*/
baud_rate = (baud_rate > 0) ? baud_rate : 9600;
if (SERIAL_SETBAUDRATE (remote_desc, baud_rate))
{
SERIAL_CLOSE (remote_desc);
perror_with_name (name);
}
SERIAL_RAW (remote_desc);
/* If there is something sitting in the buffer we might take it as a
response to a command, which would be bad. */
SERIAL_FLUSH_INPUT (remote_desc);
if (from_tty)
{
puts_filtered ("Remote debugging using ");
puts_filtered (name);
puts_filtered ("\n");
}
remote_cisco_mode = 1;
push_target (&remote_cisco_ops); /* Switch to using cisco target now */
/* Start out by trying the 'P' request to set registers. We set this each
time that we open a new target so that if the user switches from one
stub to another, we can (if the target is closed and reopened) cope. */
stub_supports_P = 1;
general_thread = -2;
continue_thread = -2;
/* Force remote_write_bytes to check whether target supports
binary downloading. */
remote_binary_checked = 0;
/* Without this, some commands which require an active target (such
as kill) won't work. This variable serves (at least) double duty
as both the pid of the target process (if it has such), and as a
flag indicating that a target is active. These functions should
be split out into seperate variables, especially since GDB will
someday have a notion of debugging several processes. */
inferior_pid = MAGIC_NULL_PID;
/* Start the remote connection; if error (0), discard this target. */
if (!catch_errors (remote_start_remote_dummy, (char *) 0,
"Couldn't establish connection to remote target\n",
RETURN_MASK_ALL))
{
pop_target ();
return;
}
}
static void
remote_cisco_close (quitting)
int quitting;
{
remote_cisco_mode = 0;
remote_close (quitting);
}
static void
remote_cisco_mourn PARAMS ((void))
{
remote_mourn_1 (&remote_cisco_ops);
}
enum {
READ_MORE,
FATAL_ERROR,
ENTER_DEBUG,
DISCONNECT_TELNET
} minitelnet_return;
/* shared between readsocket() and readtty() */
static char *tty_input;
static int escape_count;
static int echo_check;
extern int quit_flag;
static int
readsocket ()
{
int data;
/* Loop until the socket doesn't have any more data */
while ((data = readchar (0)) >= 0)
{
/* Check for the escape sequence */
if (data == '|')
{
/* If this is the fourth escape, get out */
if (++escape_count == 4)
{
return ENTER_DEBUG;
}
else
{ /* This is a '|', but not the fourth in a row.
Continue without echoing it. If it isn't actually
one of four in a row, it'll be echoed later. */
continue;
}
}
else /* Not a '|' */
{
/* Ensure any pending '|'s are flushed. */
for ( ; escape_count > 0; escape_count--)
putchar('|');
}
if (data == '\r') /* If this is a return character, */
continue; /* - just supress it. */
if (echo_check != -1) /* Check for echo of user input. */
{
if (tty_input[echo_check] == data)
{
echo_check++; /* Character matched user input: */
continue; /* Continue without echoing it. */
}
else if ((data == '\n') && (tty_input[echo_check] == '\r'))
{ /* End of the line (and of echo checking). */
echo_check = -1; /* No more echo supression */
continue; /* Continue without echoing. */
}
else
{ /* Failed check for echo of user input.
We now have some suppressed output to flush! */
int j;
for (j = 0; j < echo_check; j++)
putchar (tty_input[j]);
echo_check = -1;
}
}
putchar (data); /* Default case: output the char. */
}
if (data == SERIAL_TIMEOUT) /* Timeout returned from readchar. */
return READ_MORE; /* Try to read some more */
else
return FATAL_ERROR; /* Trouble, bail out */
}
static int
readtty ()
{
int status;
int tty_bytecount;
/* First, read a buffer full from the terminal */
tty_bytecount = read (fileno (stdin), tty_input, sizeof (tty_input) - 1);
if (tty_bytecount == -1)
{
perror ("readtty: read failed");
return FATAL_ERROR;
}
/* Remove a quoted newline. */
if (tty_input[tty_bytecount - 1] == '\n' &&
tty_input[tty_bytecount - 2] == '\\') /* line ending in backslash */
{
tty_input[--tty_bytecount] = 0; /* remove newline */
tty_input[--tty_bytecount] = 0; /* remove backslash */
}
/* Turn trailing newlines into returns */
if (tty_input[tty_bytecount - 1] == '\n')
tty_input[tty_bytecount - 1] = '\r';
/* If the line consists of a ~, enter debugging mode. */
if ((tty_input[0] == '~') && (tty_bytecount == 2))
return ENTER_DEBUG;
/* Make this a zero terminated string and write it out */
tty_input[tty_bytecount] = 0;
if (SERIAL_WRITE (remote_desc, tty_input, tty_bytecount))
{
perror_with_name ("readtty: write failed");
return FATAL_ERROR;
}
return READ_MORE;
}
static int
minitelnet ()
{
fd_set input; /* file descriptors for select */
int tablesize; /* max number of FDs for select */
int status;
int quit_count = 0;
extern int escape_count; /* global shared by readsocket */
extern int echo_check; /* ditto */
escape_count = 0;
echo_check = -1;
tablesize = 8 * sizeof (input);
for (;;)
{
/* Check for anything from our socket - doesn't block. Note that
this must be done *before* the select as there may be
buffered I/O waiting to be processed. */
if ((status = readsocket ()) == FATAL_ERROR)
{
error ("Debugging terminated by communications error");
}
else if (status != READ_MORE)
{
return (status);
}
fflush(stdout); /* Flush output before blocking */
/* Now block on more socket input or TTY input */
FD_ZERO (&input);
FD_SET (fileno(stdin), &input);
FD_SET (remote_desc->fd, &input);
status = select (tablesize, &input, 0, 0, 0);
if ((status == -1) && (errno != EINTR))
{
error ("Communications error on select %d", errno);
}
/* Handle Control-C typed */
if (quit_flag)
{
if ((++quit_count) == 2)
{
if (query ("Interrupt GDB? "))
{
printf_filtered ("Interrupted by user.\n");
return_to_top_level (RETURN_QUIT);
}
quit_count = 0;
}
quit_flag = 0;
if (remote_break)
SERIAL_SEND_BREAK (remote_desc);
else
SERIAL_WRITE (remote_desc, "\003", 1);
continue;
}
/* Handle console input */
if (FD_ISSET (fileno (stdin), &input))
{
quit_count = 0;
echo_check = 0;
status = readtty ();
if (status == READ_MORE)
continue;
return status; /* telnet session ended */
}
}
}
static int
remote_cisco_wait (pid, status)
int pid;
struct target_waitstatus *status;
{
if (minitelnet() != ENTER_DEBUG)
{
error ("Debugging session terminated by protocol error");
}
putpkt ("?");
return remote_wait (pid, status);
}
static void
init_remote_cisco_ops ()
{
remote_cisco_ops.to_shortname = "cisco";
remote_cisco_ops.to_longname = "Remote serial target in cisco-specific protocol";
remote_cisco_ops.to_doc =
"Use a remote machine via TCP, using a cisco-specific protocol.\n\
Specify the serial device it is connected to (e.g. host:2020).";
remote_cisco_ops.to_open = remote_cisco_open;
remote_cisco_ops.to_close = remote_cisco_close;
remote_cisco_ops.to_detach = remote_detach;
remote_cisco_ops.to_resume = remote_resume;
remote_cisco_ops.to_wait = remote_cisco_wait;
remote_cisco_ops.to_fetch_registers = remote_fetch_registers;
remote_cisco_ops.to_store_registers = remote_store_registers;
remote_cisco_ops.to_prepare_to_store = remote_prepare_to_store;
remote_cisco_ops.to_xfer_memory = remote_xfer_memory;
remote_cisco_ops.to_files_info = remote_files_info;
remote_cisco_ops.to_insert_breakpoint = remote_insert_breakpoint;
remote_cisco_ops.to_remove_breakpoint = remote_remove_breakpoint;
remote_cisco_ops.to_kill = remote_kill;
remote_cisco_ops.to_load = generic_load;
remote_cisco_ops.to_mourn_inferior = remote_cisco_mourn;
remote_cisco_ops.to_thread_alive = remote_thread_alive;
remote_cisco_ops.to_find_new_threads = remote_threads_info;
remote_cisco_ops.to_stratum = process_stratum;
remote_cisco_ops.to_has_all_memory = 1;
remote_cisco_ops.to_has_memory = 1;
remote_cisco_ops.to_has_stack = 1;
remote_cisco_ops.to_has_registers = 1;
remote_cisco_ops.to_has_execution = 1;
remote_cisco_ops.to_magic = OPS_MAGIC;
}
static void
build_remote_gdbarch_data ()
{
tty_input = xmalloc (PBUFSIZ);
}
void
_initialize_remote ()
{
/* runtime constants */
/* architecture specific data */
build_remote_gdbarch_data ();
register_gdbarch_swap (&tty_input, sizeof (&tty_input), NULL);
register_gdbarch_swap (NULL, 0, build_remote_gdbarch_data);
/* runtime constants - we retain the value of remote_write_size
across architecture swaps. */
remote_write_size = PBUFSIZ;
init_remote_ops ();
@ -3434,6 +4122,9 @@ _initialize_remote ()
init_extended_remote_ops ();
add_target (&extended_remote_ops);
init_remote_cisco_ops ();
add_target (&remote_cisco_ops);
#if 0
init_remote_threadtests ();
#endif
@ -3487,4 +4178,8 @@ in a memory packet.\n",
var_boolean, (char *) &remote_binary_download,
"Set binary downloads.\n", &setlist),
&showlist);
add_info ("remote-process", remote_info_process,
"Query the remote system for process info.");
}

View File

@ -399,7 +399,7 @@ skip_prologue (pc, fdata)
(op & 0xffff0000) == 0x3bde0000) { /* addi 30,30,foo@l */
continue;
} else if ((op & 0xfc000000) == 0x48000000) { /* bl foo,
} else if ((op & 0xfc000001) == 0x48000001) { /* bl foo,
to save fprs??? */
fdata->frameless = 0;

View File

@ -1,3 +1,19 @@
Fri Jun 11 12:56:50 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdb.base/call-strs.c (link_malloc): New function. Ensure that
malloc() is linked in.
1999-06-08 Fernando Nasser <fnasser@totem.to.cygnus.com>
* gdb.base/ending-run.exp: Make sure we fail and do not timeout at
step at end.
* gdb.base/annota1.exp: Increase match_max to prevent timeout.
1999-06-08 Jim Blandy <jimb@zwingli.cygnus.com>
* gdb.java/jv-print.exp: New file. (Our first Java test!)
Fri Jun 4 10:47:46 1999 Jeffrey A Law (law@cygnus.com)
* gdb.base/a1-selftest.exp: Remove bogus hppa xfail.

View File

@ -269,6 +269,12 @@ gdb_expect {
# test:
# annotate-signal-handler-caller
#
verbose "match_max local is: [match_max]"
verbose "match_max default is: [match_max -d]"
# This is necessary because a 2000 buffer is not enought to get everything
# up to the prompt ad the test gets a timeout.
match_max 3000
verbose "match_max now is: [match_max]"
send_gdb "backtrace\n"
gdb_expect {
-re ".*frame-begin 0 $hex.*0.*frame-end.*frame-begin 1 $hex.*1.*\032\032signal-handler-caller\r\n.signal handler called.\r\n\r\n\032\032frame-end\r\n\r\n.*frame-begin 2 $hex.*2.*frame-begin 3 $hex.*3.*frame-end.*$gdb_prompt$" \

View File

@ -43,6 +43,11 @@ char * s7;
return bigbuf;
}
char *
link_malloc ()
{
return (char*) malloc (1);
}
main()
{

View File

@ -141,6 +141,7 @@ gdb_expect {
-re ".*in.*start.*$gdb_prompt $" {
pass "step out of main"
}
-re ".*$gdb_prompt $" { fail "step at end 2" }
timeout { fail "hang or timeout on step at end 2" }
}
}
@ -157,6 +158,7 @@ gdb_expect {
-re ".*Program received signal SIGTRAP.*$gdb_prompt $" {
pass "Cygmon stopped in ending trap."
}
-re ".*$gdb_prompt $" { fail "step at end 1" }
timeout { fail "hang or timeout on step at end 1" }
}

2383
gdb/top.c

File diff suppressed because it is too large Load Diff

View File

@ -67,6 +67,9 @@ extern void command_loop PARAMS ((void));
extern int quit_confirm PARAMS ((void));
extern void quit_force PARAMS ((char *, int));
extern void quit_command PARAMS ((char *, int));
extern void command_loop_marker PARAMS ((int));
extern int quit_cover PARAMS ((PTR));
extern void execute_command PARAMS ((char *, int));
/* This function returns a pointer to the string that is used
by gdb for its command prompt. */
@ -83,3 +86,12 @@ extern int readnow_symbol_files;
/* Perform _initialize initialization */
extern void gdb_init PARAMS ((char *));
/* For use by event-top.c */
/* Variables from top.c. */
extern int source_line_number;
extern char *source_file_name;
extern char *source_error;
extern char *source_pre_error;
extern int history_expansion_p;
extern int server_command;

View File

@ -835,7 +835,12 @@ read_actions (t)
immediate_quit++;
#ifdef STOP_SIGNAL
if (job_control)
signal (STOP_SIGNAL, stop_sig);
{
if (async_p)
signal (STOP_SIGNAL, handle_stop_sig);
else
signal (STOP_SIGNAL, stop_sig);
}
#endif
old_chain = make_cleanup ((make_cleanup_func) free_actions, (void *) t);
while (1)

View File

@ -717,7 +717,6 @@ void notice_quit()
#endif /* !defined(__GO32__) && !defined(_MSC_VER) */
/* Control C comes here */
void
request_quit (signo)
int signo;
@ -735,7 +734,6 @@ request_quit (signo)
quit ();
#endif
}
/* Memory management stuff (malloc friends). */
@ -1444,7 +1442,12 @@ prompt_for_continue ()
while (*p == ' ' || *p == '\t')
++p;
if (p[0] == 'q')
request_quit (SIGINT);
{
if (!async_p)
request_quit (SIGINT);
else
async_request_quit (0);
}
free (ignore);
}
immediate_quit--;
@ -1633,6 +1636,8 @@ stdio_fileopen (file)
static gdb_file_flush_ftype tui_file_flush;
extern gdb_file_fputs_ftype tui_file_fputs;
static gdb_file_isatty_ftype tui_file_isatty;
static gdb_file_rewind_ftype tui_file_rewind;
static gdb_file_put_ftype tui_file_put;
static gdb_file_delete_ftype tui_file_delete;
static struct gdb_file *tui_file_new PARAMS ((void));
static int tui_file_magic;
@ -1646,6 +1651,8 @@ tui_file_new ()
set_gdb_file_flush (file, tui_file_flush);
set_gdb_file_fputs (file, tui_file_fputs);
set_gdb_file_isatty (file, tui_file_isatty);
set_gdb_file_rewind (file, tui_file_rewind);
set_gdb_file_put (file, tui_file_put);
tui->ts_magic = &tui_file_magic;
return file;
}
@ -1690,6 +1697,30 @@ tui_file_isatty (file)
else return 0;
}
static void
tui_file_rewind (file)
struct gdb_file *file;
{
struct tui_stream *stream = gdb_file_data (file);
if (stream->ts_magic != &tui_file_magic)
error ("Internal error: bad magic number");
stream->ts_strbuf[0] = '\0';
}
static void
tui_file_put (file, dest)
struct gdb_file *file;
struct gdb_file *dest;
{
struct tui_stream *stream = gdb_file_data (file);
if (stream->ts_magic != &tui_file_magic)
error ("Internal error: bad magic number");
if (stream->ts_streamtype == astring)
{
fputs_unfiltered (stream->ts_strbuf, dest);
}
}
GDB_FILE *
gdb_file_init_astring (n)
int n;
@ -1806,6 +1837,8 @@ static gdb_file_isatty_ftype null_file_isatty;
static gdb_file_fputs_ftype null_file_fputs;
static gdb_file_flush_ftype null_file_flush;
static gdb_file_delete_ftype null_file_delete;
static gdb_file_rewind_ftype null_file_rewind;
static gdb_file_put_ftype null_file_put;
struct gdb_file
{
@ -1813,6 +1846,8 @@ struct gdb_file
gdb_file_fputs_ftype *to_fputs;
gdb_file_delete_ftype *to_delete;
gdb_file_isatty_ftype *to_isatty;
gdb_file_rewind_ftype *to_rewind;
gdb_file_put_ftype *to_put;
void *to_data;
};
@ -1824,6 +1859,8 @@ gdb_file_new ()
set_gdb_file_flush (file, null_file_flush);
set_gdb_file_fputs (file, null_file_fputs);
set_gdb_file_isatty (file, null_file_isatty);
set_gdb_file_rewind (file, null_file_rewind);
set_gdb_file_put (file, null_file_put);
return file;
}
@ -1842,6 +1879,21 @@ null_file_isatty (file)
return 0;
}
static void
null_file_rewind (file)
struct gdb_file *file;
{
return;
}
static void
null_file_put (file, src)
struct gdb_file *file;
struct gdb_file *src;
{
return;
}
static void
null_file_flush (file)
struct gdb_file *file;
@ -1885,6 +1937,21 @@ gdb_file_isatty (file)
return file->to_isatty (file);
}
void
gdb_file_rewind (file)
struct gdb_file *file;
{
return file->to_rewind (file);
}
void
gdb_file_put (file, dest)
struct gdb_file *file;
struct gdb_file *dest;
{
return file->to_put (file, dest);
}
void
fputs_unfiltered (buf, file)
const char *buf;
@ -1909,6 +1976,22 @@ set_gdb_file_isatty (file, isatty)
file->to_isatty = isatty;
}
void
set_gdb_file_rewind (file, rewind)
struct gdb_file *file;
gdb_file_rewind_ftype *rewind;
{
file->to_rewind = rewind;
}
void
set_gdb_file_put (file, put)
struct gdb_file *file;
gdb_file_put_ftype *put;
{
file->to_put = put;
}
void
set_gdb_file_fputs (file, fputs)
struct gdb_file *file;

View File

@ -276,6 +276,8 @@ extern value_ptr value_from_longest PARAMS ((struct type *type, LONGEST num));
extern value_ptr value_from_double PARAMS ((struct type *type, DOUBLEST num));
extern value_ptr value_from_string PARAMS ((char *string));
extern value_ptr value_at PARAMS ((struct type *type, CORE_ADDR addr, asection *sect));
extern value_ptr value_at_lazy PARAMS ((struct type *type, CORE_ADDR addr, asection *sect));

View File

@ -1454,6 +1454,32 @@ value_from_longest (type, num)
return val;
}
/* Create a value for a string constant to be stored locally
(not in the inferior's memory space, but in GDB memory).
This is analogous to value_from_longest, which also does not
use inferior memory. String shall NOT contain embedded nulls. */
value_ptr
value_from_string (ptr)
char *ptr;
{
value_ptr val;
int len = strlen (ptr);
int lowbound = current_language->string_lower_bound;
struct type *rangetype =
create_range_type ((struct type *) NULL,
builtin_type_int,
lowbound, len + lowbound - 1);
struct type *stringtype =
create_array_type ((struct type *) NULL,
*current_language->string_char_type,
rangetype);
val = allocate_value (stringtype);
memcpy (VALUE_CONTENTS_RAW (val), ptr, len);
return val;
}
value_ptr
value_from_double (type, num)
struct type *type;