import gdb-1999-08-09 snapshot

This commit is contained in:
Jason Molenda 1999-08-09 21:36:23 +00:00
parent 10e80b4145
commit 96baa820df
118 changed files with 11966 additions and 12071 deletions

View File

@ -1,3 +1,297 @@
Sun Aug 8 12:06:47 1999 Fred Fish <fnf@cygnus.com>
* coffread.c (process_coff_symbol): Remove section_offsets from
prototype and function definition. Get section_offsets from the
passed objfile and pass it on to callees the same way.
(coff_symtab_read): Ditto.
(coff_symfile_read): Ditto.
* dbxread.c (read_dbx_dynamic_symtab): Ditto.
(read_dbx_symtab): Ditto.
(dbx_symfile_read): Ditto.
(coffstab_build_psymtabs): Ditto.
(elfstab_build_psymtabs): Ditto.
(stabsect_build_psymtabs): Ditto.
* dstread.c (dst_symfile_read): Ditto.
* elfread.c (elf_symfile_read): Ditto.
* jv-class.c (jv_class_symfile_read): Ditto.
* mipsread.c (mipscoff_symfile_read): Ditto.
* nlmread.c (nlm_symfile_read): Ditto.
* os9kread.c (os9k_symfile_read): Ditto.
* somread.c (som_symfile_read): Ditto.
* stabsread.h (elfstab_build_psymtabs): Ditto.
* xcoffread.c (xcoff_initial_scan): Ditto.
* symfile.h (sym_read): Remove section_offsets from prototype.
* symfile.c (syms_from_objfile): Call sym_read without
section_offsets.
(reread_symbols): Ditto.
* elfread.c (elfstab_offset_sections): Use SIZEOF_SECTION_OFFSETS
to allocate sections offsets array.
* xcoffread.c (xcoff_symfile_offsets): Ditto.
* partial-stab.h (section_offsets): Get from objfile.
* dbxread.c (read_dbx_symtab): Fix typo that made -1 casted
to a CORE_ADDR look like an subtraction expression.
* objfiles.h: Add some comments.
* symfile.c: Add some comments.
* objfiles.c: Add some comments.
(objfile_relocated): Use ALL_OBJFILE_OSECTIONS to iterate over
sections.
(find_pc_sect_sections): Use ALL_OBJSECTIONS to iterate over all
sections in all objfiles.
* symfile.c (syms_from_objfile): Use ALL_OBJFILE_OSECTIONS.
* irix5-nat.c (symbol_add_stub): Fix typo that made taking the
address of lowest_sect with '&' look like a bitwise and op.
* osfsolib.c (symbol_add_stub): Ditto.
* solib.c (symbol_add_stub): Ditto.
* symfile.c (syms_from_objfile): Ditto.
* dwarf2read.c (dwarf2_build_psymtabs_hard): Minor format tweak.
* symfile.c (syms_from_objfile): Ditto, and fix typo.
* top.c (init_main): Fix typo in comment (DEFULAT_PROMPT).
* doc/gdbint.texinfo (find_sym_fns): This replaces symfile_init.
1999-08-08 James Ingham <jingham@leda.cygnus.com>
* remote.c (remote_insert_breakpoint): Fix typo in Z packet support.
Also move Z packet support OUTSIDE of REMOTE_BREAKPOINT ifdef,
since this is not set for all targets that support the Z packet.
Fri Aug 6 17:17:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
* defs.h (fatal): Delete declaration.
(internal_error): Declare.
* utils.c (nomem): Call internal_error instead of fatal.
(fatal_dump_core): Delete.
(malloc_botch): Print message direct to stderr.
(fatal): Delete definition.
* utils.c (internal_error): Define.
* gdbarch.h, gdbarch.c, hppah-nat.c, ch-exp.c, dsrec.c, sh-tdep.c,
infptrace.c, f-lang.c, symm-nat.c, top.c, m3-nat.c, v850-tdep.c,
remote-vx.c, remote-sim.c, remote-mips.c, source.c, infcmd.c,
findvar.c, remote.c: Replace fatal with call to internal_error.
Sun Aug 8 15:28:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
* ser-pipe.c (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Move
definition from here.
* defs.h: To here.
Sat Aug 7 21:44:59 1999 Fred Fish <fnf@cygnus.com>
* remote.c (remote_insert_breakpoint): Fix typo, missing ';'.
Sun Aug 8 11:26:57 1999 Andrew Cagney <cagney@b1.cygnus.com>
* mips-tdep.c (mips_gdbarch_init): Add break; to the default case.
Fri Aug 6 19:26:03 1999 Andrew Cagney <cagney@b1.cygnus.com>
* defs.h: Delete #if ANSI_PROTOTYPES code, GDB assumes ISO-C.
* remote-rdp.c (send_rdp), remote-os9k.c (printf_monitor),
remote-mips.c: (mips_error), remote-array.c: (printf_monitor,
debuglogs), complaints.c (complain), monitor.c:
(monitor_printf_noecho, monitor_printf), language.c (type_error,
range_error), remote-st.c: (printf_stdebug), remote-sim.c
(gdb_os_printf_filtered, gdb_os_vprintf_filtered,
gdb_os_evprintf_filtered, gdb_os_error), serial.c (serial_printf),
utils.c (warning, error, fatal, fatal_dump_core, (query,
fprintf_filtered, fprintf_unfiltered, fprintfi_filtered,
printf_filtered, printf_unfiltered, printfi_filtered): Delete
legacy #ifndef ANSI_PROTOTYPES varargs code.
* defs.h: Don't #include <varargs.h>.
* remote-rdp.c, remote-os9k.c, remote-mips.c, remote-array.c,
monitor.c, remote-st.c: Don't include <varargs.h> or <stdarg.h>.
1999-08-06 James Ingham <jingham@leda.cygnus.com>
* configure.in, configure: add the --enable-multi-ice to determine
whether to configure and build the multi-ice-gdb-server. Note,
for now this only builds on cygwin, so don't enable it for other
platforms...
1999-08-06 Tom Tromey <tromey@cygnus.com>
* Makefile.in (SFILES): Added kod.c and kod-cisco.c.
(COMMON_OBS): Added kod.o and kod-cisco.o.
(kod-cisco.o): New target.
(kod.o): New target.
* kod-cisco.c: New file.
* kod.c: New file.
1999-08-06 James Ingham <jingham@leda.cygnus.com>
These are some fixups for the Arm, and support for the
disassembly-flavor for the ARM.
* defs.h: Declare the disassembly_flavor_hook
* top.c: Define the disassembly_flavor_hook
* i386-tdep.c: Remove unnecessary declaration of the
disassembly_flavor_hook.
* config/arm/tm-arm.h: Change definition of
arm_init_extra_frame_info.
Add a few more comments.
* arm-tdep.c (arm_init_extra_frame_info): Listen to and use the
fromleaf parameter passed into init_extra_frame_info.
(set_disassembly_flavor_sfunc): New Function.
(set_disassembly_flavor): New Function.
(arm_othernames): Use the set_disassembly_flavor.
(_initialize_arm_tdep): Setup the disassembly flavor commands, and
initialize the flavor.
(arm_frameless_function_invocation): Adjust for
frameless functions that have 1 or 2 instructions that mimic the
standard APCS form.
(arm_scan_prologue): Be more careful about scanning the function
prologue. Don't match things that just have a few of the prologue
instructions out of order, and don't get thrown by the scheduler
migrating instructions into the prologue.
Add support for the "Z" and "z" packets to request the stub
to set a breakpoint.
* remote.c (set_remote_protocol_Z_packet_cmd): New function.
(show_remote_protocol_Z_packet_cmd): New Function.
(remote_open_1): Init the Z packet config.
(remote_async_open_1): Init the Z packet config.
(remote_insert_breakpoint): Use the "Z" packet if supported.
(remote_remove_breakpoint): Use the "z" packet if supported.
(remote_insert_watchpoint): New Function - currently wired to
nothing.
(remote_remove_watchpoint): Ditto.
(remote_insert_hw_breakpoint): Ditto.
(remote_remove_hw_breakpoint): Ditto.
1999-08-06 Stan Shebs <shebs@andros.cygnus.com>
* infcmd.c: Include parser-defs.h.
(interrupt_target_command): Declare.
(stack_dummy_testing): Remove old funky flag.
(run_stack_dummy): Remove unused reference to old funky flag.
1999-08-06 Tom Tromey <tromey@cygnus.com>
* command.c (do_setshow_command): Call set_hook if not NULL.
* top.c (set_hook): New hook definition.
* defs.h (set_hook): Declare.
1999-08-05 Stan Shebs <shebs@andros.cygnus.com>
* infrun.c: Convert code to pure standard C, elim some warnings.
(stopped_for_shlib_catchpoint): Remove, never used.
1999-08-05 Keith Seitz <keiths@cygnus.com>
* NEWS: Mention new Motorola MCore target.
* sparc-tdep.c (gdb_print_insn_sparc): Print insns of the current
architecture.
Thu Aug 5 20:41:22 1999 Andrew Cagney <cagney@b1.cygnus.com>
* configure.in (configdirs): Add check for socketpair.
* configure, config.in: Re-generate.
From Mon Jul 19 10:46:18 1999 Philippe De Muyter <phdm@macqel.be>:
* ser-pipe.c (sys/wait.h): Include this file only #if HAVE_SYS_WAIT_H.
(STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Macros defined if needed.
Thu Aug 5 20:04:17 1999 Andrew Cagney <cagney@b1.cygnus.com>
* target.c (debug_to_open, debug_to_attach, debug_to_post_attach,
debug_to_require_attach, debug_to_detach, debug_to_require_detach,
debug_to_wait, debug_to_post_wait, debug_to_fetch_registers,
debug_to_store_registers, debug_to_prepare_to_store,
debug_to_xfer_memory, debug_to_files_info,
debug_to_insert_breakpoint, debug_to_remove_breakpoint,
debug_to_terminal_init, debug_to_terminal_inferior,
debug_to_terminal_ours_for_output, debug_to_terminal_ours,
debug_to_terminal_info, debug_to_kill, debug_to_load,
debug_to_lookup_symbol, debug_to_create_inferior,
debug_to_post_startup_inferior,
debug_to_acknowledge_created_inferior,
debug_to_clone_and_follow_inferior,
debug_to_post_follow_inferior_by_clone,
debug_to_insert_fork_catchpoint, debug_to_remove_fork_catchpoint,
debug_to_insert_vfork_catchpoint,
debug_to_remove_vfork_catchpoint, debug_to_has_forked,
debug_to_has_vforked, debug_to_can_follow_vfork_prior_to_exec,
debug_to_post_follow_vfork, debug_to_insert_exec_catchpoint,
debug_to_remove_exec_catchpoint, debug_to_has_execd,
debug_to_reported_exec_events_per_exec_call,
debug_to_has_syscall_event, debug_to_has_exited,
debug_to_mourn_inferior, debug_to_can_run,
debug_to_notice_signals, debug_to_thread_alive, debug_to_stop,
debug_to_query, debug_to_rcmd, debug_to_enable_exception_callback,
debug_to_get_current_exception_event, debug_to_pid_to_exec_file,
debug_to_core_file_to_sym_file, debug_to_close): Send trace output
to ``gdb_stdlog'' instead of ``gdb_stderr''.
Thu Aug 5 16:22:10 1999 Andrew Cagney <cagney@b1.cygnus.com>
* remote.c (init_remote_ops): Initialize remote_ops.to_rcmd.
(init_remote_async_ops): Initialize remote_async_ops.to_query.
(remote_rcmd): New function.
* monitor.c (monitor_rcmd): Rename monitor_command.
(init_base_monitor_ops): Initialize monitor_ops.to_rcmd.
(_initialize_remote_monitors): Move "monitor" command from here.
* target.c (initialize_targets): To here.
(monitor_command): New function. Implement "monitor" command.
* target.c (cleanup_target): de_fault to_rcmd.
(update_current_target): INHERIT to_rcmd.
(debug_to_rcmd): New function.
(setup_target_debug): Initialize current_target.to_rcmd.
* target.h (struct target_ops): Add field to_rcmd.
(target_rcmd): Define.
Thu Aug 5 14:24:07 1999 Andrew Cagney <cagney@b1.cygnus.com>
* remote.c: Replace comment describing remote protocol with
pointer to official document.
Thu Aug 5 11:59:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
* remote.c (remote_protocol_binary_download): New variable.
Replace ``remote_binary_download'' and ``remote_binary_checked''.
(set_remote_protocol_binary_download_cmd,
show_remote_protocol_binary_download_cmd): New functions.
(remote_open_1, remote_async_open_1, remote_cisco_open):
Initialize ``remote_protocol_binary_download'' instead of
``remote_binary_download''.
(check_binary_download): Re-write.
(remote_write_bytes): Ditto.
(_initialize_remote): Add ``set remote X-packet'' and ``show
remote X-packet'' commands. Disable old ``set
remotebinarydownload'' command.
1999-08-04 Keith Seitz <keiths@cygnus.com>
* remote-rdi.c (arm_rdi_close): Close the transport device, too.
Wed Aug 4 10:42:58 1999 Fred Fish <fnf@cygnus.com>
* xcoffread.c (scan_xcoff_symtab): Change main_aux into
an array of 5 internal_auxent to leave room for bfd to
write n_numaux entries. Change code to use the first one.
1999-08-02 Stan Shebs <shebs@andros.cygnus.com>
* c-valprint.c (c_val_print): When printing decimal equivalent
of a char, cast appropriately.
1999-08-02 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
From Jonathan Larmour <jlarmour@cygnus.co.uk>:
* main.c (print_gdb_help): Use gdbinit variable to determine file
name used for --nx help
1999-08-01 Jason Molenda (jsm@bugshack.cygnus.com)
* config/mips/tm-mips.h (BIG_ENDIAN): Don't define here.
@ -898,6 +1192,16 @@ Thu Jun 10 20:04:02 1999 Andrew Cagney <cagney@b1.cygnus.com>
mn10300-tdep.c: New function.
* config/mn10300/tm-mn10300.h (SAVED_PC_AFTER_CALL): Update.
1999-06-10 Keith Seitz <keiths@cygnus.com>
* mcore-rom.c (picobug_dumpregs): Return a value. Any value, it
doesn't matter.
* mcore-tdep.c (mcore_analyze_prologue): Set NO_MORE_FRAMES
if the start of the function is the entry point.
(mcore_analyze_prologue): rotli takes an immediate, not an
offset immediate.
(mcore_push_arguments): Fix compiler warning.
1999-06-09 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* rs6000-tdep.c (skip_prologue): Don't mistake a branch for a
@ -1376,6 +1680,12 @@ Tue May 25 16:05:11 1999 Andrew Cagney <cagney@b1.cygnus.com>
(value_from_register, value_of_register): Remove #ifdef
REGISTER_CONVERTIBLE. Assume REGISTER_CONVERTIBLE etc defined.
1999-05-25 Keith Seitz <keiths@cygnus.com>
* config/mcore/tm-mcore.h (FRAME_NUM_ARGS): Re-write definition of
FRAME_NUM_ARGS so that it returns NUM_ARGS as a result instead of
setting a variable as a side effect.
Tue May 25 16:18:25 1999 Andrew Cagney <cagney@amy.cygnus.com>
* remote-d10v.c (d10v_eva_prepare_to_trace,
@ -1622,6 +1932,16 @@ Thu May 20 12:18:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
1999-05-19 Keith Seitz <keiths@cygnus.com>
* config/mcore/tm-mcore.h (BELIEVE_PCC_PROMOTION): Define. We
really do want to believe what gcc tells us about types...
1999-05-19 Keith Seitz <keiths@cygnus.com>
* config/mcore/tm-mcore.h (FRAME_ARGS_ADDRESS): Define to a function.
(FRAME_LOCALS_ADDRESS): Ditto.
* mcore-tdep.c (mcore_frame_args_addcress): New function.
(mcore_frame_locals_address): New function.
* monitor.c (monitor_open): Only assume we have eight
breakpoints if the monitor implementation does not tell
us how many there really are. Alloc memory for these
@ -1637,11 +1957,23 @@ Thu May 20 12:18:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
individual monitor implementations can tell us how many
breakpoints the monitor supports.
* mcore-rom.c (init_picobug_cmds): Add number of breakpoints supported
by picobug monitor.
1999-05-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
From Philippe De Muyter <phdm@macqel.be>:
* event-loop.h: Include sys/wait.h only if HAVE_SYS_WAIT_H.
1999-05-17 Keith Seitz <keiths@cygnus.com>
* configure.tgt: Add MCore target.
* Makefile.in: Add mcore-tdep.c and mcore-rom.c
* config/mcore/tm-mcore.h: New file.
* config/mcore/mcore.mt: New file.
* mcore-rom.c: New file.
* mcore-tdep.c: New file.
1999-05-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
* top.c (print_command_line): Added the missing stream argument.

View File

@ -224,7 +224,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 = 19990802
VERSION = 19990809
DIST=gdb
LINT=/usr/5bin/lint
@ -381,6 +381,7 @@ SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \
event-loop.c event-top.c \
expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c \
findvar.c gdbarch.c gdbtypes.c infcmd.c inflow.c infrun.c language.c \
kod.c kod-cisco.c \
jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \
m2-exp.y m2-lang.c m2-typeprint.c m2-valprint.c main.c maint.c \
mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c parse.c \
@ -508,6 +509,7 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o stack.o thread.o \
event-loop.o event-top.o \
gdbarch.o gdbtypes.o copying.o $(DEPFILES) \
mem-break.o target.o parse.o language.o $(YYOBJ) buildsym.o \
kod.o kod-cisco.o \
exec.o bcache.o objfiles.o minsyms.o maint.o demangle.o \
dbxread.o coffread.o elfread.o \
dwarfread.o dwarf2read.o mipsread.o stabsread.o corefile.o \
@ -954,6 +956,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
lynx-nat.c m3-nat.c \
m68k-tdep.c \
m88k-nat.c m88k-tdep.c mac-nat.c \
mcore-tdep.c \
mips-nat.c \
mips-tdep.c mipsm3-nat.c mipsv4-nat.c news-xdep.c \
nindy-share/Onindy.c nindy-share/nindy.c \
@ -1231,6 +1234,10 @@ jv-valprint.o: jv-valprint.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \
$(expression_h) $(value_h) $(INCLUDE_DIR)/demangle.h valprint.h \
language.h jv-lang.h c-lang.h gdbcore.h annotate.h
kod.o: kod.c $(defs_h) $(command_h) $(gdbcmd_h) target.h gdb_string.h
kod-cisco.o: kod-cisco.c $(defs_h) gdb_string.h
language.o: language.c $(bfd_h) $(defs_h) $(expression_h) $(frame_h) \
$(gdbcmd_h) $(gdbtypes_h) language.h parser-defs.h $(symtab_h) \
target.h $(value_h) gdb_string.h
@ -1270,6 +1277,11 @@ main.o: main.c top.h $(defs_h) gdb_string.h $(event_loop_h)
maint.o: maint.c $(defs_h) $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) language.h \
$(expression_h) objfiles.h symfile.h
mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(gdbcmd_h) $(value_h) $(symtab_h)
mcore-rom.o: mcore-rom.c $(defs_h) $(gdbcore_h) target.h monitor.h \
gdb_string.h
mdebugread.o: mdebugread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \
$(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \
objfiles.h partial-stab.h stabsread.h symfile.h $(symtab_h) \

View File

@ -5,6 +5,7 @@
* New targets
Motorola MCore mcore-*-*
x86 VxWorks i[3456]86-*-vxworks*
PowerPC VxWorks powerpc-*-vxworks*
TI TMS320C80 tic80-*-*
@ -34,6 +35,12 @@ instead of 64 bits has been fixed.
The command ``set remote-mips64-transfers-32bit-regs on'' has been
added to provide backward compatibility with older versions of GDB.
* ``set remotebinarydownload'' replaced by ``set remote X-packet''
The command ``set remotebinarydownload'' command has been replaced by
``set remote X-packet''. Other commands in ``set remote'' family
include ``set remote P-packet''.
*** Changes in GDB-4.18:
* New native configurations

View File

@ -922,7 +922,7 @@ setup_arbitrary_frame (argc, argv)
frame = create_new_frame (argv[0], argv[1]);
if (!frame)
fatal ("internal: create_new_frame returned invalid frame id");
internal_error ("create_new_frame returned invalid frame id");
/* Creating a new frame munges the `frame' value from the current
GR1, so we restore it again here. FIXME, untangle all this

View File

@ -47,30 +47,45 @@
#define ROUND_DOWN(n,a) ((n) & ~((a) - 1))
#define ROUND_UP(n,a) (((n) + (a) - 1) & ~((a) - 1))
static char *APCS_register_names[] =
{"a1", "a2", "a3", "a4", /* 0 1 2 3 */
"v1", "v2", "v3", "v4", /* 4 5 6 7 */
"v5", "v6", "sl", "fp", /* 8 9 10 11 */
"ip", "sp", "lr", "pc", /* 12 13 14 15 */
"f0", "f1", "f2", "f3", /* 16 17 18 19 */
"f4", "f5", "f6", "f7", /* 20 21 22 23 */
"fps", "ps"} /* 24 25 */ ;
static char *apcs_register_names[] =
{ "a1", "a2", "a3", "a4", /* 0 1 2 3 */
"v1", "v2", "v3", "v4", /* 4 5 6 7 */
"v5", "v6", "sl", "fp", /* 8 9 10 11 */
"ip", "sp", "lr", "pc", /* 12 13 14 15 */
"f0", "f1", "f2", "f3", /* 16 17 18 19 */
"f4", "f5", "f6", "f7", /* 20 21 22 23 */
"fps","ps" } /* 24 25 */;
/* These names are the ones which gcc emits, and
I find them less confusing. Toggle between them
using the `othernames' command. */
static char *additional_register_names[] =
{"r0", "r1", "r2", "r3", /* 0 1 2 3 */
"r4", "r5", "r6", "r7", /* 4 5 6 7 */
"r8", "r9", "r10", "r11", /* 8 9 10 11 */
"r12", "r13", "r14", "pc", /* 12 13 14 15 */
"f0", "f1", "f2", "f3", /* 16 17 18 19 */
"f4", "f5", "f6", "f7", /* 20 21 22 23 */
"fps", "ps"} /* 24 25 */ ;
{ "r0", "r1", "r2", "r3", /* 0 1 2 3 */
"r4", "r5", "r6", "r7", /* 4 5 6 7 */
"r8", "r9", "r10", "r11", /* 8 9 10 11 */
"r12", "r13", "r14", "pc", /* 12 13 14 15 */
"f0", "f1", "f2", "f3", /* 16 17 18 19 */
"f4", "f5", "f6", "f7", /* 20 21 22 23 */
"fps","ps" } /* 24 25 */;
/* By default use the APCS registers names */
char **arm_register_names = APCS_register_names;
char **arm_register_names = apcs_register_names;
/* This is the variable the is set with "set disassembly-flavor",
and its legitimate values. */
static char apcs_flavor[] = "apcs";
static char r_prefix_flavor[] = "r-prefix";
static char *valid_flavors[] = {
apcs_flavor,
r_prefix_flavor,
NULL
};
static char *disassembly_flavor = apcs_flavor;
/* This is used to keep the bfd arch_info in sync with the disassembly flavor. */
static void set_disassembly_flavor_sfunc PARAMS ((char *, int, \
struct cmd_list_element *));
static void set_disassembly_flavor ();
/* Should call_function allocate stack space for a struct return? */
/* The system C compiler uses a similar structure return convention to gcc */
@ -167,12 +182,17 @@ int
arm_frameless_function_invocation (fi)
struct frame_info *fi;
{
int frameless;
CORE_ADDR func_start, after_prologue;
int frameless;
func_start = (get_pc_function_start ((fi)->pc) + FUNCTION_START_OFFSET);
after_prologue = func_start;
SKIP_PROLOGUE (after_prologue);
frameless = (after_prologue == func_start);
/* There are some frameless functions whose first two instructions
follow the standard APCS form, in which case after_prologue
will be func_start + 8. */
frameless = (after_prologue < func_start + 12);
return frameless;
}
@ -226,11 +246,12 @@ arm_skip_prologue (pc)
CORE_ADDR func_addr, func_end;
struct symtab_and_line sal;
/* See what the symbol table says. */
/* See what the symbol table says. */
if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
{
sal = find_pc_line (func_addr, 0);
if (sal.line != 0 && sal.end < func_end)
if ((sal.line != 0) && (sal.end < func_end))
return sal.end;
}
@ -464,20 +485,65 @@ save_prologue_cache (fi)
4) the offset from the stack pointer to the frame pointer
This information is stored in the "extra" fields of the frame_info.
A typical Arm function prologue might look like this:
mov ip, sp
stmfd sp!, {fp, ip, lr, pc}
sub fp, ip, #4
sub sp, sp, #16
There are two basic forms for the ARM prologue. The fixed argument
function call will look like:
mov ip, sp
stmfd sp!, {fp, ip, lr, pc}
sub fp, ip, #4
[sub sp, sp, #4]
Which would create this stack frame (offsets relative to FP):
IP -> 4 (caller's stack)
FP -> 0 PC (points to address of stmfd instruction + 12 in callee)
-4 LR (return address in caller)
-8 IP (copy of caller's SP)
-12 FP (caller's FP)
SP -> -28 Local variables
IP -> 4 (caller's stack)
FP -> 0 PC (points to address of stmfd instruction + 8 in callee)
-4 LR (return address in caller)
-8 IP (copy of caller's SP)
-12 FP (caller's FP)
SP -> -28 Local variables
The frame size would thus be 32 bytes, and the frame offset would be
28 bytes. */
28 bytes. The stmfd call can also save any of the vN registers it
plans to use, which increases the frame size accordingly.
Note: The stored PC is 8 off of the STMFD instruction that stored it
because the ARM Store instructions always store PC + 8 when you read
the PC register.
A variable argument function call will look like:
mov ip, sp
stmfd sp!, {a1, a2, a3, a4}
stmfd sp!, {fp, ip, lr, pc}
sub fp, ip, #20
Which would create this stack frame (offsets relative to FP):
IP -> 20 (caller's stack)
16 A4
12 A3
8 A2
4 A1
FP -> 0 PC (points to address of stmfd instruction + 8 in callee)
-4 LR (return address in caller)
-8 IP (copy of caller's SP)
-12 FP (caller's FP)
SP -> -28 Local variables
The frame size would thus be 48 bytes, and the frame offset would be
28 bytes.
There is another potential complication, which is that the optimizer
will try to separate the store of fp in the "stmfd" instruction from
the "sub fp, ip, #NN" instruction. Almost anything can be there, so
we just key on the stmfd, and then scan for the "sub fp, ip, #NN"...
Also, note, the original version of the ARM toolchain claimed that there
should be an
instruction at the end of the prologue. I have never seen GCC produce
this, and the ARM docs don't mention it. We still test for it below in
case it happens...
*/
static void
arm_scan_prologue (fi)
@ -519,56 +585,106 @@ arm_scan_prologue (fi)
else
{
/* Get address of the stmfd in the prologue of the callee; the saved
PC is the address of the stmfd + 12. */
prologue_start = ADDR_BITS_REMOVE (read_memory_integer (fi->frame, 4)) - 12;
prologue_end = prologue_start + 40; /* FIXME: should be big enough */
PC is the address of the stmfd + 8. */
prologue_start = ADDR_BITS_REMOVE(read_memory_integer (fi->frame, 4))
- 8;
prologue_end = prologue_start + 64; /* This is all the insn's
that could be in the prologue,
plus room for 5 insn's inserted
by the scheduler. */
}
/* Now search the prologue looking for instructions that set up the
frame pointer, adjust the stack pointer, and save registers. */
frame pointer, adjust the stack pointer, and save registers.
Be careful, however, and if it doesn't look like a prologue,
don't try to scan it. If, for instance, a frameless function
begins with stmfd sp!, then we will tell ourselves there is
a frame, which will confuse stack traceback, as well ad"finish"
and other operations that rely on a knowledge of the stack
traceback.
In the APCS, the prologue should start with "mov ip, sp" so
if we don't see this as the first insn, we will stop. */
sp_offset = fp_offset = 0;
for (current_pc = prologue_start; current_pc < prologue_end; current_pc += 4)
if (read_memory_unsigned_integer (prologue_start, 4)
== 0xe1a0c00d) /* mov ip, sp */
{
unsigned int insn = read_memory_unsigned_integer (current_pc, 4);
if ((insn & 0xffff0000) == 0xe92d0000) /* stmfd sp!, {..., r7, lr} */
for (current_pc = prologue_start +4; current_pc < prologue_end;
current_pc += 4)
{
int mask = insn & 0xffff;
/* Calculate offsets of saved registers. */
for (regno = PC_REGNUM; regno >= 0; regno--)
if (mask & (1 << regno))
{
sp_offset -= 4;
fi->fsr.regs[regno] = sp_offset;
}
unsigned int insn = read_memory_unsigned_integer (current_pc, 4);
if ((insn & 0xffff0000) == 0xe92d0000)
/* stmfd sp!, {..., fp, ip, lr, pc}
or
stmfd sp!, {a1, a2, a3, a4} */
{
int mask = insn & 0xffff;
/* Calculate offsets of saved registers. */
for (regno = PC_REGNUM; regno >= 0; regno--)
if (mask & (1 << regno))
{
sp_offset -= 4;
fi->fsr.regs[regno] = sp_offset;
}
}
else if ((insn & 0xfffff000) == 0xe24cb000) /* sub fp, ip #n */
{
unsigned imm = insn & 0xff; /* immediate value */
unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */
imm = (imm >> rot) | (imm << (32-rot));
fp_offset = -imm;
fi->framereg = FP_REGNUM;
}
else if ((insn & 0xfffff000) == 0xe24dd000) /* sub sp, sp #n */
{
unsigned imm = insn & 0xff; /* immediate value */
unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */
imm = (imm >> rot) | (imm << (32-rot));
sp_offset -= imm;
}
else if ((insn & 0xffff7fff) == 0xed6d0103) /* stfe f?, [sp, -#c]! */
{
sp_offset -= 12;
regno = F0_REGNUM + ((insn >> 12) & 0x07);
fi->fsr.regs[regno] = sp_offset;
}
else if ((insn & 0xffbf0fff) == 0xec2d0200) /* sfmfd f0, 4, [sp!] */
{
int n_saved_fp_regs, i;
unsigned int fp_start_reg, fp_bound_reg;
if ((insn & 0x800) == 0x800) /* N0 is set */
{
if ((insn & 0x40000) == 0x40000) /* N1 is set */
n_saved_fp_regs = 3;
else
n_saved_fp_regs = 1;
}
else
{
if ((insn & 0x40000) == 0x40000) /* N1 is set */
n_saved_fp_regs = 2;
else
n_saved_fp_regs = 4;
}
fp_start_reg = F0_REGNUM + ((insn >> 12) & 0x7);
fp_bound_reg = fp_start_reg + n_saved_fp_regs;
for (; fp_start_reg < fp_bound_reg; fp_start_reg++)
{
sp_offset -= 12;
fi->fsr.regs[fp_start_reg++] = sp_offset;
}
}
else
continue; /* The optimizer might shove anything into the
prologue, so we just skip what we don't recognize. */
}
else if ((insn & 0xfffff000) == 0xe24cb000) /* sub fp, ip #n */
{
unsigned imm = insn & 0xff; /* immediate value */
unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */
imm = (imm >> rot) | (imm << (32 - rot));
fp_offset = -imm;
fi->framereg = FP_REGNUM;
}
else if ((insn & 0xfffff000) == 0xe24dd000) /* sub sp, sp #n */
{
unsigned imm = insn & 0xff; /* immediate value */
unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */
imm = (imm >> rot) | (imm << (32 - rot));
sp_offset -= imm;
}
else if ((insn & 0xffff7fff) == 0xed6d0103) /* stfe f?, [sp, -#c]! */
{
sp_offset -= 12;
regno = F0_REGNUM + ((insn >> 12) & 0x07);
fi->fsr.regs[regno] = sp_offset;
}
else if (insn == 0xe1a0c00d) /* mov ip, sp */
continue;
else
break; /* not a recognized prologue instruction */
}
/* The frame size is just the negative of the offset (from the original SP)
@ -576,7 +692,7 @@ arm_scan_prologue (fi)
[new FP] - [new SP]. */
fi->framesize = -sp_offset;
fi->frameoffset = fp_offset - sp_offset;
save_prologue_cache (fi);
}
@ -685,11 +801,15 @@ arm_frame_chain (fi)
sp. This is tricky because we sometimes don't use an explicit
frame pointer, and the previous stack pointer isn't necessarily recorded
on the stack. The only reliable way to get this info is to
examine the prologue. */
examine the prologue.
FROMLEAF is a little confusing, it means this is the next frame up
the chain AFTER a frameless function. If this is true, then the
frame value for this frame is still in the fp register. */
void
arm_init_extra_frame_info (fi)
struct frame_info *fi;
arm_init_extra_frame_info (fromleaf, fi)
int fromleaf;
struct frame_info * fi;
{
int reg;
@ -715,12 +835,16 @@ arm_init_extra_frame_info (fi)
if (!fi->next) /* this is the innermost frame? */
fi->frame = read_register (fi->framereg);
else
/* not the innermost frame */
/* If we have an FP, the callee saved it. */ if (fi->framereg == FP_REGNUM || fi->framereg == THUMB_FP_REGNUM)
if (fi->next->fsr.regs[fi->framereg] != 0)
fi->frame = read_memory_integer (fi->next->fsr.regs[fi->framereg],
4);
else /* not the innermost frame */
/* If we have an FP, the callee saved it. */
if (fi->framereg == FP_REGNUM || fi->framereg == THUMB_FP_REGNUM)
if (fi->next->fsr.regs[fi->framereg] != 0)
fi->frame = read_memory_integer (fi->next->fsr.regs[fi->framereg],
4);
else if (fromleaf) /* If we were called by a frameless fn.
then our frame is still in the frame pointer
register on the board... */
fi->frame = read_fp ();
/* Calculate actual addresses of saved registers using offsets determined
by arm_scan_prologue. */
@ -1058,7 +1182,7 @@ arm_float_info ()
type = (status >> 24) & 127;
printf ("%s FPU type %d\n",
(status & (1 << 31)) ? "Hardware" : "Software",
(status & (1<<31)) ? "Hardware" : "Software",
type);
fputs ("mask: ", stdout);
print_fpu_flags (status >> 16);
@ -1066,21 +1190,57 @@ arm_float_info ()
print_fpu_flags (status);
}
/* If the disassembly mode is APCS, we have to also switch the
bfd mach_type. This function is run in the set disassembly_flavor
command, and does that. */
static void
set_disassembly_flavor_sfunc (args, from_tty, c)
char *args;
int from_tty;
struct cmd_list_element *c;
{
set_disassembly_flavor ();
if (disassembly_flavor_hook != NULL)
disassembly_flavor_hook(args, from_tty);
}
static void
set_disassembly_flavor ()
{
if (disassembly_flavor == apcs_flavor)
{
if (arm_toggle_regnames () == 0)
arm_toggle_regnames ();
arm_register_names = apcs_register_names;
}
else if (disassembly_flavor == r_prefix_flavor)
{
if (arm_toggle_regnames () == 1)
arm_toggle_regnames ();
arm_register_names = additional_register_names;
}
}
/* arm_othernames implements the "othernames" command. This is kind of
hacky, and I prefer the set-show disassembly-flavor which is also used
for the x86 gdb. I will keep this around, however, in case anyone is
actually using it. */
static void
arm_othernames ()
{
if (arm_register_names == APCS_register_names)
if (disassembly_flavor == r_prefix_flavor)
{
arm_register_names = additional_register_names;
arm_toggle_regnames ();
disassembly_flavor = apcs_flavor;
set_disassembly_flavor ();
}
else
{
arm_register_names = APCS_register_names;
arm_toggle_regnames ();
disassembly_flavor = r_prefix_flavor;
set_disassembly_flavor ();
}
}
/* FIXME: Fill in with the 'right thing', see asm
@ -1646,23 +1806,37 @@ arm_skip_stub (pc)
void
_initialize_arm_tdep ()
{
int regname_is_APCS = (arm_register_names == APCS_register_names);
struct cmd_list_element *new_cmd;
tm_print_insn = gdb_print_insn_arm;
/* Sync the opcode insn printer with our register viewer: */
if (arm_toggle_regnames () != regname_is_APCS)
if (arm_toggle_regnames () != 1)
arm_toggle_regnames ();
/* Add the deprecated "othernames" command */
add_com ("othernames", class_obscure, arm_othernames,
"Switch to the other set of register names.");
/* Add the disassembly-flavor command */
new_cmd = add_set_enum_cmd ("disassembly-flavor", no_class,
valid_flavors,
(char *) &disassembly_flavor,
"Set the disassembly flavor, \
the valid values are \"apcs\" and \"r-prefix\", \
and the default value is \"apcs\".",
&setlist);
new_cmd->function.sfunc = set_disassembly_flavor_sfunc;
add_show_from_set(new_cmd, &showlist);
/* ??? Maybe this should be a boolean. */
add_show_from_set (add_set_cmd ("apcs32", no_class,
var_zinteger, (char *) &arm_apcs_32,
"Set usage of ARM 32-bit mode.\n", &setlist),
&showlist);
var_zinteger, (char *)&arm_apcs_32,
"Set usage of ARM 32-bit mode.\n", &setlist),
& showlist);
}

View File

@ -538,7 +538,7 @@ xfer_core_file (memaddr, myaddr, len)
{
/* Address did not classify into one of the known ranges.
This shouldn't happen; we catch the endpoints. */
fatal ("Internal: Bad case logic in xfer_core_file.");
internal_error ("Bad case logic in xfer_core_file.");
}
/* Now we know which file to use.

View File

@ -403,10 +403,13 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
}
else
{
fprintf_filtered (stream, TYPE_UNSIGNED (type) ? "%u" : "%d",
unpack_long (type, valaddr + embedded_offset));
val = unpack_long (type, valaddr + embedded_offset);
if (TYPE_UNSIGNED (type))
fprintf_filtered (stream, "%u", (unsigned int) val);
else
fprintf_filtered (stream, "%d", (int) val);
fputs_filtered (" ", stream);
LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr + embedded_offset), stream);
LA_PRINT_CHAR ((unsigned char) val, stream);
}
break;

View File

@ -217,7 +217,7 @@ peek_token_ (i)
int i;
{
if (i > MAX_LOOK_AHEAD)
fatal ("internal error - too much lookahead");
internal_error ("ch-exp.c - too much lookahead");
if (terminal_buffer[i] == TOKEN_NOT_READ)
{
terminal_buffer[i] = ch_lex ();
@ -235,7 +235,7 @@ pushback_token (code, node)
{
int i;
if (terminal_buffer[MAX_LOOK_AHEAD] != TOKEN_NOT_READ)
fatal ("internal error - cannot pushback token");
internal_error ("ch-exp.c - cannot pushback token");
for (i = MAX_LOOK_AHEAD; i > 0; i--)
{
terminal_buffer[i] = terminal_buffer[i - 1];
@ -269,9 +269,7 @@ require (token)
{
if (PEEK_TOKEN () != token)
{
char buf[80];
sprintf (buf, "internal parser error - expected token %d", (int) token);
fatal (buf);
internal_error ("ch-exp.c - expected token %d", (int) token);
}
FORWARD_TOKEN ();
}

View File

@ -193,7 +193,6 @@ static struct type *coff_read_enum_type PARAMS ((int, int, int));
static struct symbol *process_coff_symbol PARAMS ((struct coff_symbol *,
union internal_auxent *,
struct section_offsets *,
struct objfile *));
static void patch_opaque_types PARAMS ((struct symtab *));
@ -218,8 +217,7 @@ static void read_one_sym PARAMS ((struct coff_symbol *,
struct internal_syment *,
union internal_auxent *));
static void coff_symtab_read PARAMS ((long, int, struct section_offsets *,
struct objfile *));
static void coff_symtab_read PARAMS ((long, int, struct objfile *));
static void find_linenos PARAMS ((bfd *, sec_ptr, PTR));
@ -227,8 +225,7 @@ static void coff_symfile_init PARAMS ((struct objfile *));
static void coff_new_init PARAMS ((struct objfile *));
static void coff_symfile_read PARAMS ((struct objfile *,
struct section_offsets *, int));
static void coff_symfile_read PARAMS ((struct objfile *, int));
static void coff_symfile_finish PARAMS ((struct objfile *));
@ -596,9 +593,8 @@ static bfd *symfile_bfd;
/* ARGSUSED */
static void
coff_symfile_read (objfile, section_offsets, mainline)
coff_symfile_read (objfile, mainline)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
{
struct coff_symfile_info *info;
@ -673,8 +669,7 @@ coff_symfile_read (objfile, section_offsets, mainline)
/* Now that the executable file is positioned at symbol table,
process it and define symbols accordingly. */
coff_symtab_read ((long) symtab_offset, num_symbols, section_offsets,
objfile);
coff_symtab_read ((long) symtab_offset, num_symbols, objfile);
/* Sort symbols alphabetically within each block. */
@ -712,7 +707,6 @@ coff_symfile_read (objfile, section_offsets, mainline)
stabstrsize = bfd_section_size (abfd, info->stabstrsect);
coffstab_build_psymtabs (objfile,
section_offsets,
mainline,
info->textaddr, info->textsize,
info->stabsects,
@ -750,10 +744,9 @@ coff_symfile_finish (objfile)
We read them one at a time using read_one_sym (). */
static void
coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
coff_symtab_read (symtab_offset, nsyms, objfile)
long symtab_offset;
int nsyms;
struct section_offsets *section_offsets;
struct objfile *objfile;
{
register struct context_stack *new;
@ -841,7 +834,7 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
if (ISFCN (cs->c_type) && cs->c_sclass != C_TPDEF)
{
/* Record all functions -- external and static -- in minsyms. */
tmpaddr = cs->c_value + ANOFFSET (section_offsets, SECT_OFF_TEXT);
tmpaddr = cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
record_minimal_symbol (cs->c_name, tmpaddr, mst_text, objfile);
fcn_line_ptr = main_aux.x_sym.x_fcnary.x_fcn.x_lnnoptr;
@ -906,7 +899,7 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
followed by a later file with no symbols. */
if (in_source_file)
complete_symtab (filestring,
cs->c_value + ANOFFSET (section_offsets, SECT_OFF_TEXT),
cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT),
main_aux.x_scn.x_scnlen);
in_source_file = 0;
}
@ -965,7 +958,7 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
tmpaddr = cs->c_value;
if (cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXTFUNC
|| cs->c_sclass == C_THUMBEXT)
tmpaddr += ANOFFSET (section_offsets, sec);
tmpaddr += ANOFFSET (objfile->section_offsets, sec);
switch (sec)
{
@ -1012,7 +1005,7 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
{
struct symbol *sym;
sym = process_coff_symbol
(cs, &main_aux, section_offsets, objfile);
(cs, &main_aux, objfile);
SYMBOL_VALUE (sym) = tmpaddr;
SYMBOL_SECTION (sym) = sec;
}
@ -1039,8 +1032,7 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
new = push_context (depth, fcn_start_addr);
fcn_cs_saved.c_name = getsymname (&fcn_sym_saved);
new->name =
process_coff_symbol (&fcn_cs_saved, &fcn_aux_saved,
section_offsets, objfile);
process_coff_symbol (&fcn_cs_saved, &fcn_aux_saved, objfile);
}
else if (STREQ (cs->c_name, ".ef"))
{
@ -1084,7 +1076,7 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
fcn_first_line_addr);
else
enter_linenos (fcn_line_ptr, fcn_first_line, fcn_last_line,
section_offsets);
objfile->section_offsets);
finish_block (new->name, &local_symbols, new->old_blocks,
new->start_addr,
@ -1098,11 +1090,11 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
of the epilogue. */
cs->c_value
+ FUNCTION_EPILOGUE_SIZE
+ ANOFFSET (section_offsets, SECT_OFF_TEXT),
+ ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT),
#else
fcn_cs_saved.c_value
+ fcn_aux_saved.x_sym.x_misc.x_fsize
+ ANOFFSET (section_offsets, SECT_OFF_TEXT),
+ ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT),
#endif
objfile
);
@ -1114,7 +1106,7 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
if (STREQ (cs->c_name, ".bb"))
{
tmpaddr = cs->c_value;
tmpaddr += ANOFFSET (section_offsets, SECT_OFF_TEXT);
tmpaddr += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
push_context (++depth, tmpaddr);
}
else if (STREQ (cs->c_name, ".eb"))
@ -1134,7 +1126,7 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
if (local_symbols && context_stack_depth > 0)
{
tmpaddr =
cs->c_value + ANOFFSET (section_offsets, SECT_OFF_TEXT);
cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
/* Make a block for the local symbols within. */
finish_block (0, &local_symbols, new->old_blocks,
new->start_addr, tmpaddr, objfile);
@ -1145,7 +1137,7 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
break;
default:
process_coff_symbol (cs, &main_aux, section_offsets, objfile);
process_coff_symbol (cs, &main_aux, objfile);
break;
}
}
@ -1521,10 +1513,9 @@ patch_opaque_types (s)
}
static struct symbol *
process_coff_symbol (cs, aux, section_offsets, objfile)
process_coff_symbol (cs, aux, objfile)
register struct coff_symbol *cs;
register union internal_auxent *aux;
struct section_offsets *section_offsets;
struct objfile *objfile;
{
register struct symbol *sym
@ -1547,7 +1538,7 @@ process_coff_symbol (cs, aux, section_offsets, objfile)
if (ISFCN (cs->c_type))
{
SYMBOL_VALUE (sym) += ANOFFSET (section_offsets, SECT_OFF_TEXT);
SYMBOL_VALUE (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
SYMBOL_TYPE (sym) =
lookup_function_type (decode_function_type (cs, cs->c_type, aux));
@ -1577,7 +1568,7 @@ process_coff_symbol (cs, aux, section_offsets, objfile)
case C_EXT:
SYMBOL_CLASS (sym) = LOC_STATIC;
SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value;
SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (section_offsets, SECT_OFF_TEXT);
SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
add_symbol_to_list (sym, &global_symbols);
break;
@ -1586,7 +1577,7 @@ process_coff_symbol (cs, aux, section_offsets, objfile)
case C_STAT:
SYMBOL_CLASS (sym) = LOC_STATIC;
SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value;
SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (section_offsets, SECT_OFF_TEXT);
SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
if (within_function)
{
/* Static symbol of local scope */
@ -2211,8 +2202,7 @@ static struct sym_fns coff_sym_fns =
coff_symfile_init, /* sym_init: read initial info, setup for sym_read() */
coff_symfile_read, /* sym_read: read a symbol file into symtab */
coff_symfile_finish, /* sym_finish: finished with file, cleanup */
default_symfile_offsets,
/* sym_offsets: xlate external to internal form */
default_symfile_offsets, /* sym_offsets: xlate external to internal form */
NULL /* next: pointer to next struct sym_fns */
};

View File

@ -1418,6 +1418,8 @@ do_setshow_command (arg, from_tty, c)
else
error ("gdb internal error: bad cmd_type in do_setshow_command");
(*c->function.sfunc) (NULL, from_tty, c);
if (c->type == set_cmd && set_hook)
set_hook (c);
}
/* Show all the settings in a list of show commands. */

View File

@ -60,24 +60,11 @@ extern int info_verbose;
/* Print a complaint about the input symbols, and link the complaint block
into a chain for later handling. */
/* VARARGS */
void
#ifdef ANSI_PROTOTYPES
complain (struct complaint *complaint,...)
#else
complain (va_alist)
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, complaint);
#else
struct complaint *complaint;
va_start (args);
complaint = va_arg (args, struct complaint *);
#endif
complaint->counter++;
if (complaint->next == NULL)

View File

@ -135,9 +135,6 @@
/* Define if you have the bzero function. */
#undef HAVE_BZERO
/* Define if you have the poll function. */
#undef HAVE_POLL
/* Define if you have the dcgettext function. */
#undef HAVE_DCGETTEXT
@ -153,6 +150,9 @@
/* Define if you have the munmap function. */
#undef HAVE_MUNMAP
/* Define if you have the poll function. */
#undef HAVE_POLL
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
@ -171,6 +171,9 @@
/* Define if you have the sigaction function. */
#undef HAVE_SIGACTION
/* Define if you have the socketpair function. */
#undef HAVE_SOCKETPAIR
/* Define if you have the stpcpy function. */
#undef HAVE_STPCPY

View File

@ -290,8 +290,10 @@ extern use_struct_convention_fn arm_use_struct_convention;
int frameoffset; \
int framereg;
extern void arm_init_extra_frame_info PARAMS ((struct frame_info * fi));
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) arm_init_extra_frame_info (fi)
extern void arm_init_extra_frame_info PARAMS ((int fromleaf,
struct frame_info *fi));
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
arm_init_extra_frame_info (fromleaf, fi)
/* Return the frame address. On ARM, it is R11; on Thumb it is R7. */
CORE_ADDR arm_target_read_fp PARAMS ((void));
@ -314,11 +316,25 @@ extern int arm_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
/* Define other aspects of the stack frame. */
/* An expression that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. */
extern int arm_frameless_function_invocation PARAMS ((struct frame_info * frame));
#define FRAMELESS_FUNCTION_INVOCATION(FI) (arm_frameless_function_invocation (FI))
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0.
Sometimes we have functions that do a little setup (like saving the vN
registers with the stmdb instruction, but DO NOT set up a frame.
The symbol table will report this as a prologue. However, it is
important not to try to parse these partial frames as frames, or we
will get really confused.
So I will demand 3 instructions between the start & end of the prologue
before I call it a real prologue, i.e. at least
mov ip, sp,
stmdb sp!, {}
sub sp, ip, #4. */
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(arm_frameless_function_invocation (FI))
/* Saved Pc. */
#define FRAME_SAVED_PC(FRAME) arm_frame_saved_pc (FRAME)

View File

@ -0,0 +1,5 @@
# Target: Motorola MCore processor
TDEPFILES= mcore-tdep.o mcore-rom.o monitor.o dsrec.o
TM_FILE= tm-mcore.h
SIM_OBS = remote-sim.o
SIM = ../sim/mcore/libsim.a

160
gdb/config/mcore/tm-mcore.h Normal file
View File

@ -0,0 +1,160 @@
/* Parameters for execution on a Motorola MCore.
Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* The mcore is big endian */
#define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
/* All registers are 32 bits */
#define REGISTER_SIZE 4
#define MAX_REGISTER_RAW_SIZE 4
#define REGISTER_VIRTUAL_TYPE(REG) builtin_type_int
#define REGISTER_BYTE(REG) ((REG) * REGISTER_SIZE)
#define REGISTER_VIRTUAL_SIZE(REG) 4
#define REGISTER_RAW_SIZE(REG) 4
#define MAX_REGISTER_VIRTUAL_SIZE 4
#define REGISTER_BYTES (NUM_REGS * REGISTER_SIZE)
extern char *mcore_register_names[];
#define REGISTER_NAME(I) mcore_register_names[I]
/* Registers. The Motorola MCore contains:
16 32-bit general purpose registers (r0-r15)
16 32-bit alternate file registers (ar0-ar15)
32 32-bit control registers (cr0-cr31)
+ 1 pc
------
65 registers */
#define NUM_REGS 65
#define PC_REGNUM 64
#define SP_REGNUM 0
#define FP_REGNUM (SP_REGNUM)
#define PR_REGNUM 15
#define FIRST_ARGREG 2
#define LAST_ARGREG 7
#define RETVAL_REGNUM 2
/* Offset from address of function to start of its code.
Zero on most machines. */
#define FUNCTION_START_OFFSET 0
#define DECR_PC_AFTER_BREAK 0
/* BREAKPOINT_FROM_PC uses the program counter value to determine
the breakpoint that should be used. */
extern breakpoint_from_pc_fn mcore_breakpoint_from_pc;
#define BREAKPOINT_FROM_PC(PCPTR, LENPTR) mcore_breakpoint_from_pc (PCPTR, LENPTR)
#define INNER_THAN(LHS,RHS) ((LHS) < (RHS))
#define SAVED_PC_AFTER_CALL(FRAME) read_register (PR_REGNUM)
struct frame_info;
struct type;
struct value;
extern void mcore_init_extra_frame_info (struct frame_info *fi);
#define INIT_EXTRA_FRAME_INFO(FROMLEAF, FI) mcore_init_extra_frame_info ((FI))
#define INIT_FRAME_PC /* Not necessary */
#define FRAME_INIT_SAVED_REGS(FI) /* handled by init_extra_frame_info */
extern CORE_ADDR mcore_frame_chain (struct frame_info *fi);
#define FRAME_CHAIN(FI) mcore_frame_chain ((FI))
#define FRAME_CHAIN_VALID(FP, FI) generic_frame_chain_valid ((FP), (FI))
extern CORE_ADDR mcore_frame_saved_pc (struct frame_info *);
#define FRAME_SAVED_PC(FI) (mcore_frame_saved_pc ((FI)))
/* Extracting/storing return values. */
extern void mcore_store_return_value (struct type *type, char *valbuf);
#define STORE_RETURN_VALUE(TYPE, VALBUF) mcore_store_return_value ((TYPE), (VALBUF))
extern void mcore_extract_return_value (struct type *type, char *regbut, char *valbuf);
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
mcore_extract_return_value ((TYPE), (REGBUF), (VALBUF));
#define STORE_STRUCT_RETURN(ADDR, SP) /* handled by mcore_push_arguments */
extern CORE_ADDR mcore_extract_struct_value_address (char *regbuf);
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
mcore_extract_struct_value_address (REGBUF)
extern CORE_ADDR mcore_skip_prologue (CORE_ADDR pc);
#define SKIP_PROLOGUE(PC) (PC) = mcore_skip_prologue ((PC))
#define FRAME_ARGS_SKIP 0
extern CORE_ADDR mcore_frame_args_address (struct frame_info *fi);
#define FRAME_ARGS_ADDRESS(FI) mcore_frame_args_address ((FI))
extern CORE_ADDR mcore_frame_locals_address (struct frame_info *fi);
#define FRAME_LOCALS_ADDRESS(FI) mcore_frame_locals_address ((FI))
#define FRAME_NUM_ARGS(FI) (-1)
extern void mcore_pop_frame (struct frame_info *fi);
#define POP_FRAME mcore_pop_frame (get_current_frame ())
#define USE_GENERIC_DUMMY_FRAMES 1
#define CALL_DUMMY {0}
#define CALL_DUMMY_START_OFFSET (0)
#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
#define CALL_DUMMY_LOCATION AT_ENTRY_POINT
#define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP)
#define CALL_DUMMY_ADDRESS() entry_point_address ()
#define SIZEOF_CALL_DUMMY_WORDS 0
extern CORE_ADDR mcore_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
#define PUSH_RETURN_ADDRESS(PC, SP) mcore_push_return_address (PC, SP)
#define PUSH_DUMMY_FRAME generic_push_dummy_frame ()
extern CORE_ADDR mcore_push_arguments PARAMS ((int, struct value **, CORE_ADDR,
unsigned char, CORE_ADDR));
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
(SP) = mcore_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP)
/* MCore will never pass a sturcture by reference. It will always be split
between registers and stack. */
#define REG_STRUCT_HAS_ADDR(GCC_P, TYPE) 0
extern use_struct_convention_fn mcore_use_struct_convention;
#define USE_STRUCT_CONVENTION(GCC_P, TYPE) mcore_use_struct_convention (GCC_P, TYPE)
/* override the default get_saved_register function with
one that takes account of generic CALL_DUMMY frames */
#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
/* Cons up virtual frame pointer for trace */
extern void mcore_virtual_frame_pointer PARAMS ((CORE_ADDR, long *, long *));
#define TARGET_VIRTUAL_FRAME_POINTER(PC, REGP, OFFP) \
mcore_virtual_frame_pointer ((PC), (REGP), (OFFP))
/* MCore can be bi-endian. */
#define TARGET_BYTE_ORDER_SELECTABLE_P 1
/* For PE, gcc will tell us what th real type of
arguments are when it promotes arguments. */
#define BELIEVE_PCC_PROMOTION 1

578
gdb/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -44,6 +44,19 @@ CONFIG_SRCS=
configdirs="doc testsuite"
AC_ARG_ENABLE(multi-ice,
[ --enable-multi-ice Build the multi-ice-gdb-server],
[case "${enableval}" in
yes ) enable_multi_ice="yes" ;;
no) enable_multi_ice="no" ;;
*) AC_MSG_ERROR(Bad value for --enable-multi-ice: ${enableval}) ;;
esac
])
if test "${enable_multi_ice}" = "yes"; then
configdirs="${configdirs} multi-ice"
fi
dnl
changequote(,)dnl
@ -75,7 +88,8 @@ AC_HEADER_STAT
AC_C_CONST
AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll)
AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll \
socketpair)
AC_FUNC_ALLOCA
BFD_NEED_DECLARATION(malloc)
@ -604,6 +618,13 @@ s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
fi
changequote([,])
SUBDIRS="doc testsuite nlm"
if test "${enable_multi_ice}" = "yes"; then
SUBDIRS="${SUBDIRS} multi-ice"
fi
AC_SUBST(SUBDIRS)
# If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
# (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
# corresponding links. But we have to remove the xm.h files and tm.h

View File

@ -160,6 +160,7 @@ m88*-motorola-sysv4*) gdb_target=delta88v4 ;;
m88*-motorola-*) gdb_target=delta88 ;;
m88*-*-*) gdb_target=m88k ;;
mcore*-*-*) gdb_target=mcore ;;
mips64*-big-*) gdb_target=bigmips64 ;;
mips*-big-*) gdb_target=bigmips ;;
mips*-dec-mach3*) gdb_target=mach3 ;;

View File

@ -286,12 +286,10 @@ static void
dbx_psymtab_to_symtab_1 PARAMS ((struct partial_symtab *));
static void
read_dbx_dynamic_symtab PARAMS ((struct section_offsets *,
struct objfile * objfile));
read_dbx_dynamic_symtab PARAMS ((struct objfile * objfile));
static void
read_dbx_symtab PARAMS ((struct section_offsets *, struct objfile *,
CORE_ADDR, int));
read_dbx_symtab PARAMS ((struct objfile *, CORE_ADDR, int));
static void
free_bincl_list PARAMS ((struct objfile *));
@ -318,7 +316,7 @@ static void
dbx_new_init PARAMS ((struct objfile *));
static void
dbx_symfile_read PARAMS ((struct objfile *, struct section_offsets *, int));
dbx_symfile_read PARAMS ((struct objfile *, int));
static void
dbx_symfile_finish PARAMS ((struct objfile *));
@ -579,9 +577,8 @@ record_minimal_symbol (name, address, type, objfile)
table (as opposed to a shared lib or dynamically loaded file). */
static void
dbx_symfile_read (objfile, section_offsets, mainline)
dbx_symfile_read (objfile, mainline)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline; /* FIXME comments above */
{
bfd *sym_bfd;
@ -631,13 +628,13 @@ dbx_symfile_read (objfile, section_offsets, mainline)
/* Now that the symbol table data of the executable file are all in core,
process them and define symbols accordingly. */
read_dbx_symtab (section_offsets, objfile,
read_dbx_symtab (objfile,
DBX_TEXT_ADDR (objfile),
DBX_TEXT_SIZE (objfile));
/* Add the dynamic symbols. */
read_dbx_dynamic_symtab (section_offsets, objfile);
read_dbx_dynamic_symtab (objfile);
/* Install any minimal symbols that have been collected as the current
minimal symbols for this objfile. */
@ -1103,8 +1100,7 @@ free_bincl_list (objfile)
add them to the minimal symbol table. */
static void
read_dbx_dynamic_symtab (section_offsets, objfile)
struct section_offsets *section_offsets;
read_dbx_dynamic_symtab (objfile)
struct objfile *objfile;
{
bfd *abfd = objfile->obfd;
@ -1163,17 +1159,17 @@ read_dbx_dynamic_symtab (section_offsets, objfile)
if (bfd_get_section_flags (abfd, sec) & SEC_CODE)
{
sym_value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
type = N_TEXT;
}
else if (bfd_get_section_flags (abfd, sec) & SEC_DATA)
{
sym_value += ANOFFSET (section_offsets, SECT_OFF_DATA);
sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
type = N_DATA;
}
else if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
{
sym_value += ANOFFSET (section_offsets, SECT_OFF_BSS);
sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
type = N_BSS;
}
else
@ -1214,7 +1210,7 @@ read_dbx_dynamic_symtab (section_offsets, objfile)
{
arelent *rel = *relptr;
CORE_ADDR address =
rel->address + ANOFFSET (section_offsets, SECT_OFF_DATA);
rel->address + ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
switch (bfd_get_arch (abfd))
{
@ -1251,8 +1247,7 @@ read_dbx_dynamic_symtab (section_offsets, objfile)
of the file (a set of zeros if the mainline program). */
static void
read_dbx_symtab (section_offsets, objfile, text_addr, text_size)
struct section_offsets *section_offsets;
read_dbx_symtab (objfile, text_addr, text_size)
struct objfile *objfile;
CORE_ADDR text_addr;
int text_size;
@ -1307,7 +1302,7 @@ read_dbx_symtab (section_offsets, objfile, text_addr, text_size)
last_source_file = NULL;
lowest_text_address = (CORE_ADDR) - 1;
lowest_text_address = (CORE_ADDR) -1;
symfile_bfd = objfile->obfd; /* For next_text_symbol */
abfd = objfile->obfd;
@ -1389,8 +1384,8 @@ read_dbx_symtab (section_offsets, objfile, text_addr, text_size)
{
/* Don't set pst->texthigh lower than it already is. */
CORE_ADDR text_end =
(lowest_text_address == (CORE_ADDR) - 1
? (text_addr + section_offsets->offsets[SECT_OFF_TEXT])
(lowest_text_address == (CORE_ADDR) -1
? (text_addr + objfile->section_offsets->offsets[SECT_OFF_TEXT])
: lowest_text_address)
+ text_size;
@ -2525,11 +2520,10 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
adjusted for coff details. */
void
coffstab_build_psymtabs (objfile, section_offsets, mainline,
coffstab_build_psymtabs (objfile, mainline,
textaddr, textsize, stabsects,
stabstroffset, stabstrsize)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
CORE_ADDR textaddr;
unsigned int textsize;
@ -2603,7 +2597,7 @@ coffstab_build_psymtabs (objfile, section_offsets, mainline,
symbuf_read = 0;
}
dbx_symfile_read (objfile, section_offsets, 0);
dbx_symfile_read (objfile, 0);
}
/* Scan and build partial symbols for an ELF symbol file.
@ -2627,11 +2621,10 @@ coffstab_build_psymtabs (objfile, section_offsets, mainline,
adjusted for elf details. */
void
elfstab_build_psymtabs (objfile, section_offsets, mainline,
elfstab_build_psymtabs (objfile, mainline,
staboffset, stabsize,
stabstroffset, stabstrsize)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
file_ptr staboffset;
unsigned int stabsize;
@ -2684,7 +2677,7 @@ elfstab_build_psymtabs (objfile, section_offsets, mainline,
/* In an elf file, we've already installed the minimal symbols that came
from the elf (non-stab) symbol table, so always act like an
incremental load here. */
dbx_symfile_read (objfile, section_offsets, 0);
dbx_symfile_read (objfile, 0);
}
/* Scan and build partial symbols for a file with special sections for stabs
@ -2705,10 +2698,9 @@ elfstab_build_psymtabs (objfile, section_offsets, mainline,
This routine is mostly copied from dbx_symfile_init and dbx_symfile_read. */
void
stabsect_build_psymtabs (objfile, section_offsets, mainline, stab_name,
stabsect_build_psymtabs (objfile, mainline, stab_name,
stabstr_name, text_name)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
char *stab_name;
char *stabstr_name;
@ -2773,7 +2765,7 @@ stabsect_build_psymtabs (objfile, section_offsets, mainline, stab_name,
/* Now, do an incremental load */
processing_acc_compilation = 1;
dbx_symfile_read (objfile, section_offsets, 0);
dbx_symfile_read (objfile, 0);
}
static struct sym_fns aout_sym_fns =
@ -2783,8 +2775,7 @@ static struct sym_fns aout_sym_fns =
dbx_symfile_init, /* sym_init: read initial info, setup for sym_read() */
dbx_symfile_read, /* sym_read: read a symbol file into symtab */
dbx_symfile_finish, /* sym_finish: finished with file, cleanup */
default_symfile_offsets,
/* sym_offsets: parse user's offsets to internal form */
default_symfile_offsets, /* sym_offsets: parse user's offsets to internal form */
NULL /* next: pointer to next struct sym_fns */
};

View File

@ -48,11 +48,7 @@
#include "ansidecl.h"
#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <stdarg.h> /* for va_list */
#include "libiberty.h"
@ -226,7 +222,7 @@ struct cleanup
#endif
#ifndef ATTR_FORMAT
# if defined(__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 4 && defined (__ANSI_PROTOTYPES)
# if defined(__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 4
# define ATTR_FORMAT(type, x, y) __attribute__ ((format(type, x, y)))
# else
# define ATTR_FORMAT(type, x, y) /* nothing */
@ -823,7 +819,7 @@ extern NORETURN void error PARAMS((const char *, ...)) ATTR_NORETURN;
extern void error_begin PARAMS ((void));
extern NORETURN void fatal PARAMS((char *, ...)) ATTR_NORETURN;
extern NORETURN void internal_error (char *, ...) ATTR_NORETURN;
extern NORETURN void nomem PARAMS ((long)) ATTR_NORETURN;
@ -1159,6 +1155,7 @@ extern void (*readline_begin_hook) PARAMS ((char *, ...));
extern char * (*readline_hook) PARAMS ((char *));
extern void (*readline_end_hook) PARAMS ((void));
extern void (*register_changed_hook) PARAMS ((int regno));
extern void (*disassembly_flavor_hook) PARAMS((char *args, int from_tty));
extern void (*memory_changed_hook) PARAMS ((CORE_ADDR addr, int len));
extern void (*context_hook) PARAMS ((int));
extern int (*target_wait_hook) PARAMS ((int pid,
@ -1167,6 +1164,8 @@ extern int (*target_wait_hook) PARAMS ((int pid,
extern void (*call_command_hook) PARAMS ((struct cmd_list_element *c,
char *cmd, int from_tty));
extern void (*set_hook) PARAMS ((struct cmd_list_element *c));
extern NORETURN void (*error_hook) PARAMS ((void)) ATTR_NORETURN;
extern void (*error_begin_hook) PARAMS ((void));
@ -1229,4 +1228,15 @@ extern int use_windows;
#endif
#endif
/* Define well known filenos if the system does not define them. */
#ifndef STDIN_FILENO
#define STDIN_FILENO 0
#endif
#ifndef STDOUT_FILENO
#define STDOUT_FILENO 1
#endif
#ifndef STDERR_FILENO
#define STDERR_FILENO 2
#endif
#endif /* #ifndef DEFS_H */

View File

@ -1,3 +1,16 @@
1999-08-06 Tom Tromey <tromey@cygnus.com>
* gdb.texinfo (KOD): New node.
Fri Aug 6 17:05:48 1999 Andrew Cagney <cagney@b1.cygnus.com>
* remote.texi (Rcmd): Fix minor formatting typos.
Thu Aug 5 17:57:41 1999 Andrew Cagney <cagney@b1.cygnus.com>
* remote.texi (protocol qRcmd): Allow ``OK'' and ``O...'' response
packets.
1999-07-14 Jim Blandy <jimb@zwingli.cygnus.com>
* gdbint.texinfo (PREPARE_TO_PROCEED, ADDR_BITS_REMOVE): Doc

View File

@ -8325,6 +8325,7 @@ targets}).
* Target Commands:: Commands for managing targets
* Byte Order:: Choosing target byte order
* Remote:: Remote debugging
* KOD:: Kernel Object Display
@end menu
@ -8703,7 +8704,7 @@ Note that these commands merely adjust interpretation of symbolic
data on the host, and that they have absolutely no effect on the
target system.
@node Remote, , Byte Order, Targets
@node Remote, KOD, Byte Order, Targets
@section Remote debugging
@cindex remote debugging
@ -8742,6 +8743,44 @@ configuration of @value{GDBN}; use @code{help target} to list them.
@include remote.texi
@node KOD, , Remote, Targets
@section Kernel Object Display
@cindex kernel object display
@cindex kernel object
@cindex KOD
Some targets support kernel object display. Using this facility,
@value{GDBN} communicates specially with the underlying operating system
and can display information about operating system-level objects such as
mutexes and other synchronization objects. Exactly which objects can be
displayed is determined on a per-OS basis.
Use the @code{set os} command to set the operating system. This tells
@value{GDBN} which kernel object display module to initialize:
@example
(gdb) set os cisco
@end example
If @code{set os} succeeds, @value{GDBN} will display some information
about the operating system, and will create a new @code{info} command
which can be used to query the target. The @code{info} command is named
after the operating system:
@example
(gdb) info cisco
List of Cisco Kernel Objects
Object Description
any Any and all objects
@end example
Further subcommands can be used to query about particular objects known
by the kernel.
There is currently no way to determine whether a given operating system
is supported other than to try it.
@node Controlling GDB
@chapter Controlling @value{GDBN}

View File

@ -361,7 +361,7 @@ command), and it can also read more symbols via the ``add-file'' and
Symbol files are initially opened by code in @file{symfile.c} using the
BFD library. BFD identifies the type of the file by examining its
header. @code{symfile_init} then uses this identification to locate a
header. @code{find_sym_fns} then uses this identification to locate a
set of symbol-reading functions.
Symbol reading modules identify themselves to GDB by calling

View File

@ -770,9 +770,13 @@ See @code{remote.c:remote_unpack_thread_info_response()}.
execution. @emph{Implementors should note that providing access to a
stubs's interpreter may have security implications}.
@item
@tab reply @var{OUTPUT}
@tab reply @var{OUTPUT} or @code{OK}
@tab
The @var{OUTPUT} (hex encoded). Must be non-empty.
The @var{OUTPUT} is the hex encoded output from the command. @code{OK}
is returned when the @var{OUTPUT} would have been empty. The target may
also respond with a number of intermediate @code{O}@var{OUTPUT} console
output packets.
@item
@tab reply @samp{}
@tab

View File

@ -257,8 +257,8 @@ make_srec (srec, targ_addr, abfd, sect, sectoff, maxrecsize, flags)
else if (tmp & SREC_4_BYTE_ADDR)
addr_size = 4;
else
fatal ("make_srec: Bad address (0x%x), or bad flags (0x%x).",
targ_addr, flags);
internal_error ("make_srec: Bad address (0x%x), or bad flags (0x%x).",
targ_addr, flags);
/* Now that we know the address size, we can figure out how much
data this record can hold. */

View File

@ -68,7 +68,7 @@ static void
dst_new_init PARAMS ((struct objfile *));
static void
dst_symfile_read PARAMS ((struct objfile *, struct section_offsets *, int));
dst_symfile_read PARAMS ((struct objfile *, int));
static void
dst_symfile_finish PARAMS ((struct objfile *));
@ -263,9 +263,8 @@ static bfd *symfile_bfd;
/* ARGSUSED */
static void
dst_symfile_read (objfile, section_offsets, mainline)
dst_symfile_read (objfile, mainline)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
{
bfd *abfd = objfile->obfd;

View File

@ -1003,7 +1003,7 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
/* Allocate a new partial symbol table structure */
pst = start_psymtab_common (objfile, section_offsets,
comp_unit_die.name ? comp_unit_die.name : "",
comp_unit_die.name ? comp_unit_die.name : "",
comp_unit_die.lowpc,
objfile->global_psymbols.next,
objfile->static_psymbols.next);

View File

@ -71,7 +71,7 @@ static void
elf_new_init PARAMS ((struct objfile *));
static void
elf_symfile_read PARAMS ((struct objfile *, struct section_offsets *, int));
elf_symfile_read PARAMS ((struct objfile *, int));
static void
elf_symfile_finish PARAMS ((struct objfile *));
@ -584,9 +584,8 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
capability even for files compiled without -g. */
static void
elf_symfile_read (objfile, section_offsets, mainline)
elf_symfile_read (objfile, mainline)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
{
bfd *abfd = objfile->obfd;
@ -610,7 +609,7 @@ elf_symfile_read (objfile, section_offsets, mainline)
which can later be used by elfstab_offset_sections. */
/* FIXME, should take a section_offsets param, not just an offset. */
offset = ANOFFSET (section_offsets, 0);
offset = ANOFFSET (objfile->section_offsets, 0);
elf_symtab_read (abfd, offset, objfile, 0);
/* Add the dynamic symbols. */
@ -653,7 +652,7 @@ elf_symfile_read (objfile, section_offsets, mainline)
swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap;
if (swap)
elfmdebug_build_psymtabs (objfile, swap, ei.mdebugsect,
section_offsets);
objfile->section_offsets);
}
if (ei.stabsect)
{
@ -666,7 +665,6 @@ elf_symfile_read (objfile, section_offsets, mainline)
/* FIXME should probably warn about a stab section without a stabstr. */
if (str_sect)
elfstab_build_psymtabs (objfile,
section_offsets,
mainline,
ei.stabsect->filepos,
bfd_section_size (abfd, ei.stabsect),
@ -676,13 +674,13 @@ elf_symfile_read (objfile, section_offsets, mainline)
if (dwarf2_has_info (abfd))
{
/* DWARF 2 sections */
dwarf2_build_psymtabs (objfile, section_offsets, mainline);
dwarf2_build_psymtabs (objfile, objfile->section_offsets, mainline);
}
else if (ei.dboffset && ei.lnoffset)
{
/* DWARF sections */
dwarf_build_psymtabs (objfile,
section_offsets, mainline,
objfile->section_offsets, mainline,
ei.dboffset, ei.dbsize,
ei.lnoffset, ei.lnsize);
}
@ -818,10 +816,7 @@ elfstab_offset_sections (objfile, pst)
/* Found it! Allocate a new psymtab struct, and fill it in. */
maybe->found++;
pst->section_offsets = (struct section_offsets *)
obstack_alloc (&objfile->psymbol_obstack,
sizeof (struct section_offsets) +
sizeof (pst->section_offsets->offsets) * (SECT_OFF_MAX - 1));
obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
for (i = 0; i < SECT_OFF_MAX; i++)
ANOFFSET (pst->section_offsets, i) = maybe->sections[i];
return;
@ -841,8 +836,7 @@ static struct sym_fns elf_sym_fns =
elf_symfile_init, /* sym_init: read initial info, setup for sym_read() */
elf_symfile_read, /* sym_read: read a symbol file into symtab */
elf_symfile_finish, /* sym_finish: finished with file, cleanup */
default_symfile_offsets,
/* sym_offsets: Translate ext. to int. relocation */
default_symfile_offsets, /* sym_offsets: Translate ext. to int. relocation */
NULL /* next: pointer to next struct sym_fns */
};

View File

@ -920,7 +920,7 @@ get_bf_for_fcn (the_function)
item at the head of the queue is the one you want) */
if (saved_bf_list == NULL)
fatal ("cannot get .bf node off empty list");
internal_error ("cannot get .bf node off empty list");
if (current_head_bf_list != NULL)
if (current_head_bf_list->symnum_fcn == the_function)

View File

@ -606,9 +606,11 @@ value_of_register (regnum)
memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer,
REGISTER_RAW_SIZE (regnum));
else
fatal ("Register \"%s\" (%d) has conflicting raw (%d) and virtual (%d) size",
REGISTER_NAME (regnum), regnum,
REGISTER_RAW_SIZE (regnum), REGISTER_VIRTUAL_SIZE (regnum));
internal_error ("Register \"%s\" (%d) has conflicting raw (%d) and virtual (%d) size",
REGISTER_NAME (regnum),
regnum,
REGISTER_RAW_SIZE (regnum),
REGISTER_VIRTUAL_SIZE (regnum));
VALUE_LVAL (reg_val) = lval;
VALUE_ADDRESS (reg_val) = addr;
VALUE_REGNO (reg_val) = regnum;
@ -1025,7 +1027,7 @@ generic_target_read_pc (pid)
return pc_val;
}
#endif
fatal ("generic_target_read_pc");
internal_error ("generic_target_read_pc");
return 0;
}
@ -1073,7 +1075,7 @@ generic_target_write_pc (pc, pid)
#endif
#endif
#else
fatal ("generic_target_write_pc");
internal_error ("generic_target_write_pc");
#endif
}
@ -1113,7 +1115,7 @@ generic_target_read_sp ()
if (SP_REGNUM >= 0)
return read_register (SP_REGNUM);
#endif
fatal ("generic_target_read_sp");
internal_error ("generic_target_read_sp");
}
CORE_ADDR
@ -1137,7 +1139,7 @@ generic_target_write_sp (val)
return;
}
#endif
fatal ("generic_target_write_sp");
internal_error ("generic_target_write_sp");
}
void
@ -1158,7 +1160,7 @@ generic_target_read_fp ()
if (FP_REGNUM >= 0)
return read_register (FP_REGNUM);
#endif
fatal ("generic_target_read_fp");
internal_error ("generic_target_read_fp");
}
CORE_ADDR
@ -1182,7 +1184,7 @@ generic_target_write_fp (val)
return;
}
#endif
fatal ("generic_target_write_fp");
internal_error ("generic_target_write_fp");
}
void
@ -1609,7 +1611,7 @@ value_from_register (type, regnum, frame)
VALUE_ADDRESS (v) = first_addr;
}
else
fatal ("value_from_register: Value not stored anywhere!");
internal_error ("value_from_register: Value not stored anywhere!");
VALUE_OPTIMIZED_OUT (v) = optim;

View File

@ -1,22 +1,24 @@
/* *INDENT-OFF* */ /* typedef (f)();'' confuses indent */
/* Dynamic architecture support for GDB, the GNU debugger.
Copyright 1998-1999, Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* *INDENT-OFF* */ /* typedef (f)();'' confuses indent */
#include "defs.h"
@ -336,235 +338,235 @@ verify_gdbarch (gdbarch)
return;
/* fundamental */
if (gdbarch->byte_order == 0)
fatal ("verify_gdbarch: byte-order unset");
internal_error ("verify_gdbarch: byte-order unset");
if (gdbarch->bfd_arch_info == NULL)
fatal ("verify_gdbarch: bfd_arch_info unset");
internal_error ("verify_gdbarch: bfd_arch_info unset");
/* Check those that need to be defined for the given multi-arch level. */
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->ptr_bit == 0))
fatal ("gdbarch: verify_gdbarch: ptr_bit invalid");
internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->short_bit == 0))
fatal ("gdbarch: verify_gdbarch: short_bit invalid");
internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->int_bit == 0))
fatal ("gdbarch: verify_gdbarch: int_bit invalid");
internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->long_bit == 0))
fatal ("gdbarch: verify_gdbarch: long_bit invalid");
internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->long_long_bit == 0))
fatal ("gdbarch: verify_gdbarch: long_long_bit invalid");
internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->float_bit == 0))
fatal ("gdbarch: verify_gdbarch: float_bit invalid");
internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->double_bit == 0))
fatal ("gdbarch: verify_gdbarch: double_bit invalid");
internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->long_double_bit == 0))
fatal ("gdbarch: verify_gdbarch: long_double_bit invalid");
internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->read_pc == 0))
fatal ("gdbarch: verify_gdbarch: read_pc invalid");
internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->write_pc == 0))
fatal ("gdbarch: verify_gdbarch: write_pc invalid");
internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->read_fp == 0))
fatal ("gdbarch: verify_gdbarch: read_fp invalid");
internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->write_fp == 0))
fatal ("gdbarch: verify_gdbarch: write_fp invalid");
internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->read_sp == 0))
fatal ("gdbarch: verify_gdbarch: read_sp invalid");
internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->write_sp == 0))
fatal ("gdbarch: verify_gdbarch: write_sp invalid");
internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->num_regs == -1))
fatal ("gdbarch: verify_gdbarch: num_regs invalid");
internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->sp_regnum == -1))
fatal ("gdbarch: verify_gdbarch: sp_regnum invalid");
internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->fp_regnum == -1))
fatal ("gdbarch: verify_gdbarch: fp_regnum invalid");
internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->pc_regnum == -1))
fatal ("gdbarch: verify_gdbarch: pc_regnum invalid");
internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->register_name == 0))
fatal ("gdbarch: verify_gdbarch: register_name invalid");
internal_error ("gdbarch: verify_gdbarch: register_name invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->register_size == -1))
fatal ("gdbarch: verify_gdbarch: register_size invalid");
internal_error ("gdbarch: verify_gdbarch: register_size invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->register_bytes == -1))
fatal ("gdbarch: verify_gdbarch: register_bytes invalid");
internal_error ("gdbarch: verify_gdbarch: register_bytes invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->register_byte == 0))
fatal ("gdbarch: verify_gdbarch: register_byte invalid");
internal_error ("gdbarch: verify_gdbarch: register_byte invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->register_raw_size == 0))
fatal ("gdbarch: verify_gdbarch: register_raw_size invalid");
internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->max_register_raw_size == -1))
fatal ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->register_virtual_size == 0))
fatal ("gdbarch: verify_gdbarch: register_virtual_size invalid");
internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->max_register_virtual_size == -1))
fatal ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->register_virtual_type == 0))
fatal ("gdbarch: verify_gdbarch: register_virtual_type invalid");
internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->use_generic_dummy_frames == -1))
fatal ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->call_dummy_location == 0))
fatal ("gdbarch: verify_gdbarch: call_dummy_location invalid");
internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0))
fatal ("gdbarch: verify_gdbarch: call_dummy_address invalid");
internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->call_dummy_start_offset == -1))
fatal ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->call_dummy_breakpoint_offset == -1))
fatal ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->call_dummy_breakpoint_offset_p == -1))
fatal ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->call_dummy_length == -1))
fatal ("gdbarch: verify_gdbarch: call_dummy_length invalid");
internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->pc_in_call_dummy == 0))
fatal ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->call_dummy_p == -1))
fatal ("gdbarch: verify_gdbarch: call_dummy_p invalid");
internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->call_dummy_stack_adjust_p == -1))
fatal ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0))
fatal ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->fix_call_dummy == 0))
fatal ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->get_saved_register == 0))
fatal ("gdbarch: verify_gdbarch: get_saved_register invalid");
internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->register_convertible == 0))
fatal ("gdbarch: verify_gdbarch: register_convertible invalid");
internal_error ("gdbarch: verify_gdbarch: register_convertible invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->register_convert_to_virtual == 0))
fatal ("gdbarch: verify_gdbarch: register_convert_to_virtual invalid");
internal_error ("gdbarch: verify_gdbarch: register_convert_to_virtual invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->register_convert_to_raw == 0))
fatal ("gdbarch: verify_gdbarch: register_convert_to_raw invalid");
internal_error ("gdbarch: verify_gdbarch: register_convert_to_raw invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->extract_return_value == 0))
fatal ("gdbarch: verify_gdbarch: extract_return_value invalid");
internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->push_arguments == 0))
fatal ("gdbarch: verify_gdbarch: push_arguments invalid");
internal_error ("gdbarch: verify_gdbarch: push_arguments invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->push_dummy_frame == 0))
fatal ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->push_return_address == 0))
fatal ("gdbarch: verify_gdbarch: push_return_address invalid");
internal_error ("gdbarch: verify_gdbarch: push_return_address invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->pop_frame == 0))
fatal ("gdbarch: verify_gdbarch: pop_frame invalid");
internal_error ("gdbarch: verify_gdbarch: pop_frame invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->d10v_make_daddr == 0))
fatal ("gdbarch: verify_gdbarch: d10v_make_daddr invalid");
internal_error ("gdbarch: verify_gdbarch: d10v_make_daddr invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->d10v_make_iaddr == 0))
fatal ("gdbarch: verify_gdbarch: d10v_make_iaddr invalid");
internal_error ("gdbarch: verify_gdbarch: d10v_make_iaddr invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->d10v_daddr_p == 0))
fatal ("gdbarch: verify_gdbarch: d10v_daddr_p invalid");
internal_error ("gdbarch: verify_gdbarch: d10v_daddr_p invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->d10v_iaddr_p == 0))
fatal ("gdbarch: verify_gdbarch: d10v_iaddr_p invalid");
internal_error ("gdbarch: verify_gdbarch: d10v_iaddr_p invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->d10v_convert_daddr_to_raw == 0))
fatal ("gdbarch: verify_gdbarch: d10v_convert_daddr_to_raw invalid");
internal_error ("gdbarch: verify_gdbarch: d10v_convert_daddr_to_raw invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->d10v_convert_iaddr_to_raw == 0))
fatal ("gdbarch: verify_gdbarch: d10v_convert_iaddr_to_raw invalid");
internal_error ("gdbarch: verify_gdbarch: d10v_convert_iaddr_to_raw invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->store_struct_return == 0))
fatal ("gdbarch: verify_gdbarch: store_struct_return invalid");
internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->store_return_value == 0))
fatal ("gdbarch: verify_gdbarch: store_return_value invalid");
internal_error ("gdbarch: verify_gdbarch: store_return_value invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->extract_struct_value_address == 0))
fatal ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->use_struct_convention == 0))
fatal ("gdbarch: verify_gdbarch: use_struct_convention invalid");
internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->frame_init_saved_regs == 0))
fatal ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->init_extra_frame_info == 0))
fatal ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->skip_prologue == 0))
fatal ("gdbarch: verify_gdbarch: skip_prologue invalid");
internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->inner_than == 0))
fatal ("gdbarch: verify_gdbarch: inner_than invalid");
internal_error ("gdbarch: verify_gdbarch: inner_than invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->breakpoint_from_pc == 0))
fatal ("gdbarch: verify_gdbarch: breakpoint_from_pc invalid");
internal_error ("gdbarch: verify_gdbarch: breakpoint_from_pc invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->decr_pc_after_break == -1))
fatal ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->function_start_offset == -1))
fatal ("gdbarch: verify_gdbarch: function_start_offset invalid");
internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->remote_translate_xfer_address == 0))
fatal ("gdbarch: verify_gdbarch: remote_translate_xfer_address invalid");
internal_error ("gdbarch: verify_gdbarch: remote_translate_xfer_address invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->frame_args_skip == -1))
fatal ("gdbarch: verify_gdbarch: frame_args_skip invalid");
internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->frameless_function_invocation == 0))
fatal ("gdbarch: verify_gdbarch: frameless_function_invocation invalid");
internal_error ("gdbarch: verify_gdbarch: frameless_function_invocation invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->frame_chain == 0))
fatal ("gdbarch: verify_gdbarch: frame_chain invalid");
internal_error ("gdbarch: verify_gdbarch: frame_chain invalid");
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->frame_chain_valid == 0))
fatal ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->frame_saved_pc == 0))
fatal ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->frame_args_address == 0))
fatal ("gdbarch: verify_gdbarch: frame_args_address invalid");
internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->frame_locals_address == 0))
fatal ("gdbarch: verify_gdbarch: frame_locals_address invalid");
internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->saved_pc_after_call == 0))
fatal ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid");
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->frame_num_args == 0))
fatal ("gdbarch: verify_gdbarch: frame_num_args invalid");
internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
}
@ -908,7 +910,7 @@ gdbarch_ptr_bit (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->ptr_bit == 0)
fatal ("gdbarch: gdbarch_ptr_bit invalid");
internal_error ("gdbarch: gdbarch_ptr_bit invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
@ -928,7 +930,7 @@ gdbarch_short_bit (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->short_bit == 0)
fatal ("gdbarch: gdbarch_short_bit invalid");
internal_error ("gdbarch: gdbarch_short_bit invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
@ -948,7 +950,7 @@ gdbarch_int_bit (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->int_bit == 0)
fatal ("gdbarch: gdbarch_int_bit invalid");
internal_error ("gdbarch: gdbarch_int_bit invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
@ -968,7 +970,7 @@ gdbarch_long_bit (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->long_bit == 0)
fatal ("gdbarch: gdbarch_long_bit invalid");
internal_error ("gdbarch: gdbarch_long_bit invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
@ -988,7 +990,7 @@ gdbarch_long_long_bit (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->long_long_bit == 0)
fatal ("gdbarch: gdbarch_long_long_bit invalid");
internal_error ("gdbarch: gdbarch_long_long_bit invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
@ -1008,7 +1010,7 @@ gdbarch_float_bit (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->float_bit == 0)
fatal ("gdbarch: gdbarch_float_bit invalid");
internal_error ("gdbarch: gdbarch_float_bit invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
@ -1028,7 +1030,7 @@ gdbarch_double_bit (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->double_bit == 0)
fatal ("gdbarch: gdbarch_double_bit invalid");
internal_error ("gdbarch: gdbarch_double_bit invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
@ -1048,7 +1050,7 @@ gdbarch_long_double_bit (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->long_double_bit == 0)
fatal ("gdbarch: gdbarch_long_double_bit invalid");
internal_error ("gdbarch: gdbarch_long_double_bit invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
@ -1067,7 +1069,7 @@ CORE_ADDR
gdbarch_read_pc (struct gdbarch *gdbarch, int pid)
{
if (gdbarch->read_pc == 0)
fatal ("gdbarch: gdbarch_read_pc invalid");
internal_error ("gdbarch: gdbarch_read_pc invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
@ -1086,7 +1088,7 @@ void
gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid)
{
if (gdbarch->write_pc == 0)
fatal ("gdbarch: gdbarch_write_pc invalid");
internal_error ("gdbarch: gdbarch_write_pc invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
@ -1105,7 +1107,7 @@ CORE_ADDR
gdbarch_read_fp (struct gdbarch *gdbarch)
{
if (gdbarch->read_fp == 0)
fatal ("gdbarch: gdbarch_read_fp invalid");
internal_error ("gdbarch: gdbarch_read_fp invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n");
@ -1124,7 +1126,7 @@ void
gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val)
{
if (gdbarch->write_fp == 0)
fatal ("gdbarch: gdbarch_write_fp invalid");
internal_error ("gdbarch: gdbarch_write_fp invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n");
@ -1143,7 +1145,7 @@ CORE_ADDR
gdbarch_read_sp (struct gdbarch *gdbarch)
{
if (gdbarch->read_sp == 0)
fatal ("gdbarch: gdbarch_read_sp invalid");
internal_error ("gdbarch: gdbarch_read_sp invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
@ -1162,7 +1164,7 @@ void
gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
{
if (gdbarch->write_sp == 0)
fatal ("gdbarch: gdbarch_write_sp invalid");
internal_error ("gdbarch: gdbarch_write_sp invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n");
@ -1182,7 +1184,7 @@ gdbarch_num_regs (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->num_regs == -1)
fatal ("gdbarch: gdbarch_num_regs invalid");
internal_error ("gdbarch: gdbarch_num_regs invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
@ -1202,7 +1204,7 @@ gdbarch_sp_regnum (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->sp_regnum == -1)
fatal ("gdbarch: gdbarch_sp_regnum invalid");
internal_error ("gdbarch: gdbarch_sp_regnum invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
@ -1222,7 +1224,7 @@ gdbarch_fp_regnum (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->fp_regnum == -1)
fatal ("gdbarch: gdbarch_fp_regnum invalid");
internal_error ("gdbarch: gdbarch_fp_regnum invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
@ -1242,7 +1244,7 @@ gdbarch_pc_regnum (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->pc_regnum == -1)
fatal ("gdbarch: gdbarch_pc_regnum invalid");
internal_error ("gdbarch: gdbarch_pc_regnum invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
@ -1260,8 +1262,8 @@ set_gdbarch_pc_regnum (gdbarch, pc_regnum)
char *
gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
{
if (gdbarch->register_name == 0)
fatal ("gdbarch: gdbarch_register_name invalid");
if (gdbarch->register_name == 0 || 1)
internal_error ("gdbarch: gdbarch_register_name invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
@ -1281,7 +1283,7 @@ gdbarch_register_size (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->register_size == -1)
fatal ("gdbarch: gdbarch_register_size invalid");
internal_error ("gdbarch: gdbarch_register_size invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n");
@ -1301,7 +1303,7 @@ gdbarch_register_bytes (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->register_bytes == -1)
fatal ("gdbarch: gdbarch_register_bytes invalid");
internal_error ("gdbarch: gdbarch_register_bytes invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n");
@ -1320,7 +1322,7 @@ int
gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
{
if (gdbarch->register_byte == 0)
fatal ("gdbarch: gdbarch_register_byte invalid");
internal_error ("gdbarch: gdbarch_register_byte invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n");
@ -1339,7 +1341,7 @@ int
gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
{
if (gdbarch->register_raw_size == 0)
fatal ("gdbarch: gdbarch_register_raw_size invalid");
internal_error ("gdbarch: gdbarch_register_raw_size invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n");
@ -1359,7 +1361,7 @@ gdbarch_max_register_raw_size (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->max_register_raw_size == -1)
fatal ("gdbarch: gdbarch_max_register_raw_size invalid");
internal_error ("gdbarch: gdbarch_max_register_raw_size invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n");
@ -1378,7 +1380,7 @@ int
gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
{
if (gdbarch->register_virtual_size == 0)
fatal ("gdbarch: gdbarch_register_virtual_size invalid");
internal_error ("gdbarch: gdbarch_register_virtual_size invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n");
@ -1398,7 +1400,7 @@ gdbarch_max_register_virtual_size (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->max_register_virtual_size == -1)
fatal ("gdbarch: gdbarch_max_register_virtual_size invalid");
internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n");
@ -1417,7 +1419,7 @@ struct type *
gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
{
if (gdbarch->register_virtual_type == 0)
fatal ("gdbarch: gdbarch_register_virtual_type invalid");
internal_error ("gdbarch: gdbarch_register_virtual_type invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n");
@ -1437,7 +1439,7 @@ gdbarch_use_generic_dummy_frames (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->use_generic_dummy_frames == -1)
fatal ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n");
@ -1457,7 +1459,7 @@ gdbarch_call_dummy_location (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->call_dummy_location == 0)
fatal ("gdbarch: gdbarch_call_dummy_location invalid");
internal_error ("gdbarch: gdbarch_call_dummy_location invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
@ -1476,7 +1478,7 @@ CORE_ADDR
gdbarch_call_dummy_address (struct gdbarch *gdbarch)
{
if (gdbarch->call_dummy_address == 0)
fatal ("gdbarch: gdbarch_call_dummy_address invalid");
internal_error ("gdbarch: gdbarch_call_dummy_address invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n");
@ -1496,7 +1498,7 @@ gdbarch_call_dummy_start_offset (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->call_dummy_start_offset == -1)
fatal ("gdbarch: gdbarch_call_dummy_start_offset invalid");
internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n");
@ -1516,7 +1518,7 @@ gdbarch_call_dummy_breakpoint_offset (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->call_dummy_breakpoint_offset == -1)
fatal ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n");
@ -1536,7 +1538,7 @@ gdbarch_call_dummy_breakpoint_offset_p (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->call_dummy_breakpoint_offset_p == -1)
fatal ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n");
@ -1556,7 +1558,7 @@ gdbarch_call_dummy_length (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->call_dummy_length == -1)
fatal ("gdbarch: gdbarch_call_dummy_length invalid");
internal_error ("gdbarch: gdbarch_call_dummy_length invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n");
@ -1575,7 +1577,7 @@ int
gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
{
if (gdbarch->pc_in_call_dummy == 0)
fatal ("gdbarch: gdbarch_pc_in_call_dummy invalid");
internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n");
@ -1595,7 +1597,7 @@ gdbarch_call_dummy_p (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->call_dummy_p == -1)
fatal ("gdbarch: gdbarch_call_dummy_p invalid");
internal_error ("gdbarch: gdbarch_call_dummy_p invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n");
@ -1651,7 +1653,7 @@ gdbarch_call_dummy_stack_adjust_p (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->call_dummy_stack_adjust_p == -1)
fatal ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n");
@ -1671,7 +1673,7 @@ gdbarch_call_dummy_stack_adjust (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
fatal ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n");
@ -1690,7 +1692,7 @@ void
gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p)
{
if (gdbarch->fix_call_dummy == 0)
fatal ("gdbarch: gdbarch_fix_call_dummy invalid");
internal_error ("gdbarch: gdbarch_fix_call_dummy invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n");
@ -1745,7 +1747,7 @@ void
gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)
{
if (gdbarch->get_saved_register == 0)
fatal ("gdbarch: gdbarch_get_saved_register invalid");
internal_error ("gdbarch: gdbarch_get_saved_register invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n");
@ -1764,7 +1766,7 @@ int
gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
{
if (gdbarch->register_convertible == 0)
fatal ("gdbarch: gdbarch_register_convertible invalid");
internal_error ("gdbarch: gdbarch_register_convertible invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n");
@ -1783,7 +1785,7 @@ void
gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
{
if (gdbarch->register_convert_to_virtual == 0)
fatal ("gdbarch: gdbarch_register_convert_to_virtual invalid");
internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n");
@ -1802,7 +1804,7 @@ void
gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
{
if (gdbarch->register_convert_to_raw == 0)
fatal ("gdbarch: gdbarch_register_convert_to_raw invalid");
internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n");
@ -1821,7 +1823,7 @@ void
gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
{
if (gdbarch->extract_return_value == 0)
fatal ("gdbarch: gdbarch_extract_return_value invalid");
internal_error ("gdbarch: gdbarch_extract_return_value invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
@ -1840,7 +1842,7 @@ CORE_ADDR
gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
{
if (gdbarch->push_arguments == 0)
fatal ("gdbarch: gdbarch_push_arguments invalid");
internal_error ("gdbarch: gdbarch_push_arguments invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n");
@ -1859,7 +1861,7 @@ void
gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
{
if (gdbarch->push_dummy_frame == 0)
fatal ("gdbarch: gdbarch_push_dummy_frame invalid");
internal_error ("gdbarch: gdbarch_push_dummy_frame invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n");
@ -1878,7 +1880,7 @@ CORE_ADDR
gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
{
if (gdbarch->push_return_address == 0)
fatal ("gdbarch: gdbarch_push_return_address invalid");
internal_error ("gdbarch: gdbarch_push_return_address invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n");
@ -1897,7 +1899,7 @@ void
gdbarch_pop_frame (struct gdbarch *gdbarch)
{
if (gdbarch->pop_frame == 0)
fatal ("gdbarch: gdbarch_pop_frame invalid");
internal_error ("gdbarch: gdbarch_pop_frame invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n");
@ -1916,7 +1918,7 @@ CORE_ADDR
gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x)
{
if (gdbarch->d10v_make_daddr == 0)
fatal ("gdbarch: gdbarch_d10v_make_daddr invalid");
internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_daddr called\n");
@ -1935,7 +1937,7 @@ CORE_ADDR
gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x)
{
if (gdbarch->d10v_make_iaddr == 0)
fatal ("gdbarch: gdbarch_d10v_make_iaddr invalid");
internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_iaddr called\n");
@ -1954,7 +1956,7 @@ int
gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
{
if (gdbarch->d10v_daddr_p == 0)
fatal ("gdbarch: gdbarch_d10v_daddr_p invalid");
internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_daddr_p called\n");
@ -1973,7 +1975,7 @@ int
gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x)
{
if (gdbarch->d10v_iaddr_p == 0)
fatal ("gdbarch: gdbarch_d10v_iaddr_p invalid");
internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_iaddr_p called\n");
@ -1992,7 +1994,7 @@ CORE_ADDR
gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
{
if (gdbarch->d10v_convert_daddr_to_raw == 0)
fatal ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_daddr_to_raw called\n");
@ -2011,7 +2013,7 @@ CORE_ADDR
gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x)
{
if (gdbarch->d10v_convert_iaddr_to_raw == 0)
fatal ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_iaddr_to_raw called\n");
@ -2030,7 +2032,7 @@ void
gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
{
if (gdbarch->store_struct_return == 0)
fatal ("gdbarch: gdbarch_store_struct_return invalid");
internal_error ("gdbarch: gdbarch_store_struct_return invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n");
@ -2049,7 +2051,7 @@ void
gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
{
if (gdbarch->store_return_value == 0)
fatal ("gdbarch: gdbarch_store_return_value invalid");
internal_error ("gdbarch: gdbarch_store_return_value invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
@ -2068,7 +2070,7 @@ CORE_ADDR
gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
{
if (gdbarch->extract_struct_value_address == 0)
fatal ("gdbarch: gdbarch_extract_struct_value_address invalid");
internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
@ -2087,7 +2089,7 @@ int
gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
{
if (gdbarch->use_struct_convention == 0)
fatal ("gdbarch: gdbarch_use_struct_convention invalid");
internal_error ("gdbarch: gdbarch_use_struct_convention invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n");
@ -2106,7 +2108,7 @@ void
gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
{
if (gdbarch->frame_init_saved_regs == 0)
fatal ("gdbarch: gdbarch_frame_init_saved_regs invalid");
internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n");
@ -2125,7 +2127,7 @@ void
gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
{
if (gdbarch->init_extra_frame_info == 0)
fatal ("gdbarch: gdbarch_init_extra_frame_info invalid");
internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n");
@ -2144,7 +2146,7 @@ CORE_ADDR
gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
{
if (gdbarch->skip_prologue == 0)
fatal ("gdbarch: gdbarch_skip_prologue invalid");
internal_error ("gdbarch: gdbarch_skip_prologue invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
@ -2163,7 +2165,7 @@ int
gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
{
if (gdbarch->inner_than == 0)
fatal ("gdbarch: gdbarch_inner_than invalid");
internal_error ("gdbarch: gdbarch_inner_than invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
@ -2182,7 +2184,7 @@ unsigned char *
gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
if (gdbarch->breakpoint_from_pc == 0)
fatal ("gdbarch: gdbarch_breakpoint_from_pc invalid");
internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
@ -2202,7 +2204,7 @@ gdbarch_decr_pc_after_break (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->decr_pc_after_break == -1)
fatal ("gdbarch: gdbarch_decr_pc_after_break invalid");
internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
@ -2222,7 +2224,7 @@ gdbarch_function_start_offset (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->function_start_offset == -1)
fatal ("gdbarch: gdbarch_function_start_offset invalid");
internal_error ("gdbarch: gdbarch_function_start_offset invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
@ -2241,7 +2243,7 @@ void
gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
{
if (gdbarch->remote_translate_xfer_address == 0)
fatal ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
@ -2261,7 +2263,7 @@ gdbarch_frame_args_skip (gdbarch)
struct gdbarch *gdbarch;
{
if (gdbarch->frame_args_skip == -1)
fatal ("gdbarch: gdbarch_frame_args_skip invalid");
internal_error ("gdbarch: gdbarch_frame_args_skip invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
@ -2280,7 +2282,7 @@ int
gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
{
if (gdbarch->frameless_function_invocation == 0)
fatal ("gdbarch: gdbarch_frameless_function_invocation invalid");
internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n");
@ -2299,7 +2301,7 @@ CORE_ADDR
gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
{
if (gdbarch->frame_chain == 0)
fatal ("gdbarch: gdbarch_frame_chain invalid");
internal_error ("gdbarch: gdbarch_frame_chain invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n");
@ -2318,7 +2320,7 @@ int
gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
{
if (gdbarch->frame_chain_valid == 0)
fatal ("gdbarch: gdbarch_frame_chain_valid invalid");
internal_error ("gdbarch: gdbarch_frame_chain_valid invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n");
@ -2337,7 +2339,7 @@ CORE_ADDR
gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
{
if (gdbarch->frame_saved_pc == 0)
fatal ("gdbarch: gdbarch_frame_saved_pc invalid");
internal_error ("gdbarch: gdbarch_frame_saved_pc invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n");
@ -2356,7 +2358,7 @@ CORE_ADDR
gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
{
if (gdbarch->frame_args_address == 0)
fatal ("gdbarch: gdbarch_frame_args_address invalid");
internal_error ("gdbarch: gdbarch_frame_args_address invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n");
@ -2375,7 +2377,7 @@ CORE_ADDR
gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
{
if (gdbarch->frame_locals_address == 0)
fatal ("gdbarch: gdbarch_frame_locals_address invalid");
internal_error ("gdbarch: gdbarch_frame_locals_address invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n");
@ -2394,7 +2396,7 @@ CORE_ADDR
gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
{
if (gdbarch->saved_pc_after_call == 0)
fatal ("gdbarch: gdbarch_saved_pc_after_call invalid");
internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n");
@ -2413,7 +2415,7 @@ int
gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
{
if (gdbarch->frame_num_args == 0)
fatal ("gdbarch: gdbarch_frame_num_args invalid");
internal_error ("gdbarch: gdbarch_frame_num_args invalid");
if (gdbarch_debug >= 2)
/* FIXME: gdb_std??? */
fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
@ -2500,7 +2502,7 @@ gdbarch_data (data)
struct gdbarch_data *data;
{
if (data->index >= current_gdbarch->nr_data)
fatal ("gdbarch_data: request for non-existant data.");
internal_error ("gdbarch_data: request for non-existant data.");
return current_gdbarch->data[data->index];
}
@ -2625,7 +2627,7 @@ register_gdbarch_init (bfd_architecture, init)
bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
if (bfd_arch_info == NULL)
{
fatal ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture);
internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture);
}
/* Check that we haven't seen this architecture before */
for (curr = &gdbarch_init_registrary;
@ -2633,7 +2635,7 @@ register_gdbarch_init (bfd_architecture, init)
curr = &(*curr)->next)
{
if (bfd_architecture == (*curr)->bfd_architecture)
fatal ("gdbarch: Duplicate registraration of architecture (%s)",
internal_error ("gdbarch: Duplicate registraration of architecture (%s)",
bfd_arch_info->printable_name);
}
/* log it */
@ -3157,7 +3159,7 @@ set_architecture_from_arch_mach (arch, mach)
if (wanted != NULL)
set_arch (wanted, set_arch_manual);
else
fatal ("gdbarch: hardwired architecture/machine not reconized");
internal_error ("gdbarch: hardwired architecture/machine not reconized");
}
/* Set the architecture from a BFD */

View File

@ -1013,10 +1013,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) (fatal ("gdbarch: D10V_MAKE_DADDR"), 0)
#define D10V_MAKE_DADDR(X) (internal_error ("gdbarch: D10V_MAKE_DADDR"), 0)
#endif
#ifndef D10V_MAKE_IADDR
#define D10V_MAKE_IADDR(X) (fatal ("gdbarch: D10V_MAKE_IADDR"), 0)
#define D10V_MAKE_IADDR(X) (internal_error ("gdbarch: D10V_MAKE_IADDR"), 0)
#endif
@ -1042,7 +1042,7 @@ extern int generic_register_convertible_not PARAMS ((int reg_nr));
/* 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) (fatal ("gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
#define EXTRACT_STRUCT_VALUE_ADDRESS(X) (internal_error ("gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
#else
#ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P
#define EXTRACT_STRUCT_VALUE_ADDRESS_P (1)

View File

@ -157,7 +157,7 @@ fetch_register (regno)
+ (REGISTER_BYTE (regno) - REGISTER_BYTE (1)));
else
fatal ("hppa-nat.c (fetch_register): unexpected register size");
internal_error ("hppa-nat.c (fetch_register): unexpected register size");
for (i = 0; i < len; i += sizeof (int))
{

View File

@ -62,8 +62,6 @@ static char *disassembly_flavor = att_flavor;
static void set_disassembly_flavor_sfunc PARAMS ((char *, int, struct cmd_list_element *));
static void set_disassembly_flavor ();
void (*disassembly_flavor_hook) PARAMS ((char *args, int from_tty));
/* Stdio style buffering was used to minimize calls to ptrace, but this
buffering did not take into account that the code section being accessed
may not be an even number of buffers long (even if the buffer is only

View File

@ -1,5 +1,5 @@
/* Memory-access and commands for "inferior" process, for GDB.
Copyright 1986, 87, 88, 89, 91, 92, 95, 96, 1998
Copyright 1986, 87, 88, 89, 91, 92, 95, 96, 1998, 1999
Free Software Foundation, Inc.
This file is part of GDB.
@ -35,6 +35,7 @@
#include "symfile.h"
#include "objfiles.h"
#include "event-loop.h"
#include "parser-defs.h"
/* Functions exported for general use: */
@ -64,6 +65,8 @@ static void float_info PARAMS ((char *, int));
static void detach_command PARAMS ((char *, int));
static void interrupt_target_command (char *args, int from_tty);
#if !defined (DO_REGISTERS_INFO)
static void do_registers_info PARAMS ((int, int));
#endif
@ -707,10 +710,6 @@ breakpoint_auto_delete_contents (arg)
Otherwise, run_stack-dummy returns 1 (the frame will eventually be popped
when we do hit that breakpoint). */
/* DEBUG HOOK: 4 => return instead of letting the stack dummy run. */
static int stack_dummy_testing = 0;
int
run_stack_dummy (addr, buffer)
CORE_ADDR addr;
@ -720,11 +719,7 @@ run_stack_dummy (addr, buffer)
/* Now proceed, having reached the desired place. */
clear_proceed_status ();
if (stack_dummy_testing & 4)
{
POP_FRAME;
return (0);
}
if (CALL_DUMMY_BREAKPOINT_OFFSET_P)
{
struct breakpoint *bpt;
@ -899,7 +894,7 @@ finish_command_continuation (arg)
value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function));
if (!value_type)
fatal ("internal: finish_command: function has no target type");
internal_error ("finish_command: function has no target type");
if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
{
@ -1052,7 +1047,7 @@ finish_command (arg, from_tty)
value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function));
if (!value_type)
fatal ("internal: finish_command: function has no target type");
internal_error ("finish_command: function has no target type");
/* FIXME: Shouldn't we do the cleanups before returning? */
if (TYPE_CODE (value_type) == TYPE_CODE_VOID)

View File

@ -330,7 +330,7 @@ _initialize_kernel_u_addr ()
if (nlist ("/vmunix", names) == 0)
kernel_u_addr = names[0].n_value;
else
fatal ("Unable to get kernel u area address.");
internal_error ("Unable to get kernel u area address.");
#endif /* KERNEL_U_ADDR_BSD. */
}

View File

@ -38,33 +38,66 @@
/* Prototypes for local functions */
static void signals_info PARAMS ((char *, int));
static void signals_info (char *, int);
static void handle_command PARAMS ((char *, int));
static void handle_command (char *, int);
static void sig_print_info PARAMS ((enum target_signal));
static void sig_print_info (enum target_signal);
static void sig_print_header PARAMS ((void));
static void sig_print_header (void);
static void resume_cleanups PARAMS ((int));
static void resume_cleanups (int);
static int hook_stop_stub PARAMS ((PTR));
static int hook_stop_stub (void *);
static void delete_breakpoint_current_contents PARAMS ((PTR));
static void delete_breakpoint_current_contents (void *);
static void set_follow_fork_mode_command PARAMS ((char *arg, int from_tty, struct cmd_list_element * c));
static void set_follow_fork_mode_command (char *arg, int from_tty,
struct cmd_list_element * c);
static void complete_execution PARAMS ((void));
static void complete_execution (void);
static struct inferior_status *xmalloc_inferior_status (void);
static void free_inferior_status (struct inferior_status *);
static int restore_selected_frame (void *);
static void build_infrun (void);
static void follow_inferior_fork (int parent_pid, int child_pid,
int has_forked, int has_vforked);
static void follow_fork (int parent_pid, int child_pid);
static void follow_vfork (int parent_pid, int child_pid);
static void set_schedlock_func (char *args, int from_tty,
struct cmd_list_element * c);
static int is_internal_shlib_eventpoint (struct breakpoint * ep);
static int stopped_for_internal_shlib_event (bpstat bs);
struct execution_control_state;
static int currently_stepping (struct execution_control_state *ecs);
static void xdb_handle_command (char *args, int from_tty);
void _initialize_infrun (void);
int inferior_ignoring_startup_exec_events = 0;
int inferior_ignoring_leading_exec_events = 0;
/* In asynchronous mode, but simulating synchronous execution. */
int sync_execution = 0;
/* wait_for_inferior and normal_stop use this to notify the user
when the inferior stopped in a different thread than it had been
running in. */
running in. */
static int switched_from_inferior_pid;
/* This will be true for configurations that may actually report an
@ -98,7 +131,8 @@ static int may_follow_exec = MAY_FOLLOW_EXEC;
Versions of gdb which don't use the "step == this thread steps
and others continue" model but instead use the "step == this
thread steps and others wait" shouldn't do this. */
thread steps and others wait" shouldn't do this. */
static int thread_step_needed = 0;
/* This is true if thread_step_needed should actually be used. At
@ -110,34 +144,6 @@ static int thread_step_needed = 0;
static int use_thread_step_needed = USE_THREAD_STEP_NEEDED;
static void follow_inferior_fork PARAMS ((int parent_pid,
int child_pid,
int has_forked,
int has_vforked));
static void follow_fork PARAMS ((int parent_pid, int child_pid));
static void follow_vfork PARAMS ((int parent_pid, int child_pid));
static void set_schedlock_func PARAMS ((char *args, int from_tty,
struct cmd_list_element * c));
static int is_internal_shlib_eventpoint PARAMS ((struct breakpoint * ep));
static int stopped_for_internal_shlib_event PARAMS ((bpstat bs));
static int stopped_for_shlib_catchpoint PARAMS ((bpstat bs,
struct breakpoint ** cp_p));
#if __STDC__
struct execution_control_state;
#endif
static int currently_stepping PARAMS ((struct execution_control_state * ecs));
static void xdb_handle_command PARAMS ((char *args, int from_tty));
void _initialize_infrun PARAMS ((void));
/* GET_LONGJMP_TARGET returns the PC at which longjmp() will resume the
program. It needs to examine the jmp_buf argument and extract the PC
from it. The return value is non-zero on success, zero otherwise. */
@ -393,19 +399,15 @@ static char *follow_fork_mode_string = NULL;
static void
follow_inferior_fork (parent_pid, child_pid, has_forked, has_vforked)
int parent_pid;
int child_pid;
int has_forked;
int has_vforked;
follow_inferior_fork (int parent_pid, int child_pid, int has_forked,
int has_vforked)
{
int followed_parent = 0;
int followed_child = 0;
int ima_clone = 0;
/* Which process did the user want us to follow? */
char *follow_mode =
savestring (follow_fork_mode_string, strlen (follow_fork_mode_string));
savestring (follow_fork_mode_string, strlen (follow_fork_mode_string));
/* Or, did the user not know, and want us to ask? */
if (STREQ (follow_fork_mode_string, "ask"))
@ -568,21 +570,17 @@ follow_inferior_fork (parent_pid, child_pid, has_forked, has_vforked)
}
static void
follow_fork (parent_pid, child_pid)
int parent_pid;
int child_pid;
follow_fork (int parent_pid, int child_pid)
{
follow_inferior_fork (parent_pid, child_pid, 1, 0);
}
/* Forward declaration. */
static void follow_exec PARAMS ((int, char *));
static void follow_exec (int, char *);
static void
follow_vfork (parent_pid, child_pid)
int parent_pid;
int child_pid;
follow_vfork (int parent_pid, int child_pid)
{
follow_inferior_fork (parent_pid, child_pid, 0, 1);
@ -597,9 +595,7 @@ follow_vfork (parent_pid, child_pid)
}
static void
follow_exec (pid, execd_pathname)
int pid;
char *execd_pathname;
follow_exec (int pid, char *execd_pathname)
{
int saved_pid = pid;
struct target_ops *tgt;
@ -707,8 +703,7 @@ static int singlestep_breakpoints_inserted_p = 0;
/* Things to clean up if we QUIT out of resume (). */
/* ARGSUSED */
static void
resume_cleanups (arg)
int arg;
resume_cleanups (int arg)
{
normal_stop ();
}
@ -721,10 +716,7 @@ static char *scheduler_enums[] =
{schedlock_off, schedlock_on, schedlock_step};
static void
set_schedlock_func (args, from_tty, c)
char *args;
int from_tty;
struct cmd_list_element *c;
set_schedlock_func (char *args, int from_tty, struct cmd_list_element *c)
{
if (c->type == set_cmd)
if (!target_can_lock_scheduler)
@ -745,9 +737,7 @@ set_schedlock_func (args, from_tty, c)
STEP nonzero if we should step (zero to continue instead).
SIG is the signal to give the inferior (zero for none). */
void
resume (step, sig)
int step;
enum target_signal sig;
resume (int step, enum target_signal sig)
{
int should_resume = 1;
struct cleanup *old_cleanups = make_cleanup ((make_cleanup_func)
@ -867,7 +857,7 @@ resume (step, sig)
First do this, then set the ones you want, then call `proceed'. */
void
clear_proceed_status ()
clear_proceed_status (void)
{
trap_expected = 0;
step_range_start = 0;
@ -896,10 +886,7 @@ clear_proceed_status ()
You should call clear_proceed_status before calling proceed. */
void
proceed (addr, siggnal, step)
CORE_ADDR addr;
enum target_signal siggnal;
int step;
proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
{
int oneproc = 0;
@ -1031,8 +1018,9 @@ static char *prev_func_name;
/* Start remote-debugging of a machine over a serial link. */
void
start_remote ()
start_remote (void)
{
init_thread_list ();
init_wait_for_inferior ();
@ -1061,7 +1049,7 @@ start_remote ()
/* Initialize static vars when a new inferior begins. */
void
init_wait_for_inferior ()
init_wait_for_inferior (void)
{
/* These are meaningless until the first time through wait_for_inferior. */
prev_pc = 0;
@ -1090,8 +1078,7 @@ init_wait_for_inferior ()
}
static void
delete_breakpoint_current_contents (arg)
PTR arg;
delete_breakpoint_current_contents (void *arg)
{
struct breakpoint **breakpointp = (struct breakpoint **) arg;
if (*breakpointp != NULL)
@ -1145,9 +1132,9 @@ struct execution_control_state
int wait_some_more;
};
void init_execution_control_state PARAMS ((struct execution_control_state * ecs));
void init_execution_control_state (struct execution_control_state * ecs);
void handle_inferior_event PARAMS ((struct execution_control_state * ecs));
void handle_inferior_event (struct execution_control_state * ecs);
/* Wait for control to return from inferior to debugger.
If inferior gets a signal, we may decide to start it up again
@ -1156,7 +1143,7 @@ void handle_inferior_event PARAMS ((struct execution_control_state * ecs));
should be left stopped and GDB should read more commands. */
void
wait_for_inferior ()
wait_for_inferior (void)
{
struct cleanup *old_cleanups;
struct execution_control_state ecss;
@ -1219,7 +1206,7 @@ struct execution_control_state async_ecss;
struct execution_control_state *async_ecs;
void
fetch_inferior_event ()
fetch_inferior_event (void)
{
static struct cleanup *old_cleanups;
@ -1279,8 +1266,7 @@ fetch_inferior_event ()
wait_for_inferior-type loop. */
void
init_execution_control_state (ecs)
struct execution_control_state *ecs;
init_execution_control_state (struct execution_control_state *ecs)
{
ecs->random_signal = 0;
ecs->remove_breakpoints_on_following_step = 0;
@ -1302,7 +1288,7 @@ init_execution_control_state (ecs)
sanity check. We should never be setting a new
step_resume_breakpoint when we have an old one active. */
static void
check_for_old_step_resume_breakpoint ()
check_for_old_step_resume_breakpoint (void)
{
if (step_resume_breakpoint)
warning ("GDB bug: infrun.c (wait_for_inferior): dropping old step_resume breakpoint");
@ -1313,8 +1299,7 @@ check_for_old_step_resume_breakpoint ()
appropriate action. */
void
handle_inferior_event (ecs)
struct execution_control_state *ecs;
handle_inferior_event (struct execution_control_state *ecs)
{
CORE_ADDR tmp;
int stepped_after_stopped_by_watchpoint;
@ -1599,8 +1584,9 @@ handle_inferior_event (ecs)
inferior_ignoring_leading_exec_events =
target_reported_exec_events_per_exec_call () - 1;
pending_follow.execd_pathname = savestring (ecs->ws.value.execd_pathname,
strlen (ecs->ws.value.execd_pathname));
pending_follow.execd_pathname =
savestring (ecs->ws.value.execd_pathname,
strlen (ecs->ws.value.execd_pathname));
/* Did inferior_pid exec, or did a (possibly not-yet-followed)
child of a vfork exec?
@ -3046,8 +3032,7 @@ stop_stepping:
/* Are we in the middle of stepping? */
static int
currently_stepping (ecs)
struct execution_control_state *ecs;
currently_stepping (struct execution_control_state *ecs)
{
return ((through_sigtramp_breakpoint == NULL
&& !ecs->handling_longjmp
@ -3064,8 +3049,7 @@ currently_stepping (ecs)
something gdb sets for its own use, and isn't ever shown to a
user.) */
static int
is_internal_shlib_eventpoint (ep)
struct breakpoint *ep;
is_internal_shlib_eventpoint (struct breakpoint *ep)
{
return
(ep->type == bp_shlib_event)
@ -3075,9 +3059,9 @@ is_internal_shlib_eventpoint (ep)
/* This function returns TRUE if bs indicates that the inferior
stopped due to a shared library (aka dynamically-linked library)
event. */
static int
stopped_for_internal_shlib_event (bs)
bpstat bs;
stopped_for_internal_shlib_event (bpstat bs)
{
/* Note that multiple eventpoints may've caused the stop. Any
that are associated with shlib events will be accepted. */
@ -3091,45 +3075,15 @@ stopped_for_internal_shlib_event (bs)
/* If we get here, then no candidate was found. */
return 0;
}
/* This function returns TRUE if bs indicates that the inferior
stopped due to a shared library (aka dynamically-linked library)
event caught by a catchpoint.
If TRUE, cp_p is set to point to the catchpoint.
Else, the value of cp_p is undefined. */
static int
stopped_for_shlib_catchpoint (bs, cp_p)
bpstat bs;
struct breakpoint **cp_p;
{
/* Note that multiple eventpoints may've caused the stop. Any
that are associated with shlib events will be accepted. */
*cp_p = NULL;
for (; bs != NULL; bs = bs->next)
{
if ((bs->breakpoint_at != NULL)
&& ep_is_shlib_catchpoint (bs->breakpoint_at))
{
*cp_p = bs->breakpoint_at;
return 1;
}
}
/* If we get here, then no candidate was found. */
return 0;
}
/* Reset proper settings after an asynchronous command has finished.
If the execution command was in synchronous mode, register stdin
with the event loop, and reset the prompt. */
static void
complete_execution ()
complete_execution (void)
{
extern cleanup_sigint_signal_handler PARAMS ((void));
extern int cleanup_sigint_signal_handler (void);
target_executing = 0;
if (sync_execution)
@ -3151,7 +3105,7 @@ complete_execution ()
attempting to insert breakpoints. */
void
normal_stop ()
normal_stop (void)
{
/* As with the notification of thread events, we want to delay
notifying the user that we've switched thread context until
@ -3313,47 +3267,43 @@ done:
}
static int
hook_stop_stub (cmd)
PTR cmd;
hook_stop_stub (void *cmd)
{
execute_user_command ((struct cmd_list_element *) cmd, 0);
return (0);
}
int
signal_stop_state (signo)
int signo;
signal_stop_state (int signo)
{
return signal_stop[signo];
}
int
signal_print_state (signo)
int signo;
signal_print_state (int signo)
{
return signal_print[signo];
}
int
signal_pass_state (signo)
int signo;
signal_pass_state (int signo)
{
return signal_program[signo];
}
static void
sig_print_header ()
sig_print_header (void)
{
printf_filtered ("\
Signal Stop\tPrint\tPass to program\tDescription\n");
}
static void
sig_print_info (oursig)
enum target_signal oursig;
sig_print_info (enum target_signal oursig)
{
char *name = target_signal_to_name (oursig);
int name_padding = 13 - strlen (name);
if (name_padding <= 0)
name_padding = 0;
@ -3369,9 +3319,7 @@ sig_print_info (oursig)
/* Specify how various signals in the inferior should be handled. */
static void
handle_command (args, from_tty)
char *args;
int from_tty;
handle_command (char *args, int from_tty)
{
char **argv;
int digits, wordlen;
@ -3553,9 +3501,7 @@ Are you sure you want to change it? ",
}
static void
xdb_handle_command (args, from_tty)
char *args;
int from_tty;
xdb_handle_command (char *args, int from_tty)
{
char **argv;
struct cleanup *old_chain;
@ -3627,9 +3573,7 @@ xdb_handle_command (args, from_tty)
targets, all signals should be in the signal tables). */
static void
signals_info (signum_exp, from_tty)
char *signum_exp;
int from_tty;
signals_info (char *signum_exp, int from_tty)
{
enum target_signal oursig;
sig_print_header ();
@ -3695,10 +3639,8 @@ struct inferior_status
int proceed_to_finish;
};
static struct inferior_status *xmalloc_inferior_status PARAMS ((void));
static struct inferior_status *
xmalloc_inferior_status ()
xmalloc_inferior_status (void)
{
struct inferior_status *inf_status;
inf_status = xmalloc (sizeof (struct inferior_status));
@ -3707,10 +3649,8 @@ xmalloc_inferior_status ()
return inf_status;
}
static void free_inferior_status PARAMS ((struct inferior_status *));
static void
free_inferior_status (inf_status)
struct inferior_status *inf_status;
free_inferior_status (struct inferior_status *inf_status)
{
free (inf_status->registers);
free (inf_status->stop_registers);
@ -3718,10 +3658,8 @@ free_inferior_status (inf_status)
}
void
write_inferior_status_register (inf_status, regno, val)
struct inferior_status *inf_status;
int regno;
LONGEST val;
write_inferior_status_register (struct inferior_status *inf_status, int regno,
LONGEST val)
{
int size = REGISTER_RAW_SIZE (regno);
void *buf = alloca (size);
@ -3729,15 +3667,12 @@ write_inferior_status_register (inf_status, regno, val)
memcpy (&inf_status->registers[REGISTER_BYTE (regno)], buf, size);
}
/* Save all of the information associated with the inferior<==>gdb
connection. INF_STATUS is a pointer to a "struct inferior_status"
(defined in inferior.h). */
struct inferior_status *
save_inferior_status (restore_stack_info)
int restore_stack_info;
save_inferior_status (int restore_stack_info)
{
struct inferior_status *inf_status = xmalloc_inferior_status ();
@ -3778,11 +3713,8 @@ struct restore_selected_frame_args
int level;
};
static int restore_selected_frame PARAMS ((PTR));
static int
restore_selected_frame (args)
PTR args;
restore_selected_frame (void *args)
{
struct restore_selected_frame_args *fr =
(struct restore_selected_frame_args *) args;
@ -3813,8 +3745,7 @@ restore_selected_frame (args)
}
void
restore_inferior_status (inf_status)
struct inferior_status *inf_status;
restore_inferior_status (struct inferior_status *inf_status)
{
stop_signal = inf_status->stop_signal;
stop_pc = inf_status->stop_pc;
@ -3871,8 +3802,7 @@ restore_inferior_status (inf_status)
}
void
discard_inferior_status (inf_status)
struct inferior_status *inf_status;
discard_inferior_status (struct inferior_status *inf_status)
{
/* See save_inferior_status for info on stop_bpstat. */
bpstat_clear (&inf_status->stop_bpstat);
@ -3880,10 +3810,8 @@ discard_inferior_status (inf_status)
}
static void
set_follow_fork_mode_command (arg, from_tty, c)
char *arg;
int from_tty;
struct cmd_list_element *c;
set_follow_fork_mode_command (char *arg, int from_tty,
struct cmd_list_element *c)
{
if (!STREQ (arg, "parent") &&
!STREQ (arg, "child") &&
@ -3896,18 +3824,14 @@ set_follow_fork_mode_command (arg, from_tty, c)
follow_fork_mode_string = savestring (arg, strlen (arg));
}
static void build_infrun PARAMS ((void));
static void
build_infrun ()
build_infrun (void)
{
stop_registers = xmalloc (REGISTER_BYTES);
}
void
_initialize_infrun ()
_initialize_infrun (void)
{
register int i;
register int numsigs;

View File

@ -845,7 +845,7 @@ symbol_add_stub (arg)
lowest_sect = bfd_get_section_by_name (so->abfd, ".text");
if (lowest_sect == NULL)
bfd_map_over_sections (so->abfd, find_lowest_section,
(PTR) & lowest_sect);
(PTR) &lowest_sect);
if (lowest_sect)
text_addr = bfd_section_vma (so->abfd, lowest_sect) + LM_OFFSET (so);
}

321
gdb/kod-cisco.c Normal file
View File

@ -0,0 +1,321 @@
/* Kernel Object Display facility for Cisco
Copyright 1999 Free Software Foundation, Inc.
Written by Tom Tromey <tromey@cygnus.com>.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "gdb_string.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
/* Define this to turn off communication with target. */
/* #define FAKE_PACKET */
/* Size of buffer used for remote communication. */
#define PBUFSIZ 400
/* Pointers to gdb callbacks. */
static void (*gdb_kod_display) (char *);
static void (*gdb_kod_query) (char *, char *, int *);
/* Initialize and return library name and version.
The gdb side of KOD, kod.c, passes us two functions: one for
displaying output (presumably to the user) and the other for
querying the target. */
char *
cisco_kod_open (char *arg,
void (*display_func) (char *),
void (*query_func) (char *, char *, int *))
{
char buffer[PBUFSIZ];
int bufsiz = PBUFSIZ;
int i, count;
gdb_kod_display = display_func;
gdb_kod_query = query_func;
/* Get the OS info, and check the version field. This is the stub
version, which we use to see whether we will understand what
comes back. This is lame, but the `qKoL' request doesn't
actually provide enough configurability.
Right now the only defined version number is `0.0.0'.
This stub supports qKoI and the `a' (any) object requests qKaL
and qKaI. Each `a' object is returned as a 4-byte integer ID.
An info request on an object returns a pair of 4-byte integers;
the first is the object pointer and the second is the thread ID. */
#ifndef FAKE_PACKET
(*gdb_kod_query) ("oI;", buffer, &bufsiz);
#else
strcpy (buffer, "Cisco IOS/Classic/13.4 0.0.0");
#endif
count = 2;
for (i = 0; count && buffer[i] != '\0'; ++i)
{
if (buffer[i] == ' ')
--count;
}
if (buffer[i] == '\0')
error ("Remote returned malformed packet\n");
if (strcmp (&buffer[i], "0.0.0"))
error ("Remote returned unknown stub version: %s\n", &buffer[i]);
/* Return name, version, and description. I hope we have enough
space. */
return (strdup ("gdbkodcisco v0.0.0 - Cisco Kernel Object Display"));
}
/* Close the connection. */
void
cisco_kod_close ()
{
}
/* Print a "bad packet" message. */
static void
bad_packet ()
{
(*gdb_kod_display) ("Remote target returned malformed packet.\n");
}
/* Print information about currently known kernel objects.
We currently ignore the argument. There is only one mode of
querying the Cisco kernel: we ask for a dump of everything, and
it returns it. */
void
cisco_kod_request (char *arg, int from_tty)
{
char buffer[PBUFSIZ], command[PBUFSIZ];
int done = 0, i;
int fail = 0;
char **sync_ids;
int sync_len = 0;
int sync_next = 0;
char *prev_id = NULL;
if (! arg || strcmp (arg, "any"))
{
/* "Top-level" command. This is really silly, but it also seems
to be how KOD is defined. */
/* Even sillier is the fact that this first line must start
with the word "List". See kod.tcl. */
(*gdb_kod_display) ("List of Cisco Kernel Objects\n");
(*gdb_kod_display) ("Object\tDescription\n");
(*gdb_kod_display) ("any\tAny and all objects\n");
return;
}
while (! done)
{
int off = 0; /* Where we are in the string. */
long count; /* Number of objects in this packet. */
int bufsiz = PBUFSIZ;
char *s_end;
strcpy (command, "aL");
if (prev_id)
{
strcat (command, ",");
strcat (command, prev_id);
}
strcat (command, ";");
#ifndef FAKE_PACKET
/* We talk to the target by calling through the query function
passed to us when we were initialized. */
(*gdb_kod_query) (command, buffer, &bufsiz);
#else
/* Fake up a multi-part packet. */
if (! strncmp (&command[3], "a500005a", 8))
strcpy (buffer, "KAL,01,1,f500005f;f500005f;");
else
strcpy (buffer, "KAL,02,0,a500005a;a500005a;de02869f;");
#endif
/* Empty response is an error. */
if (strlen (buffer) == 0)
{
(*gdb_kod_display) ("Remote target did not recognize kernel object query command.\n");
fail = 1;
break;
}
/* If we don't get a `K' response then the buffer holds the
target's error message. */
if (buffer[0] != 'K')
{
(*gdb_kod_display) (buffer);
fail = 1;
break;
}
/* Make sure we get the response we expect. */
if (strncmp (buffer, "KAL,", 4))
{
bad_packet ();
fail = 1;
break;
}
off += 4;
/* Parse out the count. We expect to convert exactly two
characters followed by a comma. */
count = strtol (&buffer[off], &s_end, 16);
if (s_end - &buffer[off] != 2 || buffer[off + 2] != ',')
{
bad_packet ();
fail = 1;
break;
}
off += 3;
/* Parse out the `done' flag. */
if ((buffer[off] != '0' && buffer[off] != '1')
|| buffer[off + 1] != ',')
{
bad_packet ();
fail = 1;
break;
}
done = buffer[off] == '1';
off += 2;
/* Id of the last item; we might this to construct the next
request. */
prev_id = &buffer[off];
if (strlen (prev_id) < 8 || buffer[off + 8] != ';')
{
bad_packet ();
fail = 1;
break;
}
buffer[off + 8] = '\0';
off += 9;
if (sync_len == 0)
sync_ids = (char **) xmalloc (count * sizeof (char *));
else
sync_ids = (char **) xrealloc (sync_ids,
(sync_len + count) * sizeof (char *));
sync_len += count;
for (i = 0; i < count; ++i)
{
if (strlen (&buffer[off]) < 8 || buffer[off + 8] != ';')
{
bad_packet ();
fail = 1;
break;
}
buffer[off + 8] = '\0';
sync_ids[sync_next++] = xstrdup (&buffer[off]);
off += 9;
}
if (buffer[off] != '\0')
{
bad_packet ();
fail = 1;
break;
}
}
/* We've collected all the sync object IDs. Now query to get the
specific information, and arrange to print this info. */
if (! fail)
{
(*gdb_kod_display) ("Object ID\tObject Pointer\tThread ID\n");
for (i = 0; i < sync_next; ++i)
{
int off = 0;
int bufsiz = PBUFSIZ;
/* For now assume a query can be accomplished in a single
transaction. This is implied in the protocol document.
See comments above, and the KOD protocol document, to
understand the parsing of the return value. */
strcpy (command, "aI,");
strcat (command, sync_ids[i]);
strcat (command, ";");
#ifndef FAKE_PACKET
(*gdb_kod_query) (command, buffer, &bufsiz);
#else
strcpy (buffer, "KAI,");
strcat (buffer, sync_ids[i]);
strcat (buffer, ",ffef00a0,cd00123d;");
#endif
if (strlen (buffer) == 0)
{
(*gdb_kod_display) ("Remote target did not recognize KOD command.\n");
break;
}
if (strncmp (buffer, "KAI,", 4))
{
bad_packet ();
break;
}
off += 4;
if (strncmp (&buffer[off], sync_ids[i], 8)
|| buffer[off + 8] != ',')
{
bad_packet ();
break;
}
off += 9;
/* Extract thread id and sync object pointer. */
if (strlen (&buffer[off]) != 2 * 8 + 2
|| buffer[off + 8] != ','
|| buffer[off + 17] != ';')
{
bad_packet ();
break;
}
buffer[off + 8] = '\0';
buffer[off + 17] = '\0';
/* Display the result. */
(*gdb_kod_display) (sync_ids[i]);
(*gdb_kod_display) ("\t");
(*gdb_kod_display) (&buffer[off]);
(*gdb_kod_display) ("\t");
(*gdb_kod_display) (&buffer[off + 9]);
(*gdb_kod_display) ("\n");
}
}
/* Free memory. */
for (i = 0; i < sync_next; ++i)
free (sync_ids[i]);
free (sync_ids);
}

239
gdb/kod.c Normal file
View File

@ -0,0 +1,239 @@
/* Kernel Object Display generic routines and callbacks
Copyright 1998, 1999 Free Software Foundation, Inc.
Written by Fernando Nasser <fnasser@cygnus.com> for Cygnus Solutions.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "command.h"
#include "gdbcmd.h"
#include "target.h"
#include "gdb_string.h"
/* Prototypes for exported functions. */
void _initialize_kod (void);
/* Prototypes for local functions. */
static void show_kod (char *, int);
static void info_kod_command (char *, int);
static void load_kod_library (char *);
/* Prototypes for callbacks. These are passed into the KOD modules. */
static void gdb_kod_display (char *);
static void gdb_kod_query (char *, char *, int *);
/* These functions are imported from the KOD module.
gdb_kod_open - initiates the KOD connection to the remote. The
first argument is the display function the module should use to
communicate with the user. The second argument is the query
function the display should use to communicate with the target.
This should call error() if there is an error. Otherwise it should
return a malloc()d string of the form:
NAME VERSION - DESCRIPTION
Neither NAME nor VERSION should contain a hyphen.
gdb_kod_request - This is used when the user enters an "info
<module>" request. The remaining arguments are passed as the first
argument. The second argument is the standard `from_tty'
argument.
gdb_kod_close - This is called when the KOD connection to the
remote should be terminated. */
static char *(*gdb_kod_open) (void *, void *);
static void (*gdb_kod_request) (char *, int);
static void (*gdb_kod_close) ();
/* Name of inferior's operating system. */
char *operating_system;
/* We save a copy of the OS so that we can properly reset when
switching OS's. */
static char *old_operating_system;
/* Functions imported from the library for all supported OSes.
FIXME: we really should do something better, such as dynamically
loading the KOD modules. */
extern char *ecos_kod_open (void *, void *);
extern void ecos_kod_request (char *, int);
extern void ecos_kod_close ();
extern char *cisco_kod_open (void *, void *);
extern void cisco_kod_request (char *, int);
extern void cisco_kod_close ();
/* Print a line of data generated by the module. */
static void
gdb_kod_display (char *arg)
{
printf_filtered ("%s", arg);
}
/* Queries the target on behalf of the module. */
static void
gdb_kod_query (char *arg, char *result, int *maxsiz)
{
int bufsiz = 0;
/* Check if current target has remote_query capabilities.
If not, it does not have kod either. */
if (! current_target.to_query)
{
strcpy (result,
"ERR: Kernel Object Display not supported by current target\n");
return;
}
/* Just get the maximum buffer size. */
target_query ((int) 'K', 0, 0, &bufsiz);
/* Check if *we* were called just for getting the buffer size. */
if (*maxsiz == 0)
{
*maxsiz = bufsiz;
strcpy (result, "OK");
return;
}
/* Check if caller can handle a buffer this large, if not, adjust. */
if (bufsiz > *maxsiz)
bufsiz = *maxsiz;
/* See if buffer can hold the query (usually it can, as the query is
short). */
if (strlen (arg) >= bufsiz)
error ("kod: query argument too long");
/* Send actual request. */
if (target_query ((int) 'K', arg, result, &bufsiz))
strcpy (result, "ERR: remote query failed");
}
/* Print name of kod command after selecting the appropriate kod
formatting library module. As a side effect we create a new "info"
subcommand which is what the user actually uses to query the OS. */
static void
kod_set_os (char *arg, int from_tty, struct cmd_list_element *command)
{
char *p;
if (command->type != set_cmd)
return;
/* If we had already had an open OS, close it. */
if (gdb_kod_close)
(*gdb_kod_close) ();
/* Also remove the old OS's command. */
if (old_operating_system)
{
delete_cmd (old_operating_system, &infolist);
free (old_operating_system);
}
old_operating_system = strdup (operating_system);
if (! operating_system || ! *operating_system)
{
/* If user set operating system to empty, we want to forget we
had a module open. Setting these variables is just nice for
debugging and clarity. */
gdb_kod_open = NULL;
gdb_kod_request = NULL;
gdb_kod_close = NULL;
}
else
{
char *kodlib;
load_kod_library (operating_system);
kodlib = (*gdb_kod_open) (gdb_kod_display, gdb_kod_query);
/* Add kod related info commands to gdb. */
add_info (operating_system, info_kod_command,
"Displays information about Kernel Objects.");
p = strrchr (kodlib, '-');
if (p != NULL)
p++;
else
p = "Unknown KOD library";
printf_filtered ("%s - %s\n", operating_system, p);
free (kodlib);
}
}
/* Print information about currently known kernel objects of the
specified type or a list of all known kernel object types if
argument is empty. */
static void
info_kod_command (char *arg, int from_tty)
{
(*gdb_kod_request) (arg, from_tty);
}
/* Print name of kod command after selecting the appropriate kod
formatting library module. */
static void
load_kod_library (char *lib)
{
#if 0
/* FIXME: Don't have the eCos code here. */
if (! strcmp (lib, "ecos"))
{
gdb_kod_open = ecos_kod_open;
gdb_kod_request = ecos_kod_request;
gdb_kod_close = ecos_kod_close;
}
else
#endif /* 0 */
if (! strcmp (lib, "cisco"))
{
gdb_kod_open = cisco_kod_open;
gdb_kod_request = cisco_kod_request;
gdb_kod_close = cisco_kod_close;
}
else
error ("Unknown operating system: %s\n", operating_system);
}
void
_initialize_kod ()
{
struct cmd_list_element *c;
c = add_set_cmd ("os", no_class, var_string,
(char *) &operating_system,
"Set operating system",
&setlist);
c->function.sfunc = kod_set_os;
add_show_from_set (c, &showlist);
}

View File

@ -1076,21 +1076,10 @@ op_error (fmt, op, fatal)
by the value of warning_pre_print and we do not return to the top level. */
void
#ifdef ANSI_PROTOTYPES
type_error (char *string,...)
#else
type_error (va_alist)
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, string);
#else
char *string;
va_start (args);
string = va_arg (args, char *);
#endif
if (type_check == type_check_warn)
fprintf_filtered (gdb_stderr, warning_pre_print);
@ -1105,21 +1094,10 @@ type_error (va_alist)
}
void
#ifdef ANSI_PROTOTYPES
range_error (char *string,...)
#else
range_error (va_alist)
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, string);
#else
char *string;
va_start (args);
string = va_arg (args, char *);
#endif
if (range_check == range_check_warn)
fprintf_filtered (gdb_stderr, warning_pre_print);

View File

@ -1683,9 +1683,9 @@ catch_exception_raise (port, thread, task, exception, code, subcode)
}
if (exception < 0 || exception > MAX_EXCEPTION)
fatal ("catch_exception_raise: unknown exception code %d thread %d",
exception,
mid);
internal_error ("catch_exception_raise: unknown exception code %d thread %d",
exception,
mid);
if (!MACH_PORT_VALID (inferior_task))
error ("got an exception, but inferior_task is null or dead");
@ -3598,7 +3598,7 @@ mach3_exception_actions (w, force_print_only, who)
stop_code);
break;
default:
fatal ("Unknown exception");
internal_error ("Unknown exception");
}
}
}
@ -3624,13 +3624,13 @@ setup_notify_port (create_new)
MACH_PORT_RIGHT_RECEIVE,
&our_notify_port);
if (ret != KERN_SUCCESS)
fatal ("Creating notify port %s", mach_error_string (ret));
internal_error ("Creating notify port %s", mach_error_string (ret));
ret = mach_port_move_member (mach_task_self (),
our_notify_port,
inferior_wait_port_set);
if (ret != KERN_SUCCESS)
fatal ("initial move member %s", mach_error_string (ret));
internal_error ("initial move member %s", mach_error_string (ret));
}
}
@ -4650,7 +4650,7 @@ _initialize_m3_nat ()
MACH_PORT_RIGHT_PORT_SET,
&inferior_wait_port_set);
if (ret != KERN_SUCCESS)
fatal ("initial port set %s", mach_error_string (ret));
internal_error ("initial port set %s", mach_error_string (ret));
/* mach_really_wait now waits for this */
currently_waiting_for = inferior_wait_port_set;

View File

@ -684,7 +684,9 @@ Options:\n\n\
fputs_unfiltered ("\
--mapped Use mapped symbol files if supported on this system.\n\
--nw Do not use a window interface.\n\
--nx Do not read .gdbinit file.\n\
--nx Do not read ", stream);
fputs_unfiltered (gdbinit, stream);
fputs_unfiltered (" file.\n\
--quiet Do not print version number on startup.\n\
--readnow Fully read symbol files on first access.\n\
", stream);

206
gdb/mcore-rom.c Normal file
View File

@ -0,0 +1,206 @@
/* Remote debugging interface to Motorola picobug monitor for gdb,
the GNU debugger.
Copyright 1999 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "gdbcore.h"
#include "target.h"
#include "monitor.h"
#include "gdb_string.h"
/* Functions used only in this file. */
static void init_picobug_cmds (void);
/* Functions exported from this file. */
void _initialize_picobug_rom (void);
void picobug_open (char *args, int from_tty);
int picobug_dumpregs (void);
static char *picobug_inits[] =
{"\r", NULL};
static struct target_ops picobug_ops;
static struct monitor_ops picobug_cmds;
/* Picobug only supports a subset of registers from MCore. In reality,
it doesn't support ss1, either. */
/* *INDENT-OFF* */
static char *picobug_regnames[] = {
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
"psr", "vbr", "epsr", "fpsr", "epc", "fpc", 0, "ss1",
"ss2", "ss3", "ss4", 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
"pc" };
/* *INDENT-ON* */
void
picobug_open (char *args, int from_tty)
{
monitor_open (args, &picobug_cmds, from_tty);
}
/* *INDENT-OFF* */
/* We choose to write our own dumpregs routine, since the output of
the register dumping is rather difficult to encapsulate in a
regexp:
picobug> rd
pc 2f00031e epc 2f00031e fpc 00000000
psr 80000101 epsr 80000101 fpsr 00000000
ss0-ss4 bad0beef 00000000 00000000 00000000 00000000 vbr 30005c00
r0-r7 2f0fff4c 00000090 00000001 00000002 00000003 00000004 00000005 00000006
r8-r15 2f0fff64 00000000 00000000 00000000 00000000 00000000 00000000 2f00031e */
/* *INDENT-ON* */
int
picobug_dumpregs ()
{
char buf[1024];
int resp_len;
char *p;
/* Send the dump register command to the monitor and
get the reply. */
monitor_printf (picobug_cmds.dump_registers);
resp_len = monitor_expect_prompt (buf, sizeof (buf));
p = strtok (buf, " \t\r\n");
while (p)
{
if (strchr (p, '-'))
{
/* got a range. either r0-r7, r8-r15 or ss0-ss4 */
if (STREQN (p, "r0", 2) || STREQN (p, "r8", 2))
{
int rn = (p[1] == '0' ? 0 : 8);
int i = 0;
/* Get the next 8 values and record them. */
while (i < 8)
{
p = strtok (NULL, " \t\r\n");
if (p)
monitor_supply_register (rn + i, p);
i++;
}
}
else if (STREQN (p, "ss", 2))
{
/* get the next five values, ignoring the first */
int rn;
p = strtok (NULL, " \t\r\n");
for (rn = 39; rn < 43; rn++)
{
p = strtok (NULL, " \t\r\n");
if (p)
monitor_supply_register (rn, p);
}
}
else
{
break;
}
}
else
{
/* Simple register type, paired */
char *name = p;
int i;
/* Get and record value */
p = strtok (NULL, " \t\r\n");
if (p)
{
for (i = 0; i < NUM_REGS; i++)
{
if (picobug_regnames[i] && STREQ (picobug_regnames[i], name))
break;
}
if (i <= NUM_REGS)
monitor_supply_register (i, p);
}
}
p = strtok (NULL, " \t\r\n");
}
return 0;
}
static void
init_picobug_cmds (void)
{
picobug_cmds.flags = MO_GETMEM_NEEDS_RANGE | MO_CLR_BREAK_USES_ADDR | MO_PRINT_PROGRAM_OUTPUT;
picobug_cmds.init = picobug_inits; /* Init strings */
picobug_cmds.cont = "g\n"; /* continue command */
picobug_cmds.step = "s\n"; /* single step */
picobug_cmds.set_break = "br %x\n"; /* set a breakpoint */
picobug_cmds.clr_break = "nobr %x\n"; /* clear a breakpoint */
picobug_cmds.clr_all_break = "nobr\n"; /* clear all breakpoints */
picobug_cmds.setmem.cmdb = "mm %x %x ;b\n"; /* setmem.cmdb (addr, value) */
picobug_cmds.setmem.cmdw = "mm %x %x ;h\n"; /* setmem.cmdw (addr, value) */
picobug_cmds.setmem.cmdl = "mm %x %x ;w\n"; /* setmem.cmdl (addr, value) */
picobug_cmds.getmem.cmdb = "md %x %x\n"; /* getmem.cmdb (start addr, end addr) */
picobug_cmds.getmem.resp_delim = ":"; /* getmem.resp_delim */
picobug_cmds.setreg.cmd = "rm %s %x\n"; /* setreg.cmd (name, value) */
picobug_cmds.getreg.cmd = "rd %s\n"; /* getreg.cmd (name) */
picobug_cmds.getreg.resp_delim = ":"; /* getreg.resp_delim */
picobug_cmds.dump_registers = "rd\n"; /* dump_registers */
picobug_cmds.dumpregs = picobug_dumpregs; /* dump registers parser */
picobug_cmds.load = "lo\n"; /* download command */
picobug_cmds.prompt = "picobug> "; /* monitor command prompt */
picobug_cmds.line_term = "\n"; /* end-of-line terminator */
picobug_cmds.target = &picobug_ops; /* target operations */
picobug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
picobug_cmds.regnames = picobug_regnames; /* registers names */
picobug_cmds.num_breakpoints = 20; /* number of breakpoints */
picobug_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
}
void
_initialize_picobug_rom ()
{
int i;
/* Initialize m32r RevC monitor target */
init_picobug_cmds ();
init_monitor_ops (&picobug_ops);
picobug_ops.to_shortname = "picobug";
picobug_ops.to_longname = "picobug monitor";
picobug_ops.to_doc = "Debug via the picobug monitor.\n\
Specify the serial device it is connected to (e.g. /dev/ttya).";
picobug_ops.to_open = picobug_open;
add_target (&picobug_ops);
}

992
gdb/mcore-tdep.c Normal file
View File

@ -0,0 +1,992 @@
/* Target-machine dependent code for Motorola MCore for GDB, the GNU debugger
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "frame.h"
#include "symtab.h"
#include "value.h"
#include "gdbcmd.h"
/* Functions declared and used only in this file */
static CORE_ADDR mcore_analyze_prologue (struct frame_info *fi, CORE_ADDR pc, int skip_prologue);
static struct frame_info *analyze_dummy_frame (CORE_ADDR pc, CORE_ADDR frame);
static int get_insn (CORE_ADDR pc);
/* Functions exported from this file */
int mcore_use_struct_convention (int gcc_p, struct type *type);
void _initialize_mcore (void);
void mcore_init_extra_frame_info (struct frame_info *fi);
CORE_ADDR mcore_frame_saved_pc (struct frame_info *fi);
CORE_ADDR mcore_find_callers_reg (struct frame_info *fi, int regnum);
CORE_ADDR mcore_frame_args_address (struct frame_info *fi);
CORE_ADDR mcore_frame_locals_address (struct frame_info *fi);
void mcore_virtual_frame_pointer (CORE_ADDR pc, long *reg, long *offset);
CORE_ADDR mcore_push_return_address (CORE_ADDR pc, CORE_ADDR sp);
CORE_ADDR mcore_push_arguments (int nargs, value_ptr * args, CORE_ADDR sp,
unsigned char struct_return, CORE_ADDR struct_addr);
void mcore_pop_frame (struct frame_info *fi);
CORE_ADDR mcore_skip_prologue (CORE_ADDR pc);
CORE_ADDR mcore_frame_chain (struct frame_info *fi);
unsigned char *mcore_breakpoint_from_pc (CORE_ADDR * bp_addr, int *bp_size);
int mcore_use_struct_convention (int gcc_p, struct type *type);
void mcore_store_return_value (struct type *type, char *valbuf);
CORE_ADDR mcore_extract_struct_value_address (char *regbuf);
void mcore_extract_return_value (struct type *type, char *regbuf, char *valbuf);
#ifdef MCORE_DEBUG
int mcore_debug = 0;
#endif
/* The registers of the Motorola MCore processors */
/* *INDENT-OFF* */
char *mcore_register_names[] =
{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"ar0", "ar1", "ar2", "ar3", "ar4", "ar5", "ar6", "ar7",
"ar8", "ar9", "ar10", "ar11", "ar12", "ar13", "ar14", "ar15",
"psr", "vbr", "epsr", "fpsr", "epc", "fpc", "ss0", "ss1",
"ss2", "ss3", "ss4", "gcr", "gsr", "cr13", "cr14", "cr15",
"cr16", "cr17", "cr18", "cr19", "cr20", "cr21", "cr22", "cr23",
"cr24", "cr25", "cr26", "cr27", "cr28", "cr29", "cr30", "cr31",
"pc" };
/* *INDENT-ON* */
/* Additional info that we use for managing frames */
struct frame_extra_info
{
/* A generic status word */
int status;
/* Size of this frame */
int framesize;
/* The register that is acting as a frame pointer, if
it is being used. This is undefined if status
does not contain the flag MY_FRAME_IN_FP. */
int fp_regnum;
};
/* frame_extra_info status flags */
/* The base of the current frame is actually in the stack pointer.
This happens when there is no frame pointer (MCore ABI does not
require a frame pointer) or when we're stopped in the prologue or
epilogue itself. In these cases, mcore_analyze_prologue will need
to update fi->frame before returning or analyzing the register
save instructions. */
#define MY_FRAME_IN_SP 0x1
/* The base of the current frame is in a frame pointer register.
This register is noted in frame_extra_info->fp_regnum.
Note that the existance of an FP might also indicate that the
function has called alloca. */
#define MY_FRAME_IN_FP 0x2
/* This flag is set to indicate that this frame is the top-most
frame. This tells frame chain not to bother trying to unwind
beyond this frame. */
#define NO_MORE_FRAMES 0x4
/* Instruction macros used for analyzing the prologue */
#define IS_SUBI0(x) (((x) & 0xfe0f) == 0x2400) /* subi r0,oimm5 */
#define IS_STM(x) (((x) & 0xfff0) == 0x0070) /* stm rf-r15,r0 */
#define IS_STWx0(x) (((x) & 0xf00f) == 0x9000) /* stw rz,(r0,disp) */
#define IS_STWxy(x) (((x) & 0xf000) == 0x9000) /* stw rx,(ry,disp) */
#define IS_MOVx0(x) (((x) & 0xfff0) == 0x1200) /* mov rn,r0 */
#define IS_LRW1(x) (((x) & 0xff00) == 0x7100) /* lrw r1,literal */
#define IS_MOVI1(x) (((x) & 0xf80f) == 0x6001) /* movi r1,imm7 */
#define IS_BGENI1(x) (((x) & 0xfe0f) == 0x3201) /* bgeni r1,imm5 */
#define IS_BMASKI1(x) (((x) & 0xfe0f) == 0x2C01) /* bmaski r1,imm5 */
#define IS_ADDI1(x) (((x) & 0xfe0f) == 0x2001) /* addi r1,oimm5 */
#define IS_SUBI1(x) (((x) & 0xfe0f) == 0x2401) /* subi r1,oimm5 */
#define IS_RSUBI1(x) (((x) & 0xfe0f) == 0x2801) /* rsubi r1,imm5 */
#define IS_NOT1(x) (((x) & 0xffff) == 0x01f1) /* not r1 */
#define IS_ROTLI1(x) (((x) & 0xfe0f) == 0x3801) /* rotli r1,imm5 */
#define IS_BSETI1(x) (((x) & 0xfe0f) == 0x3401) /* bseti r1,imm5 */
#define IS_BCLRI1(x) (((x) & 0xfe0f) == 0x3001) /* bclri r1,imm5 */
#define IS_IXH1(x) (((x) & 0xffff) == 0x1d11) /* ixh r1,r1 */
#define IS_IXW1(x) (((x) & 0xffff) == 0x1511) /* ixw r1,r1 */
#define IS_SUB01(x) (((x) & 0xffff) == 0x0510) /* subu r0,r1 */
#define IS_RTS(x) (((x) & 0xffff) == 0x00cf) /* jmp r15 */
#define IS_R1_ADJUSTER(x) \
(IS_ADDI1(x) || IS_SUBI1(x) || IS_ROTLI1(x) || IS_BSETI1(x) \
|| IS_BCLRI1(x) || IS_RSUBI1(x) || IS_NOT1(x) \
|| IS_IXH1(x) || IS_IXW1(x))
#ifdef MCORE_DEBUG
static void
mcore_dump_insn (char *commnt, CORE_ADDR pc, int insn)
{
if (mcore_debug)
{
printf_filtered ("MCORE: %s %08x %08x ",
commnt, (unsigned int) pc, (unsigned int) insn);
(*tm_print_insn) (pc, &tm_print_insn_info);
printf_filtered ("\n");
}
}
#define mcore_insn_debug(args) { if (mcore_debug) printf_filtered args; }
#else /* !MCORE_DEBUG */
#define mcore_dump_insn(a,b,c) {}
#define mcore_insn_debug(args) {}
#endif
/* Given the address at which to insert a breakpoint (BP_ADDR),
what will that breakpoint be?
For MCore, we have a breakpoint instruction. Since all MCore
instructions are 16 bits, this is all we need, regardless of
address. bpkt = 0x0000 */
unsigned char *
mcore_breakpoint_from_pc (CORE_ADDR * bp_addr, int *bp_size)
{
static char breakpoint[] =
{0x00, 0x00};
*bp_size = 2;
return breakpoint;
}
/* Helper function for several routines below. This funtion simply
sets up a fake, aka dummy, frame (not a _call_ dummy frame) that
we can analyze with mcore_analyze_prologue. */
static struct frame_info *
analyze_dummy_frame (CORE_ADDR pc, CORE_ADDR frame)
{
static struct frame_info *dummy = NULL;
if (dummy == NULL)
{
dummy = (struct frame_info *) xmalloc (sizeof (struct frame_info));
dummy->saved_regs = (CORE_ADDR *) xmalloc (SIZEOF_FRAME_SAVED_REGS);
dummy->extra_info =
(struct frame_extra_info *) xmalloc (sizeof (struct frame_extra_info));
}
dummy->next = NULL;
dummy->prev = NULL;
dummy->pc = pc;
dummy->frame = frame;
dummy->extra_info->status = 0;
dummy->extra_info->framesize = 0;
memset (dummy->saved_regs, '\000', SIZEOF_FRAME_SAVED_REGS);
mcore_analyze_prologue (dummy, 0, 0);
return dummy;
}
/* Function prologues on the Motorol MCore processors consist of:
- adjustments to the stack pointer (r1 used as scratch register)
- store word/multiples that use r0 as the base address
- making a copy of r0 into another register (a "frame" pointer)
Note that the MCore really doesn't have a real frame pointer.
Instead, the compiler may copy the SP into a register (usually
r8) to act as an arg pointer. For our target-dependent purposes,
the frame info's "frame" member will be the beginning of the
frame. The SP could, in fact, point below this.
The prologue ends when an instruction fails to meet either of
the first two criteria or when an FP is made. We make a special
exception for gcc. When compiling unoptimized code, gcc will
setup stack slots. We need to make sure that we skip the filling
of these stack slots as much as possible. This is only done
when SKIP_PROLOGUE is set, so that it does not mess up
backtraces. */
/* Analyze the prologue of frame FI to determine where registers are saved,
the end of the prologue, etc. Return the address of the first line
of "real" code (i.e., the end of the prologue). */
static CORE_ADDR
mcore_analyze_prologue (struct frame_info *fi, CORE_ADDR pc, int skip_prologue)
{
CORE_ADDR func_addr, func_end, addr, stop;
CORE_ADDR stack_size;
int insn, rn;
int status, fp_regnum, flags;
int framesize;
int register_offsets[NUM_REGS];
char *name;
/* If provided, use the PC in the frame to look up the
start of this function. */
pc = (fi == NULL ? pc : fi->pc);
/* Find the start of this function. */
status = find_pc_partial_function (pc, &name, &func_addr, &func_end);
/* If the start of this function could not be found or if the debbuger
is stopped at the first instruction of the prologue, do nothing. */
if (status == 0)
return pc;
/* If the debugger is entry function, give up. */
if (func_addr == entry_point_address ())
{
if (fi != NULL)
fi->extra_info->status |= NO_MORE_FRAMES;
return pc;
}
/* At the start of a function, our frame is in the stack pointer. */
flags = MY_FRAME_IN_SP;
/* Start decoding the prologue. We start by checking two special cases:
1. We're about to return
2. We're at the first insn of the prologue.
If we're about to return, our frame has already been deallocated.
If we are stopped at the first instruction of a prologue,
then our frame has not yet been set up. */
/* Get the first insn from memory (all MCore instructions are 16 bits) */
mcore_insn_debug (("MCORE: starting prologue decoding\n"));
insn = get_insn (pc);
mcore_dump_insn ("got 1: ", pc, insn);
/* Check for return. */
if (fi != NULL && IS_RTS (insn))
{
mcore_insn_debug (("MCORE: got jmp r15"));
if (fi->next == NULL)
fi->frame = read_sp ();
return fi->pc;
}
/* Check for first insn of prologue */
if (fi != NULL && fi->pc == func_addr)
{
if (fi->next == NULL)
fi->frame = read_sp ();
return fi->pc;
}
/* Figure out where to stop scanning */
stop = (fi ? fi->pc : func_end);
/* Don't walk off the end of the function */
stop = (stop > func_end ? func_end : stop);
/* REGISTER_OFFSETS will contain offsets, from the top of the frame
(NOT the frame pointer), for the various saved registers or -1
if the register is not saved. */
for (rn = 0; rn < NUM_REGS; rn++)
register_offsets[rn] = -1;
/* Analyze the prologue. Things we determine from analyzing the
prologue include:
* the size of the frame
* where saved registers are located (and which are saved)
* FP used? */
mcore_insn_debug (("MCORE: Scanning prologue: func_addr=0x%x, stop=0x%x\n",
(unsigned int) func_addr, (unsigned int) stop));
framesize = 0;
for (addr = func_addr; addr < stop; addr += 2)
{
/* Get next insn */
insn = get_insn (addr);
mcore_dump_insn ("got 2: ", addr, insn);
if (IS_SUBI0 (insn))
{
int offset = 1 + ((insn >> 4) & 0x1f);
mcore_insn_debug (("MCORE: got subi r0,%d; contnuing\n", offset));
framesize += offset;
continue;
}
else if (IS_STM (insn))
{
/* Spill register(s) */
int offset;
int start_register;
/* BIG WARNING! The MCore ABI does not restrict functions
to taking only one stack allocation. Therefore, when
we save a register, we record the offset of where it was
saved relative to the current framesize. This will
then give an offset from the SP upon entry to our
function. Remember, framesize is NOT constant until
we're done scanning the prologue. */
start_register = (insn & 0xf);
mcore_insn_debug (("MCORE: got stm r%d-r15,(r0)\n", start_register));
for (rn = start_register, offset = 0; rn <= 15; rn++, offset += 4)
{
register_offsets[rn] = framesize - offset;
mcore_insn_debug (("MCORE: r%d saved at 0x%x (offset %d)\n", rn,
register_offsets[rn], offset));
}
mcore_insn_debug (("MCORE: continuing\n"));
continue;
}
else if (IS_STWx0 (insn))
{
/* Spill register: see note for IS_STM above. */
int imm;
rn = (insn >> 8) & 0xf;
imm = (insn >> 4) & 0xf;
register_offsets[rn] = framesize - (imm << 2);
mcore_insn_debug (("MCORE: r%d saved at offset 0x%x\n", rn, register_offsets[rn]));
mcore_insn_debug (("MCORE: continuing\n"));
continue;
}
else if (IS_MOVx0 (insn))
{
/* We have a frame pointer, so this prologue is over. Note
the register which is acting as the frame pointer. */
flags |= MY_FRAME_IN_FP;
flags &= ~MY_FRAME_IN_SP;
fp_regnum = insn & 0xf;
mcore_insn_debug (("MCORE: Found a frame pointer: r%d\n", fp_regnum));
/* If we found an FP, we're at the end of the prologue. */
mcore_insn_debug (("MCORE: end of prologue\n"));
if (skip_prologue)
continue;
/* If we're decoding prologue, stop here. */
addr += 2;
break;
}
else if (IS_STWxy (insn) && (flags & MY_FRAME_IN_FP) && ((insn & 0xf) == fp_regnum))
{
/* Special case. Skip over stack slot allocs, too. */
mcore_insn_debug (("MCORE: push arg onto stack.\n"));
continue;
}
else if (IS_LRW1 (insn) || IS_MOVI1 (insn)
|| IS_BGENI1 (insn) || IS_BMASKI1 (insn))
{
int adjust = 0;
int offset = 0;
int insn2;
mcore_insn_debug (("MCORE: looking at large frame\n"));
if (IS_LRW1 (insn))
{
adjust =
read_memory_integer ((addr + 2 + ((insn & 0xff) << 2)) & 0xfffffffc, 4);
}
else if (IS_MOVI1 (insn))
adjust = (insn >> 4) & 0x7f;
else if (IS_BGENI1 (insn))
adjust = 1 << ((insn >> 4) & 0x1f);
else /* IS_BMASKI (insn) */
adjust = (1 << (adjust >> 4) & 0x1f) - 1;
mcore_insn_debug (("MCORE: base framesize=0x%x\n", adjust));
/* May have zero or more insns which modify r1 */
mcore_insn_debug (("MCORE: looking for r1 adjusters...\n"));
offset = 2;
insn2 = get_insn (addr + offset);
while (IS_R1_ADJUSTER (insn2))
{
int imm;
imm = (insn2 >> 4) & 0x1f;
mcore_dump_insn ("got 3: ", addr + offset, insn);
if (IS_ADDI1 (insn2))
{
adjust += (imm + 1);
mcore_insn_debug (("MCORE: addi r1,%d\n", imm + 1));
}
else if (IS_SUBI1 (insn2))
{
adjust -= (imm + 1);
mcore_insn_debug (("MCORE: subi r1,%d\n", imm + 1));
}
else if (IS_RSUBI1 (insn2))
{
adjust = imm - adjust;
mcore_insn_debug (("MCORE: rsubi r1,%d\n", imm + 1));
}
else if (IS_NOT1 (insn2))
{
adjust = ~adjust;
mcore_insn_debug (("MCORE: not r1\n"));
}
else if (IS_ROTLI1 (insn2))
{
adjust <<= imm;
mcore_insn_debug (("MCORE: rotli r1,%d\n", imm + 1));
}
else if (IS_BSETI1 (insn2))
{
adjust |= (1 << imm);
mcore_insn_debug (("MCORE: bseti r1,%d\n", imm));
}
else if (IS_BCLRI1 (insn2))
{
adjust &= ~(1 << imm);
mcore_insn_debug (("MCORE: bclri r1,%d\n", imm));
}
else if (IS_IXH1 (insn2))
{
adjust *= 3;
mcore_insn_debug (("MCORE: ix.h r1,r1\n"));
}
else if (IS_IXW1 (insn2))
{
adjust *= 5;
mcore_insn_debug (("MCORE: ix.w r1,r1\n"));
}
offset += 2;
insn2 = get_insn (addr + offset);
};
mcore_insn_debug (("MCORE: done looking for r1 adjusters\n"));
/* If the next insn adjusts the stack pointer, we keep everything;
if not, we scrap it and we've found the end of the prologue. */
if (IS_SUB01 (insn2))
{
addr += offset;
framesize += adjust;
mcore_insn_debug (("MCORE: found stack adjustment of 0x%x bytes.\n", adjust));
mcore_insn_debug (("MCORE: skipping to new address 0x%x\n", addr));
mcore_insn_debug (("MCORE: continuing\n"));
continue;
}
/* None of these instructions are prologue, so don't touch
anything. */
mcore_insn_debug (("MCORE: no subu r1,r0, NOT altering framesize.\n"));
break;
}
/* This is not a prologue insn, so stop here. */
mcore_insn_debug (("MCORE: insn is not a prologue insn -- ending scan\n"));
break;
}
mcore_insn_debug (("MCORE: done analyzing prologue\n"));
mcore_insn_debug (("MCORE: prologue end = 0x%x\n", addr));
/* Save everything we have learned about this frame into FI. */
if (fi != NULL)
{
fi->extra_info->framesize = framesize;
fi->extra_info->fp_regnum = fp_regnum;
fi->extra_info->status = flags;
/* Fix the frame pointer. When gcc uses r8 as a frame pointer,
it is really an arg ptr. We adjust fi->frame to be a "real"
frame pointer. */
if (fi->next == NULL)
{
if (fi->extra_info->status & MY_FRAME_IN_SP)
fi->frame = read_sp () + framesize;
else
fi->frame = read_register (fp_regnum) + framesize;
}
/* Note where saved registers are stored. The offsets in REGISTER_OFFSETS
are computed relative to the top of the frame. */
for (rn = 0; rn < NUM_REGS; rn++)
{
if (register_offsets[rn] >= 0)
{
fi->saved_regs[rn] = fi->frame - register_offsets[rn];
mcore_insn_debug (("Saved register %s stored at 0x%08x, value=0x%08x\n",
mcore_register_names[rn], fi->saved_regs[rn],
read_memory_integer (fi->saved_regs[rn], 4)));
}
}
}
/* Return addr of first non-prologue insn. */
return addr;
}
/* Given a GDB frame, determine the address of the calling function's frame.
This will be used to create a new GDB frame struct, and then
INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame. */
CORE_ADDR
mcore_frame_chain (struct frame_info * fi)
{
struct frame_info *dummy;
CORE_ADDR callers_addr;
/* Analyze the prologue of this function. */
if (fi->extra_info->status == 0)
mcore_analyze_prologue (fi, 0, 0);
/* If mcore_analyze_prologue set NO_MORE_FRAMES, quit now. */
if (fi->extra_info->status & NO_MORE_FRAMES)
return 0;
/* Now that we've analyzed our prologue, we can start to ask
for information about our caller. The easiest way to do
this is to analyze our caller's prologue.
If our caller has a frame pointer, then we need to find
the value of that register upon entry to our frame.
This value is either in fi->saved_regs[rn] if it's saved,
or it's still in a register.
If our caller does not have a frame pointer, then his frame base
is <our base> + -<caller's frame size>. */
dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), fi->frame);
if (dummy->extra_info->status & MY_FRAME_IN_FP)
{
int fp = dummy->extra_info->fp_regnum;
/* Our caller has a frame pointer. */
if (fi->saved_regs[fp] != 0)
{
/* The "FP" was saved on the stack. Don't forget to adjust
the "FP" with the framesize to get a real FP. */
callers_addr = read_memory_integer (fi->saved_regs[fp], REGISTER_SIZE)
+ dummy->extra_info->framesize;
}
else
{
/* It's still in the register. Don't forget to adjust
the "FP" with the framesize to get a real FP. */
callers_addr = read_register (fp) + dummy->extra_info->framesize;
}
}
else
{
/* Our caller does not have a frame pointer. */
callers_addr = fi->frame + dummy->extra_info->framesize;
}
return callers_addr;
}
/* Skip the prologue of the function at PC. */
CORE_ADDR
mcore_skip_prologue (CORE_ADDR pc)
{
CORE_ADDR func_addr, func_end;
struct symtab_and_line sal;
/* If we have line debugging information, then the end of the
prologue should the first assembly instruction of the first
source line */
if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
{
sal = find_pc_line (func_addr, 0);
if (sal.end && sal.end < func_end)
return sal.end;
}
return mcore_analyze_prologue (NULL, pc, 1);
}
/* Return the address at which function arguments are offset. */
CORE_ADDR
mcore_frame_args_address (struct frame_info * fi)
{
return fi->frame - fi->extra_info->framesize;
}
CORE_ADDR
mcore_frame_locals_address (struct frame_info * fi)
{
return fi->frame - fi->extra_info->framesize;
}
/* Return the frame pointer in use at address PC. */
void
mcore_virtual_frame_pointer (CORE_ADDR pc, long *reg, long *offset)
{
struct frame_info *dummy = analyze_dummy_frame (pc, 0);
if (dummy->extra_info->status & MY_FRAME_IN_SP)
{
*reg = SP_REGNUM;
*offset = 0;
}
else
{
*reg = dummy->extra_info->fp_regnum;
*offset = 0;
}
}
/* Find the value of register REGNUM in frame FI. */
CORE_ADDR
mcore_find_callers_reg (struct frame_info *fi, int regnum)
{
for (; fi != NULL; fi = fi->next)
{
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
return generic_read_register_dummy (fi->pc, fi->frame, regnum);
else if (fi->saved_regs[regnum] != 0)
return read_memory_integer (fi->saved_regs[regnum],
REGISTER_SIZE);
}
return read_register (regnum);
}
/* Find the saved pc in frame FI. */
CORE_ADDR
mcore_frame_saved_pc (struct frame_info * fi)
{
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
return generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
else
return mcore_find_callers_reg (fi, PR_REGNUM);
}
/* INFERIOR FUNCTION CALLS */
/* This routine gets called when either the user uses the "return"
command, or the call dummy breakpoint gets hit. */
void
mcore_pop_frame (struct frame_info *fi)
{
int rn;
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
generic_pop_dummy_frame ();
else
{
/* Write out the PC we saved. */
write_register (PC_REGNUM, FRAME_SAVED_PC (fi));
/* Restore any saved registers. */
for (rn = 0; rn < NUM_REGS; rn++)
{
if (fi->saved_regs[rn] != 0)
{
ULONGEST value;
value = read_memory_unsigned_integer (fi->saved_regs[rn],
REGISTER_SIZE);
write_register (rn, value);
}
}
/* Actually cut back the stack. */
write_register (SP_REGNUM, FRAME_FP (fi));
}
/* Finally, throw away any cached frame information. */
flush_cached_frames ();
}
/* Setup arguments and PR for a call to the target. First six arguments
go in FIRST_ARGREG -> LAST_ARGREG, subsequent args go on to the stack.
* Types with lengths greater than REGISTER_SIZE may not be split
between registers and the stack, and they must start in an even-numbered
register. Subsequent args will go onto the stack.
* Structs may be split between registers and stack, left-aligned.
* If the function returns a struct which will not fit into registers (it's
more than eight bytes), we must allocate for that, too. Gdb will tell
us where this buffer is (STRUCT_ADDR), and we simply place it into
FIRST_ARGREG, since the MCORE treats struct returns (of less than eight
bytes) as hidden first arguments. */
CORE_ADDR
mcore_push_arguments (int nargs, value_ptr * args, CORE_ADDR sp,
unsigned char struct_return, CORE_ADDR struct_addr)
{
int argreg;
int argnum;
struct stack_arg
{
int len;
char *val;
}
*stack_args;
int nstack_args = 0;
stack_args = (struct stack_arg *) alloca (nargs * sizeof (struct stack_arg));
argreg = FIRST_ARGREG;
/* Align the stack. This is mostly a nop, but not always. It will be needed
if we call a function which has argument overflow. */
sp &= ~3;
/* If this function returns a struct which does not fit in the
return registers, we must pass a buffer to the function
which it can use to save the return value. */
if (struct_return)
write_register (argreg++, struct_addr);
/* FIXME: what about unions? */
for (argnum = 0; argnum < nargs; argnum++)
{
char *val = (char *) VALUE_CONTENTS (args[argnum]);
int len = TYPE_LENGTH (VALUE_TYPE (args[argnum]));
struct type *type = VALUE_TYPE (args[argnum]);
int olen;
mcore_insn_debug (("MCORE PUSH: argreg=%d; len=%d; %s\n",
argreg, len, TYPE_CODE (type) == TYPE_CODE_STRUCT ? "struct" : "not struct"));
/* Arguments larger than a register must start in an even
numbered register. */
olen = len;
if (TYPE_CODE (type) != TYPE_CODE_STRUCT && len > REGISTER_SIZE && argreg % 2)
{
mcore_insn_debug (("MCORE PUSH: %d > REGISTER_SIZE: and %s is not even\n",
len, mcore_register_names[argreg]));
argreg++;
}
if ((argreg <= LAST_ARGREG && len <= (LAST_ARGREG - argreg + 1) * REGISTER_SIZE)
|| (TYPE_CODE (type) == TYPE_CODE_STRUCT))
{
/* Something that will fit entirely into registers (or a struct
which may be split between registers and stack). */
mcore_insn_debug (("MCORE PUSH: arg %d going into regs\n", argnum));
if (TYPE_CODE (type) == TYPE_CODE_STRUCT && olen < REGISTER_SIZE)
{
/* Small structs must be right aligned within the register,
the most significant bits are undefined. */
write_register (argreg, extract_unsigned_integer (val, len));
argreg++;
len = 0;
}
while (len > 0 && argreg <= LAST_ARGREG)
{
write_register (argreg, extract_unsigned_integer (val, REGISTER_SIZE));
argreg++;
val += REGISTER_SIZE;
len -= REGISTER_SIZE;
}
/* Any remainder for the stack is noted below... */
}
else if (TYPE_CODE (VALUE_TYPE (args[argnum])) != TYPE_CODE_STRUCT
&& len > REGISTER_SIZE)
{
/* All subsequent args go onto the stack. */
mcore_insn_debug (("MCORE PUSH: does not fit into regs, going onto stack\n"));
argnum = LAST_ARGREG + 1;
}
if (len > 0)
{
/* Note that this must be saved onto the stack */
mcore_insn_debug (("MCORE PUSH: adding arg %d to stack\n", argnum));
stack_args[nstack_args].val = val;
stack_args[nstack_args].len = len;
nstack_args++;
}
}
/* We're done with registers and stack allocation. Now do the actual
stack pushes. */
while (nstack_args--)
{
sp -= stack_args[nstack_args].len;
write_memory (sp, stack_args[nstack_args].val, stack_args[nstack_args].len);
}
/* Return adjusted stack pointer. */
return sp;
}
/* Store the return address for the call dummy. For MCore, we've
opted to use generic call dummies, so we simply store the
CALL_DUMMY_ADDRESS into the PR register (r15). */
CORE_ADDR
mcore_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
{
write_register (PR_REGNUM, CALL_DUMMY_ADDRESS ());
return sp;
}
/* Setting/getting return values from functions.
The Motorola MCore processors use r2/r3 to return anything
not larger than 32 bits. Everything else goes into a caller-
supplied buffer, which is passed in via a hidden first
argument.
For gdb, this leaves us two routes, based on what
USE_STRUCT_CONVENTION (mcore_use_struct_convention) returns.
If this macro returns 1, gdb will call STORE_STRUCT_RETURN and
EXTRACT_STRUCT_VALUE_ADDRESS.
If USE_STRUCT_CONVENTION retruns 0, then gdb uses STORE_RETURN_VALUE
and EXTRACT_RETURN_VALUE to store/fetch the functions return value. */
/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
and TYPE is the type (which is known to be struct, union or array). */
int
mcore_use_struct_convention (int gcc_p, struct type *type)
{
return (TYPE_LENGTH (type) > 8);
}
/* Where is the return value saved? For MCore, a pointer to
this buffer was passed as a hidden first argument, so
just return that address. */
CORE_ADDR
mcore_extract_struct_value_address (char *regbuf)
{
return extract_address (regbuf + REGISTER_BYTE (FIRST_ARGREG), REGISTER_SIZE);
}
/* Given a function which returns a value of type TYPE, extract the
the function's return value and place the result into VALBUF.
REGBUF is the register contents of the target. */
void
mcore_extract_return_value (struct type *type, char *regbuf, char *valbuf)
{
/* Copy the return value (starting) in RETVAL_REGNUM to VALBUF. */
/* Only getting the first byte! if len = 1, we need the last byte of
the register, not the first. */
memcpy (valbuf, regbuf + REGISTER_BYTE (RETVAL_REGNUM) +
(TYPE_LENGTH (type) < 4 ? 4 - TYPE_LENGTH (type) : 0), TYPE_LENGTH (type));
}
/* Store the return value in VALBUF (of type TYPE) where the caller
expects to see it.
Values less than 32 bits are stored in r2, right justified and
sign or zero extended.
Values between 32 and 64 bits are stored in r2 (most
significant word) and r3 (least significant word, left justified).
Note that this includes structures of less than eight bytes, too. */
void
mcore_store_return_value (struct type *type, char *valbuf)
{
int value_size;
int return_size;
int offset;
char *zeros;
value_size = TYPE_LENGTH (type);
/* Return value fits into registers. */
return_size = (value_size + REGISTER_SIZE - 1) & ~(REGISTER_SIZE - 1);
offset = REGISTER_BYTE (RETVAL_REGNUM) + (return_size - value_size);
zeros = alloca (return_size);
memset (zeros, 0, return_size);
write_register_bytes (REGISTER_BYTE (RETVAL_REGNUM), zeros, return_size);
write_register_bytes (offset, valbuf, value_size);
}
/* Initialize our target-dependent "stuff" for this newly created frame.
This includes allocating space for saved registers and analyzing
the prologue of this frame. */
void
mcore_init_extra_frame_info (struct frame_info *fi)
{
if (fi->next)
fi->pc = FRAME_SAVED_PC (fi->next);
frame_saved_regs_zalloc (fi);
fi->extra_info = (struct frame_extra_info *)
frame_obstack_alloc (sizeof (struct frame_extra_info));
fi->extra_info->status = 0;
fi->extra_info->framesize = 0;
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
fi->frame = generic_read_register_dummy (fi->pc, fi->frame, SP_REGNUM);
}
else
mcore_analyze_prologue (fi, 0, 0);
}
/* Get an insturction from memory. */
static int
get_insn (CORE_ADDR pc)
{
char buf[4];
int status = read_memory_nobpt (pc, buf, 2);
if (status != 0)
return 0;
return extract_unsigned_integer (buf, 2);
}
void
_initialize_mcore_tdep ()
{
extern int print_insn_mcore (bfd_vma, disassemble_info *);
tm_print_insn = print_insn_mcore;
#ifdef MCORE_DEBUG
add_show_from_set (add_set_cmd ("mcoredebug", no_class,
var_boolean, (char *) &mcore_debug,
"Set mcore debugging.\n", &setlist),
&showlist);
#endif
}

View File

@ -51,8 +51,7 @@ static void
mipscoff_symfile_init PARAMS ((struct objfile *));
static void
mipscoff_symfile_read PARAMS ((struct objfile *, struct section_offsets *,
int));
mipscoff_symfile_read PARAMS ((struct objfile *, int));
static void
mipscoff_symfile_finish PARAMS ((struct objfile *));
@ -87,9 +86,8 @@ mipscoff_symfile_init (objfile)
/* Read a symbol file from a file. */
static void
mipscoff_symfile_read (objfile, section_offsets, mainline)
mipscoff_symfile_read (objfile, mainline)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
{
bfd *abfd = objfile->obfd;
@ -106,11 +104,11 @@ mipscoff_symfile_read (objfile, section_offsets, mainline)
error ("Error reading symbol table: %s", bfd_errmsg (bfd_get_error ()));
mdebug_build_psymtabs (objfile, &ecoff_backend (abfd)->debug_swap,
&ecoff_data (abfd)->debug_info, section_offsets);
&ecoff_data (abfd)->debug_info, objfile->section_offsets);
/* Add alpha coff dynamic symbols. */
read_alphacoff_dynamic_symtab (section_offsets, objfile);
read_alphacoff_dynamic_symtab (objfile->section_offsets, objfile);
/* Install any minimal symbols that have been collected as the current
minimal symbols for this objfile. */

View File

@ -42,11 +42,6 @@
#include "gdbcore.h"
#include "target.h"
#include "wait.h"
#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <signal.h>
#include <ctype.h>
#include "gdb_string.h"
@ -67,8 +62,6 @@ static void monitor_vsprintf PARAMS ((char *sndbuf, char *pattern, va_list args)
static int readchar PARAMS ((int timeout));
static void monitor_command PARAMS ((char *args, int fromtty));
static void monitor_fetch_register PARAMS ((int regno));
static void monitor_store_register PARAMS ((int regno));
@ -322,24 +315,13 @@ monitor_vsprintf (sndbuf, pattern, args)
Works just like printf. */
void
#ifdef ANSI_PROTOTYPES
monitor_printf_noecho (char *pattern,...)
#else
monitor_printf_noecho (va_alist)
va_dcl
#endif
{
va_list args;
char sndbuf[2000];
int len;
#if ANSI_PROTOTYPES
va_start (args, pattern);
#else
char *pattern;
va_start (args);
pattern = va_arg (args, char *);
#endif
monitor_vsprintf (sndbuf, pattern, args);
@ -366,24 +348,13 @@ monitor_printf_noecho (va_alist)
printf. */
void
#ifdef ANSI_PROTOTYPES
monitor_printf (char *pattern,...)
#else
monitor_printf (va_alist)
va_dcl
#endif
{
va_list args;
char sndbuf[2000];
int len;
#ifdef ANSI_PROTOTYPES
va_start (args, pattern);
#else
char *pattern;
va_start (args);
pattern = va_arg (args, char *);
#endif
monitor_vsprintf (sndbuf, pattern, args);
@ -2261,14 +2232,13 @@ monitor_stop ()
monitor_printf_noecho (current_monitor->stop);
}
/* Put a command string, in args, out to MONITOR. Output from MONITOR
is placed on the users terminal until the prompt is seen. FIXME: We
read the characters ourseleves here cause of a nasty echo. */
/* Put a COMMAND string out to MONITOR. Output from MONITOR is placed
in OUTPUT until the prompt is seen. FIXME: We read the characters
ourseleves here cause of a nasty echo. */
static void
monitor_command (args, from_tty)
char *args;
int from_tty;
monitor_rcmd (char *command,
struct gdb_file *outbuf)
{
char *p;
int resp_len;
@ -2282,11 +2252,11 @@ monitor_command (args, from_tty)
/* Send the command. Note that if no args were supplied, then we're
just sending the monitor a newline, which is sometimes useful. */
monitor_printf ("%s\r", (args ? args : ""));
monitor_printf ("%s\r", (command ? command : ""));
resp_len = monitor_expect_prompt (buf, sizeof buf);
fputs_unfiltered (buf, gdb_stdout); /* Output the response */
fputs_unfiltered (buf, outbuf); /* Output the response */
}
/* Convert hex digit A to a number. */
@ -2369,6 +2339,7 @@ init_base_monitor_ops (void)
monitor_ops.to_notice_signals = 0;
monitor_ops.to_thread_alive = 0;
monitor_ops.to_stop = monitor_stop;
monitor_ops.to_rcmd = monitor_rcmd;
monitor_ops.to_pid_to_exec_file = NULL;
monitor_ops.to_core_file_to_sym_file = NULL;
monitor_ops.to_stratum = process_stratum;
@ -2407,7 +2378,4 @@ _initialize_remote_monitors ()
When enabled, a hashmark \'#\' is displayed.",
&setlist),
&showlist);
add_com ("monitor", class_obscure, monitor_command,
"Send a command to the debug monitor.");
}

View File

@ -38,7 +38,7 @@ static void
nlm_symfile_init PARAMS ((struct objfile *));
static void
nlm_symfile_read PARAMS ((struct objfile *, struct section_offsets *, int));
nlm_symfile_read PARAMS ((struct objfile *, int));
static void
nlm_symfile_finish PARAMS ((struct objfile *));
@ -182,9 +182,8 @@ nlm_symtab_read (abfd, addr, objfile)
is not currently used. */
static void
nlm_symfile_read (objfile, section_offsets, mainline)
nlm_symfile_read (objfile, mainline)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
{
bfd *abfd = objfile->obfd;
@ -197,14 +196,14 @@ nlm_symfile_read (objfile, section_offsets, mainline)
/* FIXME, should take a section_offsets param, not just an offset. */
offset = ANOFFSET (section_offsets, 0);
offset = ANOFFSET (objfile->section_offsets, 0);
/* Process the NLM export records, which become the bfd's canonical symbol
table. */
nlm_symtab_read (abfd, offset, objfile);
stabsect_build_psymtabs (objfile, section_offsets, mainline, ".stab",
stabsect_build_psymtabs (objfile, mainline, ".stab",
".stabstr", ".text");
mainsym = lookup_symbol ("main", NULL, VAR_NAMESPACE, NULL, NULL);
@ -252,8 +251,7 @@ static struct sym_fns nlm_sym_fns =
nlm_symfile_init, /* sym_init: read initial info, setup for sym_read() */
nlm_symfile_read, /* sym_read: read a symbol file into symtab */
nlm_symfile_finish, /* sym_finish: finished with file, cleanup */
default_symfile_offsets,
/* sym_offsets: Translate ext. to int. relocation */
default_symfile_offsets, /* sym_offsets: Translate ext. to int. relocation */
NULL /* next: pointer to next struct sym_fns */
};

View File

@ -74,6 +74,11 @@ int mapped_symbol_files; /* Try to use mapped symbol files */
#define TARGET_KEEP_SECTION(ASECT) 0
#endif
/* Called via bfd_map_over_sections to build up the section table that
the objfile references. The objfile contains pointers to the start
of the table (objfile->sections) and to the first location after
the end of the table (objfile->sections_end). */
static void
add_to_objfile_sections (abfd, asect, objfile_p_char)
bfd *abfd;
@ -103,7 +108,19 @@ add_to_objfile_sections (abfd, asect, objfile_p_char)
/* Builds a section table for OBJFILE.
Returns 0 if OK, 1 on error (in which case bfd_error contains the
error). */
error).
Note that while we are building the table, which goes into the
psymbol obstack, we hijack the sections_end pointer to instead hold
a count of the number of sections. When bfd_map_over_sections
returns, this count is used to compute the pointer to the end of
the sections table, which then overwrites the count.
Also note that the OFFSET and OVLY_MAPPED in each table entry
are initialized to zero.
Also note that if anything else writes to the psymbol obstack while
we are building the table, we're pretty much hosed. */
int
build_objfile_section_table (objfile)
@ -632,8 +649,7 @@ objfile_relocate (objfile, new_offsets)
abfd = objfile->obfd;
for (s = objfile->sections;
s < objfile->sections_end; ++s)
ALL_OBJFILE_OSECTIONS (objfile, s)
{
flagword flags;
@ -944,8 +960,7 @@ find_pc_sect_section (pc, section)
struct obj_section *s;
struct objfile *objfile;
ALL_OBJFILES (objfile)
for (s = objfile->sections; s < objfile->sections_end; ++s)
ALL_OBJSECTIONS (objfile, s)
#if defined(HPUXHPPA)
if ((section == 0 || section == s->the_bfd_section) &&
s->addr <= pc && pc <= s->endaddr)

View File

@ -376,9 +376,13 @@ struct objfile
struct section_offsets *section_offsets;
int num_sections;
/* set of section begin and end addresses used to map pc addresses
into sections. Currently on the psymbol_obstack (which makes no
sense, but I'm not sure it's harming anything). */
/* These pointers are used to locate the section table, which
among other thigs, is used to map pc addresses into sections.
SECTIONS points to the first entry in the table, and
SECTIONS_END points to the first location past the last entry
in the table. Currently the table is stored on the
psymbol_obstack (which makes no sense, but I'm not sure it's
harming anything). */
struct obj_section
*sections, *sections_end;

View File

@ -152,7 +152,7 @@ static void
os9k_new_init PARAMS ((struct objfile *));
static void
os9k_symfile_read PARAMS ((struct objfile *, struct section_offsets *, int));
os9k_symfile_read PARAMS ((struct objfile *, int));
static void
os9k_symfile_finish PARAMS ((struct objfile *));
@ -332,9 +332,8 @@ read_minimal_symbols (objfile, section_offsets)
table (as opposed to a shared lib or dynamically loaded file). */
static void
os9k_symfile_read (objfile, section_offsets, mainline)
os9k_symfile_read (objfile, mainline)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline; /* FIXME comments above */
{
bfd *sym_bfd;
@ -350,11 +349,11 @@ os9k_symfile_read (objfile, section_offsets, mainline)
back_to = make_cleanup (really_free_pendings, 0);
make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
read_minimal_symbols (objfile, section_offsets);
read_minimal_symbols (objfile, objfile->section_offsets);
/* Now that the symbol table data of the executable file are all in core,
process them and define symbols accordingly. */
read_os9k_psymtab (section_offsets, objfile,
read_os9k_psymtab (objfile->section_offsets, objfile,
DBX_TEXT_ADDR (objfile),
DBX_TEXT_SIZE (objfile));
@ -1663,8 +1662,7 @@ static struct sym_fns os9k_sym_fns =
os9k_symfile_init, /* sym_init: read initial info, setup for sym_read() */
os9k_symfile_read, /* sym_read: read a symbol file into symtab */
os9k_symfile_finish, /* sym_finish: finished with file, cleanup */
default_symfile_offsets,
/* sym_offsets: parse user's offsets to internal form */
default_symfile_offsets, /* sym_offsets: parse user's offsets to internal form */
NULL /* next: pointer to next struct sym_fns */
};

View File

@ -591,7 +591,7 @@ symbol_add_stub (arg)
lowest_sect = bfd_get_section_by_name (so->abfd, ".text");
if (lowest_sect == NULL)
bfd_map_over_sections (so->abfd, find_lowest_section,
(PTR) & lowest_sect);
(PTR) &lowest_sect);
if (lowest_sect)
text_addr = bfd_section_vma (so->abfd, lowest_sect) + LM_OFFSET (so);
}

View File

@ -47,19 +47,19 @@ switch (CUR_SYMBOL_TYPE)
case N_TEXT | N_EXT:
case N_NBTEXT | N_EXT:
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
goto record_it;
case N_DATA | N_EXT:
case N_NBDATA | N_EXT:
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
goto record_it;
case N_BSS:
case N_BSS | N_EXT:
case N_NBBSS | N_EXT:
case N_SETV | N_EXT: /* FIXME, is this in BSS? */
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_BSS);
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS);
goto record_it;
case N_ABS | N_EXT:
@ -86,7 +86,7 @@ switch (CUR_SYMBOL_TYPE)
case N_FN_SEQ:
case N_TEXT:
#ifdef DBXREAD_ONLY
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
SET_NAMESTRING ();
if ((namestring[0] == '-' && namestring[1] == 'l')
|| (namestring[(nsl = strlen (namestring)) - 1] == 'o'
@ -122,7 +122,7 @@ switch (CUR_SYMBOL_TYPE)
continue;
case N_DATA:
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
goto record_it;
case N_UNDF | N_EXT:
@ -204,7 +204,7 @@ switch (CUR_SYMBOL_TYPE)
char *p;
int prev_textlow_not_set;
valu = CUR_SYMBOL_VALUE + ANOFFSET (section_offsets, SECT_OFF_TEXT);
valu = CUR_SYMBOL_VALUE + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
prev_textlow_not_set = textlow_not_set;
@ -266,7 +266,7 @@ switch (CUR_SYMBOL_TYPE)
immediately follow the first. */
if (!pst)
pst = START_PSYMTAB (objfile, section_offsets,
pst = START_PSYMTAB (objfile, objfile->section_offsets,
namestring, valu,
first_so_symnum * symbol_size,
objfile->global_psymbols.next,
@ -424,7 +424,7 @@ switch (CUR_SYMBOL_TYPE)
switch (p[1])
{
case 'S':
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
#ifdef STATIC_TRANSFORM_NAME
namestring = STATIC_TRANSFORM_NAME (namestring);
#endif
@ -435,7 +435,7 @@ switch (CUR_SYMBOL_TYPE)
psymtab_language, objfile);
continue;
case 'G':
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA);
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA);
/* The addresses in these entries are reported to be
wrong. See the code that reads 'G's for symtabs. */
add_psymbol_to_list (namestring, p - namestring,
@ -576,7 +576,7 @@ switch (CUR_SYMBOL_TYPE)
continue;
case 'f':
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
#ifdef DBXREAD_ONLY
/* Keep track of the start of the last function so we
can handle end of function symbols. */
@ -602,7 +602,7 @@ switch (CUR_SYMBOL_TYPE)
if (textlow_not_set
|| (CUR_SYMBOL_VALUE < pst->textlow
&& CUR_SYMBOL_VALUE
!= ANOFFSET (section_offsets, SECT_OFF_TEXT)))
!= ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)))
{
pst->textlow = CUR_SYMBOL_VALUE;
textlow_not_set = 0;
@ -619,7 +619,7 @@ switch (CUR_SYMBOL_TYPE)
are put into the global psymtab like one would expect.
They're also in the minimal symbol table. */
case 'F':
CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_TEXT);
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
#ifdef DBXREAD_ONLY
/* Keep track of the start of the last function so we
can handle end of function symbols. */
@ -644,7 +644,7 @@ switch (CUR_SYMBOL_TYPE)
if (textlow_not_set
|| (CUR_SYMBOL_VALUE < pst->textlow
&& CUR_SYMBOL_VALUE
!= ANOFFSET (section_offsets, SECT_OFF_TEXT)))
!= ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)))
{
pst->textlow = CUR_SYMBOL_VALUE;
textlow_not_set = 0;

View File

@ -29,11 +29,6 @@
#include "gdbcore.h"
#include "target.h"
#include "wait.h"
#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <ctype.h>
#include <signal.h>
#include <sys/types.h>
@ -200,24 +195,13 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
* printf_monitor -- send data to monitor. Works just like printf.
*/
static void
#ifdef ANSI_PROTOTYPES
printf_monitor (char *pattern,...)
#else
printf_monitor (va_alist)
va_dcl
#endif
{
va_list args;
char buf[PBUFSIZ];
int i;
#ifdef ANSI_PROTOTYPES
va_start (args, pattern);
#else
char *pattern;
va_start (args);
pattern = va_arg (args, char *);
#endif
vsprintf (buf, pattern, args);
@ -251,12 +235,7 @@ write_monitor (data, len)
* to be formatted and printed. A CR is added after each string is printed.
*/
static void
#ifdef ANSI_PROTOTYPES
debuglogs (int level, char *pattern,...)
#else
debuglogs (va_alist)
va_dcl
#endif
{
va_list args;
char *p;
@ -264,15 +243,7 @@ debuglogs (va_alist)
char newbuf[PBUFSIZ];
int i;
#ifdef ANSI_PROTOTYPES
va_start (args, pattern);
#else
char *pattern;
int level;
va_start (args);
level = va_arg (args, int); /* get the debug level */
pattern = va_arg (args, char *); /* get the printf style pattern */
#endif
if ((level < 0) || (level > 100))
{

View File

@ -35,11 +35,6 @@
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
#endif
/* Microsoft C's stat.h doesn't define all the POSIX file modes. */
#ifndef S_IROTH
@ -487,22 +482,11 @@ close_ports ()
inconsistent state. */
static NORETURN void
#ifdef ANSI_PROTOTYPES
mips_error (char *string,...)
#else
mips_error (va_alist)
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, string);
#else
char *string;
va_start (args);
string = va_arg (args, char *);
#endif
target_terminal_ours ();
wrap_here (""); /* Force out any buffered output */
@ -1279,7 +1263,7 @@ mips_request (cmd, addr, data, perr, timeout, buff)
if (cmd != '\0')
{
if (mips_need_reply)
fatal ("mips_request: Trying to send command before reply");
internal_error ("mips_request: Trying to send command before reply");
sprintf (buff, "0x0 %c 0x%s 0x%s", cmd, paddr_nz (addr), paddr_nz (data));
mips_send_packet (buff, 1);
mips_need_reply = 1;
@ -1289,7 +1273,7 @@ mips_request (cmd, addr, data, perr, timeout, buff)
return 0;
if (!mips_need_reply)
fatal ("mips_request: Trying to get reply before command");
internal_error ("mips_request: Trying to get reply before command");
mips_need_reply = 0;

View File

@ -41,11 +41,6 @@
#include "gdbcore.h"
#include "target.h"
#include "wait.h"
#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <signal.h>
#include "gdb_string.h"
#include <sys/types.h>
@ -93,24 +88,13 @@ static char readbuf[16];
/* Send data to monitor. Works just like printf. */
static void
#ifdef ANSI_PROTOTYPES
printf_monitor (char *pattern,...)
#else
printf_monitor (va_alist)
va_dcl
#endif
{
va_list args;
char buf[200];
int i;
#ifdef ANSI_PROTOTYPES
va_start (args, pattern);
#else
char *pattern;
va_start (args);
pattern = va_arg (args, char *);
#endif
vsprintf (buf, pattern, args);
va_end (args);

View File

@ -426,6 +426,7 @@ arm_rdi_close (quitting)
}
closed_already = 1;
inferior_pid = 0;
Adp_CloseDevice ();
}
}

View File

@ -42,11 +42,6 @@
#include "value.h"
#include "callback.h"
#include "command.h"
#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <ctype.h>
#include <fcntl.h>
#include "symfile.h"
@ -379,23 +374,13 @@ rdp_init (cold, tty)
}
#ifdef ANSI_PROTOTYPES
void
send_rdp (char *template,...)
#else
void
send_rdp (char *template, va_alist)
va_dcl
#endif
{
char buf[200];
char *dst = buf;
va_list alist;
#ifdef ANSI_PROTOTYPES
va_start (alist, template);
#else
va_start (alist);
#endif
while (*template)
{

View File

@ -243,25 +243,11 @@ gdb_os_flush_stderr (p)
/* GDB version of printf_filtered callback. */
/* VARARGS */
static void
#ifdef ANSI_PROTOTYPES
gdb_os_printf_filtered (host_callback * p, const char *format,...)
#else
gdb_os_printf_filtered (p, va_alist)
host_callback *p;
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
char *format;
va_start (args);
format = va_arg (args, char *);
#endif
vfprintf_filtered (gdb_stdout, format, args);
@ -270,61 +256,31 @@ gdb_os_printf_filtered (p, va_alist)
/* GDB version of error vprintf_filtered. */
/* VARARGS */
static void
#ifdef ANSI_PROTOTYPES
gdb_os_vprintf_filtered (host_callback * p, const char *format, va_list ap)
#else
gdb_os_vprintf_filtered (p, format, ap)
host_callback *p;
char *format;
va_list ap;
#endif
{
vfprintf_filtered (gdb_stdout, format, ap);
}
/* GDB version of error evprintf_filtered. */
/* VARARGS */
static void
#ifdef ANSI_PROTOTYPES
gdb_os_evprintf_filtered (host_callback * p, const char *format, va_list ap)
#else
gdb_os_evprintf_filtered (p, format, ap)
host_callback *p;
char *format;
va_list ap;
#endif
{
vfprintf_filtered (gdb_stderr, format, ap);
}
/* GDB version of error callback. */
/* VARARGS */
static void
#ifdef ANSI_PROTOTYPES
gdb_os_error (host_callback * p, const char *format,...)
#else
gdb_os_error (p, va_alist)
host_callback *p;
va_dcl
#endif
{
if (error_hook)
(*error_hook) ();
else
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
char *format;
va_start (args);
format = va_arg (args, char *);
#endif
error_begin ();
vfprintf_filtered (gdb_stderr, format, args);
@ -386,7 +342,7 @@ gdbsim_store_register (regno)
read_register_gen (regno, tmp);
nr_bytes = sim_store_register (gdbsim_desc, regno, tmp, REGISTER_RAW_SIZE (regno));
if (nr_bytes > 0 && nr_bytes != REGISTER_RAW_SIZE (regno))
fatal ("Register size different to expected");
internal_error ("Register size different to expected");
if (sr_get_debug ())
{
printf_filtered ("gdbsim_store_register: %d", regno);
@ -539,7 +495,7 @@ gdbsim_open (args, from_tty)
strcat (arg_buf, " -E little");
break;
default:
fatal ("Value of TARGET_BYTE_ORDER unknown");
internal_error ("Value of TARGET_BYTE_ORDER unknown");
}
}
/* Specify the architecture of the target when it has been

View File

@ -39,11 +39,6 @@
#include "gdbcore.h"
#include "target.h"
#include "wait.h"
#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <signal.h>
#include "gdb_string.h"
#include <sys/types.h>
@ -71,23 +66,12 @@ static serial_t st2000_desc;
/* Send data to stdebug. Works just like printf. */
static void
#ifdef ANSI_PROTOTYPES
printf_stdebug (char *pattern,...)
#else
printf_stdebug (va_alist)
va_dcl
#endif
{
va_list args;
char buf[200];
#ifdef ANSI_PROTOTYPES
va_start (args, pattern);
#else
char *pattern;
va_start (args);
pattern = va_arg (args, char *);
#endif
vsprintf (buf, pattern, args);
va_end (args);

View File

@ -1026,8 +1026,8 @@ vx_wait (pid_to_wait_for, status)
sleep_ms (200); /* FIXME Don't kill the network too badly */
}
else if (pid != inferior_pid)
fatal ("Bad pid for debugged task: %s\n",
local_hex_string ((unsigned long) pid));
internal_error ("Bad pid for debugged task: %s\n",
local_hex_string ((unsigned long) pid));
}
while (pid == 0);

View File

@ -18,188 +18,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* *INDENT-OFF* */
/* Remote communication protocol.
A debug packet whose contents are <data>
is encapsulated for transmission in the form:
$ <data> # CSUM1 CSUM2
<data> must be ASCII alphanumeric and cannot include characters
'$' or '#'. If <data> starts with two characters followed by
':', then the existing stubs interpret this as a sequence number.
CSUM1 and CSUM2 are ascii hex representation of an 8-bit
checksum of <data>, the most significant nibble is sent first.
the hex digits 0-9,a-f are used.
Receiver responds with:
+ - if CSUM is correct and ready for next packet
- - if CSUM is incorrect
<data> is as follows:
Most values are encoded in ascii hex digits. Signal numbers are according
to the numbering in target.h.
Request Packet
set thread Hct... Set thread for subsequent operations.
c = 'c' for thread used in step and
continue; t... can be -1 for all
threads.
c = 'g' for thread used in other
operations. If zero, pick a thread,
any thread.
reply OK for success
ENN for an error.
read registers g
reply XX....X Each byte of register data
is described by two hex digits.
Registers are in the internal order
for GDB, and the bytes in a register
are in the same order the machine uses.
or ENN for an error.
write regs GXX..XX Each byte of register data
is described by two hex digits.
reply OK for success
ENN for an error
write reg Pn...=r... Write register n... with value r...,
which contains two hex digits for each
byte in the register (target byte
order).
reply OK for success
ENN for an error
(not supported by all stubs).
read mem mAA..AA,LLLL AA..AA is address, LLLL is length.
reply XX..XX XX..XX is mem contents
Can be fewer bytes than requested
if able to read only part of the data.
or ENN NN is errno
write mem MAA..AA,LLLL:XX..XX
AA..AA is address,
LLLL is number of bytes,
XX..XX is data
reply OK for success
ENN for an error (this includes the case
where only part of the data was
written).
write mem XAA..AA,LLLL:XX..XX
(binary) AA..AA is address,
LLLL is number of bytes,
XX..XX is binary data
reply OK for success
ENN for an error
continue cAA..AA AA..AA is address to resume
If AA..AA is omitted,
resume at same address.
step sAA..AA AA..AA is address to resume
If AA..AA is omitted,
resume at same address.
continue with Csig;AA..AA Continue with signal sig (hex signal
signal number). If ;AA..AA is omitted,
resume at same address.
step with Ssig;AA..AA Like 'C' but step not continue.
signal
last signal ? Reply the current reason for stopping.
This is the same reply as is generated
for step or cont : SAA where AA is the
signal number.
detach D Reply OK.
There is no immediate reply to step or cont.
The reply comes when the machine stops.
It is SAA AA is the signal number.
or... TAAn...:r...;n...:r...;n...:r...;
AA = signal number
n... = register number (hex)
r... = register contents
n... = `thread'
r... = thread process ID. This is
a hex integer.
n... = other string not starting
with valid hex digit.
gdb should ignore this n,r pair
and go on to the next. This way
we can extend the protocol.
or... WAA The process exited, and AA is
the exit status. This is only
applicable for certains sorts of
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
should continue to wait for
'W', 'T', etc.
thread alive TXX Find out if the thread XX is alive.
reply OK thread is still alive
ENN thread is dead
remote restart RXX Restart the remote server
extended ops ! Use the extended remote protocol.
Sticky -- only needs to be set once.
kill request k
toggle debug d toggle debug flag (see 386 & 68k stubs)
reset r reset -- see sparc stub.
reserved <other> On other requests, the stub should
ignore the request and send an empty
response ($#<checksum>). This way
we can extend the protocol and GDB
can tell whether the stub it is
talking to uses the old or the new.
search tAA:PP,MM Search backwards starting at address
AA for a match with pattern PP and
mask MM. PP and MM are 4 bytes.
Not supported by all stubs.
general query qXXXX Request info about XXXX.
general set QXXXX=yyyy Set value of XXXX to yyyy.
query sect offs qOffsets Get section offsets. Reply is
Text=xxx;Data=yyy;Bss=zzz
Responses can be run-length encoded to save space. A '*' means that
the next character is an ASCII encoding giving a repeat count which
stands for that many repititions of the character preceding the '*'.
The encoding is n+29, yielding a printable character where n >=3
(which is where rle starts to win). Don't use an n > 126.
So
"0* " means the same as "0000". */
/* *INDENT-ON* */
/* See the GDB User Guide for details of the GDB remote protocol. */
#include "defs.h"
#include "gdb_string.h"
@ -401,6 +221,13 @@ static void set_remote_protocol_P_packet_cmd PARAMS ((char *args,
static void show_remote_protocol_P_packet_cmd PARAMS ((char *args,
int from_tty));
static void set_remote_protocol_Z_packet_cmd PARAMS ((char *args,
int from_tty,
struct cmd_list_element * c));
static void show_remote_protocol_Z_packet_cmd PARAMS ((char *args,
int from_tty));
@ -447,17 +274,6 @@ static serial_t remote_desc = NULL;
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
the stub does not understand it. This switch is still needed, though
in cases when the packet is supported in the stub, but the connection
does not allow it (i.e., 7-bit serial connection only). */
static int remote_binary_download = 1;
/* Have we already checked whether binary downloads work? */
static int remote_binary_checked;
/* Maximum number of bytes to read/write at once. The value here
is chosen to fill up a packet (the headers account for the 32). */
#define MAXBUFBYTES(N) (((N)-32)/2)
@ -558,7 +374,7 @@ set_packet_config_cmd (config, c)
config->support = PACKET_SUPPORT_UNKNOWN;
}
else
fatal ("Bad enum value");
internal_error ("Bad enum value");
}
static void
@ -657,6 +473,54 @@ show_remote_protocol_P_packet_cmd (args, from_tty)
show_packet_config_cmd (&remote_protocol_P);
}
/* Should we try the 'Z' (set breakpoint) request? */
static struct packet_config remote_protocol_Z;
static void
set_remote_protocol_Z_packet_cmd (args, from_tty, c)
char *args;
int from_tty;
struct cmd_list_element *c;
{
set_packet_config_cmd (&remote_protocol_Z, c);
}
static void
show_remote_protocol_Z_packet_cmd (args, from_tty)
char *args;
int from_tty;
{
show_packet_config_cmd (&remote_protocol_Z);
}
/* Should we try the 'X' (remote binary download) packet?
This variable (available to the user via "set remote X-packet")
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 the stub does not understand it. This switch is still
needed, though in cases when the packet is supported in the stub,
but the connection does not allow it (i.e., 7-bit serial connection
only). */
static struct packet_config remote_protocol_binary_download;
static void
set_remote_protocol_binary_download_cmd (char *args,
int from_tty,
struct cmd_list_element *c)
{
set_packet_config_cmd (&remote_protocol_binary_download, c);
}
static void
show_remote_protocol_binary_download_cmd (char *args,
int from_tty)
{
show_packet_config_cmd (&remote_protocol_binary_download);
}
/* Tokens for use by the asynchronous signal handlers for SIGINT */
PTR sigint_remote_twice_token;
@ -1742,7 +1606,7 @@ remote_cisco_section_offsets (text_addr, data_addr, bss_addr,
* Relocate the symbol file for a remote target.
*/
static void
void
remote_cisco_objfile_relocate (text_off, data_off, bss_off)
bfd_signed_vma text_off;
bfd_signed_vma data_off;
@ -1902,13 +1766,14 @@ serial device is attached to the remote system (e.g. /dev/ttya).");
push_target (target); /* Switch to using remote target now */
init_packet_config (&remote_protocol_P);
init_packet_config (&remote_protocol_Z);
general_thread = -2;
continue_thread = -2;
/* Force remote_write_bytes to check whether target supports
binary downloading. */
remote_binary_checked = 0;
init_packet_config (&remote_protocol_binary_download);
/* Without this, some commands which require an active target (such
as kill) won't work. This variable serves (at least) double duty
@ -1992,13 +1857,14 @@ serial device is attached to the remote system (e.g. /dev/ttya).");
push_target (target); /* Switch to using remote target now */
init_packet_config (&remote_protocol_P);
init_packet_config (&remote_protocol_Z);
general_thread = -2;
continue_thread = -2;
/* Force remote_write_bytes to check whether target supports
binary downloading. */
remote_binary_checked = 0;
init_packet_config (&remote_protocol_binary_download);
/* If running asynchronously, set things up for telling the target
to use the extended protocol. This will happen only after the
@ -2074,6 +1940,7 @@ remote_detach (args, from_tty)
pop_target ();
if (from_tty)
puts_filtered ("Ending remote debugging.\n");
}
/* Same as remote_detach, but with async support. */
@ -3103,41 +2970,52 @@ remote_address_masked (addr)
the whole packet, since many stubs strip the eighth bit and subsequently
compute a wrong checksum, which causes real havoc with remote_write_bytes.
NOTE: This can still lose if the serial line is not eight-bit clean. In
cases like this, the user should clear "remotebinarydownload". */
NOTE: This can still lose if the serial line is not eight-bit
clean. In cases like this, the user should clear "remote
X-packet". */
static void
check_binary_download (addr)
CORE_ADDR addr;
{
if (remote_binary_download && !remote_binary_checked)
switch (remote_protocol_binary_download.support)
{
char *buf = alloca (PBUFSIZ);
char *p;
remote_binary_checked = 1;
case PACKET_DISABLE:
break;
case PACKET_ENABLE:
break;
case PACKET_SUPPORT_UNKNOWN:
{
char *buf = alloca (PBUFSIZ);
char *p;
p = buf;
*p++ = 'X';
p += hexnumstr (p, (ULONGEST) addr);
*p++ = ',';
p += hexnumstr (p, (ULONGEST) 0);
*p++ = ':';
*p = '\0';
putpkt_binary (buf, (int) (p - buf));
getpkt (buf, 0);
p = buf;
*p++ = 'X';
p += hexnumstr (p, (ULONGEST) addr);
*p++ = ',';
p += hexnumstr (p, (ULONGEST) 0);
*p++ = ':';
*p = '\0';
putpkt_binary (buf, (int) (p - buf));
getpkt (buf, 0);
if (buf[0] == '\0')
remote_binary_download = 0;
}
if (remote_debug)
{
if (remote_binary_download)
fprintf_unfiltered (gdb_stdlog,
"binary downloading suppported by target\n");
else
fprintf_unfiltered (gdb_stdlog,
"binary downloading NOT suppported by target\n");
if (buf[0] == '\0')
{
if (remote_debug)
fprintf_unfiltered (gdb_stdlog,
"binary downloading NOT suppported by target\n");
remote_protocol_binary_download.support = PACKET_DISABLE;
}
else
{
if (remote_debug)
fprintf_unfiltered (gdb_stdlog,
"binary downloading suppported by target\n");
remote_protocol_binary_download.support = PACKET_ENABLE;
}
break;
}
}
}
@ -3182,15 +3060,18 @@ remote_write_bytes (memaddr, myaddr, len)
/* sprintf (buf, "M%lx,%x:", (unsigned long) memaddr, todo); */
memaddr = remote_address_masked (memaddr);
p = buf;
if (remote_binary_download)
switch (remote_protocol_binary_download.support)
{
case PACKET_ENABLE:
*p++ = 'X';
todo = min (len, max_buf_size);
}
else
{
break;
case PACKET_DISABLE:
*p++ = 'M';
todo = min (len, max_buf_size / 2); /* num bytes that will fit */
break;
case PACKET_SUPPORT_UNKNOWN:
internal_error ("remote_write_bytes: bad switch");
}
p += hexnumstr (p, (ULONGEST) memaddr);
@ -3204,50 +3085,57 @@ remote_write_bytes (memaddr, myaddr, len)
/* We send target system values byte by byte, in increasing byte
addresses, each byte encoded as two hex characters (or one
binary character). */
if (remote_binary_download)
switch (remote_protocol_binary_download.support)
{
int escaped = 0;
for (i = 0;
(i < todo) && (i + escaped) < (max_buf_size - 2);
i++)
{
switch (myaddr[i] & 0xff)
{
case '$':
case '#':
case 0x7d:
/* These must be escaped */
escaped++;
*p++ = 0x7d;
*p++ = (myaddr[i] & 0xff) ^ 0x20;
break;
default:
*p++ = myaddr[i] & 0xff;
break;
}
}
if (i < todo)
{
/* Escape chars have filled up the buffer prematurely,
and we have actually sent fewer bytes than planned.
Fix-up the length field of the packet. */
/* FIXME: will fail if new len is a shorter string than
old len. */
plen += hexnumstr (plen, (ULONGEST) i);
*plen++ = ':';
}
}
else
{
for (i = 0; i < todo; i++)
{
*p++ = tohex ((myaddr[i] >> 4) & 0xf);
*p++ = tohex (myaddr[i] & 0xf);
}
*p = '\0';
case PACKET_ENABLE:
{
int escaped = 0;
for (i = 0;
(i < todo) && (i + escaped) < (max_buf_size - 2);
i++)
{
switch (myaddr[i] & 0xff)
{
case '$':
case '#':
case 0x7d:
/* These must be escaped */
escaped++;
*p++ = 0x7d;
*p++ = (myaddr[i] & 0xff) ^ 0x20;
break;
default:
*p++ = myaddr[i] & 0xff;
break;
}
}
if (i < todo)
{
/* Escape chars have filled up the buffer prematurely,
and we have actually sent fewer bytes than planned.
Fix-up the length field of the packet. */
/* FIXME: will fail if new len is a shorter string than
old len. */
plen += hexnumstr (plen, (ULONGEST) i);
*plen++ = ':';
}
break;
}
case PACKET_DISABLE:
{
for (i = 0; i < todo; i++)
{
*p++ = tohex ((myaddr[i] >> 4) & 0xf);
*p++ = tohex (myaddr[i] & 0xf);
}
*p = '\0';
break;
}
case PACKET_SUPPORT_UNKNOWN:
internal_error ("remote_write_bytes: bad switch");
}
putpkt_binary (buf, (int) (p - buf));
@ -4032,7 +3920,52 @@ remote_insert_breakpoint (addr, contents_cache)
{
#ifdef REMOTE_BREAKPOINT
int val;
#endif
int bp_size;
/* Try the "Z" packet if it is not already disabled.
If it succeeds, then set the support to PACKET_ENABLE.
If it fails, and the user has explicitly requested the Z support
then report an error, otherwise, mark it disabled and go on. */
if ((remote_protocol_Z.support == PACKET_ENABLE)
|| (remote_protocol_Z.support == PACKET_SUPPORT_UNKNOWN))
{
char buf[PBUFSIZ], *p = buf;
addr = remote_address_masked (addr);
*(p++) = 'Z';
*(p++) = '0';
*(p++) = ',';
p += hexnumstr (p, (ULONGEST) addr);
BREAKPOINT_FROM_PC (&addr, &bp_size);
sprintf (p, ",%d", bp_size);
putpkt (buf);
getpkt (buf, 0);
if (buf[0] != '\0')
{
remote_protocol_Z.support = PACKET_ENABLE;
return (buf[0] == 'E');
}
/* The stub does not support the 'Z' request. If the user has
explicitly requested the Z support, or if the stub previously
said it supported the packet, this is an error,
otherwise, mark it disabled. */
else if (remote_protocol_Z.support == PACKET_ENABLE)
{
error ("Protocol error: Z packet not recognized by stub");
}
else
{
remote_protocol_Z.support = PACKET_DISABLE;
}
}
#ifdef REMOTE_BREAKPOINT
val = target_read_memory (addr, contents_cache, sizeof big_break_insn);
if (val == 0)
@ -4056,6 +3989,29 @@ remote_remove_breakpoint (addr, contents_cache)
CORE_ADDR addr;
char *contents_cache;
{
char buf[PBUFSIZ];
int bp_size;
if ((remote_protocol_Z.support == PACKET_ENABLE)
|| (remote_protocol_Z.support == PACKET_SUPPORT_UNKNOWN))
{
char buf[PBUFSIZ], *p = buf;
*(p++) = 'z';
*(p++) = '0';
*(p++) = ',';
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
BREAKPOINT_FROM_PC (&addr, &bp_size);
sprintf (p, ",%d", bp_size);
putpkt (buf);
getpkt (buf, 0);
return (buf[0] == 'E');
}
#ifdef REMOTE_BREAKPOINT
return target_write_memory (addr, contents_cache, sizeof big_break_insn);
#else
@ -4063,6 +4019,107 @@ remote_remove_breakpoint (addr, contents_cache)
#endif /* REMOTE_BREAKPOINT */
}
#ifdef TARGET_HAS_HARDWARE_WATCHPOINTS
int
remote_insert_watchpoint (addr, len, type)
CORE_ADDR addr;
int len;
int type;
{
char buf[PBUFSIZ], *p;
if (remote_protocol_Z.support == PACKET_DISABLE)
error ("Can't set hardware watchpoints without the 'Z' packet\n");
sprintf (buf, "Z%x,", type + 2 );
p = strchr (buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
sprintf (p, ",%lx", len);
putpkt (buf);
getpkt (buf, 0);
if (buf[0] == '\0' || buf [0] == 'E')
return -1;
return 0;
}
int
remote_remove_watchpoint (addr, len, type)
CORE_ADDR addr;
int len;
int type;
{
char buf[PBUFSIZ], *p;
sprintf (buf, "z%x,", type + 2 );
p = strchr (buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
sprintf (p, ",%lx", len);
putpkt (buf);
getpkt (buf, 0);
if (buf[0] == '\0' || buf [0] == 'E')
return -1;
return 0;
}
int
remote_insert_hw_breakpoint (addr, len)
CORE_ADDR addr;
int len;
{
char buf[PBUFSIZ], *p = buf;
if (remote_protocol_Z.support == PACKET_DISABLE)
error ("Can't set hardware breakpoints without the 'Z' packet\n");
*(p++) = 'Z';
*(p++) = '1';
*(p++) = ',';
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
*p = '\0';
putpkt (buf);
getpkt (buf, 0);
if (buf[0] == '\0' || buf [0] == 'E')
return -1;
return 0;
}
int
remote_remove_hw_breakpoint (addr, len)
CORE_ADDR addr;
int len;
{
char buf[PBUFSIZ], *p = buf;
*(p++) = 'z';
*(p++) = '1';
*(p++) = ',';
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
*p = '\0';
putpkt(buf);
getpkt (buf, 0);
if (buf[0] == '\0' || buf [0] == 'E')
return -1;
return 0;
}
#endif
/* Some targets are only capable of doing downloads, and afterwards
they switch to the remote serial protocol. This function provides
a clean way to get from the download target to the remote target.
@ -4286,6 +4343,59 @@ remote_query (query_type, buf, outbuf, bufsiz)
return 0;
}
static void
remote_rcmd (char *command,
struct gdb_file *outbuf)
{
int i;
char *buf = alloca (PBUFSIZ);
char *p = buf;
if (!remote_desc)
error ("remote rcmd is only available after target open");
/* The query prefix */
strcpy (buf, "qRcmd,");
p = strchr (buf, '\0');
if ((strlen (buf) + strlen (command) * 2 + 8/*misc*/) > PBUFSIZ)
error ("\"monitor\" command ``%s'' is too long\n", command);
/* Encode the actual command */
for (i = 0; command[i]; i++)
{
*p++ = tohex ((command[i] >> 4) & 0xf);
*p++ = tohex (command[i] & 0xf);
}
*p = '\0';
if (putpkt (buf) < 0)
error ("Communication problem with target\n");
/* get/display the response */
while (1)
{
/* XXX - see also tracepoint.c:remote_get_noisy_reply() */
buf[0] = '\0';
getpkt (buf, 0);
if (buf[0] == '\0')
error ("Target does not support this command\n");
if (buf[0] == 'O' && buf[1] != 'K')
{
remote_console_output (buf + 1); /* 'O' message from stub */
continue;
}
if (strcmp (buf, "OK") == 0)
break;
for (p = buf; p[0] != '\0' && p[1] != '\0'; p += 2)
{
char c = (fromhex (p[0]) << 4) + fromhex (p[1]);
fputc_unfiltered (c, outbuf);
}
break;
}
}
static void
packet_command (args, from_tty)
char *args;
@ -4498,6 +4608,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
remote_ops.to_find_new_threads = remote_threads_info;
remote_ops.to_stop = remote_stop;
remote_ops.to_query = remote_query;
remote_ops.to_rcmd = remote_rcmd;
remote_ops.to_stratum = process_stratum;
remote_ops.to_has_all_memory = 1;
remote_ops.to_has_memory = 1;
@ -4623,13 +4734,14 @@ device is attached to the remote system (e.g. host:port).");
push_target (&remote_cisco_ops); /* Switch to using cisco target now */
init_packet_config (&remote_protocol_P);
init_packet_config (&remote_protocol_Z);
general_thread = -2;
continue_thread = -2;
/* Force remote_write_bytes to check whether target supports
binary downloading. */
remote_binary_checked = 0;
init_packet_config (&remote_protocol_binary_download);
/* Without this, some commands which require an active target (such
as kill) won't work. This variable serves (at least) double duty
@ -4952,6 +5064,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
remote_async_ops.to_find_new_threads = remote_threads_info;
remote_async_ops.to_stop = remote_stop;
remote_async_ops.to_query = remote_query;
remote_async_ops.to_rcmd = remote_rcmd;
remote_async_ops.to_stratum = process_stratum;
remote_async_ops.to_has_all_memory = 1;
remote_async_ops.to_has_memory = 1;
@ -5088,11 +5201,20 @@ in a memory packet.\n",
&setlist),
&showlist);
add_packet_config_cmd (&remote_protocol_binary_download,
"X", "binary-download",
set_remote_protocol_binary_download_cmd,
show_remote_protocol_binary_download_cmd,
&remote_set_cmdlist, &remote_show_cmdlist);
#if 0
/* XXXX - should ``set remotebinarydownload'' be retained for
compatibility. */
add_show_from_set
(add_set_cmd ("remotebinarydownload", no_class,
var_boolean, (char *) &remote_binary_download,
"Set binary downloads.\n", &setlist),
&showlist);
#endif
add_info ("remote-process", remote_info_process,
"Query the remote system for process info.");
@ -5101,4 +5223,9 @@ in a memory packet.\n",
set_remote_protocol_P_packet_cmd,
show_remote_protocol_P_packet_cmd,
&remote_set_cmdlist, &remote_show_cmdlist);
add_packet_config_cmd (&remote_protocol_Z, "Z", "breakpoint",
set_remote_protocol_Z_packet_cmd,
show_remote_protocol_Z_packet_cmd,
&remote_set_cmdlist, &remote_show_cmdlist);
}

View File

@ -23,7 +23,9 @@
#include "defs.h"
#include "serial.h"
#include <sys/types.h>
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#include <sys/socket.h>
#include <sys/time.h>
#include <fcntl.h>
@ -70,7 +72,7 @@ pipe_open (scb, name)
serial_t scb;
const char *name;
{
#if !defined(O_NONBLOCK) || !defined(F_GETFL) || !defined(F_SETFL)
#if !defined(O_NONBLOCK) || !defined(F_GETFL) || !defined(F_SETFL) || !HAVE_SOCKETPAIR
return -1;
#else
struct pipe_state *state;

View File

@ -492,27 +492,12 @@ connect_command (args, fromtty)
}
#endif /* 0 */
/* VARARGS */
void
#ifdef ANSI_PROTOTYPES
serial_printf (serial_t desc, const char *format,...)
#else
serial_printf (va_alist)
va_dcl
#endif
{
va_list args;
char *buf;
#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
serial_t desc;
char *format;
va_start (args);
desc = va_arg (args, serial_t);
format = va_arg (args, char *);
#endif
vasprintf (&buf, format, args);
SERIAL_WRITE (desc, buf, strlen (buf));

View File

@ -620,7 +620,7 @@ sh_target_architecture_hook (ap)
}
}
fatal ("Architecture `%s' unreconized", ap->printable_name);
internal_error ("Architecture `%s' unreconized", ap->printable_name);
}
/* Print the registers in a form similar to the E7000 */

View File

@ -1033,7 +1033,7 @@ symbol_add_stub (arg)
lowest_sect = bfd_get_section_by_name (so->abfd, ".text");
if (lowest_sect == NULL)
bfd_map_over_sections (so->abfd, find_lowest_section,
(PTR) & lowest_sect);
(PTR) &lowest_sect);
if (lowest_sect)
text_addr = bfd_section_vma (so->abfd, lowest_sect)
+ (CORE_ADDR) LM_ADDR (so);

View File

@ -43,7 +43,7 @@ static void
som_new_init PARAMS ((struct objfile *));
static void
som_symfile_read PARAMS ((struct objfile *, struct section_offsets *, int));
som_symfile_read PARAMS ((struct objfile *, int));
static void
som_symfile_finish PARAMS ((struct objfile *));
@ -53,7 +53,7 @@ som_symtab_read PARAMS ((bfd *, struct objfile *,
struct section_offsets *));
static struct section_offsets *
som_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
som_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
/* FIXME: These should really be in a common header somewhere */
@ -356,9 +356,8 @@ som_symtab_read (abfd, objfile, section_offsets)
capability even for files compiled without -g. */
static void
som_symfile_read (objfile, section_offsets, mainline)
som_symfile_read (objfile, mainline)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
{
bfd *abfd = objfile->obfd;
@ -386,20 +385,20 @@ som_symfile_read (objfile, section_offsets, mainline)
actually scan the DNTT. It does scan the linker symbol
table and thus build up a "minimal symbol table". */
som_symtab_read (abfd, objfile, section_offsets);
som_symtab_read (abfd, objfile, objfile->section_offsets);
/* Now read information from the stabs debug sections.
This is a no-op for SOM.
Perhaps it is intended for some kind of mixed STABS/SOM
situation? */
stabsect_build_psymtabs (objfile, section_offsets, mainline,
stabsect_build_psymtabs (objfile, mainline,
"$GDB_SYMBOLS$", "$GDB_STRINGS$", "$TEXT$");
/* Now read the native debug information.
This builds the psymtab. This used to be done via a scan of
the DNTT, but is now done via the PXDB-built quick-lookup tables
together with a scan of the GNTT. See hp-psymtab-read.c. */
hpread_build_psymtabs (objfile, section_offsets, mainline);
hpread_build_psymtabs (objfile, objfile->section_offsets, mainline);
/* Install any minimal symbols that have been collected as the current
minimal symbols for this objfile.

View File

@ -205,7 +205,7 @@ select_source_symtab (s)
{
if (cs_pst->readin)
{
fatal ("Internal: select_source_symtab: readin pst found and no symtabs.");
internal_error ("select_source_symtab: readin pst found and no symtabs.");
}
else
{

View File

@ -454,7 +454,7 @@ setup_arbitrary_frame (argc, argv)
frame = create_new_frame (argv[0], 0);
if (!frame)
fatal ("internal: create_new_frame returned invalid frame");
internal_error ("create_new_frame returned invalid frame");
frame->bottom = argv[1];
frame->pc = FRAME_SAVED_PC (frame);
@ -974,7 +974,7 @@ sparc_frame_find_saved_regs (fi, saved_regs_addr)
CORE_ADDR frame_addr = FRAME_FP (fi);
if (!fi)
fatal ("Bad frame info struct in FRAME_FIND_SAVED_REGS");
internal_error ("Bad frame info struct in FRAME_FIND_SAVED_REGS");
memset (saved_regs_addr, 0, sizeof (*saved_regs_addr));
@ -1735,7 +1735,7 @@ gdb_print_insn_sparc (memaddr, info)
disassemble_info *info;
{
/* It's necessary to override mach again because print_insn messes it up. */
info->mach = TM_PRINT_INSN_MACH;
info->mach = TARGET_ARCHITECTURE->mach;
return print_insn_sparc (memaddr, info);
}

View File

@ -208,7 +208,6 @@ process_one_symbol PARAMS ((int, int, CORE_ADDR, char *,
extern void elfstab_build_psymtabs
PARAMS ((struct objfile * objfile,
struct section_offsets * section_offsets,
int mainline,
file_ptr staboff, unsigned int stabsize,
file_ptr stabstroffset,
@ -216,7 +215,6 @@ extern void elfstab_build_psymtabs
extern void coffstab_build_psymtabs
PARAMS ((struct objfile * objfile,
struct section_offsets * section_offsets,
int mainline,
CORE_ADDR textaddr, unsigned int textsize,
struct stab_section_list * stabs,
@ -225,7 +223,6 @@ extern void coffstab_build_psymtabs
extern void stabsect_build_psymtabs
PARAMS ((struct objfile * objfile,
struct section_offsets * section_offsets,
int mainline,
char *stab_name,
char *stabstr_name,

View File

@ -483,14 +483,16 @@ default_symfile_offsets (objfile, addr)
/* Process a symbol file, as either the main file or as a dynamically
loaded file.
NAME is the file name (which will be tilde-expanded and made
absolute herein) (but we don't free or modify NAME itself).
FROM_TTY says how verbose to be. MAINLINE specifies whether this
is the main symbol file, or whether it's an extra symbol file such
as dynamically loaded code. If !mainline, ADDR is the address
where the text segment was loaded. If VERBO, the caller has printed
a verbose message about the symbol reading (and complaints can be
more terse about it). */
OBJFILE is where the symbols are to be read from.
ADDR is the address where the text segment was loaded, unless the
objfile is the main symbol file, in which case it is zero.
MAINLINE is nonzero if this is the main symbol file, or zero if
it's an extra symbol file such as dynamically loaded code.
VERBO is nonzero if the caller has printed a verbose message about
the symbol reading (and complaints can be more terse about it). */
void
syms_from_objfile (objfile, addr, mainline, verbo)
@ -546,7 +548,7 @@ syms_from_objfile (objfile, addr, mainline, verbo)
lowest_sect = bfd_get_section_by_name (objfile->obfd, ".text");
if (lowest_sect == NULL)
bfd_map_over_sections (objfile->obfd, find_lowest_section,
(PTR) & lowest_sect);
(PTR) &lowest_sect);
if (lowest_sect == NULL)
warning ("no loadable sections found in added symbol-file %s",
@ -557,7 +559,7 @@ syms_from_objfile (objfile, addr, mainline, verbo)
warning ("Lowest section in %s is %s at 0x%lx",
objfile->name,
bfd_section_name (objfile->obfd, lowest_sect),
(unsigned long) bfd_section_vma (objfile->obfd, lowest_sect));
(unsigned long) bfd_section_vma (objfile->obfd, lowest_sect));
if (lowest_sect)
addr -= bfd_section_vma (objfile->obfd, lowest_sect);
@ -587,7 +589,7 @@ syms_from_objfile (objfile, addr, mainline, verbo)
Section offsets are built similarly, except that they are built
by adding addr in all cases because there is no clear mapping
from section_offsets into actual sections. Note that solib.c
has a different algorythm for finding section offsets.
has a different algorithm for finding section offsets.
These should probably all be collapsed into some target
independent form of shared library support. FIXME. */
@ -596,7 +598,7 @@ syms_from_objfile (objfile, addr, mainline, verbo)
{
struct obj_section *s;
for (s = objfile->sections; s < objfile->sections_end; ++s)
ALL_OBJFILE_OSECTIONS (objfile, s)
{
s->addr -= s->offset;
s->addr += addr;
@ -607,7 +609,7 @@ syms_from_objfile (objfile, addr, mainline, verbo)
}
#endif /* not IBM6000_TARGET */
(*objfile->sf->sym_read) (objfile, section_offsets, mainline);
(*objfile->sf->sym_read) (objfile, mainline);
if (!have_partial_symbols () && !have_full_symbols ())
{
@ -633,10 +635,10 @@ syms_from_objfile (objfile, addr, mainline, verbo)
discard_cleanups (old_chain);
/* Call this after reading in a new symbol table to give target dependant code
a crack at the new symbols. For instance, this could be used to update the
values of target-specific symbols GDB needs to keep track of (such as
_sigtramp, or whatever). */
/* Call this after reading in a new symbol table to give target
dependant code a crack at the new symbols. For instance, this
could be used to update the values of target-specific symbols GDB
needs to keep track of (such as _sigtramp, or whatever). */
TARGET_SYMFILE_POSTREAD (objfile);
}
@ -1506,7 +1508,7 @@ reread_symbols ()
/* The "mainline" parameter is a hideous hack; I think leaving it
zero is OK since dbxread.c also does what it needs to do if
objfile->global_psymbols.size is 0. */
(*objfile->sf->sym_read) (objfile, objfile->section_offsets, 0);
(*objfile->sf->sym_read) (objfile, 0);
if (!have_partial_symbols () && !have_full_symbols ())
{
wrap_here ("");

View File

@ -88,7 +88,7 @@ struct sym_fns
symbol file (e.g. shared library or dynamically loaded file)
is being read. */
void (*sym_read) PARAMS ((struct objfile *, struct section_offsets *, int));
void (*sym_read) PARAMS ((struct objfile *, int));
/* Called when we are finished with an objfile. Should do all cleanup
that is specific to the object file format for the particular objfile. */
@ -116,7 +116,7 @@ struct sym_fns
do anything special. */
extern struct section_offsets *
default_symfile_offsets PARAMS ((struct objfile * objfile, CORE_ADDR addr));
default_symfile_offsets PARAMS ((struct objfile * objfile, CORE_ADDR addr));
extern void

View File

@ -543,7 +543,7 @@ child_wait (pid, status)
}
break;
case PTS_WATCHPT_HIT:
fatal ("PTS_WATCHPT_HIT\n");
internal_error ("PTS_WATCHPT_HIT\n");
break;
default:
/* stopped by signal */
@ -873,8 +873,8 @@ _initialize_symm_nat ()
rv = mptrace (XPT_MPDEBUGGER, 0, 0, 0);
if (-1 == rv)
{
fatal ("_initialize_symm_nat(): mptrace(XPT_MPDEBUGGER): %s",
safe_strerror (errno));
internal_error ("_initialize_symm_nat(): mptrace(XPT_MPDEBUGGER): %s",
safe_strerror (errno));
}
/*
@ -891,14 +891,14 @@ _initialize_symm_nat ()
rv = sigaddset (&set, SIGCHLD);
if (-1 == rv)
{
fatal ("_initialize_symm_nat(): sigaddset(SIGCHLD): %s",
safe_strerror (errno));
internal_error ("_initialize_symm_nat(): sigaddset(SIGCHLD): %s",
safe_strerror (errno));
}
rv = sigprocmask (SIG_BLOCK, &set, (sigset_t *) NULL);
if (-1 == rv)
{
fatal ("_initialize_symm_nat(): sigprocmask(SIG_BLOCK): %s",
safe_strerror (errno));
internal_error ("_initialize_symm_nat(): sigprocmask(SIG_BLOCK): %s",
safe_strerror (errno));
}
sact.sa_handler = sigchld_handler;
@ -907,8 +907,8 @@ _initialize_symm_nat ()
rv = sigaction (SIGCHLD, &sact, (struct sigaction *) NULL);
if (-1 == rv)
{
fatal ("_initialize_symm_nat(): sigaction(SIGCHLD): %s",
safe_strerror (errno));
internal_error ("_initialize_symm_nat(): sigaction(SIGCHLD): %s",
safe_strerror (errno));
}
#endif
}

View File

@ -444,6 +444,7 @@ cleanup_target (t)
de_fault (to_thread_alive, (int (*)PARAMS ((int))) target_ignore);
de_fault (to_stop, (void (*)PARAMS ((void))) target_ignore);
de_fault (to_query, (int (*)PARAMS ((int /*char */ , char *, char *, int *))) target_ignore);
de_fault (to_rcmd, (void (*) (char *, struct gdb_file *)) tcomplain);
de_fault (to_enable_exception_callback, (struct symtab_and_line * (*)PARAMS ((enum exception_event_kind, int))) nosupport_runtime);
de_fault (to_get_current_exception_event, (struct exception_event_record * (*)PARAMS ((void))) nosupport_runtime);
@ -527,6 +528,7 @@ update_current_target ()
INHERIT (to_find_new_threads, t);
INHERIT (to_stop, t);
INHERIT (to_query, t);
INHERIT (to_rcmd, t);
INHERIT (to_enable_exception_callback, t);
INHERIT (to_get_current_exception_event, t);
INHERIT (to_pid_to_exec_file, t);
@ -1937,7 +1939,7 @@ debug_to_open (args, from_tty)
{
debug_target.to_open (args, from_tty);
fprintf_unfiltered (gdb_stderr, "target_open (%s, %d)\n", args, from_tty);
fprintf_unfiltered (gdb_stdlog, "target_open (%s, %d)\n", args, from_tty);
}
static void
@ -1946,7 +1948,7 @@ debug_to_close (quitting)
{
debug_target.to_close (quitting);
fprintf_unfiltered (gdb_stderr, "target_close (%d)\n", quitting);
fprintf_unfiltered (gdb_stdlog, "target_close (%d)\n", quitting);
}
static void
@ -1956,7 +1958,7 @@ debug_to_attach (args, from_tty)
{
debug_target.to_attach (args, from_tty);
fprintf_unfiltered (gdb_stderr, "target_attach (%s, %d)\n", args, from_tty);
fprintf_unfiltered (gdb_stdlog, "target_attach (%s, %d)\n", args, from_tty);
}
@ -1966,7 +1968,7 @@ debug_to_post_attach (pid)
{
debug_target.to_post_attach (pid);
fprintf_unfiltered (gdb_stderr, "target_post_attach (%d)\n", pid);
fprintf_unfiltered (gdb_stdlog, "target_post_attach (%d)\n", pid);
}
static void
@ -1976,7 +1978,7 @@ debug_to_require_attach (args, from_tty)
{
debug_target.to_require_attach (args, from_tty);
fprintf_unfiltered (gdb_stderr,
fprintf_unfiltered (gdb_stdlog,
"target_require_attach (%s, %d)\n", args, from_tty);
}
@ -1987,7 +1989,7 @@ debug_to_detach (args, from_tty)
{
debug_target.to_detach (args, from_tty);
fprintf_unfiltered (gdb_stderr, "target_detach (%s, %d)\n", args, from_tty);
fprintf_unfiltered (gdb_stdlog, "target_detach (%s, %d)\n", args, from_tty);
}
static void
@ -1998,7 +2000,7 @@ debug_to_require_detach (pid, args, from_tty)
{
debug_target.to_require_detach (pid, args, from_tty);
fprintf_unfiltered (gdb_stderr,
fprintf_unfiltered (gdb_stdlog,
"target_require_detach (%d, %s, %d)\n", pid, args, from_tty);
}
@ -2010,7 +2012,7 @@ debug_to_resume (pid, step, siggnal)
{
debug_target.to_resume (pid, step, siggnal);
fprintf_unfiltered (gdb_stderr, "target_resume (%d, %s, %s)\n", pid,
fprintf_unfiltered (gdb_stdlog, "target_resume (%d, %s, %s)\n", pid,
step ? "step" : "continue",
target_signal_to_name (siggnal));
}
@ -2024,40 +2026,40 @@ debug_to_wait (pid, status)
retval = debug_target.to_wait (pid, status);
fprintf_unfiltered (gdb_stderr,
fprintf_unfiltered (gdb_stdlog,
"target_wait (%d, status) = %d, ", pid, retval);
fprintf_unfiltered (gdb_stderr, "status->kind = ");
fprintf_unfiltered (gdb_stdlog, "status->kind = ");
switch (status->kind)
{
case TARGET_WAITKIND_EXITED:
fprintf_unfiltered (gdb_stderr, "exited, status = %d\n",
fprintf_unfiltered (gdb_stdlog, "exited, status = %d\n",
status->value.integer);
break;
case TARGET_WAITKIND_STOPPED:
fprintf_unfiltered (gdb_stderr, "stopped, signal = %s\n",
fprintf_unfiltered (gdb_stdlog, "stopped, signal = %s\n",
target_signal_to_name (status->value.sig));
break;
case TARGET_WAITKIND_SIGNALLED:
fprintf_unfiltered (gdb_stderr, "signalled, signal = %s\n",
fprintf_unfiltered (gdb_stdlog, "signalled, signal = %s\n",
target_signal_to_name (status->value.sig));
break;
case TARGET_WAITKIND_LOADED:
fprintf_unfiltered (gdb_stderr, "loaded\n");
fprintf_unfiltered (gdb_stdlog, "loaded\n");
break;
case TARGET_WAITKIND_FORKED:
fprintf_unfiltered (gdb_stderr, "forked\n");
fprintf_unfiltered (gdb_stdlog, "forked\n");
break;
case TARGET_WAITKIND_VFORKED:
fprintf_unfiltered (gdb_stderr, "vforked\n");
fprintf_unfiltered (gdb_stdlog, "vforked\n");
break;
case TARGET_WAITKIND_EXECD:
fprintf_unfiltered (gdb_stderr, "execd\n");
fprintf_unfiltered (gdb_stdlog, "execd\n");
break;
case TARGET_WAITKIND_SPURIOUS:
fprintf_unfiltered (gdb_stderr, "spurious\n");
fprintf_unfiltered (gdb_stdlog, "spurious\n");
break;
default:
fprintf_unfiltered (gdb_stderr, "unknown???\n");
fprintf_unfiltered (gdb_stdlog, "unknown???\n");
break;
}
@ -2071,7 +2073,7 @@ debug_to_post_wait (pid, status)
{
debug_target.to_post_wait (pid, status);
fprintf_unfiltered (gdb_stderr, "target_post_wait (%d, %d)\n",
fprintf_unfiltered (gdb_stdlog, "target_post_wait (%d, %d)\n",
pid, status);
}
@ -2081,13 +2083,13 @@ debug_to_fetch_registers (regno)
{
debug_target.to_fetch_registers (regno);
fprintf_unfiltered (gdb_stderr, "target_fetch_registers (%s)",
fprintf_unfiltered (gdb_stdlog, "target_fetch_registers (%s)",
regno != -1 ? REGISTER_NAME (regno) : "-1");
if (regno != -1)
fprintf_unfiltered (gdb_stderr, " = 0x%x %d",
fprintf_unfiltered (gdb_stdlog, " = 0x%x %d",
(unsigned long) read_register (regno),
read_register (regno));
fprintf_unfiltered (gdb_stderr, "\n");
fprintf_unfiltered (gdb_stdlog, "\n");
}
static void
@ -2097,12 +2099,12 @@ debug_to_store_registers (regno)
debug_target.to_store_registers (regno);
if (regno >= 0 && regno < NUM_REGS)
fprintf_unfiltered (gdb_stderr, "target_store_registers (%s) = 0x%x %d\n",
fprintf_unfiltered (gdb_stdlog, "target_store_registers (%s) = 0x%x %d\n",
REGISTER_NAME (regno),
(unsigned long) read_register (regno),
(unsigned long) read_register (regno));
else
fprintf_unfiltered (gdb_stderr, "target_store_registers (%d)\n", regno);
fprintf_unfiltered (gdb_stdlog, "target_store_registers (%d)\n", regno);
}
static void
@ -2110,7 +2112,7 @@ debug_to_prepare_to_store ()
{
debug_target.to_prepare_to_store ();
fprintf_unfiltered (gdb_stderr, "target_prepare_to_store ()\n");
fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n");
}
static int
@ -2125,7 +2127,7 @@ debug_to_xfer_memory (memaddr, myaddr, len, write, target)
retval = debug_target.to_xfer_memory (memaddr, myaddr, len, write, target);
fprintf_unfiltered (gdb_stderr,
fprintf_unfiltered (gdb_stdlog,
"target_xfer_memory (0x%x, xxx, %d, %s, xxx) = %d",
(unsigned int) memaddr, /* possable truncate long long */
len, write ? "write" : "read", retval);
@ -2136,16 +2138,16 @@ debug_to_xfer_memory (memaddr, myaddr, len, write, target)
{
int i;
fputs_unfiltered (", bytes =", gdb_stderr);
fputs_unfiltered (", bytes =", gdb_stdlog);
for (i = 0; i < retval; i++)
{
if ((((long) &(myaddr[i])) & 0xf) == 0)
fprintf_unfiltered (gdb_stderr, "\n");
fprintf_unfiltered (gdb_stderr, " %02x", myaddr[i] & 0xff);
fprintf_unfiltered (gdb_stdlog, "\n");
fprintf_unfiltered (gdb_stdlog, " %02x", myaddr[i] & 0xff);
}
}
fputc_unfiltered ('\n', gdb_stderr);
fputc_unfiltered ('\n', gdb_stdlog);
return retval;
}
@ -2156,7 +2158,7 @@ debug_to_files_info (target)
{
debug_target.to_files_info (target);
fprintf_unfiltered (gdb_stderr, "target_files_info (xxx)\n");
fprintf_unfiltered (gdb_stdlog, "target_files_info (xxx)\n");
}
static int
@ -2168,7 +2170,7 @@ debug_to_insert_breakpoint (addr, save)
retval = debug_target.to_insert_breakpoint (addr, save);
fprintf_unfiltered (gdb_stderr,
fprintf_unfiltered (gdb_stdlog,
"target_insert_breakpoint (0x%x, xxx) = %d\n",
(unsigned long) addr, retval);
return retval;
@ -2183,7 +2185,7 @@ debug_to_remove_breakpoint (addr, save)
retval = debug_target.to_remove_breakpoint (addr, save);
fprintf_unfiltered (gdb_stderr,
fprintf_unfiltered (gdb_stdlog,
"target_remove_breakpoint (0x%x, xxx) = %d\n",
(unsigned long) addr, retval);
return retval;
@ -2194,7 +2196,7 @@ debug_to_terminal_init ()
{
debug_target.to_terminal_init ();
fprintf_unfiltered (gdb_stderr, "target_terminal_init ()\n");
fprintf_unfiltered (gdb_stdlog, "target_terminal_init ()\n");
}
static void
@ -2202,7 +2204,7 @@ debug_to_terminal_inferior ()
{
debug_target.to_terminal_inferior ();
fprintf_unfiltered (gdb_stderr, "target_terminal_inferior ()\n");
fprintf_unfiltered (gdb_stdlog, "target_terminal_inferior ()\n");
}
static void
@ -2210,7 +2212,7 @@ debug_to_terminal_ours_for_output ()
{
debug_target.to_terminal_ours_for_output ();
fprintf_unfiltered (gdb_stderr, "target_terminal_ours_for_output ()\n");
fprintf_unfiltered (gdb_stdlog, "target_terminal_ours_for_output ()\n");
}
static void
@ -2218,7 +2220,7 @@ debug_to_terminal_ours ()
{
debug_target.to_terminal_ours ();
fprintf_unfiltered (gdb_stderr, "target_terminal_ours ()\n");
fprintf_unfiltered (gdb_stdlog, "target_terminal_ours ()\n");
}
static void
@ -2228,7 +2230,7 @@ debug_to_terminal_info (arg, from_tty)
{
debug_target.to_terminal_info (arg, from_tty);
fprintf_unfiltered (gdb_stderr, "target_terminal_info (%s, %d)\n", arg,
fprintf_unfiltered (gdb_stdlog, "target_terminal_info (%s, %d)\n", arg,
from_tty);
}
@ -2237,7 +2239,7 @@ debug_to_kill ()
{
debug_target.to_kill ();
fprintf_unfiltered (gdb_stderr, "target_kill ()\n");
fprintf_unfiltered (gdb_stdlog, "target_kill ()\n");
}
static void
@ -2247,7 +2249,7 @@ debug_to_load (args, from_tty)
{
debug_target.to_load (args, from_tty);
fprintf_unfiltered (gdb_stderr, "target_load (%s, %d)\n", args, from_tty);
fprintf_unfiltered (gdb_stdlog, "target_load (%s, %d)\n", args, from_tty);
}
static int
@ -2259,7 +2261,7 @@ debug_to_lookup_symbol (name, addrp)
retval = debug_target.to_lookup_symbol (name, addrp);
fprintf_unfiltered (gdb_stderr, "target_lookup_symbol (%s, xxx)\n", name);
fprintf_unfiltered (gdb_stdlog, "target_lookup_symbol (%s, xxx)\n", name);
return retval;
}
@ -2272,7 +2274,7 @@ debug_to_create_inferior (exec_file, args, env)
{
debug_target.to_create_inferior (exec_file, args, env);
fprintf_unfiltered (gdb_stderr, "target_create_inferior (%s, %s, xxx)\n",
fprintf_unfiltered (gdb_stdlog, "target_create_inferior (%s, %s, xxx)\n",
exec_file, args);
}
@ -2282,7 +2284,7 @@ debug_to_post_startup_inferior (pid)
{
debug_target.to_post_startup_inferior (pid);
fprintf_unfiltered (gdb_stderr, "target_post_startup_inferior (%d)\n",
fprintf_unfiltered (gdb_stdlog, "target_post_startup_inferior (%d)\n",
pid);
}
@ -2292,7 +2294,7 @@ debug_to_acknowledge_created_inferior (pid)
{
debug_target.to_acknowledge_created_inferior (pid);
fprintf_unfiltered (gdb_stderr, "target_acknowledge_created_inferior (%d)\n",
fprintf_unfiltered (gdb_stdlog, "target_acknowledge_created_inferior (%d)\n",
pid);
}
@ -2303,7 +2305,7 @@ debug_to_clone_and_follow_inferior (child_pid, followed_child)
{
debug_target.to_clone_and_follow_inferior (child_pid, followed_child);
fprintf_unfiltered (gdb_stderr,
fprintf_unfiltered (gdb_stdlog,
"target_clone_and_follow_inferior (%d, %d)\n",
child_pid, *followed_child);
}
@ -2313,7 +2315,7 @@ debug_to_post_follow_inferior_by_clone ()
{
debug_target.to_post_follow_inferior_by_clone ();
fprintf_unfiltered (gdb_stderr, "target_post_follow_inferior_by_clone ()\n");
fprintf_unfiltered (gdb_stdlog, "target_post_follow_inferior_by_clone ()\n");
}
static int
@ -2324,7 +2326,7 @@ debug_to_insert_fork_catchpoint (pid)
retval = debug_target.to_insert_fork_catchpoint (pid);
fprintf_unfiltered (gdb_stderr, "target_insert_fork_catchpoint (%d) = %d\n",
fprintf_unfiltered (gdb_stdlog, "target_insert_fork_catchpoint (%d) = %d\n",
pid, retval);
return retval;
@ -2338,7 +2340,7 @@ debug_to_remove_fork_catchpoint (pid)
retval = debug_target.to_remove_fork_catchpoint (pid);
fprintf_unfiltered (gdb_stderr, "target_remove_fork_catchpoint (%d) = %d\n",
fprintf_unfiltered (gdb_stdlog, "target_remove_fork_catchpoint (%d) = %d\n",
pid, retval);
return retval;
@ -2352,7 +2354,7 @@ debug_to_insert_vfork_catchpoint (pid)
retval = debug_target.to_insert_vfork_catchpoint (pid);
fprintf_unfiltered (gdb_stderr, "target_insert_vfork_catchpoint (%d)= %d\n",
fprintf_unfiltered (gdb_stdlog, "target_insert_vfork_catchpoint (%d)= %d\n",
pid, retval);
return retval;
@ -2366,7 +2368,7 @@ debug_to_remove_vfork_catchpoint (pid)
retval = debug_target.to_remove_vfork_catchpoint (pid);
fprintf_unfiltered (gdb_stderr, "target_remove_vfork_catchpoint (%d) = %d\n",
fprintf_unfiltered (gdb_stdlog, "target_remove_vfork_catchpoint (%d) = %d\n",
pid, retval);
return retval;
@ -2381,7 +2383,7 @@ debug_to_has_forked (pid, child_pid)
has_forked = debug_target.to_has_forked (pid, child_pid);
fprintf_unfiltered (gdb_stderr, "target_has_forked (%d, %d) = %d\n",
fprintf_unfiltered (gdb_stdlog, "target_has_forked (%d, %d) = %d\n",
pid, *child_pid, has_forked);
return has_forked;
@ -2396,7 +2398,7 @@ debug_to_has_vforked (pid, child_pid)
has_vforked = debug_target.to_has_vforked (pid, child_pid);
fprintf_unfiltered (gdb_stderr, "target_has_vforked (%d, %d) = %d\n",
fprintf_unfiltered (gdb_stdlog, "target_has_vforked (%d, %d) = %d\n",
pid, *child_pid, has_vforked);
return has_vforked;
@ -2409,7 +2411,7 @@ debug_to_can_follow_vfork_prior_to_exec ()
can_immediately_follow_vfork = debug_target.to_can_follow_vfork_prior_to_exec ();
fprintf_unfiltered (gdb_stderr, "target_can_follow_vfork_prior_to_exec () = %d\n",
fprintf_unfiltered (gdb_stdlog, "target_can_follow_vfork_prior_to_exec () = %d\n",
can_immediately_follow_vfork);
return can_immediately_follow_vfork;
@ -2424,7 +2426,7 @@ debug_to_post_follow_vfork (parent_pid, followed_parent, child_pid, followed_chi
{
debug_target.to_post_follow_vfork (parent_pid, followed_parent, child_pid, followed_child);
fprintf_unfiltered (gdb_stderr,
fprintf_unfiltered (gdb_stdlog,
"target_post_follow_vfork (%d, %d, %d, %d)\n",
parent_pid, followed_parent, child_pid, followed_child);
}
@ -2437,7 +2439,7 @@ debug_to_insert_exec_catchpoint (pid)
retval = debug_target.to_insert_exec_catchpoint (pid);
fprintf_unfiltered (gdb_stderr, "target_insert_exec_catchpoint (%d) = %d\n",
fprintf_unfiltered (gdb_stdlog, "target_insert_exec_catchpoint (%d) = %d\n",
pid, retval);
return retval;
@ -2451,7 +2453,7 @@ debug_to_remove_exec_catchpoint (pid)
retval = debug_target.to_remove_exec_catchpoint (pid);
fprintf_unfiltered (gdb_stderr, "target_remove_exec_catchpoint (%d) = %d\n",
fprintf_unfiltered (gdb_stdlog, "target_remove_exec_catchpoint (%d) = %d\n",
pid, retval);
return retval;
@ -2466,7 +2468,7 @@ debug_to_has_execd (pid, execd_pathname)
has_execd = debug_target.to_has_execd (pid, execd_pathname);
fprintf_unfiltered (gdb_stderr, "target_has_execd (%d, %s) = %d\n",
fprintf_unfiltered (gdb_stdlog, "target_has_execd (%d, %s) = %d\n",
pid, (*execd_pathname ? *execd_pathname : "<NULL>"),
has_execd);
@ -2480,7 +2482,7 @@ debug_to_reported_exec_events_per_exec_call ()
reported_exec_events = debug_target.to_reported_exec_events_per_exec_call ();
fprintf_unfiltered (gdb_stderr,
fprintf_unfiltered (gdb_stdlog,
"target_reported_exec_events_per_exec_call () = %d\n",
reported_exec_events);
@ -2512,7 +2514,7 @@ debug_to_has_syscall_event (pid, kind, syscall_id)
}
}
fprintf_unfiltered (gdb_stderr,
fprintf_unfiltered (gdb_stdlog,
"target_has_syscall_event (%d, %s, %d) = %d\n",
pid, kind_spelling, *syscall_id, has_syscall_event);
@ -2529,7 +2531,7 @@ debug_to_has_exited (pid, wait_status, exit_status)
has_exited = debug_target.to_has_exited (pid, wait_status, exit_status);
fprintf_unfiltered (gdb_stderr, "target_has_exited (%d, %d, %d) = %d\n",
fprintf_unfiltered (gdb_stdlog, "target_has_exited (%d, %d, %d) = %d\n",
pid, wait_status, *exit_status, has_exited);
return has_exited;
@ -2540,7 +2542,7 @@ debug_to_mourn_inferior ()
{
debug_target.to_mourn_inferior ();
fprintf_unfiltered (gdb_stderr, "target_mourn_inferior ()\n");
fprintf_unfiltered (gdb_stdlog, "target_mourn_inferior ()\n");
}
static int
@ -2550,7 +2552,7 @@ debug_to_can_run ()
retval = debug_target.to_can_run ();
fprintf_unfiltered (gdb_stderr, "target_can_run () = %d\n", retval);
fprintf_unfiltered (gdb_stdlog, "target_can_run () = %d\n", retval);
return retval;
}
@ -2561,7 +2563,7 @@ debug_to_notice_signals (pid)
{
debug_target.to_notice_signals (pid);
fprintf_unfiltered (gdb_stderr, "target_notice_signals (%d)\n", pid);
fprintf_unfiltered (gdb_stdlog, "target_notice_signals (%d)\n", pid);
}
static int
@ -2572,7 +2574,7 @@ debug_to_thread_alive (pid)
retval = debug_target.to_thread_alive (pid);
fprintf_unfiltered (gdb_stderr, "target_thread_alive (%d) = %d\n",
fprintf_unfiltered (gdb_stdlog, "target_thread_alive (%d) = %d\n",
pid, retval);
return retval;
@ -2583,7 +2585,7 @@ debug_to_stop ()
{
debug_target.to_stop ();
fprintf_unfiltered (gdb_stderr, "target_stop ()\n");
fprintf_unfiltered (gdb_stdlog, "target_stop ()\n");
}
static int
@ -2597,11 +2599,19 @@ debug_to_query (type, req, resp, siz)
retval = debug_target.to_query (type, req, resp, siz);
fprintf_unfiltered (gdb_stderr, "target_query (%c, %s, %s, %d) = %d\n", type, req, resp, *siz, retval);
fprintf_unfiltered (gdb_stdlog, "target_query (%c, %s, %s, %d) = %d\n", type, req, resp, *siz, retval);
return retval;
}
static void
debug_to_rcmd (char *command,
struct gdb_file *outbuf)
{
debug_target.to_rcmd (command, outbuf);
fprintf_unfiltered (gdb_stdlog, "target_rcmd (%s, ...)\n", command);
}
static struct symtab_and_line *
debug_to_enable_exception_callback (kind, enable)
enum exception_event_kind kind;
@ -2609,7 +2619,7 @@ debug_to_enable_exception_callback (kind, enable)
{
struct symtab_and_line *result;
result = debug_target.to_enable_exception_callback (kind, enable);
fprintf_unfiltered (gdb_stderr,
fprintf_unfiltered (gdb_stdlog,
"target get_exception_callback_sal (%d, %d)\n",
kind, enable);
return result;
@ -2620,7 +2630,7 @@ debug_to_get_current_exception_event ()
{
struct exception_event_record *result;
result = debug_target.to_get_current_exception_event ();
fprintf_unfiltered (gdb_stderr, "target get_current_exception_event ()\n");
fprintf_unfiltered (gdb_stdlog, "target get_current_exception_event ()\n");
return result;
}
@ -2632,7 +2642,7 @@ debug_to_pid_to_exec_file (pid)
exec_file = debug_target.to_pid_to_exec_file (pid);
fprintf_unfiltered (gdb_stderr, "target_pid_to_exec_file (%d) = %s\n",
fprintf_unfiltered (gdb_stdlog, "target_pid_to_exec_file (%d) = %s\n",
pid, exec_file);
return exec_file;
@ -2646,7 +2656,7 @@ debug_to_core_file_to_sym_file (core)
sym_file = debug_target.to_core_file_to_sym_file (core);
fprintf_unfiltered (gdb_stderr, "target_core_file_to_sym_file (%s) = %s\n",
fprintf_unfiltered (gdb_stdlog, "target_core_file_to_sym_file (%s) = %s\n",
core, sym_file);
return sym_file;
@ -2707,6 +2717,7 @@ setup_target_debug ()
current_target.to_thread_alive = debug_to_thread_alive;
current_target.to_stop = debug_to_stop;
current_target.to_query = debug_to_query;
current_target.to_rcmd = debug_to_rcmd;
current_target.to_enable_exception_callback = debug_to_enable_exception_callback;
current_target.to_get_current_exception_event = debug_to_get_current_exception_event;
current_target.to_pid_to_exec_file = debug_to_pid_to_exec_file;
@ -2720,6 +2731,19 @@ static char targ_desc[] =
Shows the entire stack of targets currently in use (including the exec-file,\n\
core-file, and process, if any), as well as the symbol file name.";
static void
do_monitor_command (char *cmd,
int from_tty)
{
if ((current_target.to_rcmd == (void*) tcomplain)
|| (current_target.to_rcmd == debug_to_rcmd
&& (debug_target.to_rcmd == (void*) tcomplain)))
{
error ("\"monitor\" command not supported by this target.\n");
}
target_rcmd (cmd, gdb_stdtarg);
}
void
initialize_targets ()
{
@ -2736,6 +2760,10 @@ initialize_targets ()
When non-zero, target debugging is enabled.", &setlist),
&showlist);
add_com ("monitor", class_obscure, do_monitor_command,
"Send a command to the remote monitor (remote targets only).");
if (!STREQ (signals[TARGET_SIGNAL_LAST].string, "TARGET_SIGNAL_MAGIC"))
abort ();
}

View File

@ -376,6 +376,7 @@ struct target_ops
void (*to_find_new_threads) PARAMS ((void));
void (*to_stop) PARAMS ((void));
int (*to_query) PARAMS ((int /*char */ , char *, char *, int *));
void (*to_rcmd) (char *command, struct gdb_file *output);
struct symtab_and_line *(*to_enable_exception_callback) PARAMS ((enum exception_event_kind, int));
struct exception_event_record *(*to_get_current_exception_event) PARAMS ((void));
char *(*to_pid_to_exec_file) PARAMS ((int pid));
@ -930,6 +931,14 @@ print_section_info PARAMS ((struct target_ops *, bfd *));
#define target_query(query_type, query, resp_buffer, bufffer_size) \
(*current_target.to_query) (query_type, query, resp_buffer, bufffer_size)
/* Send the specified COMMAND to the target's monitor
(shell,interpreter) for execution. The result of the query is
placed in OUTBUF. */
#define target_rcmd(command, outbuf) \
(*current_target.to_rcmd) (command, outbuf)
/* Get the symbol information for a breakpointable routine called when
an exception event occurs.
Intended mainly for C++, and for those

View File

@ -1,3 +1,32 @@
1999-08-05 Stan Shebs <shebs@andros.cygnus.com>
* gdb.base/display.exp: Help expect by putting a newline in the
funky printf, remove a bogus p/a test.
1999-08-05 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* gdb.base/display.exp: Make sure that when we say 'run', we are
connected to the target. This is necessary when running not
natively.
1999-08-03 Stan Shebs <shebs@andros.cygnus.com>
* gdb.base/step-test.exp: Removed some extraneous messages.
* gdb.base/long_long.exp: Don't run memory examination tests
on little-endian targets (they will need a different set of
results to match).
1999-08-02 Stan Shebs <shebs@andros.cygnus.com>
* gdb.c++/virtfunc.exp: Expect to fail the virtual call tests
until somebody decides to fix GDB.
* gdb.base/long_long.c: Stop compiler complaint by specifying long
constant as "ULL".
* gdb.base/long_long.exp: Loosen x/c test, add partial result
matches for a couple x/2 commands.
1999-07-30 Stan Shebs <shebs@andros.cygnus.com>
* gdb.c++/ref-types.cc, gdb.c++/ref-types.exp: Appease doschk

View File

@ -185,7 +185,7 @@ proc infrun_breakpoint_command_test {} {
if { [istarget "hppa*-hp-hpux*"] } {
gdb_test "continue" \
"Continuing.*.*.*Breakpoint \[0-9\]*, factorial \\(value=5\\).*at.*\[0-9\]*\[ \]*if \\(value > 1\\) \{.*\[0-9\]*\[ \]*value \\*= factorial \\(value - 1\\);.*" \
"contiune in infrun_breakpoint_command_test"
"continue in infrun_breakpoint_command_test"
} else {
gdb_test "continue" \
"Breakpoint \[0-9\]*, factorial \\(value=5\\).*at.*

View File

@ -46,6 +46,7 @@ gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# Some coverage stuff
#
gdb_test "kill" ".*The program is not being run.*"
@ -59,9 +60,16 @@ gdb_test "detach" ".*"
# Ok, on to real life
#
if {![runto main]} {
fail "Could not run to main - other tests will fail."
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then {
fail "Could not run to main - other tests will fail."
continue
}
gdb_test "b 14" ".*Breakpoint 2.*" "break do_loops"
gdb_test "c" ".*Breakpoint 2, do_loops.*" "get to do_loops"
@ -133,7 +141,7 @@ gdb_test "printf" ".*Argument required.*"
gdb_test "printf %d" ".*Bad format string, missing.*"
gdb_test "printf \"%d" ".*Bad format string, non-terminated.*"
gdb_test "printf \"%d%d\",i" ".*Wrong number of arguments.*"
gdb_test "printf \"\\\\!\\a\\f\\r\\t\\v\\b\"" ".*!.*"
gdb_test "printf \"\\\\!\\a\\f\\r\\t\\v\\b\\n\"" ".*!.*"
gdb_test "printf \"\"" ".*" "re-set term"
gdb_test "printf \"\\w\"" ".*Unrecognized escape character.*"
gdb_test "printf \"%d\" j" ".*Invalid argument syntax.*"
@ -159,7 +167,6 @@ gdb_test "p/i sum" ".*Format letter.*is meaningless.*.*" "no i"
gdb_test "p/a &sum" ".*= $hex.*<sum>.*"
gdb_test "p/a main+1000" ".*= $hex.*<.*>.*"
gdb_test "p/a \$pc" ".*= $hex.*<do_vars+.*>.*"
gdb_test "p/a &j" ".*= $hex.*<do_vars+.*>.*"
gdb_test "p/a &&j" ".*A parse error.*"
# Done!

View File

@ -31,7 +31,7 @@ int known_types()
*/
bin = 0x123456789abcdefLL; /* 64 bits = 16 hex digits */
oct = 01234567123456701234567LL; /* = 21+ octal digits */
dec = 12345678901234567890LL; /* = 19+ decimal digits */
dec = 12345678901234567890ULL; /* = 19+ decimal digits */
/* Stop here and look!
*/

View File

@ -1,4 +1,4 @@
# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
# Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -58,6 +58,17 @@ if { ![runto known_types] } then {
return
}
set target_bigendian_p 1
send_gdb "show endian\n"
gdb_expect {
-re ".*little endian.*$gdb_prompt $" { set target_bigendian_p 0 }
-re ".*big endian.*$gdb_prompt $" { }
-re ".*$gdb_prompt $" {
fail "getting target endian"
}
default { fail "(timeout) getting target endian" }
}
gdb_test "n 4" ".*38.*" "get to known place"
# Check the hack for long long prints.
@ -87,76 +98,90 @@ gdb_test "p/a oct" ".*0x.*77053977.*"
gdb_test "p/c oct" ".*'w'.*"
gdb_test "p/f oct" ".*-5.9822653797615723e-120.*"
gdb_test "p/d *(int *)&oct" ".*-1490098887.*"
gdb_test "p/u *(int *)&oct" ".*2804868409.*"
gdb_test "p/o *(int *)&oct" ".*024713562471.*"
gdb_test "p/t *(int *)&oct" ".*10100111001011101110010100111001.*"
gdb_test "p/a *(int *)&oct" ".*0xf*a72ee539.*"
gdb_test "p/c *(int *)&oct" ".*57 '9'.*"
gdb_test "p/f *(int *)&oct" ".*-2.42716126e-15.*"
if { $target_bigendian_p } {
gdb_test "p/d *(short *)&oct" ".*-22738.*"
gdb_test "p/u *(short *)&oct" ".*42798.*"
gdb_test "p/o *(short *)&oct" ".*0123456.*"
gdb_test "p/t *(short *)&oct" ".*1010011100101110.*"
gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*"
gdb_test "p/c *(short *)&oct" ".* 46 '.'.*"
gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*"
gdb_test "p/f *(short *)&oct" ".*-22738.*"
gdb_test "p/d *(int *)&oct" ".*-1490098887.*"
gdb_test "p/u *(int *)&oct" ".*2804868409.*"
gdb_test "p/o *(int *)&oct" ".*024713562471.*"
gdb_test "p/t *(int *)&oct" ".*10100111001011101110010100111001.*"
gdb_test "p/a *(int *)&oct" ".*0xf*a72ee539.*"
gdb_test "p/c *(int *)&oct" ".*57 '9'.*"
gdb_test "p/f *(int *)&oct" ".*-2.42716126e-15.*"
gdb_test "x/x &oct" ".*0xa72ee539.*"
gdb_test "x/d &oct" ".*.-1490098887*"
gdb_test "x/u &oct" ".*2804868409.*"
gdb_test "x/o &oct" ".*024713562471.*"
gdb_test "x/t &oct" ".*10100111001011101110010100111001.*"
gdb_test "x/a &oct" ".*0xa72ee539.*"
gdb_test "x/c &oct" ".*-89 '\\\\247'.*"
gdb_test "x/f &oct" ".*-5.9822653797615723e-120.*"
gdb_test "p/d *(short *)&oct" ".*-22738.*"
gdb_test "p/u *(short *)&oct" ".*42798.*"
gdb_test "p/o *(short *)&oct" ".*0123456.*"
gdb_test "p/t *(short *)&oct" ".*1010011100101110.*"
gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*"
gdb_test "p/c *(short *)&oct" ".* 46 '.'.*"
gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*"
gdb_test "p/f *(short *)&oct" ".*-22738.*"
gdb_test "x/2x &oct" ".*.*"
gdb_test "x/2d &oct" ".*.*"
gdb_test "x/2u &oct" ".*.*"
gdb_test "x/2o &oct" ".*.*"
gdb_test "x/2t &oct" ".*.*"
gdb_test "x/2a &oct" ".*.*"
gdb_test "x/2c &oct" ".*.*"
gdb_test "x/2f &oct" ".*.*"
gdb_test "x/x &oct" ".*0xa72ee539.*"
gdb_test "x/d &oct" ".*.-1490098887*"
gdb_test "x/u &oct" ".*2804868409.*"
gdb_test "x/o &oct" ".*024713562471.*"
gdb_test "x/t &oct" ".*10100111001011101110010100111001.*"
gdb_test "x/a &oct" ".*0xa72ee539.*"
gdb_test "x/c &oct" ".*-89 .*"
# FIXME GDB's output is correct, but this longer match fails.
# gdb_test "x/c &oct" ".*-89 '\\\\247'.*"
gdb_test "x/f &oct" ".*-5.9822653797615723e-120.*"
gdb_test "x/2bx &oct" ".*.*"
gdb_test "x/2bd &oct" ".*.*"
gdb_test "x/2bu &oct" ".*.*"
gdb_test "x/2bo &oct" ".*.*"
gdb_test "x/2bt &oct" ".*.*"
gdb_test "x/2ba &oct" ".*.*"
gdb_test "x/2bc &oct" ".*.*"
gdb_test "x/2bf &oct" ".*.*"
# FIXME Fill in the results for all the following tests. (But be careful
# about looking at locations with unspecified contents!)
gdb_test "x/2hx &oct" ".*.*"
gdb_test "x/2hd &oct" ".*.*"
gdb_test "x/2hu &oct" ".*.*"
gdb_test "x/2ho &oct" ".*.*"
gdb_test "x/2ht &oct" ".*.*"
gdb_test "x/2ha &oct" ".*.*"
gdb_test "x/2hc &oct" ".*.*"
gdb_test "x/2hf &oct" ".*.*"
gdb_test "x/2x &oct" ".*0xa72ee53977053977.*"
gdb_test "x/2d &oct" ".*-6399925985474168457.*"
gdb_test "x/2u &oct" ".*.*"
gdb_test "x/2o &oct" ".*.*"
gdb_test "x/2t &oct" ".*.*"
gdb_test "x/2a &oct" ".*.*"
gdb_test "x/2c &oct" ".*.*"
gdb_test "x/2f &oct" ".*.*"
gdb_test "x/2wx &oct" ".*.*"
gdb_test "x/2wd &oct" ".*.*"
gdb_test "x/2wu &oct" ".*.*"
gdb_test "x/2wo &oct" ".*.*"
gdb_test "x/2wt &oct" ".*.*"
gdb_test "x/2wa &oct" ".*.*"
gdb_test "x/2wc &oct" ".*.*"
gdb_test "x/2wf &oct" ".*.*"
gdb_test "x/2bx &oct" ".*.*"
gdb_test "x/2bd &oct" ".*.*"
gdb_test "x/2bu &oct" ".*.*"
gdb_test "x/2bo &oct" ".*.*"
gdb_test "x/2bt &oct" ".*.*"
gdb_test "x/2ba &oct" ".*.*"
gdb_test "x/2bc &oct" ".*.*"
gdb_test "x/2bf &oct" ".*.*"
gdb_test "x/2gx &oct" ".*.*"
gdb_test "x/2gd &oct" ".*.*"
gdb_test "x/2gu &oct" ".*.*"
gdb_test "x/2go &oct" ".*.*"
gdb_test "x/2gt &oct" ".*.*"
gdb_test "x/2ga &oct" ".*.*"
gdb_test "x/2gc &oct" ".*.*"
gdb_test "x/2gf &oct" ".*.*"
gdb_test "x/2hx &oct" ".*.*"
gdb_test "x/2hd &oct" ".*.*"
gdb_test "x/2hu &oct" ".*.*"
gdb_test "x/2ho &oct" ".*.*"
gdb_test "x/2ht &oct" ".*.*"
gdb_test "x/2ha &oct" ".*.*"
gdb_test "x/2hc &oct" ".*.*"
gdb_test "x/2hf &oct" ".*.*"
gdb_test "x/2wx &oct" ".*.*"
gdb_test "x/2wd &oct" ".*.*"
gdb_test "x/2wu &oct" ".*.*"
gdb_test "x/2wo &oct" ".*.*"
gdb_test "x/2wt &oct" ".*.*"
gdb_test "x/2wa &oct" ".*.*"
gdb_test "x/2wc &oct" ".*.*"
gdb_test "x/2wf &oct" ".*.*"
gdb_test "x/2gx &oct" ".*.*"
gdb_test "x/2gd &oct" ".*.*"
gdb_test "x/2gu &oct" ".*.*"
gdb_test "x/2go &oct" ".*.*"
gdb_test "x/2gt &oct" ".*.*"
gdb_test "x/2ga &oct" ".*.*"
gdb_test "x/2gc &oct" ".*.*"
gdb_test "x/2gf &oct" ".*.*"
} else {
# FIXME Add little-endian versions of these tests, or define a
# gdb_test_bi with two strings to match on.
}
gdb_exit
return 0

View File

@ -149,7 +149,6 @@ test_i "stepi into function" "stepi" \
send_gdb "finish\n"
gdb_expect {
-re ".*(Program received|Program exited).*$gdb_prompt $" {
puts "*** Matched Program recieved"
# Oops... We ran to the end of the program... Better reset
if {![runto_main]} then {
fail "Can't run to main"
@ -162,13 +161,11 @@ gdb_expect {
fail "stepi: finish call"
}
-re ".*${decimal}.*callee.*NEXTI.*$gdb_prompt $" {
puts "*** Matched success..."
pass "stepi: finish call"
}
-re ".*${decimal}.*callee.*STEPI.*$gdb_prompt $" {
# On PA64 we end up at a different instruction than PA32
if { [istarget "hppa2.0w-hp-hpux*"] } {
puts "*** Matched success..."
pass "stepi: finish call 2"
} else {
fail "stepi: finish call 2"

View File

@ -1,4 +1,4 @@
# Copyright (C) 1992, 1994, 1997 Free Software Foundation, Inc.
# Copyright (C) 1992, 1994, 1997, 1999 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -34,6 +34,7 @@ if [get_compiler_info ${binfile} "c++"] {
return -1
}
source ${binfile}.ci
# Check to see if we have an executable to test. If not, then either we
# haven't tried to compile one, or the compilation failed for some reason.
@ -678,6 +679,7 @@ proc test_virtual_calls {} {
global gdb_prompt
global GDB
global nl
global gcc_compiled
if [target_info exists gdb,cannot_call_functions] {
setup_xfail "*-*-*" 2416
@ -685,6 +687,12 @@ proc test_virtual_calls {} {
return 0
}
# FIXME: In fall 1998, GCC's virtual function type info was changed,
# which causes GDB to be unable to resolve these calls. Until the
# problem is fixed, XFAIL these tests. -sts 1999-08-02
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print pAe->f()\n"
gdb_expect {
-re ".* = 20$nl$gdb_prompt $" { pass "print pAe->f()" }
@ -706,6 +714,8 @@ proc test_virtual_calls {} {
eof { fail "print pAe->f() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print pAa->f()\n"
gdb_expect {
-re ".* = 1$nl$gdb_prompt $" { pass "print pAa->f()" }
@ -718,6 +728,8 @@ proc test_virtual_calls {} {
eof { fail "print pAa->f() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print pDe->vg()\n"
gdb_expect {
-re ".* = 202$nl$gdb_prompt $" { pass "print pDe->vg()" }
@ -730,6 +742,8 @@ proc test_virtual_calls {} {
eof { fail "print pDe->vg() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print pADe->vg()\n"
gdb_expect {
-re ".* = 202$nl$gdb_prompt $" { pass "print pADe->vg()" }
@ -742,6 +756,8 @@ proc test_virtual_calls {} {
eof { fail "print pADe->vg() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print pDd->vg()\n"
gdb_expect {
-re ".* = 101$nl$gdb_prompt $" { pass "print pDd->vg()" }
@ -754,6 +770,8 @@ proc test_virtual_calls {} {
eof { fail "print pDd->vg() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print pEe->vvb()\n"
gdb_expect {
-re ".* = 411$nl$gdb_prompt $" { pass "print pEe->vvb()" }
@ -766,6 +784,8 @@ proc test_virtual_calls {} {
eof { fail "print pEe->vvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print pVB->vvb()\n"
gdb_expect {
-re ".* = 407$nl$gdb_prompt $" { pass "print pVB->vvb()" }
@ -778,6 +798,8 @@ proc test_virtual_calls {} {
eof { fail "print pVB->vvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print pBe->vvb()\n"
gdb_expect {
-re ".* = 411$nl$gdb_prompt $" { pass "print pBe->vvb()" }
@ -790,6 +812,8 @@ proc test_virtual_calls {} {
eof { fail "print pBe->vvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print pDe->vvb()\n"
gdb_expect {
-re ".* = 411$nl$gdb_prompt $" { pass "print pDe->vvb()" }
@ -802,6 +826,8 @@ proc test_virtual_calls {} {
eof { fail "print pDe->vvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print pEe->vd()\n"
gdb_expect {
-re ".* = 282$nl$gdb_prompt $" { pass "print pEe->vd()" }
@ -814,6 +840,8 @@ proc test_virtual_calls {} {
eof { fail "print pEe->vd() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print pEe->fvb()\n"
gdb_expect {
-re ".* = 311$nl$gdb_prompt $" { pass "print pEe->fvb()" }
@ -826,6 +854,8 @@ proc test_virtual_calls {} {
eof { fail "print pEe->fvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
if {$gcc_compiled} then { setup_xfail "*-*-*" }
send_gdb "print pEe->D::vg()\n"
setup_xfail "*-*-*"
gdb_expect {

View File

@ -445,6 +445,9 @@ void (*registers_changed_hook) PARAMS ((void));
that several registers have changed (see value_assign). */
void (*register_changed_hook) PARAMS ((int regno));
/* Tell the GUI that the disassembly flavor has changed */
void (*disassembly_flavor_hook) PARAMS((char *args, int from_tty));
/* Tell the GUI someone changed LEN bytes of memory at ADDR */
void (*memory_changed_hook) PARAMS ((CORE_ADDR addr, int len));
@ -459,6 +462,11 @@ int (*target_wait_hook) PARAMS ((int pid, struct target_waitstatus * status));
void (*call_command_hook) PARAMS ((struct cmd_list_element * c, char *cmd,
int from_tty));
/* Called after a `set' command has finished. Is only run if the
`set' command succeeded. */
void (*set_hook) PARAMS ((struct cmd_list_element *c));
/* Called when the current thread changes. Argument is thread id. */
void (*context_hook) PARAMS ((int id));
@ -1045,7 +1053,7 @@ arg_cleanup ()
{
struct user_args *oargs = user_args;
if (!user_args)
fatal ("Internal error, arg_cleanup called with no user args.\n");
internal_error ("Internal error, arg_cleanup called with no user args.\n");
user_args = user_args->next;
free (oargs);
@ -3808,7 +3816,7 @@ init_main ()
else
{
/* initialize the prompt stack to a simple "(gdb) " prompt or to
whatever the DEFULAT_PROMPT is. */
whatever the DEFAULT_PROMPT is. */
the_prompts.top = 0;
PREFIX (0) = "";
#ifdef DEFAULT_PROMPT

View File

@ -65,9 +65,6 @@ static void fputs_maybe_filtered PARAMS ((const char *, GDB_FILE *, int));
static void malloc_botch PARAMS ((void));
#endif
static void
fatal_dump_core PARAMS ((char *,...));
static void
prompt_for_continue PARAMS ((void));
@ -431,24 +428,11 @@ warning_begin ()
The primary difference between warnings and errors is that a warning
does not force the return to command level. */
/* VARARGS */
void
#ifdef ANSI_PROTOTYPES
warning (const char *string,...)
#else
warning (va_alist)
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, string);
#else
char *string;
va_start (args);
string = va_arg (args, char *);
#endif
if (warning_hook)
(*warning_hook) (string, args);
else
@ -487,36 +471,17 @@ error_begin ()
The first argument STRING is the error message, used as a fprintf string,
and the remaining args are passed as arguments to it. */
/* VARARGS */
NORETURN void
#ifdef ANSI_PROTOTYPES
error (const char *string,...)
#else
error (va_alist)
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, string);
#else
va_start (args);
#endif
if (error_hook)
(*error_hook) ();
else
{
error_begin ();
#ifdef ANSI_PROTOTYPES
vfprintf_filtered (gdb_stderr, string, args);
#else
{
char *string1;
string1 = va_arg (args, char *);
vfprintf_filtered (gdb_stderr, string1, args);
}
#endif
fprintf_filtered (gdb_stderr, "\n");
va_end (args);
return_to_top_level (RETURN_ERROR);
@ -524,69 +489,46 @@ error (va_alist)
}
/* Print an error message and exit reporting failure.
This is for a error that we cannot continue from.
The arguments are printed a la printf.
/* Print a message reporting an internal error. Ask the user if they
want to continue, dump core, or just exit. */
This function cannot be declared volatile (NORETURN) in an
ANSI environment because exit() is not declared volatile. */
/* VARARGS */
NORETURN void
#ifdef ANSI_PROTOTYPES
fatal (char *string,...)
#else
fatal (va_alist)
va_dcl
#endif
internal_error (char *string, ...)
{
static char msg[] = "Internal GDB error: recursive internal error.\n";
static int dejavu = 0;
va_list args;
#ifdef ANSI_PROTOTYPES
/* don't allow infinite error recursion. */
switch (dejavu)
{
case 0:
dejavu = 1;
break;
case 1:
dejavu = 2;
fputs_unfiltered (msg, gdb_stderr);
abort ();
default:
dejavu = 3;
write (STDERR_FILENO, msg, sizeof (msg));
exit (1);
}
/* Try to get the message out */
fputs_unfiltered ("\nGDB-INTERNAL-ERROR: ", gdb_stderr);
va_start (args, string);
#else
char *string;
va_start (args);
string = va_arg (args, char *);
#endif
fprintf_unfiltered (gdb_stderr, "\ngdb: ");
vfprintf_unfiltered (gdb_stderr, string, args);
fprintf_unfiltered (gdb_stderr, "\n");
va_end (args);
exit (1);
}
fputs_unfiltered ("\n", gdb_stderr);
/* Print an error message and exit, dumping core.
The arguments are printed a la printf (). */
if (query ("\
An internal GDB error has been detected.\n\
Do you want to quit GDB (dumping core)? "))
abort ();
/* VARARGS */
static void
#ifdef ANSI_PROTOTYPES
fatal_dump_core (char *string,...)
#else
fatal_dump_core (va_alist)
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, string);
#else
char *string;
va_start (args);
string = va_arg (args, char *);
#endif
/* "internal error" is always correct, since GDB should never dump
core, no matter what the input. */
fprintf_unfiltered (gdb_stderr, "\ngdb internal error: ");
vfprintf_unfiltered (gdb_stderr, string, args);
fprintf_unfiltered (gdb_stderr, "\n");
va_end (args);
signal (SIGQUIT, SIG_DFL);
kill (getpid (), SIGQUIT);
/* We should never get here, but just in case... */
exit (1);
dejavu = 0;
return_to_top_level (RETURN_ERROR);
}
/* The strerror() function can return NULL for errno values that are
@ -847,7 +789,8 @@ init_malloc (md)
static void
malloc_botch ()
{
fatal_dump_core ("Memory corruption");
fprintf_unfiltered (gdb_stderr, "Memory corruption\n");
abort ();
}
/* Attempt to install hooks in mmalloc/mrealloc/mfree for the heap specified
@ -898,11 +841,11 @@ nomem (size)
{
if (size > 0)
{
fatal ("virtual memory exhausted: can't allocate %ld bytes.", size);
internal_error ("virtual memory exhausted: can't allocate %ld bytes.", size);
}
else
{
fatal ("virtual memory exhausted.");
internal_error ("virtual memory exhausted.");
}
}
@ -1075,25 +1018,14 @@ gdb_print_address (addr, stream)
/* VARARGS */
int
#ifdef ANSI_PROTOTYPES
query (char *ctlstr,...)
#else
query (va_alist)
va_dcl
#endif
{
va_list args;
register int answer;
register int ans2;
int retval;
#ifdef ANSI_PROTOTYPES
va_start (args, ctlstr);
#else
char *ctlstr;
va_start (args);
ctlstr = va_arg (args, char *);
#endif
if (query_hook)
{
@ -2443,50 +2375,20 @@ vprintf_unfiltered (format, args)
vfprintf_unfiltered (gdb_stdout, format, args);
}
/* VARARGS */
void
#ifdef ANSI_PROTOTYPES
fprintf_filtered (GDB_FILE * stream, const char *format,...)
#else
fprintf_filtered (va_alist)
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
GDB_FILE *stream;
char *format;
va_start (args);
stream = va_arg (args, GDB_FILE *);
format = va_arg (args, char *);
#endif
vfprintf_filtered (stream, format, args);
va_end (args);
}
/* VARARGS */
void
#ifdef ANSI_PROTOTYPES
fprintf_unfiltered (GDB_FILE * stream, const char *format,...)
#else
fprintf_unfiltered (va_alist)
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
GDB_FILE *stream;
char *format;
va_start (args);
stream = va_arg (args, GDB_FILE *);
format = va_arg (args, char *);
#endif
vfprintf_unfiltered (stream, format, args);
va_end (args);
}
@ -2494,28 +2396,11 @@ fprintf_unfiltered (va_alist)
/* Like fprintf_filtered, but prints its result indented.
Called as fprintfi_filtered (spaces, stream, format, ...); */
/* VARARGS */
void
#ifdef ANSI_PROTOTYPES
fprintfi_filtered (int spaces, GDB_FILE * stream, const char *format,...)
#else
fprintfi_filtered (va_alist)
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
int spaces;
GDB_FILE *stream;
char *format;
va_start (args);
spaces = va_arg (args, int);
stream = va_arg (args, GDB_FILE *);
format = va_arg (args, char *);
#endif
print_spaces_filtered (spaces, stream);
vfprintf_filtered (stream, format, args);
@ -2523,47 +2408,21 @@ fprintfi_filtered (va_alist)
}
/* VARARGS */
void
#ifdef ANSI_PROTOTYPES
printf_filtered (const char *format,...)
#else
printf_filtered (va_alist)
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
char *format;
va_start (args);
format = va_arg (args, char *);
#endif
vfprintf_filtered (gdb_stdout, format, args);
va_end (args);
}
/* VARARGS */
void
#ifdef ANSI_PROTOTYPES
printf_unfiltered (const char *format,...)
#else
printf_unfiltered (va_alist)
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
char *format;
va_start (args);
format = va_arg (args, char *);
#endif
vfprintf_unfiltered (gdb_stdout, format, args);
va_end (args);
}
@ -2571,26 +2430,11 @@ printf_unfiltered (va_alist)
/* Like printf_filtered, but prints it's result indented.
Called as printfi_filtered (spaces, format, ...); */
/* VARARGS */
void
#ifdef ANSI_PROTOTYPES
printfi_filtered (int spaces, const char *format,...)
#else
printfi_filtered (va_alist)
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
int spaces;
char *format;
va_start (args);
spaces = va_arg (args, int);
format = va_arg (args, char *);
#endif
print_spaces_filtered (spaces, gdb_stdout);
vfprintf_filtered (gdb_stdout, format, args);
va_end (args);

View File

@ -873,7 +873,7 @@ v850_target_architecture_hook (ap)
}
}
fatal ("Architecture `%s' unreconized", ap->printable_name);
internal_error ("Architecture `%s' unreconized", ap->printable_name);
}
void

View File

@ -196,7 +196,7 @@ static struct complaint eb_complaint =
{"Mismatched .eb symbol ignored starting at symnum %d", 0, 0};
static void
xcoff_initial_scan PARAMS ((struct objfile *, struct section_offsets *, int));
xcoff_initial_scan PARAMS ((struct objfile *, int));
static void
scan_xcoff_symtab PARAMS ((struct section_offsets *, struct objfile *));
@ -2230,7 +2230,7 @@ scan_xcoff_symtab (section_offsets, objfile)
char *sraw_symbol;
struct internal_syment symbol;
union internal_auxent main_aux;
union internal_auxent main_aux[5];
unsigned int ssymnum;
char *last_csect_name = NULL; /* last seen csect's name and value */
@ -2279,7 +2279,7 @@ scan_xcoff_symtab (section_offsets, objfile)
union internal_auxent csect_aux;
unsigned int symnum_before = ssymnum;
swap_sym (&symbol, &main_aux, &namestring, &sraw_symbol,
swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol,
&ssymnum, objfile);
if (symbol.n_numaux > 1)
{
@ -2293,7 +2293,7 @@ scan_xcoff_symtab (section_offsets, objfile)
&csect_aux);
}
else
csect_aux = main_aux;
csect_aux = main_aux[0];
/* If symbol name starts with ".$" or "$", ignore it. */
if (namestring[0] == '$'
@ -2401,7 +2401,7 @@ scan_xcoff_symtab (section_offsets, objfile)
if (first_fun_line_offset == 0 && symbol.n_numaux > 1)
first_fun_line_offset =
main_aux.x_sym.x_fcnary.x_fcn.x_lnnoptr;
main_aux[0].x_sym.x_fcnary.x_fcn.x_lnnoptr;
RECORD_MINIMAL_SYMBOL
(namestring, symbol.n_value,
sclass == C_HIDEXT ? mst_file_text : mst_text,
@ -2476,7 +2476,7 @@ scan_xcoff_symtab (section_offsets, objfile)
unsigned int symnum_before;
symnum_before = ssymnum;
swap_sym (&symbol, &main_aux, &namestring, &sraw_symbol,
swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol,
&ssymnum, objfile);
/* See if the last csect needs to be recorded. */
@ -2510,7 +2510,7 @@ scan_xcoff_symtab (section_offsets, objfile)
exists, otherwise use the symbol itself. */
if (!strcmp (namestring, ".file") && symbol.n_numaux > 0)
{
filestring = coff_getfilename (&main_aux, objfile);
filestring = coff_getfilename (&main_aux[0], objfile);
}
else
filestring = namestring;
@ -2600,7 +2600,7 @@ scan_xcoff_symtab (section_offsets, objfile)
case C_STSYM:
stype = N_LSYM;
pstab:;
swap_sym (&symbol, &main_aux, &namestring, &sraw_symbol,
swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol,
&ssymnum, objfile);
#define CUR_SYMBOL_TYPE stype
#define CUR_SYMBOL_VALUE symbol.n_value
@ -2654,9 +2654,8 @@ get_toc_offset (objfile)
table (as opposed to a shared lib or dynamically loaded file). */
static void
xcoff_initial_scan (objfile, section_offsets, mainline)
xcoff_initial_scan (objfile, mainline)
struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline; /* FIXME comments above */
{
bfd *abfd;
@ -2751,7 +2750,7 @@ xcoff_initial_scan (objfile, section_offsets, mainline)
/* Now that the symbol table data of the executable file are all in core,
process them and define symbols accordingly. */
scan_xcoff_symtab (section_offsets, objfile);
scan_xcoff_symtab (objfile->section_offsets, objfile);
/* Install any minimal symbols that have been collected as the current
minimal symbols for this objfile. */
@ -2771,10 +2770,7 @@ xcoff_symfile_offsets (objfile, addr)
objfile->num_sections = SECT_OFF_MAX;
section_offsets = (struct section_offsets *)
obstack_alloc
(&objfile->psymbol_obstack,
sizeof (struct section_offsets)
+ sizeof (section_offsets->offsets) * objfile->num_sections);
obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
/* syms_from_objfile kindly subtracts from addr the bfd_section_vma
of the .text section. This strikes me as wrong--whether the

View File

@ -1,3 +1,35 @@
1999-08-08 Doug Evans <devans@casey.cygnus.com>
* cgen-engine.h (SEM_FN_NAME,SEMF_FN_NAME): Delete.
(insn_sem): Rewrite.
(sem_fn_desc): New struct.
(idesc): Rewrite.
* genmloop.sh (scache case,@cpu@_scache_lookup): Profile scache hit,
misses if ! FAST_P.
(scache case): Split into non-parallel/parallel versions.
(@cpu@_engine_run_{full,fast}): Call @cpu@_{sem,semf}_init_idesc_table
if not use semantic switch version.
1999-08-04 Doug Evans <devans@casey.cygnus.com>
* cgen-defs.h (SEM_BRANCH_TYPE): New enum.
* cgen-engine.h (SEM_BRANCH_UNTAKEN,SEM_BRANCH_UNCACHEABLE): Delete.
(SEM_BRANCH_INIT_EXTRACT): Delete.
(SEM_BRANCH_INIT): Replace npc_ptr with br_type.
(SEM_BRANCH_FINI): Ditto.
(SEM_BRANCH_VIA_ADDR): Ditto.
(SEM_BRANCH_VIA_CACHE): Ditto. Delete cachvarptr arg.
(SEM_BRANCH_ADDR_CACHE): Delete.
(SEM_SKIP_COMPILE,SEM_SKIP_INSN): New macros.
* cgen-scache.h (cpu_scache): Replace member pbb_pr_npc_ptr with
pbb_br_type.
* genmloop.sh (eng.hin): Update prototype of ${cpu}_pbb_cti_chain.
(@cpu@_pbb_begin): Initialize branch_target.
(@cpu@_pbb_cti_chain): Replace arg new_vpc_ptr with br_type.
(@cpu@_engine_run_full): Replace local pbb_br_npc_ptr with
pbb_br_type.
(@cpu@_engine_run_fast): Ditto.
Fri Jul 16 14:47:53 1999 Dave Brolley <brolley@cygnus.com>
* cgen-utils.c (RORSI): New function.

View File

@ -63,8 +63,8 @@ typedef struct {
IDESC *idesc;
#define CPU_IDESC(cpu) ((cpu)->cgen_cpu.idesc)
/* Whether the read,write,semantic entries (computed goto labels) have been
initialized or not. */
/* Whether the read,write,semantic entries (function pointers or computed
goto labels) have been initialized or not. */
int idesc_read_init_p;
#define CPU_IDESC_READ_INIT_P(cpu) ((cpu)->cgen_cpu.idesc_read_init_p)
int idesc_write_init_p;

View File

@ -92,6 +92,15 @@ typedef SCACHE *SEM_PC;
#else
typedef IADDR SEM_PC;
#endif
/* Kinds of branches. */
typedef enum {
SEM_BRANCH_UNTAKEN,
/* Branch to an uncacheable address (e.g. j reg). */
SEM_BRANCH_UNCACHEABLE,
/* Branch to a cacheable (fixed) address. */
SEM_BRANCH_CACHEABLE
} SEM_BRANCH_TYPE;
/* Virtual insn support. */

View File

@ -180,11 +180,6 @@ do { \
& CGEN_ATTR_MASK (CGEN_INSN_SKIP_CTI)) \
!= 0)
/* These are used so that we can compile two copies of the semantic code,
one with full feature support and one without that runs fast(er). */
#define SEM_FN_NAME(cpu,fn) XCONCAT3 (cpu,_sem_,fn)
#define SEMF_FN_NAME(cpu,fn) XCONCAT3 (cpu,_semf_,fn)
/* Return pointer to ARGBUF given ptr to SCACHE. */
#define SEM_ARGBUF(sem_arg) (& (sem_arg) -> argbuf)
@ -217,22 +212,11 @@ do { \
#define PBB_UPDATE_INSN_COUNT(cpu,sc) \
(CPU_INSN_COUNT (cpu) += SEM_ARGBUF (sc) -> fields.chain.insn_count)
/* Value for br_addr_ptr indicating branch wasn't taken. */
#define SEM_BRANCH_UNTAKEN ((SEM_PC *) 0)
/* Value for br_addr_ptr indicating branch was taken to uncacheable
address (e.g. j reg). */
#define SEM_BRANCH_UNCACHEABLE ((SEM_PC *) 1)
/* Initialize next-pbb link for SEM_BRANCH_VIA_CACHE. */
#define SEM_BRANCH_INIT_EXTRACT(abuf) \
do { (abuf)->fields.cti.addr_cache = 0; } while (0)
/* Do not append a `;' to invocations of this.
npc,npc_ptr are for communication between the cti insn and cti-chain. */
npc,br_type are for communication between the cti insn and cti-chain. */
#define SEM_BRANCH_INIT \
IADDR npc = 0; /* assign a value for -Wall */ \
SEM_PC *npc_ptr = SEM_BRANCH_UNTAKEN;
SEM_BRANCH_TYPE br_type = SEM_BRANCH_UNTAKEN;
/* SEM_IN_SWITCH is defined at the top of the mainloop.c files
generated by genmloop.sh. It exists so generated semantic code needn't
@ -241,30 +225,36 @@ do { (abuf)->fields.cti.addr_cache = 0; } while (0)
#define SEM_BRANCH_FINI(pcvar) \
do { \
pbb_br_npc = npc; \
pbb_br_npc_ptr = npc_ptr; \
pbb_br_type = br_type; \
} while (0)
#else /* 1 semantic function per instruction */
#define SEM_BRANCH_FINI(pcvar) \
do { \
CPU_PBB_BR_NPC (current_cpu) = npc; \
CPU_PBB_BR_NPC_PTR (current_cpu) = npc_ptr; \
CPU_PBB_BR_TYPE (current_cpu) = br_type; \
} while (0)
#endif
/* Return address of cached branch address value. */
#define SEM_BRANCH_ADDR_CACHE(sem_arg) \
(& SEM_ARGBUF (sem_arg)->fields.cti.addr_cache)
#define SEM_BRANCH_VIA_CACHE(cpu, sc, newval, pcvar, cachevarptr) \
#define SEM_BRANCH_VIA_CACHE(cpu, sc, newval, pcvar) \
do { \
npc = (newval); \
npc_ptr = (cachevarptr); \
br_type = SEM_BRANCH_CACHEABLE; \
} while (0)
#define SEM_BRANCH_VIA_ADDR(cpu, sc, newval, pcvar) \
do { \
npc = (newval); \
npc_ptr = SEM_BRANCH_UNCACHEABLE; \
br_type = SEM_BRANCH_UNCACHEABLE; \
} while (0)
#define SEM_SKIP_COMPILE(cpu, sc, skip) \
do { \
SEM_ARGBUF (sc) -> skip_count = (skip); \
} while (0)
#define SEM_SKIP_INSN(cpu, sc, vpcvar) \
do { \
(vpcvar) += SEM_ARGBUF (sc) -> skip_count; \
} while (0)
#else /* ! WITH_SCACHE_PBB */
@ -273,8 +263,6 @@ do { \
#define SEM_NEXT_VPC(sem_arg, pc, len) ((pc) + (len))
#define SEM_BRANCH_INIT_EXTRACT(abuf) do { } while (0)
/* ??? May wish to move taken_p out of here and make it explicit. */
#define SEM_BRANCH_INIT \
int taken_p = 0;
@ -285,9 +273,7 @@ do { \
#define SEM_BRANCH_FINI(pcvar) \
do { TARGET_SEM_BRANCH_FINI (pcvar, taken_p); } while (0)
#define SEM_BRANCH_ADDR_CACHE(sem_arg) shouldnt_be_used
#define SEM_BRANCH_VIA_CACHE(cpu, sc, newval, pcvar, cachevar) \
#define SEM_BRANCH_VIA_CACHE(cpu, sc, newval, pcvar) \
do { \
(pcvar) = (newval); \
taken_p = 1; \
@ -314,9 +300,7 @@ do { \
#define SEM_BRANCH_INIT \
int taken_p = 0;
#define SEM_BRANCH_ADDR_CACHE(sem_arg) shouldnt_be_used
#define SEM_BRANCH_VIA_CACHE(cpu, abuf, newval, pcvar, cachevar) \
#define SEM_BRANCH_VIA_CACHE(cpu, abuf, newval, pcvar) \
do { \
(pcvar) = (newval); \
taken_p = 1; \
@ -344,10 +328,12 @@ do { \
/* Instruction information. */
/* Compile time computable instruction data.
/* Sanity check, at most one of these may be true. */
#if WITH_PARALLEL_READ && WITH_PARALLEL_WRITE
#error "Both WITH_PARALLEL_READ && WITH_PARALLEL_WRITE can't be true."
#endif
??? May wish to move parallel execution support into its own struct.
It's a fair bit of "clutter" for the "normal" case. */
/* Compile time computable instruction data. */
struct insn_sem {
/* The instruction type (a number that identifies each insn over the
@ -357,10 +343,8 @@ struct insn_sem {
/* Index in IDESC table. */
int index;
/* Sanity check, at most one of these may be true. */
#if WITH_PARALLEL_READ && WITH_PARALLEL_WRITE
#error "Both WITH_PARALLEL_READ && WITH_PARALLEL_WRITE can't be true."
#endif
/* Semantic format number. */
int sfmt;
#if WITH_PARALLEL_READ || WITH_PARALLEL_WRITE
/* Index in IDESC table of parallel handler. */
@ -368,50 +352,38 @@ struct insn_sem {
#endif
#if WITH_PARALLEL_READ
#ifndef __GNUC__
/* Semantic format number of pre-read handler.
Only used by chips that support parallel execution of several insns.
It is always implemented as a `switch'. In the case of GNUC we use
computed gotos. When not GNUC, this is the argument to `switch'. */
int fmt;
#endif
/* Index in IDESC table of read handler. */
int read_index;
#endif
#if WITH_PARALLEL_WRITE
/* Index in IDESC table of writeback handler.
Only used by chips that support parallel execution of several insns. */
/* Index in IDESC table of writeback handler. */
int write_index;
#endif
};
/* Routines to execute the insn.
The full version has all features (profiling,tracing) compiled in.
The fast version has none of that. */
#if ! WITH_SEM_SWITCH_FULL
SEMANTIC_FN *sem_full;
#endif
#if WITH_FAST && ! WITH_SEM_SWITCH_FAST
SEMANTIC_FN *sem_fast;
#endif
/* Entry in semantic function table.
This information is copied to the insn descriptor table at run-time. */
struct sem_fn_desc {
/* Index in IDESC table. */
int index;
/* Function to perform the semantics of the insn. */
SEMANTIC_FN *fn;
};
/* Run-time computed instruction descriptor. */
struct idesc {
/* Parallel read-before-exec support. */
#if WITH_PARALLEL_READ
struct idesc *par_idesc;
#if WITH_SEM_SWITCH_FAST
#ifdef __GNUC__
void *read;
void *sem_fast_lab;
#else
int fmt;
/* nothing needed, switch's on `num' member */
#endif
#endif
/* Parallel write-after-exec support. */
#if WITH_PARALLEL_WRITE
/* Pointer to parallel handler if serial insn.
Pointer to writeback handler if parallel insn. */
struct idesc *par_idesc;
#else
SEMANTIC_FN *sem_fast;
#endif
#if WITH_SEM_SWITCH_FULL
@ -424,20 +396,20 @@ struct idesc {
SEMANTIC_FN *sem_full;
#endif
#if WITH_SEM_SWITCH_FAST
#ifdef __GNUC__
void *sem_fast_lab;
#else
/* nothing needed, switch's on `num' member */
#endif
#else
SEMANTIC_FN *sem_fast;
/* Parallel support. */
#if WITH_PARALLEL_READ || WITH_PARALLEL_WRITE
/* Pointer to parallel handler if serial insn.
Pointer to readahead/writeback handler if parallel insn. */
struct idesc *par_idesc;
#endif
/* Instruction number (index in IDESC table, profile table).
Also used to switch on in non-gcc semantic switches. */
int num;
/* Semantic format id. */
int sfmt;
/* instruction data (name, attributes, size, etc.) */
const CGEN_INSN *idata;

View File

@ -313,6 +313,8 @@ scache_flush_cpu (SIM_CPU *cpu)
SCACHE *
scache_lookup (SIM_CPU *cpu, IADDR pc)
{
/* FIXME: hash computation is wrong, doesn't take into account
NUM_HASH_CHAIN_ENTRIES. A lot of the hash table will be unused! */
unsigned int slot = HASH_PC (pc) & (CPU_SCACHE_NUM_HASH_CHAINS (cpu) - 1);
int i, max_i = CPU_SCACHE_NUM_HASH_CHAIN_ENTRIES (cpu);
SCACHE_MAP *scm;
@ -343,6 +345,8 @@ scache_lookup (SIM_CPU *cpu, IADDR pc)
SCACHE *
scache_lookup_or_alloc (SIM_CPU *cpu, IADDR pc, int n, SCACHE **bufp)
{
/* FIXME: hash computation is wrong, doesn't take into account
NUM_HASH_CHAIN_ENTRIES. A lot of the hash table will be unused! */
unsigned int slot = HASH_PC (pc) & (CPU_SCACHE_NUM_HASH_CHAINS (cpu) - 1);
int i, max_i = CPU_SCACHE_NUM_HASH_CHAIN_ENTRIES (cpu);
SCACHE_MAP *scm;
@ -372,6 +376,7 @@ scache_lookup_or_alloc (SIM_CPU *cpu, IADDR pc, int n, SCACHE **bufp)
static int next_free = 0;
scm = & CPU_SCACHE_HASH_TABLE (cpu) [slot];
/* FIXME: This seems rather clumsy. */
for (i = 0; i < next_free; ++i, ++scm)
continue;
++next_free;
@ -381,6 +386,8 @@ scache_lookup_or_alloc (SIM_CPU *cpu, IADDR pc, int n, SCACHE **bufp)
/* At this point SCM points to the hash table entry to use.
Now make sure there's room in the cache. */
/* FIXME: Kinda weird to use a next_free adjusted scm when cache is
flushed. */
{
int elm_size = IMP_PROPS_SCACHE_ELM_SIZE (MACH_IMP_PROPS (CPU_MACH (cpu)));

View File

@ -69,10 +69,10 @@ typedef struct cpu_scache {
SCACHE *next_free;
#define CPU_SCACHE_NEXT_FREE(cpu) ((cpu) -> cgen_cpu.scache.next_free)
/* Address of cti-chain insn, only used by functional semantics,
not switch form. */
SCACHE **pbb_br_npc_ptr;
#define CPU_PBB_BR_NPC_PTR(cpu) ((cpu) -> cgen_cpu.scache.pbb_br_npc_ptr)
/* Kind of branch being taken.
Only used by functional semantics, not switch form. */
SEM_BRANCH_TYPE pbb_br_type;
#define CPU_PBB_BR_TYPE(cpu) ((cpu) -> cgen_cpu.scache.pbb_br_type)
/* Target's branch address. */
IADDR pbb_br_npc;
#define CPU_PBB_BR_NPC(cpu) ((cpu) -> cgen_cpu.scache.pbb_br_npc)

View File

@ -238,7 +238,7 @@ if [ x$pbb = xyes ] ; then
echo ""
echo "extern SEM_PC ${cpu}_pbb_begin (SIM_CPU *, int);"
echo "extern SEM_PC ${cpu}_pbb_chain (SIM_CPU *, SEM_ARG);"
echo "extern SEM_PC ${cpu}_pbb_cti_chain (SIM_CPU *, SEM_ARG, SEM_PC *, PCADDR);"
echo "extern SEM_PC ${cpu}_pbb_cti_chain (SIM_CPU *, SEM_ARG, SEM_BRANCH_TYPE, PCADDR);"
echo "extern void ${cpu}_pbb_before (SIM_CPU *, SCACHE *);"
echo "extern void ${cpu}_pbb_after (SIM_CPU *, SCACHE *);"
fi
@ -372,10 +372,10 @@ fi
# Note that this code may declare some locals.
${SHELL} $infile init
if [ x$parallel != xno ] ; then
if [ x$parallel = xread ] ; then
cat << EOF
#if defined (HAVE_PARALLEL_EXEC) && defined (__GNUC__)
#if defined (__GNUC__)
{
if (! CPU_IDESC_READ_INIT_P (current_cpu))
{
@ -392,17 +392,19 @@ fi
cat << EOF
#if WITH_SEM_SWITCH_FULL && defined (__GNUC__)
{
if (! CPU_IDESC_SEM_INIT_P (current_cpu))
{
if (! CPU_IDESC_SEM_INIT_P (current_cpu))
{
#if WITH_SEM_SWITCH_FULL
#if defined (__GNUC__)
/* ??? Later maybe paste sem-switch.c in when building mainloop.c. */
#define DEFINE_LABELS
#include "$switch"
CPU_IDESC_SEM_INIT_P (current_cpu) = 1;
}
}
#endif
#else
@cpu@_sem_init_idesc_table (current_cpu);
#endif
CPU_IDESC_SEM_INIT_P (current_cpu) = 1;
}
do
{
@ -446,9 +448,10 @@ fi # simple engine
##########################################################################
# Scache engine: lookup insn in scache, fetch if missing, then execute it.
# Non-parallel scache engine: lookup insn in scache, fetch if missing,
# then execute it.
if [ x$scache = xyes ] ; then
if [ x$scache = xyes -a x$parallel = xno ] ; then
cat << EOF
@ -463,7 +466,7 @@ static INLINE SCACHE *
fetch and decode the instruction. */
if (sc->argbuf.addr != vpc)
{
if (FAST_P)
if (! FAST_P)
PROFILE_COUNT_SCACHE_MISS (current_cpu);
/* begin extract-scache */
@ -474,7 +477,7 @@ ${SHELL} $infile extract-scache
cat << EOF
/* end extract-scache */
}
else if (FAST_P)
else if (! FAST_P)
{
PROFILE_COUNT_SCACHE_HIT (current_cpu);
/* Make core access statistics come out right.
@ -497,38 +500,20 @@ void
EOF
if [ x$parallel != xno ] ; then
cat << EOF
PAREXEC pbufs[MAX_PARALLEL_INSNS];
PAREXEC *par_exec;
EOF
fi
# Any initialization code before looping starts.
# Note that this code may declare some locals.
${SHELL} $infile init
if [ x$parallel != xno ] ; then
cat << EOF
#if defined (HAVE_PARALLEL_EXEC) && defined (__GNUC__)
{
if (! CPU_IDESC_READ_INIT_P (current_cpu))
{
/* ??? Later maybe paste read.c in when building mainloop.c. */
#define DEFINE_LABELS
#include "readx.c"
CPU_IDESC_READ_INIT_P (current_cpu) = 1;
}
}
#endif
EOF
fi
cat << EOF
if (! CPU_IDESC_SEM_INIT_P (current_cpu))
{
#if ! WITH_SEM_SWITCH_FULL
@cpu@_sem_init_idesc_table (current_cpu);
#endif
CPU_IDESC_SEM_INIT_P (current_cpu) = 1;
}
vpc = GET_H_PC ();
do
@ -558,7 +543,7 @@ EOF
####################################
# Scache engine: fast version.
# Non-parallel scache engine: fast version.
if [ x$fast = xyes ] ; then
@ -576,49 +561,25 @@ void
EOF
if [ x$parallel != xno ] ; then
cat << EOF
PAREXEC pbufs[MAX_PARALLEL_INSNS];
PAREXEC *par_exec;
EOF
fi
# Any initialization code before looping starts.
# Note that this code may declare some locals.
${SHELL} $infile init
if [ x$parallel != xno ] ; then
cat << EOF
#if defined (HAVE_PARALLEL_EXEC) && defined (__GNUC__)
{
if (! CPU_IDESC_READ_INIT_P (current_cpu))
{
/* ??? Later maybe paste read.c in when building mainloop.c. */
#define DEFINE_LABELS
#include "readx.c"
CPU_IDESC_READ_INIT_P (current_cpu) = 1;
}
}
#endif
EOF
fi # parallel != no
cat << EOF
#if WITH_SEM_SWITCH_FAST && defined (__GNUC__)
{
if (! CPU_IDESC_SEM_INIT_P (current_cpu))
{
if (! CPU_IDESC_SEM_INIT_P (current_cpu))
{
#if WITH_SEM_SWITCH_FAST
#if defined (__GNUC__)
/* ??? Later maybe paste sem-switch.c in when building mainloop.c. */
#define DEFINE_LABELS
#include "$switch"
CPU_IDESC_SEM_INIT_P (current_cpu) = 1;
}
}
#endif
#else
@cpu@_semf_init_idesc_table (current_cpu);
#endif
CPU_IDESC_SEM_INIT_P (current_cpu) = 1;
}
vpc = GET_H_PC ();
@ -649,7 +610,197 @@ EOF
fi # -fast
fi # -scache
fi # -scache && ! parallel
##########################################################################
# Parallel scache engine: lookup insn in scache, fetch if missing,
# then execute it.
# For the parallel case we give the target more flexibility.
if [ x$scache = xyes -a x$parallel != xno ] ; then
cat << EOF
static INLINE SCACHE *
@cpu@_scache_lookup (SIM_CPU *current_cpu, PCADDR vpc, SCACHE *scache,
unsigned int hash_mask, int *last_insn_p, int FAST_P)
{
/* First step: look up current insn in hash table. */
SCACHE *sc = scache + SCACHE_HASH_PC (vpc, hash_mask);
/* If the entry isn't the one we want (cache miss),
fetch and decode the instruction. */
if (sc->argbuf.addr != vpc)
{
if (! FAST_P)
PROFILE_COUNT_SCACHE_MISS (current_cpu);
#define SET_LAST_INSN_P(last_p) do { *last_insn_p = (last_p); } while (0)
/* begin extract-scache */
EOF
${SHELL} $infile extract-scache
cat << EOF
/* end extract-scache */
#undef SET_LAST_INSN_P
}
else if (! FAST_P)
{
PROFILE_COUNT_SCACHE_HIT (current_cpu);
/* Make core access statistics come out right.
The size is a guess, but it's currently not used either. */
PROFILE_COUNT_CORE (current_cpu, vpc, 2, exec_map);
}
return sc;
}
#define FAST_P 0
void
@cpu@_engine_run_full (SIM_CPU *current_cpu)
{
SIM_DESC current_state = CPU_STATE (current_cpu);
SCACHE *scache = CPU_SCACHE_CACHE (current_cpu);
unsigned int hash_mask = CPU_SCACHE_HASH_MASK (current_cpu);
SEM_PC vpc;
EOF
# Any initialization code before looping starts.
# Note that this code may declare some locals.
${SHELL} $infile init
if [ x$parallel = xread ] ; then
cat << EOF
#if defined (__GNUC__)
{
if (! CPU_IDESC_READ_INIT_P (current_cpu))
{
/* ??? Later maybe paste read.c in when building mainloop.c. */
#define DEFINE_LABELS
#include "readx.c"
CPU_IDESC_READ_INIT_P (current_cpu) = 1;
}
}
#endif
EOF
fi
cat << EOF
if (! CPU_IDESC_SEM_INIT_P (current_cpu))
{
#if ! WITH_SEM_SWITCH_FULL
@cpu@_sem_init_idesc_table (current_cpu);
#endif
CPU_IDESC_SEM_INIT_P (current_cpu) = 1;
}
vpc = GET_H_PC ();
do
{
/* begin full-exec-scache */
EOF
${SHELL} $infile full-exec-scache
cat << EOF
/* end full-exec-scache */
}
while (0 /*CPU_RUNNING_P (current_cpu)*/);
}
#undef FAST_P
EOF
####################################
# Parallel scache engine: fast version.
if [ x$fast = xyes ] ; then
cat << EOF
#define FAST_P 1
void
@cpu@_engine_run_fast (SIM_CPU *current_cpu)
{
SIM_DESC current_state = CPU_STATE (current_cpu);
SCACHE *scache = CPU_SCACHE_CACHE (current_cpu);
unsigned int hash_mask = CPU_SCACHE_HASH_MASK (current_cpu);
SEM_PC vpc;
PAREXEC pbufs[MAX_PARALLEL_INSNS];
PAREXEC *par_exec;
EOF
# Any initialization code before looping starts.
# Note that this code may declare some locals.
${SHELL} $infile init
if [ x$parallel = xread ] ; then
cat << EOF
#if defined (__GNUC__)
{
if (! CPU_IDESC_READ_INIT_P (current_cpu))
{
/* ??? Later maybe paste read.c in when building mainloop.c. */
#define DEFINE_LABELS
#include "readx.c"
CPU_IDESC_READ_INIT_P (current_cpu) = 1;
}
}
#endif
EOF
fi
cat << EOF
if (! CPU_IDESC_SEM_INIT_P (current_cpu))
{
#if WITH_SEM_SWITCH_FAST
#if defined (__GNUC__)
/* ??? Later maybe paste sem-switch.c in when building mainloop.c. */
#define DEFINE_LABELS
#include "$switch"
#endif
#else
@cpu@_semf_init_idesc_table (current_cpu);
#endif
CPU_IDESC_SEM_INIT_P (current_cpu) = 1;
}
vpc = GET_H_PC ();
do
{
/* begin fast-exec-scache */
EOF
${SHELL} $infile fast-exec-scache
cat << EOF
/* end fast-exec-scache */
}
while (0 /*CPU_RUNNING_P (current_cpu)*/);
}
#undef FAST_P
EOF
fi # -fast
fi # -scache && parallel
##########################################################################
@ -766,6 +917,7 @@ cat << EOF
sc->argbuf.addr = pc;
sc->argbuf.fields.chain.insn_count = _insn_count;
sc->argbuf.fields.chain.next = 0;
sc->argbuf.fields.chain.branch_target = 0;
++sc;
}
@ -817,15 +969,17 @@ INLINE SEM_PC
}
/* Chain to the next block from a cti terminated previous block.
NEW_VPC_PTR is one of SEM_BRANCH_UNTAKEN, SEM_BRANCH_UNCACHEABLE, or
a pointer to a location containing the SEM_PC of the branch's address.
BR_TYPE indicates whether the branch was taken and whether we can cache
the vpc of the branch target.
NEW_PC is the target's branch address, and is only valid if
NEW_VPC_PTR != SEM_BRANCH_UNTAKEN. */
BR_TYPE != SEM_BRANCH_UNTAKEN. */
INLINE SEM_PC
@cpu@_pbb_cti_chain (SIM_CPU *current_cpu, SEM_ARG sem_arg,
SEM_PC *new_vpc_ptr, PCADDR new_pc)
SEM_BRANCH_TYPE br_type, PCADDR new_pc)
{
SEM_PC *new_vpc_ptr;
PBB_UPDATE_INSN_COUNT (current_cpu, sem_arg);
/* If not running forever, exit back to main loop. */
@ -841,7 +995,7 @@ INLINE SEM_PC
/* Restart compiler if we branched to an uncacheable address
(e.g. "j reg"). */
if (new_vpc_ptr == SEM_BRANCH_UNCACHEABLE)
if (br_type == SEM_BRANCH_UNCACHEABLE)
{
SET_H_PC (new_pc);
return CPU_SCACHE_PBB_BEGIN (current_cpu);
@ -849,22 +1003,25 @@ INLINE SEM_PC
/* If branch wasn't taken, update the pc and set BR_ADDR_PTR to our
next chain ptr. */
if (new_vpc_ptr == SEM_BRANCH_UNTAKEN)
if (br_type == SEM_BRANCH_UNTAKEN)
{
ARGBUF *abuf = SEM_ARGBUF (sem_arg);
SET_H_PC (abuf->addr);
new_pc = abuf->addr;
SET_H_PC (new_pc);
new_vpc_ptr = &abuf->fields.chain.next;
}
else
{
ARGBUF *abuf = SEM_ARGBUF (sem_arg);
SET_H_PC (new_pc);
new_vpc_ptr = &abuf->fields.chain.branch_target;
}
/* If chained to next block, go straight to it. */
if (*new_vpc_ptr)
return *new_vpc_ptr;
/* See if next block has already been compiled. */
*new_vpc_ptr = scache_lookup (current_cpu, GET_H_PC ());
*new_vpc_ptr = scache_lookup (current_cpu, new_pc);
if (*new_vpc_ptr)
return *new_vpc_ptr;
/* Nope, so next insn is a virtual insn to invoke the compiler
@ -955,8 +1112,8 @@ void
SEM_PC vpc;
#if WITH_SEM_SWITCH_FULL
/* For communication between cti's and cti-chain. */
SEM_BRANCH_TYPE pbb_br_type;
PCADDR pbb_br_npc;
SEM_PC *pbb_br_npc_ptr;
#endif
EOF
@ -983,10 +1140,14 @@ cat << EOF
a pbb). And in the "let's run until we're done" case we don't return
until the program exits. */
#if WITH_SEM_SWITCH_FULL && defined (__GNUC__)
#if WITH_SEM_SWITCH_FULL
#if defined (__GNUC__)
/* ??? Later maybe paste sem-switch.c in when building mainloop.c. */
#define DEFINE_LABELS
#include "$switch"
#endif
#else
@cpu@_sem_init_idesc_table (current_cpu);
#endif
/* Initialize the "begin (compile) a pbb" virtual insn. */
@ -1041,8 +1202,8 @@ void
SEM_PC vpc;
#if WITH_SEM_SWITCH_FAST
/* For communication between cti's and cti-chain. */
SEM_BRANCH_TYPE pbb_br_type;
PCADDR pbb_br_npc;
SEM_PC *pbb_br_npc_ptr;
#endif
EOF
@ -1069,10 +1230,14 @@ cat << EOF
a pbb). And in the "let's run until we're done" case we don't return
until the program exits. */
#if WITH_SEM_SWITCH_FAST && defined (__GNUC__)
#if WITH_SEM_SWITCH_FAST
#if defined (__GNUC__)
/* ??? Later maybe paste sem-switch.c in when building mainloop.c. */
#define DEFINE_LABELS
#include "$switch"
#endif
#else
@cpu@_semf_init_idesc_table (current_cpu);
#endif
/* Initialize the "begin (compile) a pbb" virtual insn. */

View File

@ -1,3 +1,11 @@
1999-08-09 Doug Evans <devans@casey.cygnus.com>
* cpu.h,decode.c,decode.h,model.c,sem-switch.c,sem.c: Rebuild.
1999-08-04 Doug Evans <devans@casey.cygnus.com>
* cpu.h,cpuall.h,decode.c,model.c,sem-switch.c,sem.c: Rebuild.
1999-07-06 Doug Evans <devans@casey.cygnus.com>
* cpu.h,decode.h,model.c,sem-switch.c,sem.c: Rebuild.

View File

@ -189,536 +189,227 @@ typedef struct {
UINT load_regs_pending;
} MODEL_FR30_1_DATA;
/* Instruction argument buffer. */
union sem_fields {
struct { /* empty sformat for unspecified field list */
int empty;
} fmt_empty;
struct { /* e.g. add $Rj,$Ri */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
unsigned char out_Ri;
} fmt_add;
struct { /* e.g. add $u4,$Ri */
UINT f_u4;
SI * i_Ri;
unsigned char in_Ri;
unsigned char out_Ri;
} fmt_addi;
struct { /* e.g. add2 $m4,$Ri */
SI f_m4;
SI * i_Ri;
unsigned char in_Ri;
unsigned char out_Ri;
} fmt_add2;
struct { /* e.g. addc $Rj,$Ri */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
unsigned char out_Ri;
} fmt_addc;
struct { /* e.g. addn $Rj,$Ri */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
unsigned char out_Ri;
} fmt_addn;
struct { /* e.g. addn $u4,$Ri */
UINT f_u4;
SI * i_Ri;
unsigned char in_Ri;
unsigned char out_Ri;
} fmt_addni;
struct { /* e.g. addn2 $m4,$Ri */
SI f_m4;
SI * i_Ri;
unsigned char in_Ri;
unsigned char out_Ri;
} fmt_addn2;
struct { /* e.g. cmp $Rj,$Ri */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
} fmt_cmp;
struct { /* e.g. cmp $u4,$Ri */
UINT f_u4;
SI * i_Ri;
unsigned char in_Ri;
} fmt_cmpi;
struct { /* e.g. cmp2 $m4,$Ri */
SI f_m4;
SI * i_Ri;
unsigned char in_Ri;
} fmt_cmp2;
struct { /* e.g. and $Rj,$Ri */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
unsigned char out_Ri;
} fmt_and;
struct { /* e.g. and $Rj,@$Ri */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
} fmt_andm;
struct { /* e.g. andh $Rj,@$Ri */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
} fmt_andh;
struct { /* e.g. andb $Rj,@$Ri */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
} fmt_andb;
struct { /* e.g. bandl $u4,@$Ri */
UINT f_u4;
SI * i_Ri;
unsigned char in_Ri;
} fmt_bandl;
struct { /* e.g. btstl $u4,@$Ri */
UINT f_u4;
SI * i_Ri;
unsigned char in_Ri;
} fmt_btstl;
struct { /* e.g. mul $Rj,$Ri */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
} fmt_mul;
struct { /* e.g. mulu $Rj,$Ri */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
} fmt_mulu;
struct { /* e.g. mulh $Rj,$Ri */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
} fmt_mulh;
struct { /* e.g. div0s $Ri */
SI * i_Ri;
unsigned char in_Ri;
} fmt_div0s;
struct { /* e.g. div0u $Ri */
int empty;
} fmt_div0u;
struct { /* e.g. div1 $Ri */
SI * i_Ri;
unsigned char in_Ri;
} fmt_div1;
struct { /* e.g. div2 $Ri */
SI * i_Ri;
unsigned char in_Ri;
} fmt_div2;
struct { /* e.g. div3 */
int empty;
} fmt_div3;
struct { /* e.g. div4s */
int empty;
} fmt_div4s;
struct { /* e.g. lsl $Rj,$Ri */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
unsigned char out_Ri;
} fmt_lsl;
struct { /* e.g. lsl $u4,$Ri */
UINT f_u4;
SI * i_Ri;
unsigned char in_Ri;
unsigned char out_Ri;
} fmt_lsli;
struct { /* e.g. ldi:8 $i8,$Ri */
UINT f_i8;
SI * i_Ri;
unsigned char out_Ri;
} fmt_ldi8;
struct { /* e.g. ldi:20 $i20,$Ri */
UINT f_i20;
SI * i_Ri;
unsigned char out_Ri;
} fmt_ldi20;
struct { /* e.g. ldi:32 $i32,$Ri */
UINT f_i32;
SI * i_Ri;
unsigned char out_Ri;
} fmt_ldi32;
struct { /* e.g. ld @$Rj,$Ri */
SI * i_Rj;
SI * i_Ri;
unsigned char in_Rj;
unsigned char out_Ri;
} fmt_ld;
struct { /* e.g. ld @($R13,$Rj),$Ri */
SI * i_Rj;
SI * i_Ri;
unsigned char in_Rj;
unsigned char in_h_gr_13;
unsigned char out_Ri;
} fmt_ldr13;
struct { /* e.g. ld @($R14,$disp10),$Ri */
SI f_disp10;
SI * i_Ri;
unsigned char in_h_gr_14;
unsigned char out_Ri;
} fmt_ldr14;
struct { /* e.g. lduh @($R14,$disp9),$Ri */
SI f_disp9;
SI * i_Ri;
unsigned char in_h_gr_14;
unsigned char out_Ri;
} fmt_ldr14uh;
struct { /* e.g. ldub @($R14,$disp8),$Ri */
INT f_disp8;
SI * i_Ri;
unsigned char in_h_gr_14;
unsigned char out_Ri;
} fmt_ldr14ub;
struct { /* e.g. ld @($R15,$udisp6),$Ri */
USI f_udisp6;
SI * i_Ri;
unsigned char in_h_gr_15;
unsigned char out_Ri;
} fmt_ldr15;
struct { /* e.g. ld @$R15+,$Ri */
UINT f_Ri;
SI * i_Ri;
unsigned char in_h_gr_15;
unsigned char out_Ri;
unsigned char out_h_gr_15;
} fmt_ldr15gr;
struct { /* e.g. ld @$R15+,$Rs2 */
UINT f_Rs2;
unsigned char in_h_gr_15;
unsigned char out_h_gr_15;
} fmt_ldr15dr;
struct { /* e.g. ld @$R15+,$ps */
int empty;
unsigned char in_h_gr_15;
unsigned char out_h_gr_15;
} fmt_ldr15ps;
struct { /* e.g. st $Ri,@$Rj */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
} fmt_st;
struct { /* e.g. st $Ri,@($R13,$Rj) */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
unsigned char in_h_gr_13;
} fmt_str13;
struct { /* e.g. st $Ri,@($R14,$disp10) */
SI f_disp10;
SI * i_Ri;
unsigned char in_Ri;
unsigned char in_h_gr_14;
} fmt_str14;
struct { /* e.g. sth $Ri,@($R14,$disp9) */
SI f_disp9;
SI * i_Ri;
unsigned char in_Ri;
unsigned char in_h_gr_14;
} fmt_str14h;
struct { /* e.g. stb $Ri,@($R14,$disp8) */
INT f_disp8;
SI * i_Ri;
unsigned char in_Ri;
unsigned char in_h_gr_14;
} fmt_str14b;
struct { /* e.g. st $Ri,@($R15,$udisp6) */
USI f_udisp6;
SI * i_Ri;
unsigned char in_Ri;
unsigned char in_h_gr_15;
} fmt_str15;
struct { /* e.g. st $Ri,@-$R15 */
SI * i_Ri;
unsigned char in_Ri;
unsigned char in_h_gr_15;
unsigned char out_h_gr_15;
} fmt_str15gr;
struct { /* e.g. st $Rs2,@-$R15 */
UINT f_Rs2;
unsigned char in_h_gr_15;
unsigned char out_h_gr_15;
} fmt_str15dr;
struct { /* e.g. st $ps,@-$R15 */
int empty;
unsigned char in_h_gr_15;
unsigned char out_h_gr_15;
} fmt_str15ps;
struct { /* e.g. mov $Rj,$Ri */
SI * i_Rj;
SI * i_Ri;
unsigned char in_Rj;
unsigned char out_Ri;
} fmt_mov;
struct { /* e.g. mov $Rs1,$Ri */
UINT f_Rs1;
SI * i_Ri;
unsigned char out_Ri;
} fmt_movdr;
struct { /* e.g. mov $ps,$Ri */
SI * i_Ri;
unsigned char out_Ri;
} fmt_movps;
struct { /* e.g. mov $Ri,$Rs1 */
UINT f_Rs1;
SI * i_Ri;
unsigned char in_Ri;
} fmt_mov2dr;
struct { /* e.g. mov $Ri,$ps */
SI * i_Ri;
unsigned char in_Ri;
} fmt_mov2ps;
struct { /* e.g. bno:d $label9 */
int empty;
} fmt_bnod;
struct { /* e.g. dmov $R13,@$dir10 */
USI f_dir10;
unsigned char in_h_gr_13;
} fmt_dmovr13;
struct { /* e.g. dmovh $R13,@$dir9 */
USI f_dir9;
unsigned char in_h_gr_13;
} fmt_dmovr13h;
struct { /* e.g. dmovb $R13,@$dir8 */
UINT f_dir8;
unsigned char in_h_gr_13;
} fmt_dmovr13b;
struct { /* e.g. dmov @$R13+,@$dir10 */
USI f_dir10;
unsigned char in_h_gr_13;
unsigned char out_h_gr_13;
} fmt_dmovr13pi;
struct { /* e.g. dmovh @$R13+,@$dir9 */
USI f_dir9;
unsigned char in_h_gr_13;
unsigned char out_h_gr_13;
} fmt_dmovr13pih;
struct { /* e.g. dmovb @$R13+,@$dir8 */
UINT f_dir8;
unsigned char in_h_gr_13;
unsigned char out_h_gr_13;
} fmt_dmovr13pib;
struct { /* e.g. dmov @$R15+,@$dir10 */
USI f_dir10;
unsigned char in_h_gr_15;
unsigned char out_h_gr_15;
} fmt_dmovr15pi;
struct { /* e.g. dmov @$dir10,$R13 */
USI f_dir10;
unsigned char out_h_gr_13;
} fmt_dmov2r13;
struct { /* e.g. dmovh @$dir9,$R13 */
USI f_dir9;
unsigned char out_h_gr_13;
} fmt_dmov2r13h;
struct { /* e.g. dmovb @$dir8,$R13 */
UINT f_dir8;
unsigned char out_h_gr_13;
} fmt_dmov2r13b;
struct { /* e.g. dmov @$dir10,@$R13+ */
USI f_dir10;
unsigned char in_h_gr_13;
unsigned char out_h_gr_13;
} fmt_dmov2r13pi;
struct { /* e.g. dmovh @$dir9,@$R13+ */
USI f_dir9;
unsigned char in_h_gr_13;
unsigned char out_h_gr_13;
} fmt_dmov2r13pih;
struct { /* e.g. dmovb @$dir8,@$R13+ */
UINT f_dir8;
unsigned char in_h_gr_13;
unsigned char out_h_gr_13;
} fmt_dmov2r13pib;
struct { /* e.g. dmov @$dir10,@-$R15 */
USI f_dir10;
unsigned char in_h_gr_15;
unsigned char out_h_gr_15;
} fmt_dmov2r15pd;
struct { /* e.g. ldres @$Ri+,$u4 */
SI * i_Ri;
unsigned char in_Ri;
unsigned char out_Ri;
} fmt_ldres;
struct { /* e.g. copop $u4c,$ccc,$CRj,$CRi */
int empty;
} fmt_copop;
struct { /* e.g. andccr $u8 */
UINT f_u8;
} fmt_andccr;
struct { /* e.g. stilm $u8 */
UINT f_u8;
} fmt_stilm;
struct { /* e.g. addsp $s10 */
SI f_s10;
unsigned char in_h_gr_15;
unsigned char out_h_gr_15;
} fmt_addsp;
struct { /* e.g. extsb $Ri */
SI * i_Ri;
unsigned char in_Ri;
unsigned char out_Ri;
} fmt_extsb;
struct { /* e.g. extub $Ri */
SI * i_Ri;
unsigned char in_Ri;
unsigned char out_Ri;
} fmt_extub;
struct { /* e.g. extsh $Ri */
SI * i_Ri;
unsigned char in_Ri;
unsigned char out_Ri;
} fmt_extsh;
struct { /* e.g. extuh $Ri */
SI * i_Ri;
unsigned char in_Ri;
unsigned char out_Ri;
} fmt_extuh;
struct { /* e.g. ldm0 ($reglist_low_ld) */
UINT f_reglist_low_ld;
unsigned char in_h_gr_15;
unsigned char out_h_gr_0;
unsigned char out_h_gr_1;
unsigned char out_h_gr_15;
unsigned char out_h_gr_2;
unsigned char out_h_gr_3;
unsigned char out_h_gr_4;
unsigned char out_h_gr_5;
unsigned char out_h_gr_6;
unsigned char out_h_gr_7;
} fmt_ldm0;
struct { /* e.g. ldm1 ($reglist_hi_ld) */
UINT f_reglist_hi_ld;
unsigned char in_h_gr_15;
unsigned char out_h_gr_10;
unsigned char out_h_gr_11;
unsigned char out_h_gr_12;
unsigned char out_h_gr_13;
unsigned char out_h_gr_14;
unsigned char out_h_gr_15;
unsigned char out_h_gr_8;
unsigned char out_h_gr_9;
} fmt_ldm1;
struct { /* e.g. stm0 ($reglist_low_st) */
UINT f_reglist_low_st;
unsigned char in_h_gr_0;
unsigned char in_h_gr_1;
unsigned char in_h_gr_15;
unsigned char in_h_gr_2;
unsigned char in_h_gr_3;
unsigned char in_h_gr_4;
unsigned char in_h_gr_5;
unsigned char in_h_gr_6;
unsigned char in_h_gr_7;
unsigned char out_h_gr_15;
} fmt_stm0;
struct { /* e.g. stm1 ($reglist_hi_st) */
UINT f_reglist_hi_st;
unsigned char in_h_gr_10;
unsigned char in_h_gr_11;
unsigned char in_h_gr_12;
unsigned char in_h_gr_13;
unsigned char in_h_gr_14;
unsigned char in_h_gr_15;
unsigned char in_h_gr_8;
unsigned char in_h_gr_9;
unsigned char out_h_gr_15;
} fmt_stm1;
struct { /* e.g. enter $u10 */
USI f_u10;
unsigned char in_h_gr_14;
unsigned char in_h_gr_15;
unsigned char out_h_gr_14;
unsigned char out_h_gr_15;
} fmt_enter;
struct { /* e.g. leave */
int empty;
unsigned char in_h_gr_14;
unsigned char in_h_gr_15;
unsigned char out_h_gr_14;
unsigned char out_h_gr_15;
} fmt_leave;
struct { /* e.g. xchb @$Rj,$Ri */
SI * i_Ri;
SI * i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
unsigned char out_Ri;
} fmt_xchb;
/* cti insns, kept separately so addr_cache is in fixed place */
struct {
union {
struct { /* e.g. jmp @$Ri */
SI * i_Ri;
unsigned char in_Ri;
} fmt_jmp;
struct { /* e.g. call @$Ri */
SI * i_Ri;
unsigned char in_Ri;
} fmt_callr;
struct { /* e.g. call $label12 */
IADDR i_label12;
} fmt_call;
struct { /* e.g. ret */
int empty;
} fmt_ret;
struct { /* e.g. int $u8 */
UINT f_u8;
} fmt_int;
struct { /* e.g. inte */
int empty;
} fmt_inte;
struct { /* e.g. reti */
int empty;
} fmt_reti;
struct { /* e.g. bra:d $label9 */
IADDR i_label9;
} fmt_brad;
struct { /* e.g. beq:d $label9 */
IADDR i_label9;
} fmt_beqd;
struct { /* e.g. bc:d $label9 */
IADDR i_label9;
} fmt_bcd;
struct { /* e.g. bn:d $label9 */
IADDR i_label9;
} fmt_bnd;
struct { /* e.g. bv:d $label9 */
IADDR i_label9;
} fmt_bvd;
struct { /* e.g. blt:d $label9 */
IADDR i_label9;
} fmt_bltd;
struct { /* e.g. ble:d $label9 */
IADDR i_label9;
} fmt_bled;
struct { /* e.g. bls:d $label9 */
IADDR i_label9;
} fmt_blsd;
} fields;
#if WITH_SCACHE_PBB
SEM_PC addr_cache;
#endif
} cti;
struct { /* no operands */
int empty;
} fmt_empty;
struct { /* */
IADDR i_label9;
} sfmt_brad;
struct { /* */
UINT f_u8;
} sfmt_int;
struct { /* */
IADDR i_label12;
} sfmt_call;
struct { /* */
SI f_s10;
unsigned char in_h_gr_15;
unsigned char out_h_gr_15;
} sfmt_addsp;
struct { /* */
USI f_dir10;
unsigned char in_h_gr_15;
unsigned char out_h_gr_15;
} sfmt_dmovr15pi;
struct { /* */
UINT f_dir8;
unsigned char in_h_gr_13;
unsigned char out_h_gr_13;
} sfmt_dmovr13pib;
struct { /* */
USI f_dir9;
unsigned char in_h_gr_13;
unsigned char out_h_gr_13;
} sfmt_dmovr13pih;
struct { /* */
USI f_dir10;
unsigned char in_h_gr_13;
unsigned char out_h_gr_13;
} sfmt_dmovr13pi;
struct { /* */
SI* i_Ri;
UINT f_Rs1;
unsigned char in_Ri;
} sfmt_mov2dr;
struct { /* */
SI* i_Ri;
UINT f_Rs1;
unsigned char out_Ri;
} sfmt_movdr;
struct { /* */
UINT f_Rs2;
unsigned char in_h_gr_15;
unsigned char out_h_gr_15;
} sfmt_ldr15dr;
struct { /* */
SI* i_Ri;
UINT f_i32;
unsigned char out_Ri;
} sfmt_ldi32;
struct { /* */
SI* i_Ri;
UINT f_i20;
unsigned char out_Ri;
} sfmt_ldi20;
struct { /* */
SI* i_Ri;
UINT f_i8;
unsigned char out_Ri;
} sfmt_ldi8;
struct { /* */
SI* i_Ri;
unsigned char in_Ri;
unsigned char in_h_gr_15;
unsigned char out_h_gr_15;
} sfmt_str15gr;
struct { /* */
SI* i_Ri;
USI f_udisp6;
unsigned char in_Ri;
unsigned char in_h_gr_15;
} sfmt_str15;
struct { /* */
SI* i_Ri;
INT f_disp8;
unsigned char in_Ri;
unsigned char in_h_gr_14;
} sfmt_str14b;
struct { /* */
SI* i_Ri;
SI f_disp9;
unsigned char in_Ri;
unsigned char in_h_gr_14;
} sfmt_str14h;
struct { /* */
SI* i_Ri;
SI f_disp10;
unsigned char in_Ri;
unsigned char in_h_gr_14;
} sfmt_str14;
struct { /* */
SI* i_Ri;
USI f_udisp6;
unsigned char in_h_gr_15;
unsigned char out_Ri;
} sfmt_ldr15;
struct { /* */
SI* i_Ri;
INT f_disp8;
unsigned char in_h_gr_14;
unsigned char out_Ri;
} sfmt_ldr14ub;
struct { /* */
SI* i_Ri;
SI f_disp9;
unsigned char in_h_gr_14;
unsigned char out_Ri;
} sfmt_ldr14uh;
struct { /* */
SI* i_Ri;
SI f_disp10;
unsigned char in_h_gr_14;
unsigned char out_Ri;
} sfmt_ldr14;
struct { /* */
SI* i_Ri;
SI f_m4;
unsigned char in_Ri;
unsigned char out_Ri;
} sfmt_add2;
struct { /* */
SI* i_Ri;
UINT f_u4;
unsigned char in_Ri;
unsigned char out_Ri;
} sfmt_addi;
struct { /* */
USI f_u10;
unsigned char in_h_gr_14;
unsigned char in_h_gr_15;
unsigned char out_h_gr_14;
unsigned char out_h_gr_15;
} sfmt_enter;
struct { /* */
SI* i_Ri;
SI* i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
unsigned char in_h_gr_13;
} sfmt_str13;
struct { /* */
SI* i_Ri;
UINT f_Ri;
unsigned char in_h_gr_15;
unsigned char out_Ri;
unsigned char out_h_gr_15;
} sfmt_ldr15gr;
struct { /* */
SI* i_Ri;
SI* i_Rj;
unsigned char in_Rj;
unsigned char in_h_gr_13;
unsigned char out_Ri;
} sfmt_ldr13;
struct { /* */
SI* i_Ri;
SI* i_Rj;
unsigned char in_Ri;
unsigned char in_Rj;
unsigned char out_Ri;
} sfmt_add;
struct { /* */
UINT f_reglist_hi_st;
unsigned char in_h_gr_10;
unsigned char in_h_gr_11;
unsigned char in_h_gr_12;
unsigned char in_h_gr_13;
unsigned char in_h_gr_14;
unsigned char in_h_gr_15;
unsigned char in_h_gr_8;
unsigned char in_h_gr_9;
unsigned char out_h_gr_15;
} sfmt_stm1;
struct { /* */
UINT f_reglist_hi_ld;
unsigned char in_h_gr_15;
unsigned char out_h_gr_10;
unsigned char out_h_gr_11;
unsigned char out_h_gr_12;
unsigned char out_h_gr_13;
unsigned char out_h_gr_14;
unsigned char out_h_gr_15;
unsigned char out_h_gr_8;
unsigned char out_h_gr_9;
} sfmt_ldm1;
struct { /* */
UINT f_reglist_low_st;
unsigned char in_h_gr_0;
unsigned char in_h_gr_1;
unsigned char in_h_gr_15;
unsigned char in_h_gr_2;
unsigned char in_h_gr_3;
unsigned char in_h_gr_4;
unsigned char in_h_gr_5;
unsigned char in_h_gr_6;
unsigned char in_h_gr_7;
unsigned char out_h_gr_15;
} sfmt_stm0;
struct { /* */
UINT f_reglist_low_ld;
unsigned char in_h_gr_15;
unsigned char out_h_gr_0;
unsigned char out_h_gr_1;
unsigned char out_h_gr_15;
unsigned char out_h_gr_2;
unsigned char out_h_gr_3;
unsigned char out_h_gr_4;
unsigned char out_h_gr_5;
unsigned char out_h_gr_6;
unsigned char out_h_gr_7;
} sfmt_ldm0;
#if WITH_SCACHE_PBB
/* Writeback handler. */
struct {
@ -740,6 +431,7 @@ union sem_fields {
int insn_count;
/* Next pbb to execute. */
SCACHE *next;
SCACHE *branch_target;
} chain;
#endif
};
@ -751,6 +443,9 @@ struct argbuf {
const IDESC *idesc;
char trace_p;
char profile_p;
/* ??? Temporary hack for skip insns. */
char skip_count;
char unused;
/* cpu specific data follows */
union sem semantic;
int written;
@ -771,13 +466,11 @@ struct scache {
These define and assign the local vars that contain the insn's fields. */
#define EXTRACT_IFMT_EMPTY_VARS \
/* Instruction fields. */ \
unsigned int length;
#define EXTRACT_IFMT_EMPTY_CODE \
length = 0; \
#define EXTRACT_IFMT_ADD_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
UINT f_Rj; \
@ -791,7 +484,6 @@ struct scache {
f_Ri = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
#define EXTRACT_IFMT_ADDI_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
UINT f_u4; \
@ -805,7 +497,6 @@ struct scache {
f_Ri = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
#define EXTRACT_IFMT_ADD2_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
SI f_m4; \
@ -819,7 +510,6 @@ struct scache {
f_Ri = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
#define EXTRACT_IFMT_DIV0S_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
UINT f_op3; \
@ -833,7 +523,6 @@ struct scache {
f_Ri = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
#define EXTRACT_IFMT_DIV3_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
UINT f_op3; \
@ -847,7 +536,6 @@ struct scache {
f_op4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
#define EXTRACT_IFMT_LDI8_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_i8; \
UINT f_Ri; \
@ -859,7 +547,6 @@ struct scache {
f_Ri = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
#define EXTRACT_IFMT_LDI20_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_i20_4; \
UINT f_i20_16; \
@ -882,7 +569,6 @@ struct scache {
f_Ri = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
#define EXTRACT_IFMT_LDI32_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_i32; \
UINT f_op2; \
@ -903,7 +589,6 @@ struct scache {
f_Ri = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
#define EXTRACT_IFMT_LDR14_VARS \
/* Instruction fields. */ \
UINT f_op1; \
SI f_disp10; \
UINT f_Ri; \
@ -915,7 +600,6 @@ struct scache {
f_Ri = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
#define EXTRACT_IFMT_LDR14UH_VARS \
/* Instruction fields. */ \
UINT f_op1; \
SI f_disp9; \
UINT f_Ri; \
@ -927,7 +611,6 @@ struct scache {
f_Ri = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
#define EXTRACT_IFMT_LDR14UB_VARS \
/* Instruction fields. */ \
UINT f_op1; \
INT f_disp8; \
UINT f_Ri; \
@ -939,7 +622,6 @@ struct scache {
f_Ri = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
#define EXTRACT_IFMT_LDR15_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
USI f_udisp6; \
@ -953,7 +635,6 @@ struct scache {
f_Ri = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
#define EXTRACT_IFMT_LDR15DR_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
UINT f_op3; \
@ -967,7 +648,6 @@ struct scache {
f_Rs2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
#define EXTRACT_IFMT_MOVDR_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
UINT f_Rs1; \
@ -981,7 +661,6 @@ struct scache {
f_Ri = EXTRACT_MSB0_UINT (insn, 16, 12, 4); \
#define EXTRACT_IFMT_CALL_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op5; \
SI f_rel12; \
@ -993,7 +672,6 @@ struct scache {
f_rel12 = ((((EXTRACT_MSB0_INT (insn, 16, 5, 11)) << (1))) + (((pc) + (2)))); \
#define EXTRACT_IFMT_INT_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
UINT f_u8; \
@ -1005,7 +683,6 @@ struct scache {
f_u8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
#define EXTRACT_IFMT_BRAD_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_cc; \
SI f_rel9; \
@ -1017,7 +694,6 @@ struct scache {
f_rel9 = ((((EXTRACT_MSB0_INT (insn, 16, 8, 8)) << (1))) + (((pc) + (2)))); \
#define EXTRACT_IFMT_DMOVR13_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
USI f_dir10; \
@ -1029,7 +705,6 @@ struct scache {
f_dir10 = ((EXTRACT_MSB0_UINT (insn, 16, 8, 8)) << (2)); \
#define EXTRACT_IFMT_DMOVR13H_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
USI f_dir9; \
@ -1041,7 +716,6 @@ struct scache {
f_dir9 = ((EXTRACT_MSB0_UINT (insn, 16, 8, 8)) << (1)); \
#define EXTRACT_IFMT_DMOVR13B_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
UINT f_dir8; \
@ -1053,7 +727,6 @@ struct scache {
f_dir8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
#define EXTRACT_IFMT_COPOP_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_ccc; \
UINT f_op2; \
@ -1076,7 +749,6 @@ struct scache {
f_CRi = (0|(EXTRACT_MSB0_UINT (word_1, 16, 12, 16) << 0)); \
#define EXTRACT_IFMT_COPLD_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_ccc; \
UINT f_op2; \
@ -1099,7 +771,6 @@ struct scache {
f_CRi = (0|(EXTRACT_MSB0_UINT (word_1, 16, 12, 16) << 0)); \
#define EXTRACT_IFMT_COPST_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_ccc; \
UINT f_op2; \
@ -1122,7 +793,6 @@ struct scache {
f_Ric = (0|(EXTRACT_MSB0_UINT (word_1, 16, 12, 16) << 0)); \
#define EXTRACT_IFMT_ADDSP_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
SI f_s10; \
@ -1134,7 +804,6 @@ struct scache {
f_s10 = ((EXTRACT_MSB0_INT (insn, 16, 8, 8)) << (2)); \
#define EXTRACT_IFMT_LDM0_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
UINT f_reglist_low_ld; \
@ -1146,7 +815,6 @@ struct scache {
f_reglist_low_ld = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
#define EXTRACT_IFMT_LDM1_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
UINT f_reglist_hi_ld; \
@ -1158,7 +826,6 @@ struct scache {
f_reglist_hi_ld = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
#define EXTRACT_IFMT_STM0_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
UINT f_reglist_low_st; \
@ -1170,7 +837,6 @@ struct scache {
f_reglist_low_st = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
#define EXTRACT_IFMT_STM1_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
UINT f_reglist_hi_st; \
@ -1182,7 +848,6 @@ struct scache {
f_reglist_hi_st = EXTRACT_MSB0_UINT (insn, 16, 8, 8); \
#define EXTRACT_IFMT_ENTER_VARS \
/* Instruction fields. */ \
UINT f_op1; \
UINT f_op2; \
USI f_u10; \

View File

@ -44,6 +44,9 @@ struct argbuf {
const IDESC *idesc;
char trace_p;
char profile_p;
/* ??? Temporary hack for skip insns. */
char skip_count;
char unused;
/* cpu specific data follows */
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,8 @@ extern const IDESC *fr30bf_decode (SIM_CPU *, IADDR,
CGEN_INSN_INT,
ARGBUF *);
extern void fr30bf_init_idesc_table (SIM_CPU *);
extern void fr30bf_sem_init_idesc_table (SIM_CPU *);
extern void fr30bf_semf_init_idesc_table (SIM_CPU *);
/* Enum declaration for instructions in cpu family fr30bf. */
typedef enum fr30bf_insn_type {
@ -77,200 +79,34 @@ typedef enum fr30bf_insn_type {
, FR30BF_INSN_ENTER, FR30BF_INSN_LEAVE, FR30BF_INSN_XCHB, FR30BF_INSN_MAX
} FR30BF_INSN_TYPE;
#if ! WITH_SEM_SWITCH_FULL
#define SEMFULL(fn) extern SEMANTIC_FN CONCAT3 (fr30bf,_sem_,fn);
#else
#define SEMFULL(fn)
#endif
#if ! WITH_SEM_SWITCH_FAST
#define SEMFAST(fn) extern SEMANTIC_FN CONCAT3 (fr30bf,_semf_,fn);
#else
#define SEMFAST(fn)
#endif
#define SEM(fn) SEMFULL (fn) SEMFAST (fn)
/* The function version of the before/after handlers is always needed,
so we always want the SEMFULL declaration of them. */
extern SEMANTIC_FN CONCAT3 (fr30bf,_sem_,x_before);
extern SEMANTIC_FN CONCAT3 (fr30bf,_sem_,x_after);
SEM (x_invalid)
SEM (x_after)
SEM (x_before)
SEM (x_cti_chain)
SEM (x_chain)
SEM (x_begin)
SEM (add)
SEM (addi)
SEM (add2)
SEM (addc)
SEM (addn)
SEM (addni)
SEM (addn2)
SEM (sub)
SEM (subc)
SEM (subn)
SEM (cmp)
SEM (cmpi)
SEM (cmp2)
SEM (and)
SEM (or)
SEM (eor)
SEM (andm)
SEM (andh)
SEM (andb)
SEM (orm)
SEM (orh)
SEM (orb)
SEM (eorm)
SEM (eorh)
SEM (eorb)
SEM (bandl)
SEM (borl)
SEM (beorl)
SEM (bandh)
SEM (borh)
SEM (beorh)
SEM (btstl)
SEM (btsth)
SEM (mul)
SEM (mulu)
SEM (mulh)
SEM (muluh)
SEM (div0s)
SEM (div0u)
SEM (div1)
SEM (div2)
SEM (div3)
SEM (div4s)
SEM (lsl)
SEM (lsli)
SEM (lsl2)
SEM (lsr)
SEM (lsri)
SEM (lsr2)
SEM (asr)
SEM (asri)
SEM (asr2)
SEM (ldi8)
SEM (ldi20)
SEM (ldi32)
SEM (ld)
SEM (lduh)
SEM (ldub)
SEM (ldr13)
SEM (ldr13uh)
SEM (ldr13ub)
SEM (ldr14)
SEM (ldr14uh)
SEM (ldr14ub)
SEM (ldr15)
SEM (ldr15gr)
SEM (ldr15dr)
SEM (ldr15ps)
SEM (st)
SEM (sth)
SEM (stb)
SEM (str13)
SEM (str13h)
SEM (str13b)
SEM (str14)
SEM (str14h)
SEM (str14b)
SEM (str15)
SEM (str15gr)
SEM (str15dr)
SEM (str15ps)
SEM (mov)
SEM (movdr)
SEM (movps)
SEM (mov2dr)
SEM (mov2ps)
SEM (jmp)
SEM (jmpd)
SEM (callr)
SEM (callrd)
SEM (call)
SEM (calld)
SEM (ret)
SEM (ret_d)
SEM (int)
SEM (inte)
SEM (reti)
SEM (brad)
SEM (bra)
SEM (bnod)
SEM (bno)
SEM (beqd)
SEM (beq)
SEM (bned)
SEM (bne)
SEM (bcd)
SEM (bc)
SEM (bncd)
SEM (bnc)
SEM (bnd)
SEM (bn)
SEM (bpd)
SEM (bp)
SEM (bvd)
SEM (bv)
SEM (bnvd)
SEM (bnv)
SEM (bltd)
SEM (blt)
SEM (bged)
SEM (bge)
SEM (bled)
SEM (ble)
SEM (bgtd)
SEM (bgt)
SEM (blsd)
SEM (bls)
SEM (bhid)
SEM (bhi)
SEM (dmovr13)
SEM (dmovr13h)
SEM (dmovr13b)
SEM (dmovr13pi)
SEM (dmovr13pih)
SEM (dmovr13pib)
SEM (dmovr15pi)
SEM (dmov2r13)
SEM (dmov2r13h)
SEM (dmov2r13b)
SEM (dmov2r13pi)
SEM (dmov2r13pih)
SEM (dmov2r13pib)
SEM (dmov2r15pd)
SEM (ldres)
SEM (stres)
SEM (copop)
SEM (copld)
SEM (copst)
SEM (copsv)
SEM (nop)
SEM (andccr)
SEM (orccr)
SEM (stilm)
SEM (addsp)
SEM (extsb)
SEM (extub)
SEM (extsh)
SEM (extuh)
SEM (ldm0)
SEM (ldm1)
SEM (stm0)
SEM (stm1)
SEM (enter)
SEM (leave)
SEM (xchb)
#undef SEMFULL
#undef SEMFAST
#undef SEM
/* Enum declaration for semantic formats in cpu family fr30bf. */
typedef enum fr30bf_sfmt_type {
FR30BF_SFMT_EMPTY, FR30BF_SFMT_ADD, FR30BF_SFMT_ADDI, FR30BF_SFMT_ADD2
, FR30BF_SFMT_ADDC, FR30BF_SFMT_ADDN, FR30BF_SFMT_ADDNI, FR30BF_SFMT_ADDN2
, FR30BF_SFMT_CMP, FR30BF_SFMT_CMPI, FR30BF_SFMT_CMP2, FR30BF_SFMT_AND
, FR30BF_SFMT_ANDM, FR30BF_SFMT_ANDH, FR30BF_SFMT_ANDB, FR30BF_SFMT_BANDL
, FR30BF_SFMT_BTSTL, FR30BF_SFMT_MUL, FR30BF_SFMT_MULU, FR30BF_SFMT_MULH
, FR30BF_SFMT_DIV0S, FR30BF_SFMT_DIV0U, FR30BF_SFMT_DIV1, FR30BF_SFMT_DIV2
, FR30BF_SFMT_DIV3, FR30BF_SFMT_DIV4S, FR30BF_SFMT_LSL, FR30BF_SFMT_LSLI
, FR30BF_SFMT_LDI8, FR30BF_SFMT_LDI20, FR30BF_SFMT_LDI32, FR30BF_SFMT_LD
, FR30BF_SFMT_LDR13, FR30BF_SFMT_LDR14, FR30BF_SFMT_LDR14UH, FR30BF_SFMT_LDR14UB
, FR30BF_SFMT_LDR15, FR30BF_SFMT_LDR15GR, FR30BF_SFMT_LDR15DR, FR30BF_SFMT_LDR15PS
, FR30BF_SFMT_ST, FR30BF_SFMT_STR13, FR30BF_SFMT_STR14, FR30BF_SFMT_STR14H
, FR30BF_SFMT_STR14B, FR30BF_SFMT_STR15, FR30BF_SFMT_STR15GR, FR30BF_SFMT_STR15DR
, FR30BF_SFMT_STR15PS, FR30BF_SFMT_MOV, FR30BF_SFMT_MOVDR, FR30BF_SFMT_MOVPS
, FR30BF_SFMT_MOV2DR, FR30BF_SFMT_MOV2PS, FR30BF_SFMT_JMP, FR30BF_SFMT_CALLR
, FR30BF_SFMT_CALL, FR30BF_SFMT_RET, FR30BF_SFMT_INT, FR30BF_SFMT_INTE
, FR30BF_SFMT_RETI, FR30BF_SFMT_BRAD, FR30BF_SFMT_BNOD, FR30BF_SFMT_BEQD
, FR30BF_SFMT_BCD, FR30BF_SFMT_BND, FR30BF_SFMT_BVD, FR30BF_SFMT_BLTD
, FR30BF_SFMT_BLED, FR30BF_SFMT_BLSD, FR30BF_SFMT_DMOVR13, FR30BF_SFMT_DMOVR13H
, FR30BF_SFMT_DMOVR13B, FR30BF_SFMT_DMOVR13PI, FR30BF_SFMT_DMOVR13PIH, FR30BF_SFMT_DMOVR13PIB
, FR30BF_SFMT_DMOVR15PI, FR30BF_SFMT_DMOV2R13, FR30BF_SFMT_DMOV2R13H, FR30BF_SFMT_DMOV2R13B
, FR30BF_SFMT_DMOV2R13PI, FR30BF_SFMT_DMOV2R13PIH, FR30BF_SFMT_DMOV2R13PIB, FR30BF_SFMT_DMOV2R15PD
, FR30BF_SFMT_LDRES, FR30BF_SFMT_COPOP, FR30BF_SFMT_ANDCCR, FR30BF_SFMT_STILM
, FR30BF_SFMT_ADDSP, FR30BF_SFMT_EXTSB, FR30BF_SFMT_EXTUB, FR30BF_SFMT_EXTSH
, FR30BF_SFMT_EXTUH, FR30BF_SFMT_LDM0, FR30BF_SFMT_LDM1, FR30BF_SFMT_STM0
, FR30BF_SFMT_STM1, FR30BF_SFMT_ENTER, FR30BF_SFMT_LEAVE, FR30BF_SFMT_XCHB
} FR30BF_SFMT_TYPE;
/* Function unit handlers (user written). */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More