1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-09-14 09:44:18 +03:00

Compare commits

...

9 Commits

Author SHA1 Message Date
Jason Molenda
d8517d37c1 import gdb-1999-05-25 snapshot 1999-05-25 18:09:07 +00:00
Jason Molenda
87b23cbadc import gdb-1999-05-25 snapshot 1999-05-25 18:00:33 +00:00
Jason Molenda
c250861f05 import gdb-1999-0519 1999-05-19 19:58:40 +00:00
Jason Molenda
ee0bbc7b54 import gdb-1999-0519 1999-05-19 19:51:25 +00:00
Stan Shebs
07d2d395eb import gdb-1999-05-10 1999-05-11 20:29:07 +00:00
Stan Shebs
df11a28122 import gdb-1999-05-10 1999-05-11 13:32:54 +00:00
Stan Shebs
d03a6b753a import gdb-1999-05-10 1999-05-11 13:28:52 +00:00
Stan Shebs
af9010d115 import gdb-19990504 snapshot 1999-05-05 21:44:03 +00:00
Stan Shebs
aad9afaeb8 import gdb-19990504 snapshot 1999-05-05 14:42:03 +00:00
201 changed files with 12974 additions and 5458 deletions

View File

@@ -1,3 +1,558 @@
1999-05-25 Fernando Nasser <fnasser@totem.to.cygnus.com>
* utils.c (gdb_file_adjust_strbuf): Take into account the
possibility that the buffer has not been allocated yet.
Tue May 25 16:05:11 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h (REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL,
REGISTER_CONVERT_TO_RAW): Provide default definition.
* valops.c (value_assign), infcmd.c (do_registers_info), findvar.c
(value_from_register, value_of_register): Remove #ifdef
REGISTER_CONVERTIBLE. Assume REGISTER_CONVERTIBLE etc defined.
Tue May 25 16:18:25 1999 Andrew Cagney <cagney@amy.cygnus.com>
* remote-d10v.c (d10v_eva_prepare_to_trace,
d10v_eva_get_trace_data), remote-sim.c (_initialize_remote_sim):
Add declaraton. Make static.
* remote-d10v.c (_initialize_remote_d10v), d10v-tdep.c
(_initialize_d10v_tdep): Add declaration.
* config/d10v/tm-d10v.h (d10v_frame_chain): Add declaration.
Tue May 25 15:20:58 1999 Andrew Cagney <cagney@amy.cygnus.com>
* main.c (init_proc, proc_remove_foreign): Delete function.
* inftarg.c (child_mourn_inferior): Update. Delete call to
proc_remove_foreign().
* top.c (gdb_init): Update. Delete call to init_proc().
* utils.c (pollquit, fmthex, hexlate): Delete function.
Tue May 25 13:01:43 1999 Andrew Cagney <cagney@amy.cygnus.com>
* main.c (gdb_init): Move declaration from here.
* top.h: To here.
* defs.h (init_page_info): Add declaration.
* top.c (initialize_utils): Move declaration from here.
* defs.h: To here.
* infcmd.c (target_map_name_to_register): Move declaration from
here.
* parser-defs.h: To here.
* c-typeprint.c (cp_type_print_method_args), target.c
(nosupport_runtime, normal_target_post_startup_inferior): Add
declaration. Make static.
Tue May 25 13:53:23 1999 Andrew Cagney <cagney@amy.cygnus.com>
* main.c: Include "event-loop.h".
* Makefile.in (main.o): Add dependency.
* top.h (setup_event_loop, async_init_signals), top.c
(set_async_editing_command, set_async_annotation_level,
set_async_prompt), event-loop.c (display_gdb_prompt): Move
declarations from here.
* event-loop.h: To here.
* event-loop.h (delete_async_signal_handler): Add function
declaration.
* event-top.c (change_annotation_level, command_handler): Add
declaration. Make static.
Tue May 25 12:44:58 1999 Andrew Cagney <cagney@amy.cygnus.com>
* tracepoint.c (free_actions_list, add_register): Add declaration.
Make static.
(free_actions_list_cleanup_wrapper): New function. Wraps
free_actions_list for make_cleanup.
(trace_start_command): Pass free_actions_list_cleanup_wrapper
instead of free_actions_list to make_cleanup.
(_initialize_tracepoint): Add extern declaration.
Tue May 25 12:23:39 1999 Andrew Cagney <cagney@amy.cygnus.com>
* jv-typeprint.c (java_type_print_base, jv-valprint.c
(java_print_value_fields): Add static declaration.
* jv-lang.c (java_lookup_type, get_java_utf8_name,
java_lookup_type): Add static declaration.
(get_java_class_symtab, java_class_is_primitive,
java_value_string): Add declaration. Make static.
(java_rerun_cleanup): Add extern declaration for this stub
function.
Mon May 24 16:16:29 1999 Andrew Cagney <cagney@amy.cygnus.com>
* inflow.c (_initialize_inflow), annotate.c
(_initialize_annotate), os9kread.c (_initialize_os9kread),
serial.c (_initialize_serial), nlmread.c (_initialize_nlmread),
f-valprint.c (_initialize_f_valprint), cp-valprint.c
(_initialize_cp_valprint), typeprint.c (_initialize_typeprint),
complaints.c (_initialize_complaints), scm-lang.c
(_initialize_scheme_language), m2-lang.c
(_initialize_m2_language), dbxread.c (_initialize_dbxread),
f-lang.c (_initialize_f_language), ch-lang.c
(_initialize_chill_language), c-lang.c (_initialize_c_language),
corefile.c (_initialize_core), stabsread.c
(_initialize_stabsread), mipsread.c (_initialize_mipsread),
elfread.c (_initialize_elfread), coffread.c
(_initialize_coffread), maint.c (_initialize_maint_cmds),
demangle.c (_initialize_demangler), maint.c
(_initialize_maint_cmds), language.c (_initialize_language): Add
external declaration.
Mon May 24 10:04:56 1999 Andrew Cagney <cagney@b1.cygnus.com>
* config/z8k/tm-z8k.h, config/w65/tm-w65.h, config/v850/tm-v850.h,
config/tic80/tm-tic80.h, config/tahoe/tm-tahoe.h,
config/rs6000/tm-rs6000.h, config/sparc/tm-sparc.h,
config/sh/tm-sh.h, config/pyr/tm-pyr.h, config/pa/tm-hppa.h,
config/ns32k/tm-merlin.h, config/mn10300/tm-mn10300.h,
config/mn10200/tm-mn10200.h, config/mips/tm-mips.h,
config/m88k/tm-m88k.h, config/m68k/tm-news.h,
config/m68k/tm-delta68.h, config/m68k/tm-isi.h,
config/m68k/tm-m68k.h, config/m32r/tm-m32r.h,
config/i960/tm-i960.h, config/i386/tm-i386v.h,
config/i386/tm-i386.h, config/h8500/tm-h8500.h,
config/h8300/tm-h8300.h, config/fr30/tm-fr30.h,
config/d30v/tm-d30v.h, config/d10v/tm-d10v.h,
config/convex/tm-convex.h, config/arc/tm-arc.h,
config/arm/tm-arm.h, config/alpha/tm-alpha.h,
config/a29k/tm-a29k.h: 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.
* ns32k-tdep.c (merlin_frame_num_args), tahoe-tdep.c
(tahoe_frame_num_args), vax-tdep.c (vax_frame_num_args),
m68k-tdep.c (news_frame_num_args, delta68_frame_num_args,
isi_frame_num_args), convex-tdep.c (convex_frame_num_args): New
functions.
* stack.c (print_args_stub): Update use of FRAME_NUM_ARGS.
Mon May 24 11:57:04 1999 Andrew Cagney <cagney@b1.cygnus.com>
* remote.c (remote_xfer_memory): Re-write with assumption that
REMOTE_TRANSLATE_XFER_ADDRESS is defined. Pass targ_addr and
targ_len by reference.
(REMOTE_TRANSLATE_XFER_ADDRESS): Provide default definition.
* remote-d10v.c (remote_d10v_translate_xfer_address): Update.
* config/d10v/tm-d10v.h (REMOTE_TRANSLATE_XFER_ADDRESS): Update.
Mon May 24 12:10:58 1999 Andrew Cagney <cagney@amy.cygnus.com>
* value.h (default_push_arguments): Add function declaration.
* alpha-tdep.c (alpha_about_to_return), gdbarch.c (verify_gdbarch,
arch_ok, set_arch), command.c (find_cmd), infrun.c
(follow_inferior_fork, follow_fork, follow_vfork,
set_schedlock_func, is_internal_shlib_eventpoint,
stopped_for_internal_shlib_event, stopped_for_shlib_catchpoint,
xdb_handle_command), infcmd.c (run_no_args_command, go_command),
symfile.c (add_filename_language, set_ext_lang_command,
info_ext_lang_command, init_filename_language_table), symtab.c
(overload_list_add_symbol), defs.h (default_get_saved_register),
ax-general.c (grow_expr, append_const, read_const, generic_ext):
Ditto.
* infrun.c (currently_stepping): Ditto. Make static.
* valops.c (hand_function_call): Explictly type static variable
``checked''.
Mon May 24 08:36:18 1999 Andrew Cagney <cagney@b1.cygnus.com>
* d10v-tdep.c (d10v_breakpoint_from_pc, d10v_register_name,
d10v_register_byte, d10v_register_raw_size,
d10v_register_virtual_size, d10v_register_virtual_type,
d10v_make_daddr, d10v_make_iaddr, d10v_daddr_p, d10v_iaddr_p,
d10v_convert_iaddr_to_raw, d10v_convert_daddr_to_raw,
d10v_store_struct_return, d10v_store_return_value,
d10v_extract_struct_value_address, d10v_frame_saved_pc,
d10v_frame_args_address, d10v_frame_locals_address,
d10v_saved_pc_after_call): New functions.
* config/d10v/tm-d10v.h (REGISTER_BYTE, REGISTER_RAW_SIZE,
REGISTER_VIRTUAL_SIZE, REGISTER_VIRTUAL_TYPE, STORE_STRUCT_RETURN,
D10V_MAKE_DADDR, D10V_MAKE_IADDR, D10V_DADDR_P, D10V_IADDR_P,
D10V_CONVERT_DADDR_TO_RAW, D10V_CONVERT_IADDR_TO_RAW,
STORE_STRUCT_RETURN, STORE_RETURN_VALUE,
EXTRACT_STRUCT_VALUE_ADDRESS, SAVED_PC_AFTER_CALL, FRAME_SAVED_PC,
FRAME_ARGS_ADDRESS): Re-define using new functions.
* config/d10v/tm-d10v.h (BREAKPOINT_FROM_PC): Replace BREAKPOINT.
(REGISTER_NAME): Replace REGISTER_NAMES.
* utils.c (core_addr_lessthan, core_addr_greaterthan): New
functions.
* defs.h (core_addr_lessthan, core_addr_greaterthan): Declare.
Sat May 22 16:44:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
* utils.c (n_spaces): Handle case where first call has N equal to
zero.
(print_spaces): Use n_spaces.
Fri May 21 11:23:54 1999 Andrew Cagney <cagney@b1.cygnus.com>
* valops.c (value_push): Remove conditional definition based on
absense of macro PUSH_ARGUMENTS. Pass SP and STRUCT_ADDR by
reference.
(default_push_arguments): New function.
* config/v850/tm-v850.h, config/tic80/tm-tic80.h,
config/sparc/tm-sparc.h, config/sparc/tm-sp64.h,
config/sh/tm-sh.h, config/rs6000/tm-rs6000.h, config/pa/tm-hppa.h,
config/mn10300/tm-mn10300.h, config/mn10200/tm-mn10200.h,
config/mips/tm-mips.h, config/m32r/tm-m32r.h,
config/h8300/tm-h8300.h, config/fr30/tm-fr30.h,
config/d30v/tm-d30v.h, config/d10v/tm-d10v.h, config/arm/tm-arm.h,
config/alpha/tm-alpha.h: Update definition of PUSH_ARGUMENTS.
Return updated SP.
* rs6000-tdep.c (rs6000_push_arguments): Rename push_arguments.
Thu May 20 12:18:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
* blockframe.c (get_prev_frame): Remove #ifdef around test for
FRAMELESS_FUNCTION_INVOCATION.
(get_prev_frame): Change FRAMELESS_FUNCTION_INVOCATION call to a
function invocation.
* i386-tdep.c (i386_frame_num_args), stack.c (frame_info): Ditto.
* config/z8k/tm-z8k.h, config/w65/tm-w65.h, config/vax/tm-vax.h,
config/sparc/tm-sparc.h, config/sh/tm-sh.h,
config/rs6000/tm-rs6000.h, config/pa/tm-hppa.h,
config/mips/tm-mips.h, config/m88k/tm-m88k.h,
config/m68k/tm-m68k.h, config/i960/tm-i960.h,
config/i386/tm-sun386.h, config/i386/tm-i386v.h,
config/i386/tm-i386.h, config/h8500/tm-h8500.h,
config/h8300/tm-h8300.h, config/fr30/tm-fr30.h,
config/d30v/tm-d30v.h, config/d10v/tm-d10v.h,
config/convex/tm-convex.h, config/arm/tm-arm.h,
config/arc/tm-arc.h, config/alpha/tm-alpha.h,
config/a29k/tm-a29k.h: Update FRAMELESS_FUNCTION_INVOCATION.
* fr30-tdep.c (fr30_frameless_function_invocation), convex-tdep.c
(convex_frameless_function_invocation), arm-tdep.c
(arm_frameless_function_invocation): New functions.
1999-05-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* top.c: Change dates in comments to ISO format.
* event-top.c: Ditto.
* event-loop.c: Ditto.
* main.c: Ditto.
1999-05-19 Keith Seitz <keiths@cygnus.com>
* 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
dynamically.
(monitor_close): Free memory associated with breakpoint
storage.
(monitor_insert_breakpoint): Don't rely on a hardcoded
number of breakpoints.
(monitor_remove_breakpoint): Ditto.
(NUM_MONITOR_BREAKPOINTS): Removed and replaced with monitor_ops
specification.
* monitor.h (struct monitor_ops): Add new member so that the
individual monitor implementations can tell us how many
breakpoints the monitor supports.
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 Fernando Nasser <fnasser@totem.to.cygnus.com>
* top.c (print_command_line): Added the missing stream argument.
* gdbcmd.h: Added argument to prototype.
* command.c: Fixed call to include extra argument.
* breakpoint.c: Same.
1999-05-14 Jim Blandy <jimb@zwingli.cygnus.com>
Targets are #defining PREPARE_TO_PROCEED with inconsistent numbers
of arguments. Since the Mach 3 target needs an argument, we'll
make things consistent by adding an argument everywhere.
* infrun.c (proceed): Pass an argument to PREPARE_TO_PROCEED.
* config/pa/nm-hppah.h (PREPARE_TO_PROCEED): Add ignored argument
to definition.
1999-05-11 Stan Shebs <shebs@andros.cygnus.com>
Fri Apr 23 13:27:34 PDT 1999 Toshiyasu Morita (tm@netcom.com)
* sh-stub.c: Mostly localize processor dependencies.
1999-05-10 Martin Hunt <hunt@cygnus.com>
* debugify.c, debugify.h: Removed because they are no
longer used.
1999-05-08 Jim Blandy <jimb@zwingli.cygnus.com>
* infrun.c (_initialize_infrun): Handle TARGET_SIGNAL_LWP,
TARGET_SIGNAL_WAITING, and TARGET_SIGNAL_CANCEL like SIGALRM or
SIGIO --- pass them through to the inferior silently.
* target.h (enum target_signals): Add TARGET_SIGNAL_CANCEL, for
Solaris's SIGCANCEL.
* target.c (target_signal_from_host, target_signal_to_host): Add
mapping between SIGCANCEL and TARGET_SIGNAL_CANCEL.
(signals): Add entry for SIGCANCEL.
1999-05-07 Stan Shebs <shebs@andros.cygnus.com>
After years of talking about it, finally break up the
wait_for_inferior loop.
* infrun.c (struct execution_control_state): New struct,
holds what used to be local vars governing wfi behavior.
(init_execution_control_state): New function, was code in
wfi that set up execution control state.
(handle_inferior_event): New function, was body of main
wfi loop. Rewrite all local var references to go through
the ecs structure passed into this function.
(wait_for_inferior): Rewrite to set up and use execution control
state, and to call the new functions.
(currently_stepping): New function, was the macro
CURRENTLY_STEPPING.
(enum infwait_states): Rename from wfi_states.
(infwait_normal_state, etc): Similarly.
Thu May 6 15:25:32 1999 Philippe De Muyter <phdm@macqel.be>
* coffread.c (coff_symtab_read): Call `record_line' with the line
number of the ".bf" symbol only for one-line functions.
1999-05-06 Michael Snyder <msnyder@cleaver.cygnus.com>
* Makefile.in: thread.o depends on target.h.
1999-05-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* event-top.c (change_line_handler): Use POLLIN instead of
POLLRDNORM, for compatibility with Linux.
(setup_event_loop): Ditto.
1999-05-06 Jim Blandy <jimb@zwingli.cygnus.com>
* mips-tdep.c (heuristic_proc_start): Rewrite cryptic error
message about hitting the "heuristic fence post" with something
that actually gives the user a fighting chance of figuring out
why GDB is unhappy.
1999-05-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* top.c: Include event-loop.h.
(init_main): Add async version of 'set prompt' command.
If in async mode define the editing and annotate set
commands in a different way.
Initialize new variable asyn_command_editing_p to 1.
Initialize the gdb prompt for async mode.
(quit_cover): Make not static, for use by the event loop.
(gdb_init): Call async_init_signals for the asynchronous case.
(source_line_number, source_file_name, source_error,
source_pre_error, history_expansion_p): Make non-static, so
event-top.c can use them.
(command_loop_marker): Make non-static, for use in event-top.c.
Include event-loop.h.
* top.h: Add prototype for async_init_signals.
(SET_TOP_LEVEL): Move here from main.c.
Add setup_event_loop to exported functions.
* defs.h: Add async_hook to exported variables.
* main.c (SET_TOP_LEVEL): Move to top.h, so that it is visible in
event-loop.c. Add new global variable async to determine whether
we are running in async mode or not.
(main): Add support for --async switch. Use async_hook to call
setup_event_loop, when running in async mode.
* event-top.c: New file. Gdb input line handler and command line
handler for the event loop. Initialization of signal handlers.
All the handled signals have handlers called handle_<signalname>.
Set up all the appropriate tokens for asynchronous signal
handling.
* event-loop.h: New file. Data structures and definitions for the
event loop.
* event-loop.c: New file. Functions for the event loop
implementation.
* config.in: Regenerate with autoheader.
* configure.in (AC_CHECK_FUNCS): Add poll to list of functions
to be checked for.
* configure: Regenerate.
* Makefile.in (SFILES): Add new source files.
(eventloop_h): Define.
(COMMON_OBS): Add new object files.
(event-loop.o): Add rule for target object.
(event-top.o): Ditto.
1999-05-05 Stan Shebs <shebs@andros.cygnus.com>
* infrun.c (wait_for_inferior): Transform breaks and continues
into gotos, move the target_wait to the very top of the loop.
1999-05-05 Jonathan Larmour <jlarmour@cygnus.co.uk>
* configure.in: Ensure that GDB links with libuser32.a under
cygwin because libreadline requires it.
* Makefile.in (WIN32LIBS): Substitute in result from configure
* configure: regenerate
1999-05-04 Jim Blandy <jimb@zwingli.cygnus.com>
Fix from John Rigby. Richard Henderson says it seems okay.
* alpha-tdep.c (PROC_DUMMY_FRAME): As long as we're abusing fields
of (proc)->pdr, we ought to at least abuse one large enough to
hold the value we're trying to store in it. iopt is only 32 bits
wide; cbLineOffset is a bfd_vma.
1999-05-04 DJ Delorie <dj@cygnus.com>
DJGPP changes from Robert Hoehne <robert.hoehne@gmx.net>
* ser-go32.c: correct includes
* source.c (openp): use ROOTED_P instead of SLASH_P
* go32-nat.c: enhance exception and NPX handling
(go32_kill_inferior): fix small bug killing inferior
* configure.in: don't look for termcap with djgpp
* configure: rebuild
1999-05-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* main.c (main): Comment out unused and undocumented command line
option '-'.
1999-04-30 Jim Blandy <jimb@zwingli.cygnus.com>
Cleanup from Philippe De Muyter:
* configure.in (BFD_NEED_DECLARATION): Check also for strstr.
* acconfig.h (NEED_DECLARATION_MALLOC, NEED_DECLARATION_REALLOC,
NEED_DECLARATION_FREE, NEED_DECLARATION_STRERROR): Define slots
removed; they are now generated automatically.
* gdb_string.h (strstr): Provide function prototype if
NEED_DECLARATION_STRSTR.
* configure, config.in: Regenerated.
Fri Apr 30 11:16:09 1999 Michael Snyder <msnyder@cleaver.cygnus.com>
* target.h (to_find_new_threads): new target ops vector.
(target_find_new_threads): define.
* target.c (update_current_target): inherit new target ops vector.
* remote.c: Setup to_find_new_threads vector.
* sol-thread.c: ditto.
* thread.c (target_find_new_threads): rename: local_find_new_threads.
(info_threads_command): call target_find_new_threads by new method,
as a target ops vector, rather than previous macro definition method.
* infcmd.c (go_command): define only if in xdb mode.
* procfs.c: fix typo in comment.
Fri Apr 30 01:02:05 1999 Jeffrey A Law (law@cygnus.com)
* hppah-nat.c: Fix various coding convention violations introduced
by HP.
(child_acknowledge_created_inferior): Do nothing if PT_SET_EVENT_MASK
is not defined.
1999-04-28 Stan Shebs <shebs@andros.cygnus.com>
* TODO: Add some items inspired by review of the manual.
Tue Apr 27 17:38:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
* config/z8k/tm-z8k.h, config/v850/tm-v850.h,
config/tic80/tm-tic80.h, config/sparc/tm-sparc.h,
config/sh/tm-sh.h, config/pyr/tm-pyr.h, config/pa/tm-hppa.h,
config/mn10300/tm-mn10300.h, config/mn10200/tm-mn10200.h,
config/mips/tm-mips.h, config/m88k/tm-m88k.h,
config/m68k/tm-m68k.h, config/m32r/tm-m32r.h,
config/i960/tm-i960.h, config/i386/tm-i386.h,
config/h8500/tm-h8500.h, config/h8300/tm-h8300.h,
config/fr30/tm-fr30.h, config/d30v/tm-d30v.h,
config/d10v/tm-d10v.h, config/alpha/tm-alpha.h,
config/arm/tm-arm.h, config/a29k/tm-a29k.h, config/arc/tm-arc.h:
Change SKIP_PROLOGUE and SKIP_PROLOGUE_FRAMELESS_P macros so that
they return the new address.
* sparc-tdep.c (sparc_skip_prologue), hppa-tdep.c
(hppa_skip_prologue), m88k-tdep.c
(m88k_skip_prologue), i960-tdep.c
(i960_skip_prologue), arc-tdep.c
(arc_skip_prologue), a29k-tdep.c (a29k_skip_prologue): Rename
skip_prologue function.
* config/m68k/tm-isi.h: Convert macro SKIP_PROLOGUE into a new
function.
* m68k-tdep.c (isi_skip_prologue): That new function.
* vax-tdep.c (vax_skip_prologue), config/vax/tm-vax.h: Ditto.
* tahoe-tdep.c (tahoe_skip_prologue), config/tahoe/tm-tahoe.h: Ditto.
* rs6000-tdep.c (rs6000_skip_prologue), config/rs6000/tm-rs6000.h:
Ditto.
* ns32k-tdep.c (umax_skip_prologue), config/ns32k/tm-umax.h: Ditto.
* config/ns32k/tm-merlin.h, ns32k-tdep.c (merlin_skip_prologue):
Ditto.
* config/m68k/tm-altos.h, m68k-tdep.c (altos_skip_prologue): Ditto.
* config/convex/tm-convex.h, convex-tdep.c (convex_skip_prologue):
Ditto.
* symtab.c (in_prologue, find_function_start_sal, decode_line_1),
infrun.c (wait_for_inferior), blockframe.c
(frameless_look_for_prologue): Update.
* config/fr30/tm-fr30.h (FRAMELESS_FUNCTION_INVOCATION): Update.
1999-04-27 Stan Shebs <shebs@andros.cygnus.com>
* TODO: Remove item about DEBUG_EXPRESSIONS, no longer meaningful.
* infrun.c (enum wfi_state): New enum.
(wait_for_inferior): Merge all but one of the target_wait calls
into a single call, add a wfi_state variable to encode which of
the calls is being made.
1999-04-26 Jim Blandy <jimb@zwingli.cygnus.com>
Fix from Dave Holcomb.
* hpux-thread.c (init_hpux_thread_ops): Use the right function
name when initializing hpux_thread_ops.to_thread_alive.
* coffread.c (coff_symfile_read): If we have a `.stab' section,
but no `.stabstr' section, then print an error message; don't
crash.
1999-04-26 Jim Blandy <jimb@zwingli.cygnus.com>
1999-04-25 Mark Kettenis <kettenis@gnu.org>
* gnu-nat.c (gnu_attach): Call target_terminal_init before calling
inf_set_traced, since that function calls code that might try to
restore the terminal settings.
Mon Apr 26 08:55:46 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.h, gdbarch.c: More format cleanups.
Fri Apr 23 15:00:25 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbarch.c (arch_ok): New function. Fix logic test for a valid
architecture.
(set_arch): Use.
1999-04-22 Jason Molenda (jsm@bugshack.cygnus.com)
* README: Note that readline is not installed as a part of

View File

@@ -148,6 +148,8 @@ OPCODES_CFLAGS = -I$(OP_INCLUDE)
# should set this to list all the .o or .a files to be linked in.
SIM =
WIN32LIBS = @WIN32LIBS@
ENABLE_CFLAGS= @ENABLE_CFLAGS@
@@ -217,7 +219,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \
ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
VERSION = 19990422
VERSION = 19990525
DIST=gdb
LINT=/usr/5bin/lint
@@ -368,6 +370,7 @@ SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \
ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c coffread.c \
command.c complaints.c corefile.c cp-valprint.c dbxread.c \
demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.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 \
jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \
@@ -436,6 +439,7 @@ defs_h = defs.h xm.h tm.h nm.h config.status config.h gdbarch.h
inferior_h = inferior.h $(breakpoint_h)
tracepoint_h = tracepoint.h
ax_h = ax.h
event_loop_h = event-loop.h
# Header files that need to have srcdir added. Note that in the cases
# where we use a macro like $(gdbcmd_h), things are carefully arranged
@@ -491,7 +495,9 @@ TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR)
COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o stack.o thread.o \
source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \
symtab.o symfile.o symmisc.o infcmd.o infrun.o command.o \
expprint.o environ.o gdbarch.o gdbtypes.o copying.o $(DEPFILES) \
expprint.o environ.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 \
exec.o bcache.o objfiles.o minsyms.o maint.o demangle.o \
dbxread.o coffread.o elfread.o \
@@ -938,7 +944,8 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
infptrace.c inftarg.c irix4-nat.c irix5-nat.c isi-xdep.c \
lynx-nat.c m3-nat.c \
m68k-tdep.c \
m88k-nat.c m88k-tdep.c mac-nat.c mips-nat.c \
m88k-nat.c m88k-tdep.c mac-nat.c \
mips-nat.c \
mips-tdep.c mipsm3-nat.c mipsv4-nat.c news-xdep.c \
nindy-share/Onindy.c nindy-share/nindy.c \
nindy-share/ttyflush.c nindy-tdep.c \
@@ -1101,6 +1108,11 @@ eval.o: eval.c $(bfd_h) $(defs_h) $(expression_h) $(frame_h) \
$(gdbtypes_h) language.h $(symtab_h) target.h $(value_h) \
gdb_string.h
event-loop.o: event-loop.c $(event_loop_h)
event-top.o: event-top.c top.h $(readline_headers) \
$(defs_h) $(inferior_h) $(event_loop_h)
exec.o: exec.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
target.h language.h gdb_string.h
@@ -1243,7 +1255,7 @@ m88k-tdep.o: m88k-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
mac-nat.o: mac-nat.c $(defs_h) gdb_string.h
main.o: main.c top.h $(defs_h) gdb_string.h
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
@@ -1545,11 +1557,11 @@ tic80-tdep.o: tic80-tdep.c $(defs_h)
target.o: target.c $(bfd_h) $(defs_h) $(gdbcmd_h) $(inferior_h) \
objfiles.h symfile.h target.h gdb_string.h
thread.o: thread.c $(defs_h) gdbthread.h $(gdbcmd_h)
thread.o: thread.c $(defs_h) gdbthread.h $(gdbcmd_h) target.h
top.o: top.c top.h $(bfd_h) $(getopt_h) $(readline_headers) call-cmds.h \
$(defs_h) $(gdbcmd_h) $(inferior_h) language.h signals.h \
$(remote_utils_h) gdb_string.h
$(remote_utils_h) gdb_string.h $(event_loop_h)
typeprint.o: typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \
$(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) target.h \

View File

@@ -9,6 +9,20 @@ General To Do List
This list is probably not up to date, and opinions vary about the
importance or even desirability of some of the items.
Document trace machinery.
Document overlay machinery.
Extend .gdbinit mechanism to specify name on command line, allow for
lists of files to load, include function of --tclcommand.
@c This does not work (yet if ever). FIXME.
@c @item --parse=@var{lang} @dots{}
@c Configure the @value{GDBN} expression parser to parse the listed languages.
@c @samp{all} configures @value{GDBN} for all supported languages. To get a
@c list of all supported languages, omit the argument. Without this
@c option, @value{GDBN} is configured to parse all supported languages.
Add an "info bfd" command that displays supported object formats,
similarly to objdump -i.
@@ -382,9 +396,6 @@ Why do we allow a target to omit standard register names (NO_STD_REGS
in tm-z8k.h)? I thought the standard register names were supposed to
be just that, standard.
Make DEBUG_EXPRESSIONS a maintenance command, dependent on
MAINTENANCE_COMMANDS.
Allow core file without exec file on RS/6000.
Make sure "shell" with no arguments works right on DOS.
@@ -466,6 +477,9 @@ Add a command for searching memory, a la adb. It specifies size,
mask, value, start address. ADB searches until it finds it or hits
an error (or is interrupted).
Remove the range and type checking code and documentation, if not
going to implement.
# Local Variables:
# mode: text
# End:

View File

@@ -337,7 +337,7 @@ examine_prologue (pc, rsize, msize, mfp_used)
to reach some "real" code. */
CORE_ADDR
skip_prologue (pc)
a29k_skip_prologue (pc)
CORE_ADDR pc;
{
return examine_prologue (pc, NULL, NULL, NULL);

View File

@@ -1,17 +1,3 @@
/* Whether malloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_MALLOC
/* Whether realloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_REALLOC
/* Whether free must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_FREE
/* Whether strerror must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_STRERROR
@TOP@
/* Define if pstatus_t type is available */
#undef HAVE_PSTATUS_T

View File

@@ -59,6 +59,10 @@ static CORE_ADDR after_prologue PARAMS ((CORE_ADDR pc,
static int alpha_in_prologue PARAMS ((CORE_ADDR pc,
alpha_extra_func_info_t proc_desc));
static int alpha_about_to_return PARAMS ((CORE_ADDR pc));
void _initialize_alpha_tdep PARAMS ((void));
/* Heuristic_proc_start may hunt through the text section for a long
time across a 2400 baud serial line. Allows the user to limit this
search. */
@@ -108,8 +112,11 @@ static unsigned int heuristic_fence_post = 0;
*/
#define PROC_LOW_ADDR(proc) ((proc)->pdr.adr) /* least address */
/* These next two fields are kind of being hijacked. I wonder if
iline is too small for the values it needs to hold, if GDB is
running on a 32-bit host. */
#define PROC_HIGH_ADDR(proc) ((proc)->pdr.iline) /* upper address bound */
#define PROC_DUMMY_FRAME(proc) ((proc)->pdr.iopt) /* frame for CALL_DUMMY */
#define PROC_DUMMY_FRAME(proc) ((proc)->pdr.cbLineOffset) /*CALL_DUMMY frame */
#define PROC_FRAME_OFFSET(proc) ((proc)->pdr.frameoffset)
#define PROC_FRAME_REG(proc) ((proc)->pdr.framereg)
#define PROC_REG_MASK(proc) ((proc)->pdr.regmask)
@@ -1392,7 +1399,6 @@ alpha_call_dummy_address ()
return SYMBOL_VALUE_ADDRESS (sym) + 4;
}
void _initialize_alpha_tdep PARAMS ((void));
void
_initialize_alpha_tdep ()
{

View File

@@ -27,6 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Prototypes for local functions. */
extern void _initialize_annotate PARAMS ((void));
static void print_value_flags PARAMS ((struct type *));
static void breakpoint_changed PARAMS ((struct breakpoint *));

View File

@@ -264,7 +264,7 @@ arc_get_frame_setup (pc)
This allows a quicker answer. */
CORE_ADDR
skip_prologue (pc, frameless_p)
arc_skip_prologue (pc, frameless_p)
CORE_ADDR pc;
int frameless_p;
{

View File

@@ -137,6 +137,19 @@ arm_saved_pc_after_call (frame)
return ADDR_BITS_REMOVE (read_register (LR_REGNUM));
}
int
arm_frameless_function_invocation (fi)
struct frame_info *fi;
{
int frameless;
CORE_ADDR func_start, after_prologue;
func_start = (get_pc_function_start ((fi)->pc) + FUNCTION_START_OFFSET);
after_prologue = func_start;
SKIP_PROLOGUE (after_prologue);
frameless = (after_prologue == func_start);
return frameless;
}
/* A typical Thumb prologue looks like this:
push {r7, lr}
add sp, sp, #-28

View File

@@ -27,6 +27,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "value.h"
static void grow_expr PARAMS ((struct agent_expr *x, int n));
static void append_const PARAMS ((struct agent_expr *x, LONGEST val, int n));
static LONGEST read_const PARAMS ((struct agent_expr *x, int o, int n));
static void generic_ext PARAMS ((struct agent_expr *x, enum agent_op op, int n));
/* Functions for building expressions. */

View File

@@ -307,9 +307,9 @@ frameless_look_for_prologue (frame)
#ifdef SKIP_PROLOGUE_FRAMELESS_P
/* This is faster, since only care whether there *is* a prologue,
not how long it is. */
SKIP_PROLOGUE_FRAMELESS_P (after_prologue);
after_prologue = SKIP_PROLOGUE_FRAMELESS_P (after_prologue);
#else
SKIP_PROLOGUE (after_prologue);
after_prologue = SKIP_PROLOGUE (after_prologue);
#endif
return after_prologue == func_start;
}
@@ -381,17 +381,16 @@ get_prev_frame (next_frame)
define this macro to take two args; a frameinfo pointer
identifying a frame and a variable to set or clear if it is
or isn't leafless. */
#ifdef FRAMELESS_FUNCTION_INVOCATION
/* Still don't want to worry about this except on the innermost
frame. This macro will set FROMLEAF if NEXT_FRAME is a
frameless function invocation. */
if (!(next_frame->next))
{
FRAMELESS_FUNCTION_INVOCATION (next_frame, fromleaf);
fromleaf = FRAMELESS_FUNCTION_INVOCATION (next_frame);
if (fromleaf)
address = FRAME_FP (next_frame);
}
#endif
if (!fromleaf)
{

View File

@@ -2713,6 +2713,7 @@ breakpoint_1 (bnum, allflag)
static char bpenables[] = "nyn";
char wrap_indent[80];
ALL_BREAKPOINTS (b)
if (bnum == -1
|| bnum == b->number)
@@ -2928,7 +2929,7 @@ breakpoint_1 (bnum, allflag)
while (l)
{
print_command_line (l, 4);
print_command_line (l, 4, gdb_stdout);
l = l->next;
}
}

View File

@@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "language.h"
#include "c-lang.h"
extern void _initialize_c_language PARAMS ((void));
static void c_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
/* Print the character C on STREAM as part of the contents of a literal

View File

@@ -41,6 +41,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Flag indicating target was compiled by HP compiler */
extern int hp_som_som_object_present;
static void cp_type_print_method_args PARAMS ((struct type **args, char *prefix, char *varstring, int staticp, GDB_FILE *stream));
static void
c_type_print_args PARAMS ((struct type *, GDB_FILE *));
@@ -203,7 +205,7 @@ cp_type_print_derivation_info (stream, type)
}
/* Print the C++ method arguments ARGS to the file STREAM. */
void
static void
cp_type_print_method_args (args, prefix, varstring, staticp, stream)
struct type **args;
char *prefix;

View File

@@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "language.h"
#include "ch-lang.h"
extern void _initialize_chill_language PARAMS ((void));
static value_ptr
evaluate_subexp_chill PARAMS ((struct type *, struct expression *, int *, enum noside));

View File

@@ -42,6 +42,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "complaints.h"
#include "target.h"
extern void _initialize_coffread PARAMS ((void));
struct coff_symfile_info {
file_ptr min_lineno_offset; /* Where in file lowest line#s are */
file_ptr max_lineno_offset; /* 1+last byte of line#s in file */
@@ -686,6 +688,17 @@ coff_symfile_read (objfile, section_offsets, mainline)
if (info->stabsects)
{
if (! info->stabstrsect)
{
error_begin ();
fprintf_filtered
(gdb_stderr,
("The debugging information in `%s' is corrupted.\n"
"The file has a `.stabs' section, but no `.stabstr' section.\n"),
name);
return_to_top_level (RETURN_ERROR);
}
/* FIXME: dubious. Why can't we use something normal like
bfd_get_section_contents? */
bfd_seek (abfd, abfd->where, 0);
@@ -753,6 +766,7 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
char *filestring = "";
int depth = 0;
int fcn_first_line = 0;
CORE_ADDR fcn_first_line_addr;
int fcn_last_line = 0;
int fcn_start_addr = 0;
long fcn_line_ptr = 0;
@@ -1009,6 +1023,7 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
if (cs->c_naux != 1)
complain (&bf_no_aux_complaint, cs->c_symnum);
fcn_first_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
fcn_first_line_addr = cs->c_value;
/* Might want to check that locals are 0 and
context_stack_depth is zero, and complain if not. */
@@ -1019,7 +1034,6 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
new->name =
process_coff_symbol (&fcn_cs_saved, &fcn_aux_saved,
section_offsets, objfile);
record_line (current_subfile, fcn_first_line, cs->c_value);
}
else if (STREQ (cs->c_name, ".ef"))
{
@@ -1052,8 +1066,18 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
{
fcn_last_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
}
enter_linenos (fcn_line_ptr, fcn_first_line, fcn_last_line,
section_offsets);
/* fcn_first_line is the line number of the opening '{'.
Do not record it - because it would affect gdb's idea
of the line number of the first statement of the function -
except for one-line functions, for which it is also the line
number of all the statements and of the closing '}', and
for which we do not have any other statement-line-number. */
if (fcn_last_line == 1)
record_line (current_subfile, fcn_first_line,
fcn_first_line_addr);
else
enter_linenos (fcn_line_ptr, fcn_first_line, fcn_last_line,
section_offsets);
finish_block (new->name, &local_symbols, new->old_blocks,
new->start_addr,

View File

@@ -51,6 +51,12 @@ static int parse_binary_operation PARAMS ((char *));
static void print_doc_line PARAMS ((GDB_FILE *, char *));
static struct cmd_list_element *find_cmd PARAMS ((char *command,
int len,
struct cmd_list_element *clist,
int ignore_help_classes,
int *nfound));
void _initialize_command PARAMS ((void));
/* Add element named NAME.
@@ -568,6 +574,7 @@ help_cmd_list (list, class, prefix, recurse, stream)
static struct cmd_list_element *
find_cmd(command, len, clist, ignore_help_classes, nfound)
char *command;
int len;
struct cmd_list_element *clist;
int ignore_help_classes;
int *nfound;
@@ -1513,7 +1520,7 @@ show_user_1 (c, stream)
while (cmdlines)
{
print_command_line (cmdlines, 4);
print_command_line (cmdlines, 4, stream);
cmdlines = cmdlines->next;
}
fputs_filtered ("\n", stream);

View File

@@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "complaints.h"
#include "gdbcmd.h"
extern void _initialize_complaints PARAMS ((void));
/* Structure to manage complaints about symbol file contents. */
struct complaint complaint_root[1] = {

View File

@@ -1,17 +1,5 @@
/* config.in. Generated automatically from configure.in by autoheader. */
/* Whether malloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_MALLOC
/* Whether realloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_REALLOC
/* Whether free must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_FREE
/* Whether strerror must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_STRERROR
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
@@ -147,6 +135,9 @@
/* 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
@@ -321,6 +312,9 @@
/* Define if strdup is not declared in system header files. */
#undef NEED_DECLARATION_STRDUP
/* Define if strstr is not declared in system header files. */
#undef NEED_DECLARATION_STRSTR
/* Define if <sys/procfs.h> has pstatus_t. */
#undef HAVE_PSTATUS_T

View File

@@ -43,9 +43,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(pc) \
{ pc = skip_prologue (pc); }
CORE_ADDR skip_prologue ();
#define SKIP_PROLOGUE(pc) (a29k_skip_prologue (pc))
CORE_ADDR a29k_skip_prologue ();
/* Immediately after a function call, return the saved pc.
Can't go through the frames for this because on some machines
@@ -472,11 +471,10 @@ void init_frame_pc ();
/* Define other aspects of the stack frame. */
/* 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. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
/* An expression that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. */
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
/* Saved pc (i.e. return address). */
#define FRAME_SAVED_PC(fraim) \
@@ -495,7 +493,7 @@ extern CORE_ADDR frame_locals_address ();
the argcount field from it, to support debugging assembler code.
Problem was, the "argcount" field never did hold the argument
count. */
#define FRAME_NUM_ARGS(numargs, fi) ((numargs) = -1)
#define FRAME_NUM_ARGS(fi) (-1)
#define FRAME_ARGS_ADDRESS(fi) FRAME_LOCALS_ADDRESS (fi)

View File

@@ -59,7 +59,7 @@ struct symbol;
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(pc) pc = alpha_skip_prologue(pc, 0)
#define SKIP_PROLOGUE(pc) (alpha_skip_prologue(pc, 0))
extern CORE_ADDR alpha_skip_prologue PARAMS ((CORE_ADDR addr, int lenient));
/* Immediately after a function call, return the saved pc.
@@ -252,12 +252,11 @@ extern CORE_ADDR alpha_frame_chain PARAMS ((struct frame_info *));
/* Define other aspects of the stack frame. */
/* 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. */
/* An expression that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. */
/* We handle this differently for alpha, and maybe we should not */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) {(FRAMELESS) = 0;}
#define FRAMELESS_FUNCTION_INVOCATION(FI) (0)
/* Saved Pc. */
@@ -287,7 +286,7 @@ alpha_frame_saved_pc PARAMS ((struct frame_info *));
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(num, fi) ((num) = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */
@@ -312,7 +311,7 @@ extern void alpha_find_saved_regs PARAMS ((struct frame_info *));
/* Things needed for making the inferior call functions. */
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
sp = alpha_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))
(alpha_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
extern CORE_ADDR
alpha_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));

View File

@@ -37,11 +37,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
knows that the function has a frame. Its result is equal
to its input PC if the function is frameless, unequal otherwise. */
#define SKIP_PROLOGUE(pc) \
{ pc = skip_prologue (pc, 0); }
#define SKIP_PROLOGUE_FRAMELESS_P(pc) \
{ pc = skip_prologue (pc, 1); }
extern CORE_ADDR skip_prologue PARAMS ((CORE_ADDR, int));
#define SKIP_PROLOGUE(pc) (arc_skip_prologue (pc, 0))
#define SKIP_PROLOGUE_FRAMELESS_P(pc) (arc_skip_prologue (pc, 1))
extern CORE_ADDR arc_skip_prologue PARAMS ((CORE_ADDR, int));
/* Sequence of bytes for breakpoint instruction.
??? The current value is "sr -1,[-1]" and is for the simulator only.
@@ -267,17 +265,11 @@ extern void arc_software_single_step PARAMS ((unsigned int, int));
and has no caller. */
#define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe)
/* 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. */
/* An expression that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
do { \
if ((FI)->signal_handler_caller) \
(FRAMELESS) = 0; \
else \
(FRAMELESS) = frameless_look_for_prologue (FI); \
} while (0)
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(((FI)->signal_handler_caller) ? 0 : frameless_look_for_prologue (FI))
/* Where is the PC for a specific frame.
A leaf function may never save blink, so we have to check for that here. */
@@ -302,7 +294,7 @@ CORE_ADDR arc_frame_saved_pc PARAMS ((struct frame_info *));
/* Set NUMARGS to the number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(numargs, fi) (numargs = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */

View File

@@ -56,7 +56,7 @@ CORE_ADDR arm_addr_bits_remove PARAMS ((CORE_ADDR));
extern CORE_ADDR arm_skip_prologue PARAMS ((CORE_ADDR pc));
#define SKIP_PROLOGUE(pc) { pc = arm_skip_prologue (pc); }
#define SKIP_PROLOGUE(pc) (arm_skip_prologue (pc))
/* Immediately after a function call, return the saved pc.
Can't always go through the frames for this because on some machines
@@ -313,18 +313,10 @@ extern int arm_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
/* Define other aspects of the stack frame. */
/* 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. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
{ \
CORE_ADDR func_start, after_prologue; \
func_start = (get_pc_function_start ((FI)->pc) + \
FUNCTION_START_OFFSET); \
after_prologue = func_start; \
SKIP_PROLOGUE (after_prologue); \
(FRAMELESS) = (after_prologue == func_start); \
}
/* 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))
/* Saved Pc. */
@@ -338,7 +330,7 @@ extern CORE_ADDR arm_frame_saved_pc PARAMS ((struct frame_info *));
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(numargs, fi) (numargs = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */
@@ -362,9 +354,8 @@ void frame_find_saved_regs PARAMS((struct frame_info *fi,
/* Things needed for making the inferior call functions. */
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
sp = arm_push_arguments ((nargs), (args), (sp), (struct_return), (struct_addr))
extern CORE_ADDR
arm_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
(arm_push_arguments ((nargs), (args), (sp), (struct_return), (struct_addr)))
extern CORE_ADDR arm_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
/* Push an empty stack frame, to record the current PC, etc. */

View File

@@ -52,26 +52,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
[ld.- -(ap),-] pcc/gcc register arg loads
*/
#define SKIP_PROLOGUE(pc) \
{ int op, ix; \
op = read_memory_integer (pc, 2); \
if ((op & 0xffc7) == 0x5ac0) pc += 2; \
else if (op == 0x1580) pc += 4; \
else if (op == 0x15c0) pc += 6; \
if ((read_memory_integer (pc, 2) & 0xfff8) == 0x7c40 \
&& (read_memory_integer (pc + 2, 2) & 0xfff8) == 0x1240 \
&& (read_memory_integer (pc + 8, 2) & 0xfff8) == 0x7c48) \
pc += 10; \
if (read_memory_integer (pc, 2) == 0x1240) pc += 6; \
for (;;) { \
op = read_memory_integer (pc, 2); \
ix = (op >> 3) & 7; \
if (ix != 6) break; \
if ((op & 0xfcc0) == 0x3000) pc += 4; \
else if ((op & 0xfcc0) == 0x3040) pc += 6; \
else if ((op & 0xfcc0) == 0x2800) pc += 4; \
else if ((op & 0xfcc0) == 0x2840) pc += 6; \
else break;}}
extern CORE_ADDR convex_skip_prologue PARAMS ((CORE_ADDR pc));
#define SKIP_PROLOGUE(pc) (convex_skip_prologue (pc))
/* Immediately after a function call, return the saved pc.
(ignore frame and return *$sp so we can handle both calls and callq) */
@@ -278,19 +260,13 @@ extern struct value *value_of_trapped_internalvar ();
#define NEED_TEXT_START_END 1
/* 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.
/* An expression that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it.
On convex, check at the return address for `callq' -- if so, frameless,
otherwise, not. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
{ \
extern CORE_ADDR text_start, text_end; \
CORE_ADDR call_addr = SAVED_PC_AFTER_CALL (FI); \
(FRAMELESS) = (call_addr >= text_start && call_addr < text_end \
&& read_memory_integer (call_addr - 6, 1) == 0x22); \
}
extern int convex_frameless_function_invocation PARAMS ((struct frame_info *fi));
#define FRAMELESS_FUNCTION_INVOCATION(FI) (convex_frameless_function_invocatio (FI))
#define FRAME_SAVED_PC(fi) (read_memory_integer ((fi)->frame, 4))
@@ -301,9 +277,8 @@ extern struct value *value_of_trapped_internalvar ();
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(numargs, fi) \
{ numargs = read_memory_integer (FRAME_ARGS_ADDRESS (fi) - 4, 4); \
if (numargs < 0 || numargs >= 256) numargs = -1;}
extern int convex_frame_num_args PARAMS ((struct frame_info *fi));
#define FRAME_NUM_ARGS(fi) (convex_frame_num_args ((fi)))
/* Return number of bytes at start of arglist that are not really args. */

View File

@@ -48,27 +48,21 @@ struct value;
to reach some "real" code. */
extern CORE_ADDR d10v_skip_prologue ();
#define SKIP_PROLOGUE(ip) \
{(ip) = d10v_skip_prologue(ip);}
#define SKIP_PROLOGUE(ip) (d10v_skip_prologue (ip))
/* Stack grows downward. */
#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
#define INNER_THAN(lhs,rhs) (core_addr_lessthan ((lhs), (rhs)))
/* for a breakpoint, use "dbt || nop" */
#define BREAKPOINT {0x2f, 0x90, 0x5e, 0x00}
extern breakpoint_from_pc_fn d10v_breakpoint_from_pc;
#define BREAKPOINT_FROM_PC(PCPTR,LENPTR) (d10v_breakpoint_from_pc ((PCPTR), (LENPTR)))
/* If your kernel resets the pc after the trap happens you may need to
define this before including this file. */
#define DECR_PC_AFTER_BREAK 4
#define REGISTER_NAMES \
{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
"r8", "r9", "r10","r11","r12", "r13", "r14","r15",\
"psw","bpsw","pc","bpc", "cr4", "cr5", "cr6", "rpt_c",\
"rpt_s","rpt_e", "mod_s", "mod_e", "cr12", "cr13", "iba", "cr15",\
"imap0","imap1","dmap","a0", "a1"\
}
extern char *d10v_register_name PARAMS ((int reg_nr));
#define REGISTER_NAME(NR) (d10v_register_name (NR))
#define NUM_REGS 37
@@ -95,18 +89,18 @@ extern CORE_ADDR d10v_skip_prologue ();
/* Index within `registers' of the first byte of the space for
register N. */
#define REGISTER_BYTE(N) \
( ((N) > A0_REGNUM) ? ( ((N)-A0_REGNUM)*8 + A0_REGNUM*2 ) : ((N) * 2) )
extern int d10v_register_byte PARAMS ((int reg_nr));
#define REGISTER_BYTE(N) (d10v_register_byte (N))
/* Number of bytes of storage in the actual machine representation
for register N. */
#define REGISTER_RAW_SIZE(N) ( ((N) >= A0_REGNUM) ? 8 : 2 )
extern int d10v_register_raw_size PARAMS ((int reg_nr));
#define REGISTER_RAW_SIZE(N) (d10v_register_raw_size (N))
/* Number of bytes of storage in the program's representation
for register N. */
#define REGISTER_VIRTUAL_SIZE(N) ( ((N) >= A0_REGNUM) ? 8 : ( ((N) == PC_REGNUM || (N) == SP_REGNUM) ? 4 : 2 ))
extern int d10v_register_virtual_size PARAMS ((int reg_nr));
#define REGISTER_VIRTUAL_SIZE(N) (d10v_register_virtual_size (N))
/* Largest value REGISTER_RAW_SIZE can have. */
@@ -119,8 +113,8 @@ extern CORE_ADDR d10v_skip_prologue ();
/* Return the GDB type object for the "standard" data type
of data in register N. */
#define REGISTER_VIRTUAL_TYPE(N) \
( ((N) < A0_REGNUM ) ? ((N) == PC_REGNUM || (N) == SP_REGNUM ? builtin_type_long : builtin_type_short) : builtin_type_long_long)
extern struct type *d10v_register_virtual_type PARAMS ((int reg_nr));
#define REGISTER_VIRTUAL_TYPE(N) (d10v_register_virtual_type (N))
/* convert $pc and $sp to/from virtual addresses */
@@ -140,14 +134,20 @@ extern CORE_ADDR d10v_skip_prologue ();
store_unsigned_integer ((TO), 2, x); \
}
#define D10V_MAKE_DADDR(x) ((x) | DMEM_START)
#define D10V_MAKE_IADDR(x) (((x) << 2) | IMEM_START)
extern CORE_ADDR d10v_make_daddr PARAMS ((CORE_ADDR x));
#define D10V_MAKE_DADDR(x) (d10v_make_daddr (x))
extern CORE_ADDR d10v_make_iaddr PARAMS ((CORE_ADDR x));
#define D10V_MAKE_IADDR(x) (d10v_make_iaddr (x))
#define D10V_DADDR_P(X) (((X) & 0x3000000) == DMEM_START)
#define D10V_IADDR_P(X) (((X) & 0x3000000) == IMEM_START)
extern int d10v_daddr_p PARAMS ((CORE_ADDR x));
#define D10V_DADDR_P(X) (d10v_daddr_p (X))
extern int d10v_iaddr_p PARAMS ((CORE_ADDR x));
#define D10V_IADDR_P(X) (d10v_iaddr_p (X))
#define D10V_CONVERT_IADDR_TO_RAW(X) (((X) >> 2) & 0xffff)
#define D10V_CONVERT_DADDR_TO_RAW(X) ((X) & 0xffff)
extern CORE_ADDR d10v_convert_daddr_to_raw PARAMS ((CORE_ADDR x));
#define D10V_CONVERT_DADDR_TO_RAW(X) (d10v_convert_daddr_to_raw (X))
extern CORE_ADDR d10v_convert_iaddr_to_raw PARAMS ((CORE_ADDR x));
#define D10V_CONVERT_IADDR_TO_RAW(X) (d10v_convert_iaddr_to_raw (X))
#define ARG1_REGNUM R0_REGNUM
#define ARGN_REGNUM 3
@@ -159,8 +159,8 @@ extern CORE_ADDR d10v_skip_prologue ();
We store structs through a pointer passed in the first Argument
register. */
#define STORE_STRUCT_RETURN(ADDR, SP) \
{ write_register (ARG1_REGNUM, (ADDR)); }
extern void d10v_store_struct_return PARAMS ((CORE_ADDR addr, CORE_ADDR sp));
#define STORE_STRUCT_RETURN(ADDR, SP) d10v_store_struct_return ((ADDR), (SP))
/* Write into appropriate registers a function return value
@@ -168,16 +168,16 @@ extern CORE_ADDR d10v_skip_prologue ();
Things always get returned in RET1_REGNUM, RET2_REGNUM, ... */
#define STORE_RETURN_VALUE(TYPE,VALBUF) \
write_register_bytes (REGISTER_BYTE(RET1_REGNUM), VALBUF, TYPE_LENGTH (TYPE))
extern void d10v_store_return_value PARAMS ((struct type *type, char *valbuf));
#define STORE_RETURN_VALUE(TYPE,VALBUF) d10v_store_return_value ((TYPE), (VALBUF))
/* Extract from an array REGBUF containing the (raw) register state
the address in which a function should return its structure value,
as a CORE_ADDR (or an expression that can be used as one). */
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
(extract_address ((REGBUF) + REGISTER_BYTE (ARG1_REGNUM), REGISTER_RAW_SIZE (ARG1_REGNUM)) | DMEM_START)
extern CORE_ADDR d10v_extract_struct_value_address PARAMS ((char *regbuf));
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (d10v_extract_struct_value_address ((REGBUF)))
/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
@@ -209,27 +209,32 @@ extern void d10v_init_extra_frame_info PARAMS (( int fromleaf, struct frame_info
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
extern CORE_ADDR d10v_frame_chain PARAMS ((struct frame_info *frame));
#define FRAME_CHAIN(FRAME) d10v_frame_chain(FRAME)
extern int d10v_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
#define FRAME_CHAIN_VALID(chain, thisframe) d10v_frame_chain_valid (chain, thisframe)
#define FRAME_SAVED_PC(FRAME) ((FRAME)->return_pc)
#define FRAME_ARGS_ADDRESS(fi) (fi)->frame
#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
extern CORE_ADDR d10v_frame_saved_pc PARAMS ((struct frame_info *fi));
#define FRAME_SAVED_PC(fi) (d10v_frame_saved_pc ((fi)))
extern CORE_ADDR d10v_frame_args_address PARAMS ((struct frame_info *fi));
#define FRAME_ARGS_ADDRESS(fi) (d10v_frame_args_address ((fi)))
extern CORE_ADDR d10v_frame_locals_address PARAMS ((struct frame_info *fi));
#define FRAME_LOCALS_ADDRESS(fi) (d10v_frame_locals_address ((fi)))
/* Immediately after a function call, return the saved pc. We can't */
/* use frame->return_pc beause that is determined by reading R13 off the */
/*stack and that may not be written yet. */
#define SAVED_PC_AFTER_CALL(frame) ((read_register(LR_REGNUM) << 2) | IMEM_START)
extern CORE_ADDR d10v_saved_pc_after_call PARAMS ((struct frame_info *frame));
#define SAVED_PC_AFTER_CALL(frame) (d10v_saved_pc_after_call ((frame)))
/* Set VAL to the number of args passed to frame described by FI.
Can set VAL to -1, meaning no way to tell. */
/* We can't tell how many args there are */
#define FRAME_NUM_ARGS(val,fi) (val = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */
@@ -283,7 +288,7 @@ extern CORE_ADDR d10v_push_return_address PARAMS ((CORE_ADDR pc, CORE_ADDR sp));
generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
sp = d10v_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))
(d10v_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
extern CORE_ADDR d10v_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
@@ -331,7 +336,7 @@ CORE_ADDR d10v_read_fp PARAMS ((void));
need to be translated into a format that the d10v rom monitor
understands. */
int remote_d10v_translate_xfer_address PARAMS ((CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr));
extern void remote_d10v_translate_xfer_address PARAMS ((CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len));
#define REMOTE_TRANSLATE_XFER_ADDRESS(GDB_ADDR, GDB_LEN, REM_ADDR, REM_LEN) \
(REM_LEN) = remote_d10v_translate_xfer_address ((GDB_ADDR), (GDB_LEN), &(REM_ADDR))
remote_d10v_translate_xfer_address ((GDB_ADDR), (GDB_LEN), (REM_ADDR), (REM_LEN))

View File

@@ -46,9 +46,8 @@ struct value;
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
extern CORE_ADDR d30v_skip_prologue ();
#define SKIP_PROLOGUE(ip) \
{(ip) = d30v_skip_prologue(ip);}
extern CORE_ADDR d30v_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(ip) (d30v_skip_prologue (ip))
/* Stack grows downward. */
@@ -213,8 +212,8 @@ extern void d30v_init_extra_frame_info PARAMS (( int fromleaf, struct frame_info
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
#define FRAME_CHAIN(FRAME) d30v_frame_chain(FRAME)
extern int d30v_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
@@ -236,7 +235,7 @@ extern int d30v_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
Can set VAL to -1, meaning no way to tell. */
/* We can't tell how many args there are */
#define FRAME_NUM_ARGS(val,fi) (val = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */
@@ -284,7 +283,7 @@ extern CORE_ADDR d30v_fix_call_dummy PARAMS ((char *, CORE_ADDR, CORE_ADDR,
int, struct value **,
struct type *, int));
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
sp = d30v_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))
(d30v_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
extern CORE_ADDR d30v_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));

View File

@@ -135,7 +135,7 @@ extern void fr30_pop_frame PARAMS ((void));
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(numargs, fi) (numargs = -1)
#define FRAME_NUM_ARGS(fi) (-1)
#ifdef __STDC__ /* Forward decls for prototypes */
struct frame_info;
@@ -159,7 +159,7 @@ extern CORE_ADDR fr30_frame_saved_pc PARAMS ((struct frame_info *));
#define SAVED_PC_AFTER_CALL(fi) read_register (RP_REGNUM)
extern CORE_ADDR fr30_skip_prologue PARAMS ((CORE_ADDR pc));
#define SKIP_PROLOGUE(pc) pc = fr30_skip_prologue (pc)
#define SKIP_PROLOGUE(pc) (fr30_skip_prologue (pc))
/* Write into appropriate registers a function return value of type
TYPE, given in virtual format. VALBUF is in the target byte order;
@@ -190,18 +190,10 @@ extern void fr30_store_return_value PARAMS ((struct type *type, char *valbuf));
/* Define other aspects of the stack frame. */
/* 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. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
{ \
CORE_ADDR func_start, after_prologue; \
func_start = (get_pc_function_start ((FI)->pc) + \
FUNCTION_START_OFFSET); \
after_prologue = func_start; \
SKIP_PROLOGUE (after_prologue); \
(FRAMELESS) = (after_prologue == func_start); \
}
/* 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 fr30_frameless_function_invocation PARAMS ((struct frame_info *frame));
#define FRAMELESS_FUNCTION_INVOCATION(FI) (fr30_frameless_function_invocation (FI));
extern void fr30_init_extra_frame_info PARAMS ((struct frame_info *fi));
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) fr30_init_extra_frame_info (fi)
@@ -213,7 +205,7 @@ fr30_push_arguments PARAMS ((int nargs, struct value **args, CORE_ADDR sp,
int struct_return,
CORE_ADDR struct_addr));
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
(SP) = fr30_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
(fr30_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)

View File

@@ -336,7 +336,7 @@
/* OBSOLETE */
/* OBSOLETE /* We can check the stab info to see how */
/* OBSOLETE many arg we have. No info in stack will tell us *x/ */
/* OBSOLETE #define FRAME_NUM_ARGS(val,fi) (val = findarg(fi)) */
/* OBSOLETE #define FRAME_NUM_ARGS(fi) (findarg(fi)) */
/* OBSOLETE */
/* OBSOLETE /* Return number of bytes at start of arglist that are not really args. *x/ */
/* OBSOLETE #define FRAME_ARGS_SKIP 8 */

View File

@@ -312,7 +312,7 @@
/* OBSOLETE */
/* OBSOLETE /* We can check the stab info to see how */
/* OBSOLETE many arg we have. No info in stack will tell us *x/ */
/* OBSOLETE #define FRAME_NUM_ARGS(val,fi) (val = findarg(fi)) */
/* OBSOLETE #define FRAME_NUM_ARGS(fi) (findarg(fi)) */
/* OBSOLETE */
/* OBSOLETE /* Return number of bytes at start of arglist that are not really args. *x/ */
/* OBSOLETE #define FRAME_ARGS_SKIP 8 */

View File

@@ -69,7 +69,7 @@ extern void h8300_init_extra_frame_info ();
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(ip) {(ip) = h8300_skip_prologue(ip);}
#define SKIP_PROLOGUE(ip) (h8300_skip_prologue(ip))
extern CORE_ADDR h8300_skip_prologue ();
/* Immediately after a function call, return the saved pc.
@@ -213,8 +213,8 @@ CORE_ADDR h8300_frame_chain PARAMS ((struct frame_info *));
/* 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. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
/* Any function with a frame looks like this
SECOND ARG
@@ -239,7 +239,7 @@ CORE_ADDR h8300_frame_chain PARAMS ((struct frame_info *));
/* We can't tell how many args there are
now that the C compiler delays popping them. */
#define FRAME_NUM_ARGS(val,fi) (val = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */
@@ -289,7 +289,7 @@ extern CORE_ADDR h8300_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP)
#define FIX_CALL_DUMMY(DUMMY, START_SP, FUNADDR, NARGS, ARGS, TYPE, GCCP)
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
(SP) = h8300_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
(h8300_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
/* Push an empty stack frame, to record the current PC, etc. */
#define PUSH_DUMMY_FRAME generic_push_dummy_frame ()
/* Discard from the stack the innermost frame, restoring all registers. */

View File

@@ -43,7 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(ip) { (ip) = h8500_skip_prologue(ip); }
#define SKIP_PROLOGUE(ip) (h8500_skip_prologue (ip))
extern CORE_ADDR h8500_skip_prologue PARAMS ((CORE_ADDR));
/* Immediately after a function call, return the saved pc.
@@ -186,8 +186,8 @@ extern struct type *h8500_register_virtual_type PARAMS ((int regno));
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
/* Any function with a frame looks like this
SECOND ARG
@@ -221,7 +221,7 @@ extern CORE_ADDR frame_saved_pc PARAMS ((struct frame_info *frame));
/* We can't tell how many args there are
now that the C compiler delays popping them. */
#define FRAME_NUM_ARGS(val,fi) (val = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */

View File

@@ -47,7 +47,7 @@ struct type;
/* Advance PC across any function entry prologue instructions to reach some
"real" code. */
#define SKIP_PROLOGUE(frompc) {(frompc) = i386_skip_prologue((frompc));}
#define SKIP_PROLOGUE(frompc) (i386_skip_prologue (frompc))
extern int i386_skip_prologue PARAMS ((int));
@@ -207,13 +207,8 @@ extern void i386_extract_return_value PARAMS ((struct type *, char [], char *));
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
do { \
if ((FI)->signal_handler_caller) \
(FRAMELESS) = 0; \
else \
(FRAMELESS) = frameless_look_for_prologue(FI); \
} while (0)
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(((FI)->signal_handler_caller) ? 0 : frameless_look_for_prologue(FI))
/* Saved Pc. Get it from sigcontext if within sigtramp. */
@@ -232,7 +227,7 @@ extern CORE_ADDR sigtramp_saved_pc PARAMS ((struct frame_info *));
/* Return number of args passed to a frame. Can return -1, meaning no way
to tell, which is typical now that the C compiler delays popping them. */
#define FRAME_NUM_ARGS(numargs, fi) (numargs) = i386_frame_num_args(fi)
#define FRAME_NUM_ARGS(fi) (i386_frame_num_args(fi))
extern int i386_frame_num_args PARAMS ((struct frame_info *));

View File

@@ -140,8 +140,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
does not, FRAMELESS is set to 1, else 0. */
#undef FRAMELESS_FUNCTION_INVOCATION
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
#undef FRAME_SAVED_PC
#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
@@ -150,7 +150,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
Can return -1, meaning no way to tell. */
#undef FRAME_NUM_ARGS
#define FRAME_NUM_ARGS(numargs, fi) (numargs) = -1
#define FRAME_NUM_ARGS(fi) (-1)
#ifdef __STDC__ /* Forward decl's for prototypes */
struct frame_info;

View File

@@ -186,8 +186,8 @@ double_to_i387 PARAMS ((char *, char *));
does not, FRAMELESS is set to 1, else 0. */
#undef FRAMELESS_FUNCTION_INVOCATION
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
{ (FRAMELESS) = frameless_look_for_prologue (FI); }
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
#undef FRAME_SAVED_PC
#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))

View File

@@ -49,8 +49,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Advance ip across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(ip) { ip = skip_prologue (ip); }
extern CORE_ADDR skip_prologue ();
#define SKIP_PROLOGUE(ip) (i960_skip_prologue (ip))
extern CORE_ADDR i960_skip_prologue ();
/* Immediately after a function call, return the saved ip.
Can't always go through the frames for this because on some machines
@@ -286,8 +286,8 @@ extern use_struct_convention_fn i960_use_struct_convention;
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
{ (FRAMELESS) = (leafproc_return ((FI)->pc) != 0); }
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(leafproc_return ((FI)->pc) != 0)
/* Note that in the i960 architecture the return pointer is saved in the
*caller's* stack frame.
@@ -317,7 +317,7 @@ extern CORE_ADDR frame_args_address (); /* i960-tdep.c */
/* Set NUMARGS to the number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(numargs, fi) (numargs = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */

View File

@@ -155,7 +155,7 @@ extern CORE_ADDR m32r_frame_saved_pc PARAMS((struct frame_info *));
extern CORE_ADDR m32r_skip_prologue PARAMS ((CORE_ADDR pc));
/* mvs_check SKIP_PROLOGUE */
#define SKIP_PROLOGUE(pc) pc = m32r_skip_prologue (pc)
#define SKIP_PROLOGUE(pc) (m32r_skip_prologue (pc))
/* mvs_no_check FRAME_ARGS_SKIP */
#define FRAME_ARGS_SKIP 0
@@ -165,7 +165,7 @@ extern CORE_ADDR m32r_skip_prologue PARAMS ((CORE_ADDR pc));
/* mvs_no_check FRAME_LOCALS_ADDRESS */
#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
/* mvs_no_check FRAME_NUM_ARGS */
#define FRAME_NUM_ARGS(val, fi) ((val) = -1)
#define FRAME_NUM_ARGS(fi) (-1)
#define COERCE_FLOAT_TO_DOUBLE 1
@@ -216,7 +216,7 @@ extern CORE_ADDR m32r_push_arguments PARAMS ((int nargs,
/* mvs_no_check PUSH_ARGUMENTS */
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
(SP) = m32r_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
(m32r_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
#define PUSH_RETURN_ADDRESS(PC, SP) m32r_push_return_address (PC, SP)

View File

@@ -38,20 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* The only reason this is here is the tm-altos.h reference below. It
was moved back here from tm-m68k.h. FIXME? */
#define SKIP_PROLOGUE(pc) \
{ register int op = read_memory_integer (pc, 2); \
if (op == 0047126) \
pc += 4; /* Skip link #word */ \
else if (op == 0044016) \
pc += 6; /* Skip link #long */ \
/* Not sure why branches are here. */ \
/* From tm-isi.h, tm-altos.h */ \
else if (op == 0060000) \
pc += 4; /* Skip bra #word */ \
else if (op == 00600377) \
pc += 6; /* skip bra #long */ \
else if ((op & 0177400) == 0060000) \
pc += 2; /* skip bra #char */ \
}
extern CORE_ADDR altos_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(pc) (altos_skip_prologue (pc))
#include "m68k/tm-m68k.h"

View File

@@ -75,18 +75,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(val, fi) \
{ register CORE_ADDR pc = FRAME_SAVED_PC (fi); \
register int insn = 0177777 & read_memory_integer (pc, 2); \
val = 0; \
if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ \
val = read_memory_integer (pc + 2, 2); \
else if ((insn & 0170777) == 0050217 /* addql #N, sp */ \
|| (insn & 0170777) == 0050117) /* addqw */ \
{ val = (insn >> 9) & 7; if (val == 0) val = 8; } \
else if (insn == 0157774) /* addal #WW, sp */ \
val = read_memory_integer (pc + 2, 4); \
val >>= 2; }
extern int delta68_frame_num_args PARAMS ((struct frame_info *fi));
#define FRAME_NUM_ARGS (delta68_frame_num_args ((fi)))
/* On M68040 versions of sysV68 R3V7.1, ptrace(PT_WRITE_I) does not clear
the processor's instruction cache as it should. */

View File

@@ -41,18 +41,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(val, fi) \
{ register CORE_ADDR pc = FRAME_SAVED_PC (fi); \
register int insn = 0177777 & read_memory_integer (pc, 2); \
val = 0; \
if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ \
val = read_memory_integer (pc + 2, 2); \
else if ((insn & 0170777) == 0050217 /* addql #N, sp */ \
|| (insn & 0170777) == 0050117) /* addqw */ \
{ val = (insn >> 9) & 7; if (val == 0) val = 8; } \
else if (insn == 0157774) /* addal #WW, sp */ \
val = read_memory_integer (pc + 2, 4); \
val >>= 2; }
extern int isi_frame_num_args PARAMS ((struct frame_info *fi));
#define FRAME_NUM_ARGS(fi) (isi_frame_num_args ((fi)))
/* Put here the code to store, into a struct frame_saved_regs,
the addresses of the saved registers of frame described by FRAME_INFO.
@@ -131,20 +121,7 @@ retry: \
/* The only reason this is here is the tm-isi.h reference below. It
was moved back here from tm-m68k.h. FIXME? */
#define SKIP_PROLOGUE(pc) \
{ register int op = read_memory_integer (pc, 2); \
if (op == 0047126) \
pc += 4; /* Skip link #word */ \
else if (op == 0044016) \
pc += 6; /* Skip link #long */ \
/* Not sure why branches are here. */ \
/* From tm-isi.h, tm-altos.h */ \
else if (op == 0060000) \
pc += 4; /* Skip bra #word */ \
else if (op == 00600377) \
pc += 6; /* skip bra #long */ \
else if ((op & 0177400) == 0060000) \
pc += 2; /* skip bra #char */ \
}
extern CORE_ADDR isi_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(pc) (isi_skip_prologue (pc))
#include "m68k/tm-m68k.h"

View File

@@ -33,9 +33,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
to reach some "real" code. */
#if !defined(SKIP_PROLOGUE)
#define SKIP_PROLOGUE(ip) {(ip) = m68k_skip_prologue(ip);}
extern CORE_ADDR m68k_skip_prologue PARAMS ((CORE_ADDR ip));
#define SKIP_PROLOGUE(ip) (m68k_skip_prologue (ip))
#endif
extern CORE_ADDR m68k_skip_prologue PARAMS ((CORE_ADDR ip));
/* Immediately after a function call, return the saved pc.
Can't always go through the frames for this because on some machines
@@ -274,13 +274,8 @@ do \
/* 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. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
do { \
if ((FI)->signal_handler_caller) \
(FRAMELESS) = 0; \
else \
(FRAMELESS) = frameless_look_for_prologue(FI); \
} while (0)
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(((FI)->signal_handler_caller) ? 0 : frameless_look_for_prologue(FI))
/* This was determined by experimentation on hp300 BSD 4.3. Perhaps
it corresponds to some offset in /usr/include/sys/user.h or
@@ -311,7 +306,7 @@ do \
/* We can't tell how many args there are
now that the C compiler delays popping them. */
#if !defined (FRAME_NUM_ARGS)
#define FRAME_NUM_ARGS(val,fi) (val = -1)
#define FRAME_NUM_ARGS(fi) (-1)
#endif
/* Return number of bytes at start of arglist that are not really args. */

View File

@@ -59,17 +59,7 @@ Here is an m-news.h file for gdb. It supports the 68881 registers.
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(val, fi) \
{ register CORE_ADDR pc = FRAME_SAVED_PC (fi); \
register int insn = 0177777 & read_memory_integer (pc, 2); \
val = 0; \
if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ \
val = read_memory_integer (pc + 2, 2); \
else if ((insn & 0170777) == 0050217 /* addql #N, sp */ \
|| (insn & 0170777) == 0050117) /* addqw */ \
{ val = (insn >> 9) & 7; if (val == 0) val = 8; } \
else if (insn == 0157774) /* addal #WW, sp */ \
val = read_memory_integer (pc + 2, 4); \
val >>= 2; }
extern int news_frame_num_args PARAMS ((struct frame_info *fi));
#define FRAME_NUM_ARGS (news_frame_num_args ((fi)))
#include "m68k/tm-m68k.h"

View File

@@ -52,9 +52,8 @@ extern void init_extra_frame_info ();
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(frompc) \
{ (frompc) = skip_prologue (frompc); }
extern CORE_ADDR skip_prologue ();
extern CORE_ADDR m88k_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(frompc) (m88k_skip_prologue (frompc))
/* The m88k kernel aligns all instructions on 4-byte boundaries. The
kernel also uses the least significant two bits for its own hocus
@@ -446,8 +445,8 @@ extern int frameless_function_invocation ();
#define FRAME_CHAIN(thisframe) \
frame_chain (thisframe)
#define FRAMELESS_FUNCTION_INVOCATION(frame, fromleaf) \
fromleaf = frameless_function_invocation (frame)
#define FRAMELESS_FUNCTION_INVOCATION(frame) \
(frameless_function_invocation (frame))
/* Define other aspects of the stack frame. */
@@ -466,7 +465,7 @@ extern CORE_ADDR frame_locals_address ();
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(numargs, fi) ((numargs) = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */

View File

@@ -83,7 +83,7 @@ CORE_ADDR mips_addr_bits_remove PARAMS ((CORE_ADDR addr));
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(pc) pc = mips_skip_prologue (pc, 0)
#define SKIP_PROLOGUE(pc) (mips_skip_prologue (pc, 0))
extern CORE_ADDR mips_skip_prologue PARAMS ((CORE_ADDR addr, int lenient));
/* Return non-zero if PC points to an instruction which will cause a step
@@ -339,7 +339,7 @@ extern CORE_ADDR mips_frame_chain PARAMS ((struct frame_info *));
does not, FRAMELESS is set to 1, else 0. */
/* We handle this differently for mips, and maybe we should not */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) {(FRAMELESS) = 0;}
#define FRAMELESS_FUNCTION_INVOCATION(FI) (0)
/* Saved Pc. */
@@ -353,7 +353,7 @@ extern CORE_ADDR mips_frame_saved_pc PARAMS ((struct frame_info *));
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(num, fi) (num = mips_frame_num_args(fi))
#define FRAME_NUM_ARGS(fi) (mips_frame_num_args(fi))
extern int mips_frame_num_args PARAMS ((struct frame_info *));
/* Return number of bytes at start of arglist that are not really args. */
@@ -382,7 +382,7 @@ extern void mips_find_saved_regs PARAMS ((struct frame_info *));
handle it. */
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
sp = mips_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))
(mips_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
extern CORE_ADDR
mips_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));

View File

@@ -166,13 +166,13 @@ extern CORE_ADDR mn10200_frame_saved_pc PARAMS ((struct frame_info *));
(SP) = mn10200_store_struct_return (STRUCT_ADDR, SP)
extern CORE_ADDR mn10200_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(pc) pc = mn10200_skip_prologue (pc)
#define SKIP_PROLOGUE(pc) (mn10200_skip_prologue (pc))
#define FRAME_ARGS_SKIP 0
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
#define FRAME_NUM_ARGS(val, fi) ((val) = -1)
#define FRAME_NUM_ARGS(fi) (-1)
extern void mn10200_pop_frame PARAMS ((struct frame_info *));
#define POP_FRAME mn10200_pop_frame (get_current_frame ())
@@ -194,7 +194,7 @@ extern CORE_ADDR
mn10200_push_arguments PARAMS ((int, struct value **, CORE_ADDR,
unsigned char, CORE_ADDR));
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
(SP) = mn10200_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
(mn10200_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)

View File

@@ -113,13 +113,13 @@ extern CORE_ADDR mn10300_frame_saved_pc PARAMS ((struct frame_info *));
(SP) = mn10300_store_struct_return (STRUCT_ADDR, SP)
extern CORE_ADDR mn10300_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(pc) pc = mn10300_skip_prologue (pc)
#define SKIP_PROLOGUE(pc) (mn10300_skip_prologue (pc))
#define FRAME_ARGS_SKIP 0
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
#define FRAME_NUM_ARGS(val, fi) ((val) = -1)
#define FRAME_NUM_ARGS(fi) (-1)
extern void mn10300_pop_frame PARAMS ((struct frame_info *));
#define POP_FRAME mn10300_pop_frame (get_current_frame ())
@@ -141,7 +141,7 @@ extern CORE_ADDR
mn10300_push_arguments PARAMS ((int, struct value **, CORE_ADDR,
unsigned char, CORE_ADDR ));
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
(SP) = mn10300_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
(mn10300_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)

View File

@@ -27,14 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(pc) \
{ register int op = read_memory_integer (pc, 1); \
if (op == 0x82) \
{ op = read_memory_integer (pc+2,1); \
if ((op & 0x80) == 0) pc += 3; \
else if ((op & 0xc0) == 0x80) pc += 4; \
else pc += 6; \
}}
extern CORE_ADDR merlin_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(pc) (merlin_skip_prologue (pc))
/* Immediately after a function call, return the saved pc.
Can't always go through the frames for this because on some machines
@@ -198,30 +192,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(numargs, fi) \
{ CORE_ADDR pc; \
int insn; \
int addr_mode; \
int width; \
\
pc = FRAME_SAVED_PC (fi); \
insn = read_memory_integer (pc,2); \
addr_mode = (insn >> 11) & 0x1f; \
insn = insn & 0x7ff; \
if ((insn & 0x7fc) == 0x57c \
&& addr_mode == 0x14) /* immediate */ \
{ if (insn == 0x57c) /* adjspb */ \
width = 1; \
else if (insn == 0x57d) /* adjspw */ \
width = 2; \
else if (insn == 0x57f) /* adjspd */ \
width = 4; \
numargs = read_memory_integer (pc+2,width); \
if (width > 1) \
flip_bytes (&numargs, width); \
numargs = - sign_extend (numargs, width*8) / 4; } \
else numargs = -1; \
}
extern int merlin_frame_num_args PARAMS ((struct frame_info *fi));
#define FRAME_NUM_ARGS (merlin_frame_num_args ((fi)))
/* Return number of bytes at start of arglist that are not really args. */

View File

@@ -33,14 +33,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(pc) \
{ register unsigned char op = read_memory_integer (pc, 1); \
if (op == 0x82) { op = read_memory_integer (pc+2,1); \
if ((op & 0x80) == 0) pc += 3; \
else if ((op & 0xc0) == 0x80) pc += 4; \
else pc += 6; \
} \
}
extern CORE_ADDR umax_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(pc) (umax_skip_prologue (pc))
/* Immediately after a function call, return the saved pc.
Can't always go through the frames for this because on some machines
@@ -277,35 +271,8 @@ extern CORE_ADDR ns32k_get_enter_addr ();
ways in the stack frame. sp is even more special:
the address we return for it IS the sp for the next frame. */
#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
{ \
register int regmask, regnum; \
int localcount; \
register CORE_ADDR enter_addr; \
register CORE_ADDR next_addr; \
\
memset (&(frame_saved_regs), '\0', sizeof (frame_saved_regs)); \
enter_addr = ns32k_get_enter_addr ((frame_info)->pc); \
if (enter_addr > 1) \
{ \
regmask = read_memory_integer (enter_addr+1, 1) & 0xff; \
localcount = ns32k_localcount (enter_addr); \
next_addr = (frame_info)->frame + localcount; \
for (regnum = 0; regnum < 8; regnum++, regmask >>= 1) \
(frame_saved_regs).regs[regnum] = (regmask & 1) ? \
(next_addr -= 4) : 0; \
(frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame + 4;\
(frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 4;\
(frame_saved_regs).regs[FP_REGNUM] = \
(read_memory_integer ((frame_info)->frame, 4));\
} \
else if (enter_addr == 1) \
{ \
CORE_ADDR sp = read_register (SP_REGNUM); \
(frame_saved_regs).regs[PC_REGNUM] = sp; \
(frame_saved_regs).regs[SP_REGNUM] = sp + 4; \
} \
}
extern int umax_frame_num_args PARAMS ((struct frame_info *fi));
#define FRAME_NUM_ARGS (umax_frame_num_args ((fi)))
/* Things needed for making the inferior call functions. */

View File

@@ -56,7 +56,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* While this is for use by threaded programs, it doesn't appear
* to hurt non-threaded ones. This is used in infrun.c: */
#define PREPARE_TO_PROCEED() hppa_prepare_to_proceed()
#define PREPARE_TO_PROCEED(select_it) hppa_prepare_to_proceed()
extern int hppa_prepare_to_proceed PARAMS(( void ));
/* In infptrace.c or infttrace.c: */

View File

@@ -72,8 +72,8 @@ struct inferior_status;
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(pc) pc = skip_prologue (pc)
extern CORE_ADDR skip_prologue PARAMS ((CORE_ADDR));
extern CORE_ADDR hppa_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(pc) (hppa_skip_prologue (pc))
/* If PC is in some function-call trampoline code, return the PC
where the function itself actually starts. If not, return NULL. */
@@ -437,8 +437,8 @@ extern int hppa_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
/* 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. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_function_invocation(FI)
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_function_invocation (FI))
extern int frameless_function_invocation PARAMS ((struct frame_info *));
extern CORE_ADDR hppa_frame_saved_pc PARAMS ((struct frame_info *frame));
@@ -452,7 +452,7 @@ extern CORE_ADDR hppa_frame_saved_pc PARAMS ((struct frame_info *frame));
/* We can't tell how many args there are
now that the C compiler delays popping them. */
#define FRAME_NUM_ARGS(val,fi) (val = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */
@@ -624,7 +624,7 @@ hppa_fix_call_dummy PARAMS ((char *, CORE_ADDR, CORE_ADDR, int,
struct value **, struct type *, int));
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
sp = hppa_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))
(hppa_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
extern CORE_ADDR
hppa_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int,
CORE_ADDR));

View File

@@ -56,11 +56,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
extern struct frame_info *rs6000_pop_frame PARAMS ((struct frame_info *frame));
extern CORE_ADDR ppc_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
extern CORE_ADDR rs6000_push_arguments PARAMS ((int nargs,
struct value **args,
CORE_ADDR sp,
unsigned char struct_return,
CORE_ADDR struct_addr));
#undef PUSH_DUMMY_FRAME
#define PUSH_DUMMY_FRAME generic_push_dummy_frame ()

View File

@@ -56,7 +56,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
If so, what do they look like?
This is becoming harder, since tege@sics.SE wants to change
gcc to not output a prologue when no frame is needed. */
#define SKIP_PROLOGUE(pc) do {} while (0)
#define SKIP_PROLOGUE(pc) (pc)
/* Immediately after a function call, return the saved pc.
@@ -332,7 +332,7 @@ do { \
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(val, fi) (val = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */

View File

@@ -97,11 +97,8 @@ struct rs6000_framedata {
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(pc) \
do { \
struct rs6000_framedata _frame; \
pc = skip_prologue (pc, &_frame); \
} while (0)
extern CORE_ADDR rs6000_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(pc) (rs6000_skip_prologue (pc))
extern CORE_ADDR skip_prologue PARAMS((CORE_ADDR, struct rs6000_framedata *));
@@ -159,9 +156,8 @@ extern void aix_process_linenos PARAMS ((void));
handle it. */
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
sp = push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))
extern CORE_ADDR push_arguments PARAMS ((int, struct value **, CORE_ADDR,
int, CORE_ADDR));
(rs6000_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
extern CORE_ADDR rs6000_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
/* BREAKPOINT_FROM_PC uses the program counter value to determine the
breakpoint that should be used */
@@ -381,8 +377,8 @@ CORE_ADDR rs6000_frame_chain PARAMS ((struct frame_info *));
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
FRAMELESS = frameless_function_invocation (FI)
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_function_invocation (FI))
extern int frameless_function_invocation PARAMS((struct frame_info *));
@@ -424,7 +420,7 @@ extern CORE_ADDR rs6000_frame_args_address PARAMS ((struct frame_info *));
/* We can't tell how many args there are
now that the C compiler delays popping them. */
#define FRAME_NUM_ARGS(val,fi) (val = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */

View File

@@ -43,15 +43,13 @@ struct type;
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
extern CORE_ADDR sh_skip_prologue ();
#define SKIP_PROLOGUE(ip) \
{(ip) = sh_skip_prologue(ip);}
extern CORE_ADDR sh_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(ip) (sh_skip_prologue (ip))
/* Immediately after a function call, return the saved pc.
Can't always go through the frames for this because on some machines
the new frame is not set up until the new function executes
some instructions.
some instructions.
The return address is the value saved in the PR register + 4 */
@@ -64,7 +62,7 @@ extern CORE_ADDR sh_skip_prologue ();
/* Illegal instruction - used by the simulator for breakpoint
detection */
#define BREAKPOINT {0xc3, 0xc3} /* 0xc3c3 is trapa #c3, and it works in big
#define BREAKPOINT {0xc3, 0xc3} /* 0xc3c3 is trapa #c3, and it works in big
and little endian modes */
#define BIG_REMOTE_BREAKPOINT { 0xc3, 0x20 }
@@ -78,7 +76,7 @@ extern CORE_ADDR sh_skip_prologue ();
#define REGISTER_TYPE long
/* Say how much memory is needed to store a copy of the register set */
#define REGISTER_BYTES (NUM_REGS*4)
#define REGISTER_BYTES (NUM_REGS*4)
/* Index within `registers' of the first byte of the space for
register N. */
@@ -148,7 +146,7 @@ extern char **sh_register_names;
#define NUM_REALREGS 59
/* Store the address of the place in which to copy the structure the
subroutine will return. This is called from call_function.
subroutine will return. This is called from call_function.
We store structs through a pointer passed in R0 */
@@ -167,7 +165,7 @@ extern void sh_extract_return_value PARAMS ((struct type *, void *, void *));
sh_extract_return_value (TYPE, REGBUF, VALBUF)
/* Write into appropriate registers a function return value
of type TYPE, given in virtual format.
of type TYPE, given in virtual format.
Things always get returned in R0/R1 */
@@ -182,25 +180,25 @@ extern void sh_extract_return_value PARAMS ((struct type *, void *, void *));
extract_address (REGBUF, REGISTER_RAW_SIZE (0))
/* Define other aspects of the stack frame.
/* Define other aspects of the stack frame.
we keep a copy of the worked out return pc lying around, since it
is a useful bit of info */
#define EXTRA_FRAME_INFO \
CORE_ADDR return_pc; \
int leaf_function; \
int f_offset;
int f_offset;
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
sh_init_extra_frame_info(fromleaf, fi)
sh_init_extra_frame_info(fromleaf, fi)
extern void sh_init_extra_frame_info PARAMS ((int, struct frame_info *));
/* 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. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue(FI))
#define FRAME_SAVED_PC(FRAME) ((FRAME)->return_pc)
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
@@ -211,13 +209,13 @@ extern void sh_init_extra_frame_info PARAMS ((int, struct frame_info *));
/* We can't tell how many args there are */
#define FRAME_NUM_ARGS(val,fi) (val = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */
#define FRAME_ARGS_SKIP 0
extern void sh_frame_find_saved_regs PARAMS ((struct frame_info *fi,
extern void sh_frame_find_saved_regs PARAMS ((struct frame_info *fi,
struct frame_saved_regs *fsr));
/* Put here the code to store, into a struct frame_saved_regs,
@@ -233,8 +231,8 @@ extern void sh_frame_find_saved_regs PARAMS ((struct frame_info *fi,
typedef unsigned short INSN_WORD;
extern CORE_ADDR sh_push_arguments PARAMS ((int nargs,
struct value **args,
extern CORE_ADDR sh_push_arguments PARAMS ((int nargs,
struct value **args,
CORE_ADDR sp,
unsigned char struct_return,
CORE_ADDR struct_addr));
@@ -244,7 +242,7 @@ extern CORE_ADDR sh_push_arguments PARAMS ((int nargs,
#define CALL_DUMMY_LENGTH (0)
#define CALL_DUMMY_START_OFFSET (0)
#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
#define FIX_CALL_DUMMY(DUMMY, STARTADDR, FUNADDR, NARGS, ARGS, TYPE, GCCP)
#define FIX_CALL_DUMMY(DUMMY, STARTADDR, FUNADDR, NARGS, ARGS, TYPE, GCCP)
#define CALL_DUMMY_LOCATION AT_ENTRY_POINT
#define CALL_DUMMY_ADDRESS() entry_point_address ()
extern CORE_ADDR sh_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
@@ -257,9 +255,9 @@ extern CORE_ADDR sh_frame_chain PARAMS ((struct frame_info *));
#define FRAME_CHAIN_VALID(FP, FRAME) generic_frame_chain_valid (FP, FRAME)
#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP)
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
(SP) = sh_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
(sh_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
/* override the standard get_saved_register function with
/* override the standard 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)

View File

@@ -369,7 +369,7 @@ extern void sparc64_write_fp PARAMS ((CORE_ADDR));
CORE_ADDR sp64_push_arguments PARAMS ((int, struct value **, CORE_ADDR, unsigned char, CORE_ADDR));
#undef PUSH_ARGUMENTS
#define PUSH_ARGUMENTS(A,B,C,D,E) (sp = sp64_push_arguments ((A), (B), (C), (D), (E)))
#define PUSH_ARGUMENTS(A,B,C,D,E) (sp64_push_arguments ((A), (B), (C), (D), (E)))
#undef EXTRACT_RETURN_VALUE
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \

View File

@@ -88,11 +88,9 @@ struct value;
knows that the function has a frame. Its result is equal
to its input PC if the function is frameless, unequal otherwise. */
#define SKIP_PROLOGUE(pc) \
{ pc = skip_prologue (pc, 0); }
#define SKIP_PROLOGUE_FRAMELESS_P(pc) \
{ pc = skip_prologue (pc, 1); }
extern CORE_ADDR skip_prologue PARAMS ((CORE_ADDR, int));
#define SKIP_PROLOGUE(pc) (sparc_skip_prologue (pc, 0))
#define SKIP_PROLOGUE_FRAMELESS_P(pc) (sparc_skip_prologue (pc, 1))
extern CORE_ADDR sparc_skip_prologue PARAMS ((CORE_ADDR, int));
/* Immediately after a function call, return the saved pc.
Can't go through the frames for this because on some machines
@@ -364,8 +362,8 @@ extern CORE_ADDR sparc_frame_chain PARAMS ((struct frame_info *));
/* 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. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue(FI))
/* The location of I0 w.r.t SP. This is actually dependent on how the system's
window overflow/underflow routines are written. Most vendors save the L regs
@@ -392,7 +390,7 @@ extern CORE_ADDR sparc_frame_saved_pc PARAMS ((struct frame_info *));
/* We can't tell how many args there are
now that the C compiler delays popping them. */
#define FRAME_NUM_ARGS(val,fi) (val = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */
@@ -585,6 +583,6 @@ extern int deferred_stores;
function calls. */
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
sp = sparc_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))
(sparc_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
extern CORE_ADDR
sparc_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));

View File

@@ -33,26 +33,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(pc) \
{ register int op = (unsigned char) read_memory_integer (pc, 1); \
if (op == 0x11) pc += 2; /* skip brb */ \
if (op == 0x13) pc += 3; /* skip brw */ \
if (op == 0x2c && \
((unsigned char) read_memory_integer (pc+2, 1)) == 0x5e) \
pc += 3; /* skip subl2 */ \
if (op == 0xe9 && \
((unsigned char) read_memory_integer (pc+1, 1)) == 0xae && \
((unsigned char) read_memory_integer(pc+3, 1)) == 0x5e) \
pc += 4; /* skip movab */ \
if (op == 0xe9 && \
((unsigned char) read_memory_integer (pc+1, 1)) == 0xce && \
((unsigned char) read_memory_integer(pc+4, 1)) == 0x5e) \
pc += 5; /* skip movab */ \
if (op == 0xe9 && \
((unsigned char) read_memory_integer (pc+1, 1)) == 0xee && \
((unsigned char) read_memory_integer(pc+6, 1)) == 0x5e) \
pc += 7; /* skip movab */ \
}
extern CORE_ADDR tahoe_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(pc) (tahoe_skip_prologue (pc))
/* Immediately after a function call, return the saved pc.
Can't always go through the frames for this because on some machines
@@ -207,8 +189,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(numargs, fi) \
{ numargs = ((0xffff & read_memory_integer(((fi)->frame-4),4)) - 4) >> 2; }
extern int tahoe_frame_num_args PARAMS ((struct frame_info *fi));
#define FRAME_NUM_ARGS(fi) (tahoe_frame_num_args ((fi)))
/* Return number of bytes at start of arglist that are not really args. */

View File

@@ -136,7 +136,7 @@ extern struct frame_info *tic80_pop_frame PARAMS ((struct frame_info *frame));
Can set VAL to -1, meaning no way to tell. */
/* We can't tell how many args there are */
#define FRAME_NUM_ARGS(val,fi) (val = -1)
#define FRAME_NUM_ARGS(fi) (-1)
#define FRAME_ARGS_SKIP 0
#define FRAME_ARGS_ADDRESS(fi) (fi)->frame
@@ -171,7 +171,7 @@ extern void tic80_frame_find_saved_regs PARAMS ((struct frame_info *, struct fra
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(pc) { (pc) = tic80_skip_prologue (pc); }
#define SKIP_PROLOGUE(pc) (tic80_skip_prologue (pc))
extern CORE_ADDR tic80_skip_prologue PARAMS ((CORE_ADDR pc));
/* Immediately after a function call, return the saved pc.
@@ -229,7 +229,7 @@ extern CORE_ADDR tic80_push_arguments PARAMS ((int nargs,
CORE_ADDR struct_addr));
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
(SP) = tic80_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
(tic80_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
/* PUSH_RETURN_ADDRESS */
extern CORE_ADDR tic80_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));

View File

@@ -126,13 +126,13 @@ extern CORE_ADDR v850_frame_saved_pc PARAMS ((struct frame_info *));
write_register_bytes(REGISTER_BYTE (V0_REGNUM), VALBUF, TYPE_LENGTH (TYPE));
extern CORE_ADDR v850_skip_prologue PARAMS ((CORE_ADDR pc));
#define SKIP_PROLOGUE(pc) pc = v850_skip_prologue (pc)
#define SKIP_PROLOGUE(pc) (v850_skip_prologue (pc))
#define FRAME_ARGS_SKIP 0
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
#define FRAME_NUM_ARGS(val, fi) ((val) = -1)
#define FRAME_NUM_ARGS(fi) (-1)
extern void v850_pop_frame PARAMS ((struct frame_info *frame));
#define POP_FRAME v850_pop_frame (get_current_frame ())
@@ -155,7 +155,7 @@ v850_push_arguments PARAMS ((int nargs, struct value **args, CORE_ADDR sp,
unsigned char struct_return,
CORE_ADDR struct_addr));
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
(SP) = v850_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
(v850_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
#define STORE_STRUCT_RETURN(STRUCT_ADDR, SP)

View File

@@ -28,26 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(pc) \
{ register int op = (unsigned char) read_memory_integer (pc, 1); \
if (op == 0x11) pc += 2; /* skip brb */ \
if (op == 0x31) pc += 3; /* skip brw */ \
if (op == 0xC2 && \
((unsigned char) read_memory_integer (pc+2, 1)) == 0x5E) \
pc += 3; /* skip subl2 */ \
if (op == 0x9E && \
((unsigned char) read_memory_integer (pc+1, 1)) == 0xAE && \
((unsigned char) read_memory_integer(pc+3, 1)) == 0x5E) \
pc += 4; /* skip movab */ \
if (op == 0x9E && \
((unsigned char) read_memory_integer (pc+1, 1)) == 0xCE && \
((unsigned char) read_memory_integer(pc+4, 1)) == 0x5E) \
pc += 5; /* skip movab */ \
if (op == 0x9E && \
((unsigned char) read_memory_integer (pc+1, 1)) == 0xEE && \
((unsigned char) read_memory_integer(pc+6, 1)) == 0x5E) \
pc += 7; /* skip movab */ \
}
extern CORE_ADDR vax_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(pc) (vax_skip_prologue (pc))
/* Immediately after a function call, return the saved pc.
Can't always go through the frames for this because on some machines
@@ -191,7 +173,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
/* On the vax, all functions have frames. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) {(FRAMELESS) = 0;}
#define FRAMELESS_FUNCTION_INVOCATION(FI) (0)
/* Saved Pc. Get it from sigcontext if within sigtramp. */
@@ -231,8 +213,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(numargs, fi) \
{ numargs = (0xff & read_memory_integer (FRAME_ARGS_ADDRESS (fi), 1)); }
extern int vax_frame_num_args PARAMS ((struct frame_info *fi));
#define FRAME_NUM_ARGS(fi) (vax_frame_num_args ((fi)))
/* Return number of bytes at start of arglist that are not really args. */

View File

@@ -159,8 +159,8 @@ extern CORE_ADDR w65_skip_prologue ();
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
#define FRAME_CHAIN(FRAME) w65_frame_chain(FRAME)
#define FRAME_SAVED_PC(FRAME) (w65_frame_saved_pc(FRAME))
@@ -172,7 +172,7 @@ extern CORE_ADDR w65_skip_prologue ();
/* We can't tell how many args there are */
#define FRAME_NUM_ARGS(val,fi) (val = -1)
#define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */

View File

@@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(ip) {(ip) = z8k_skip_prologue(ip);}
#define SKIP_PROLOGUE(ip) (z8k_skip_prologue (ip))
extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
@@ -175,8 +175,8 @@ extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
/* 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. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
#define FRAME_SAVED_PC(FRAME) frame_saved_pc(FRAME)
@@ -190,7 +190,7 @@ extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
/* We can't tell how many args there are
now that the C compiler delays popping them. */
#if !defined (FRAME_NUM_ARGS)
#define FRAME_NUM_ARGS(val,fi) (val = -1)
#define FRAME_NUM_ARGS(fi) (-1)
#endif
/* Return number of bytes at start of arglist that are not really args. */

603
gdb/configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -75,7 +75,7 @@ AC_HEADER_STAT
AC_C_CONST
AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc)
AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll)
AC_FUNC_ALLOCA
BFD_NEED_DECLARATION(malloc)
@@ -83,6 +83,7 @@ BFD_NEED_DECLARATION(realloc)
BFD_NEED_DECLARATION(free)
BFD_NEED_DECLARATION(strerror)
BFD_NEED_DECLARATION(strdup)
BFD_NEED_DECLARATION(strstr)
# The following save_state_t checkery is only necessary for HPUX
@@ -424,6 +425,9 @@ AC_SUBST(DLLTOOL)
AC_SUBST(WINDRES)
dnl Figure out which term library to use.
if test x$gdb_host = xgo32; then
TERM_LIB=
else
if test x$gdb_cv_os_cygwin = xyes; then
TERM_LIB='`if test -r ../libtermcap/libtermcap.a; then echo ../libtermcap/libtermcap.a; else echo -ltermcap; fi`'
else
@@ -440,9 +444,15 @@ else
AC_MSG_ERROR(Could not find a term library, e.g. termcap or termlib!)
fi
fi
fi
AC_SUBST(TERM_LIB)
# libreadline needs libuser32.a in a cygwin environment
WIN32LIBS=
if test x$gdb_cv_os_cygwin = xyes; then
WIN32LIBS="-luser32"
fi
AC_SUBST(WIN32LIBS)
AC_PATH_X

View File

@@ -42,6 +42,66 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdbcmd.h"
CORE_ADDR
convex_skip_prologue (pc)
CORE_ADDR pc;
{
int op, ix;
op = read_memory_integer (pc, 2);
if ((op & 0xffc7) == 0x5ac0)
pc += 2;
else if (op == 0x1580)
pc += 4;
else if (op == 0x15c0)
pc += 6;
if ((read_memory_integer (pc, 2) & 0xfff8) == 0x7c40
&& (read_memory_integer (pc + 2, 2) & 0xfff8) == 0x1240
&& (read_memory_integer (pc + 8, 2) & 0xfff8) == 0x7c48)
pc += 10;
if (read_memory_integer (pc, 2) == 0x1240)
pc += 6;
for (;;)
{
op = read_memory_integer (pc, 2);
ix = (op >> 3) & 7;
if (ix != 6)
break;
if ((op & 0xfcc0) == 0x3000)
pc += 4;
else if ((op & 0xfcc0) == 0x3040)
pc += 6;
else if ((op & 0xfcc0) == 0x2800)
pc += 4;
else if ((op & 0xfcc0) == 0x2840)
pc += 6;
else
break;
}
return pc;
}
int
convex_frameless_function_invocation (fi)
struct frame_info *fi;
{
int frameless;
extern CORE_ADDR text_start, text_end;
CORE_ADDR call_addr = SAVED_PC_AFTER_CALL (FI);
frameless = (call_addr >= text_start && call_addr < text_end
&& read_memory_integer (call_addr - 6, 1) == 0x22);
return frameless;
}
int
convex_frame_num_args (fi)
struct frame_info *fi;
{
int numargs = read_memory_integer (FRAME_ARGS_ADDRESS (fi) - 4, 4);
if (numargs < 0 || numargs >= 256)
numargs = -1;
return numargs;
}
exec_file_command (filename, from_tty)
char *filename;
int from_tty;

View File

@@ -39,6 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Local function declarations. */
extern void _initialize_core PARAMS ((void));
static void call_extra_exec_file_hooks PARAMS ((char *filename));
/* You can have any number of hooks for `exec_file_command' command to call.

View File

@@ -44,6 +44,8 @@ int static_field_print; /* Controls printing of static fields. */
static struct obstack dont_print_vb_obstack;
static struct obstack dont_print_statmem_obstack;
extern void _initialize_cp_valprint PARAMS ((void));
static void
cp_print_static_field PARAMS ((struct type *, value_ptr, GDB_FILE *, int, int,
enum val_prettyprint));

View File

@@ -33,8 +33,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "symfile.h"
#include "objfiles.h"
void d10v_frame_find_saved_regs PARAMS ((struct frame_info *fi,
struct frame_saved_regs *fsr));
/* Local functions */
extern void _initialize_d10v_tdep PARAMS ((void));
static void d10v_eva_prepare_to_trace PARAMS ((void));
static void d10v_eva_get_trace_data PARAMS ((void));
int
d10v_frame_chain_valid (chain, frame)
@@ -61,6 +66,228 @@ d10v_use_struct_convention (gcc_p, type)
}
unsigned char *
d10v_breakpoint_from_pc (pcptr, lenptr)
CORE_ADDR *pcptr;
int *lenptr;
{
static unsigned char breakpoint [] = {0x2f, 0x90, 0x5e, 0x00};
*lenptr = sizeof (breakpoint);
return breakpoint;
}
char *
d10v_register_name (reg_nr)
int reg_nr;
{
static char *register_names[] = {
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10","r11","r12", "r13", "r14","r15",
"psw","bpsw","pc","bpc", "cr4", "cr5", "cr6", "rpt_c",
"rpt_s","rpt_e", "mod_s", "mod_e", "cr12", "cr13", "iba", "cr15",
"imap0","imap1","dmap","a0", "a1"
};
if (reg_nr < 0)
return NULL;
if (reg_nr >= (sizeof (register_names) / sizeof (*register_names)))
return NULL;
return register_names [reg_nr];
}
/* Index within `registers' of the first byte of the space for
register REG_NR. */
int
d10v_register_byte (reg_nr)
int reg_nr;
{
if (reg_nr > A0_REGNUM)
return ((reg_nr - A0_REGNUM) * 8 + (A0_REGNUM * 2));
else
return (reg_nr * 2);
}
/* Number of bytes of storage in the actual machine representation for
register REG_NR. */
int
d10v_register_raw_size (reg_nr)
int reg_nr;
{
if (reg_nr >= A0_REGNUM)
return 8;
else
return 2;
}
/* Number of bytes of storage in the program's representation
for register N. */
int
d10v_register_virtual_size (reg_nr)
int reg_nr;
{
if (reg_nr >= A0_REGNUM)
return 8;
else if (reg_nr == PC_REGNUM || reg_nr == SP_REGNUM)
return 4;
else
return 2;
}
/* Return the GDB type object for the "standard" data type
of data in register N. */
struct type *
d10v_register_virtual_type (reg_nr)
int reg_nr;
{
if (reg_nr >= A0_REGNUM)
return builtin_type_long_long;
else if (reg_nr == PC_REGNUM || reg_nr == SP_REGNUM)
return builtin_type_long;
else
return builtin_type_short;
}
#if 0
/* convert $pc and $sp to/from virtual addresses */
#define REGISTER_CONVERTIBLE(N) ((N) == PC_REGNUM || (N) == SP_REGNUM)
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
{ \
ULONGEST x = extract_unsigned_integer ((FROM), REGISTER_RAW_SIZE (REGNUM)); \
if (REGNUM == PC_REGNUM) x = (x << 2) | IMEM_START; \
else x |= DMEM_START; \
store_unsigned_integer ((TO), TYPE_LENGTH(TYPE), x); \
}
#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
{ \
ULONGEST x = extract_unsigned_integer ((FROM), TYPE_LENGTH(TYPE)); \
x &= 0x3ffff; \
if (REGNUM == PC_REGNUM) x >>= 2; \
store_unsigned_integer ((TO), 2, x); \
}
#endif
CORE_ADDR
d10v_make_daddr (x)
CORE_ADDR x;
{
return ((x) | DMEM_START);
}
CORE_ADDR
d10v_make_iaddr (x)
CORE_ADDR x;
{
return (((x) << 2) | IMEM_START);
}
int
d10v_daddr_p (x)
CORE_ADDR x;
{
return (((x) & 0x3000000) == DMEM_START);
}
int
d10v_iaddr_p (x)
CORE_ADDR x;
{
return (((x) & 0x3000000) == IMEM_START);
}
CORE_ADDR
d10v_convert_iaddr_to_raw (x)
CORE_ADDR x;
{
return (((x) >> 2) & 0xffff);
}
CORE_ADDR
d10v_convert_daddr_to_raw(x)
CORE_ADDR x;
{
return ((x) & 0xffff);
}
/* Store the address of the place in which to copy the structure the
subroutine will return. This is called from call_function.
We store structs through a pointer passed in the first Argument
register. */
void
d10v_store_struct_return (addr, sp)
CORE_ADDR addr;
CORE_ADDR sp;
{
write_register (ARG1_REGNUM, (addr));
}
/* Write into appropriate registers a function return value
of type TYPE, given in virtual format.
Things always get returned in RET1_REGNUM, RET2_REGNUM, ... */
void
d10v_store_return_value (type,valbuf)
struct type *type;
char *valbuf;
{
write_register_bytes (REGISTER_BYTE (RET1_REGNUM),
valbuf,
TYPE_LENGTH (type));
}
/* Extract from an array REGBUF containing the (raw) register state
the address in which a function should return its structure value,
as a CORE_ADDR (or an expression that can be used as one). */
CORE_ADDR
d10v_extract_struct_value_address (regbuf)
char *regbuf;
{
return (extract_address ((regbuf) + REGISTER_BYTE (ARG1_REGNUM),
REGISTER_RAW_SIZE (ARG1_REGNUM))
| DMEM_START);
}
CORE_ADDR
d10v_frame_saved_pc (frame)
struct frame_info *frame;
{
return ((frame)->return_pc);
}
CORE_ADDR
d10v_frame_args_address (fi)
struct frame_info *fi;
{
return (fi)->frame;
}
CORE_ADDR
d10v_frame_locals_address (fi)
struct frame_info *fi;
{
return (fi)->frame;
}
/* Immediately after a function call, return the saved pc. We can't
use frame->return_pc beause that is determined by reading R13 off
the stack and that may not be written yet. */
CORE_ADDR
d10v_saved_pc_after_call (frame)
struct frame_info *frame;
{
return ((read_register(LR_REGNUM) << 2)
| IMEM_START);
}
/* Discard from the stack the innermost frame, restoring all saved
registers. */
@@ -869,7 +1096,7 @@ print_insn (memaddr, stream)
return (*tm_print_insn) (memaddr, &tm_print_insn_info);
}
void
static void
d10v_eva_prepare_to_trace ()
{
if (!tracing)
@@ -881,7 +1108,7 @@ d10v_eva_prepare_to_trace ()
/* Collect trace data from the target board and format it into a form
more useful for display. */
void
static void
d10v_eva_get_trace_data ()
{
int count, i, j, oldsize;

View File

@@ -261,6 +261,8 @@ static int bincls_allocated;
/* Local function prototypes */
extern void _initialize_dbxread PARAMS ((void));
static void
process_now PARAMS ((struct objfile *));

View File

@@ -74,6 +74,10 @@ extern char *strsignal PARAMS ((int));
typedef bfd_vma CORE_ADDR;
extern int core_addr_lessthan PARAMS ((CORE_ADDR lhs, CORE_ADDR rhs));
extern int core_addr_greaterthan PARAMS ((CORE_ADDR lhs, CORE_ADDR rhs));
#ifndef min
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
@@ -248,6 +252,8 @@ extern char *chill_demangle PARAMS ((const char *));
/* From utils.c */
extern void initialize_utils PARAMS ((void));
extern void notice_quit PARAMS ((void));
extern int strcmp_iw PARAMS ((const char *, const char *));
@@ -307,6 +313,8 @@ extern PTR mrealloc PARAMS ((PTR, PTR, size_t));
extern void mfree PARAMS ((PTR, PTR));
#endif
extern void init_page_info PARAMS ((void));
/* From demangle.c */
extern void set_demangling_style PARAMS ((char *));
@@ -507,6 +515,15 @@ extern char *symtab_to_filename PARAMS ((struct symtab *));
extern int read_relative_register_raw_bytes PARAMS ((int, char *));
#if __STDC__
enum lval_type;
struct frame_info;
#endif
void default_get_saved_register PARAMS ((char *raw_buffer, int *optimized,
CORE_ADDR *addrp,
struct frame_info *frame, int regnum,
enum lval_type *lval));
/* From readline (but not in any readline .h files). */
extern char *tilde_expand PARAMS ((char *));
@@ -1012,7 +1029,7 @@ extern void store_floating PARAMS ((void *, int, DOUBLEST));
I'm not sure it's used in all contexts. It exists to deal with there
being a few stray bits in the PC which would mislead us, not as some sort
of generic thing to handle alignment or segmentation (it's possible it
should be in TARGET_READ_PC instead). */
should be in TARGET_READ_PC instead). */
#if !defined (ADDR_BITS_REMOVE)
#define ADDR_BITS_REMOVE(addr) (addr)
#endif /* No ADDR_BITS_REMOVE. */
@@ -1032,6 +1049,7 @@ struct target_waitstatus;
struct cmd_list_element;
#endif
extern void (*async_hook) PARAMS ((void));
extern void (*init_ui_hook) PARAMS ((char *argv0));
extern void (*command_loop_hook) PARAMS ((void));
extern void (*fputs_unfiltered_hook) PARAMS ((const char *linebuffer,

View File

@@ -40,6 +40,8 @@
#define DEFAULT_DEMANGLING_STYLE AUTO_DEMANGLING_STYLE_STRING
#endif
extern void _initialize_demangler PARAMS ((void));
/* String name for the current demangling style. Set by the
"set demangle-style" command, printed as part of the output by the
"show demangle-style" command. */

View File

@@ -1,3 +1,17 @@
Mon May 24 10:07:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbint.texinfo (FRAME_NUM_ARGS): Update definition. Parameter
numargs was dropped.
Thu May 20 12:26:59 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbint.texinfo (FRAMELESS_FUNCTION_INVOCATION): Update.
Tue Apr 27 19:14:20 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbint.texinfo (SKIP_PROLOGUE, SKIP_PROLOGUE_FRAMELESS_P):
Update.
Thu Apr 22 13:07:37 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbint.texinfo (USE_GENERIC_DUMMY_FRAMES): Document.

View File

@@ -1330,10 +1330,10 @@ the processor's floating point unit.
@item FP_REGNUM
The number of the frame pointer register.
@item FRAMELESS_FUNCTION_INVOCATION(fi, frameless)
Define this to set the variable @var{frameless} to 1 if the function
invocation represented by @var{fi} does not have a stack frame
associated with it. Otherwise set it to 0.
@item FRAMELESS_FUNCTION_INVOCATION(fi)
Define this to an expression that returns 1 if the function invocation
represented by @var{fi} does not have a stack frame associated with it.
Otherwise return 0.
@item FRAME_ARGS_ADDRESS_CORRECT
stack.c
@@ -1366,9 +1366,10 @@ current stack frame storing each in @code{frame->saved_regs}. Space for
@var{FRAME_FIND_SAVED_REGS} and @var{EXTRA_FRAME_INFO} are deprecated.
@item FRAME_NUM_ARGS (val, fi)
For the frame described by @var{fi}, set @var{val} to the number of arguments
that are being passed.
@item FRAME_NUM_ARGS (fi)
For the frame described by @var{fi} return the number of arguments that
are being passed. If the number of arguments is not known, return
@code{-1}.
@item FRAME_SAVED_PC(frame)
Given @var{frame}, return the pc saved there. That is, the return
@@ -1529,7 +1530,8 @@ Used in @samp{call_function_by_hand} to remove an artificial stack
frame.
@item PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)
Define this to push arguments onto the stack for inferior function call.
Define this to push arguments onto the stack for inferior function
call. Return the updated stack pointer value.
@item PUSH_DUMMY_FRAME
Used in @samp{call_function_by_hand} to create an artificial stack frame.
@@ -1557,12 +1559,12 @@ defined, no conversion will be done.
(Only used for m88k targets.)
@item SKIP_PROLOGUE (pc)
A C statement that advances the @var{pc} across any function entry
prologue instructions so as to reach ``real'' code.
A C expression that returns the address of the ``real'' code beyond the
function entry prologue found at @var{pc}.
@item SKIP_PROLOGUE_FRAMELESS_P
A C statement that should behave similarly, but that can stop as soon as
the function is known to have a frame. If not defined,
A C expression that should behave similarly, but that can stop as soon
as the function is known to have a frame. If not defined,
@code{SKIP_PROLOGUE} will be used instead.
@item SKIP_TRAMPOLINE_CODE (pc)

View File

@@ -32,6 +32,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "complaints.h"
#include "demangle.h"
extern void _initialize_elfread PARAMS ((void));
/* The struct elfinfo is available only during ELF symbol table and
psymtab reading. It is destroyed at the complation of psymtab-reading.
It's local to elf_symfile_read. */

740
gdb/event-loop.c Normal file
View File

@@ -0,0 +1,740 @@
/* Event loop machinery for GDB, the GNU debugger.
Copyright 1999 Free Software Foundation, Inc.
Written by Elena Zannoni <ezannoni@cygnus.com> of 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 "event-loop.h"
#include <readline/readline.h>
#include <setjmp.h>
#include "top.h"
/* For config.h which may define HAVE_POLL */
#include "defs.h"
#ifdef HAVE_POLL
#include <sys/poll.h>
#endif
#include <errno.h>
/* Event queue:
- the first event in the queue is the head of the queue.
It will be the next to be serviced.
- the last event in the queue
Events can be inserted at the front of the queue or at the end of
the queue. Events will be extracted from the queue for processing
starting from the head. Therefore, events inserted at the head of
the queue will be processed in a last in first out fashoin, while
those inserted at the tail of the queue will be processed in a first
in first out manner. All the fields are NULL if the queue is
empty. */
static struct
{
gdb_event *first_event; /* First pending event */
gdb_event *last_event; /* Last pending event */
}
event_queue;
/* Gdb_notifier is just a list of file descriptors gdb is interested in.
These are the input file descriptor, and the target file
descriptor. We have two flavors of the notifier, one for platforms
that have the POLL function, the other for those that don't, and
only support SELECT. Each of the elements in the gdb_notifier list is
basically a description of what kind of events gdb is interested
in, for each fd. */
/* As of 1999-04-30 only the input file descriptor is registered with the
event loop. */
#ifdef HAVE_POLL
/* Poll based implementation of the notifier. */
static struct
{
/* Ptr to head of file handler list. */
file_handler *first_file_handler;
/* Ptr to array of pollfd structures. */
struct pollfd *poll_fds;
/* Number of file descriptors to monitor. */
int num_fds;
}
gdb_notifier;
#else /* ! HAVE_POLL */
/* Select based implementation of the notifier. */
static struct
{
/* Ptr to head of file handler list. */
file_handler *first_file_handler;
/* Masks to be used in the next call to select.
Bits are set in response to calls to create_file_handler. */
fd_mask check_masks[3 * MASK_SIZE];
/* What file descriptors were found ready by select. */
fd_mask ready_masks[3 * MASK_SIZE];
/* Number of valid bits (highest fd value + 1). */
int num_fds;
}
gdb_notifier;
#endif /* HAVE_POLL */
/* All the async_signal_handlers gdb is interested in are kept onto
this list. */
static struct
{
/* Pointer to first in handler list. */
async_signal_handler *first_handler;
/* Pointer to last in handler list. */
async_signal_handler *last_handler;
}
sighandler_list;
/* Is any of the handlers ready? Check this variable using
check_async_ready. This is used by process_event, to determine
whether or not to invoke the invoke_async_signal_handler
function. */
static int async_handler_ready = 0;
static void invoke_async_signal_handler PARAMS ((void));
static int gdb_wait_for_event PARAMS ((void));
static int check_async_ready PARAMS ((void));
/* Insert an event object into the gdb event queue at
the specified position.
POSITION can be head or tail, with values TAIL, HEAD.
EVENT_PTR points to the event to be inserted into the queue.
The caller must allocate memory for the event. It is freed
after the event has ben handled.
Events in the queue will be processed head to tail, therefore,
events inserted at the head of the queue will be processed
as last in first out. Event appended at the tail of the queue
will be processed first in first out. */
static void
async_queue_event (event_ptr, position)
gdb_event *event_ptr;
queue_position position;
{
if (position == TAIL)
{
/* The event will become the new last_event. */
event_ptr->next_event = NULL;
if (event_queue.first_event == NULL)
event_queue.first_event = event_ptr;
else
event_queue.last_event->next_event = event_ptr;
event_queue.last_event = event_ptr;
}
else if (position == HEAD)
{
/* The event becomes the new first_event. */
event_ptr->next_event = event_queue.first_event;
if (event_queue.first_event == NULL)
event_queue.last_event = event_ptr;
event_queue.first_event = event_ptr;
}
}
/* Process one event.
The event can be the next one to be serviced in the event queue,
or an asynchronous event handler can be invoked in response to
the reception of a signal.
If an event was processed (either way), 1 is returned otherwise
0 is returned.
Scan the queue from head to tail, processing therefore the high
priority events first, by invoking the associated event handler
procedure. */
static int
process_event ()
{
gdb_event *event_ptr, *prev_ptr;
event_handler_func *proc;
int fd;
/* First let's see if there are any asynchronous event handlers that
are ready. These would be the result of invoking any of the
signal handlers. */
if (check_async_ready ())
{
invoke_async_signal_handler ();
return 1;
}
/* Look in the event queue to find an event that is ready
to be processed. */
for (event_ptr = event_queue.first_event; event_ptr != NULL;
event_ptr = event_ptr->next_event)
{
/* Call the handler for the event. */
proc = event_ptr->proc;
fd = event_ptr->fd;
/* Let's get rid of the event from the event queue. We need to
do this now because while processing the event, the proc
function could end up calling 'error' and therefore jump out
to the caller of this function, gdb_do_one_event. In that
case, we would have on the event queue an event wich has been
processed, but not deleted. */
if (event_queue.first_event == event_ptr)
{
event_queue.first_event = event_ptr->next_event;
if (event_ptr->next_event == NULL)
event_queue.last_event = NULL;
}
else
{
prev_ptr = event_queue.first_event;
while (prev_ptr->next_event != event_ptr)
prev_ptr = prev_ptr->next_event;
prev_ptr->next_event = event_ptr->next_event;
if (event_ptr->next_event == NULL)
event_queue.last_event = prev_ptr;
}
free ((char *) event_ptr);
/* Now call the procedure associted with the event. */
(*proc) (fd);
return 1;
}
/* this is the case if there are no event on the event queue. */
return 0;
}
/* Process one high level event. If nothing is ready at this time,
wait for something to happen (via gdb_wait_for_event), then process
it. Returns 1 if something was done otherwise returns 0 (this can
happen if there are no event sources to wait for). */
int
gdb_do_one_event ()
{
int result = 0;
while (1)
{
if (!SET_TOP_LEVEL ())
{
/* Any events already waiting in the queue? */
if (process_event ())
{
result = 1;
break;
}
/* Wait for a new event. If gdb_wait_for_event returns -1,
we should get out because this means that there are no
event sources left. This will make the event loop stop,
and the application exit. */
result = gdb_wait_for_event ();
if (result < 0)
{
result = 0;
break;
}
/* Handle any new events occurred while waiting. */
if (process_event ())
{
result = 1;
break;
}
/* If gdb_wait_for_event has returned 1, it means that one
event has been handled. We break out of the loop. */
if (result)
break;
} /* end of if !set_top_level */
else
{
display_gdb_prompt (0);
/* Maybe better to set a flag to be checked somewhere as to
whether display the prompt or not. */
}
}
return result;
}
/* Add a file handler/descriptor to the list of descriptors we are
interested in.
FD is the file descriptor for the file/stream to be listened to.
For the poll case, MASK is a combination (OR) of
POLLIN, POLLRDNORM, POLLRDBAND, POLLPRI, POLLOUT, POLLWRNORM,
POLLWRBAND: these are the events we are interested in. If any of them
occurs, proc should be called.
For the select case, MASK is a combination of READABLE, WRITABLE, EXCEPTION.
PROC is the procedure that will be called when an event occurs for
FD. CLIENT_DATA is the argument to pass to PROC. */
void
create_file_handler (fd, mask, proc, client_data)
int fd;
int mask;
file_handler_func *proc;
gdb_client_data client_data;
{
file_handler *file_ptr;
#ifndef HAVE_POLL
int index, bit;
#endif
/* Do we already have a file handler for this file? (We may be
changing its associated procedure). */
for (file_ptr = gdb_notifier.first_file_handler; file_ptr != NULL;
file_ptr = file_ptr->next_file)
{
if (file_ptr->fd == fd)
break;
}
/* It is a new file descriptor. */
if (file_ptr == NULL)
{
file_ptr = (file_handler *) xmalloc (sizeof (file_handler));
file_ptr->fd = fd;
file_ptr->ready_mask = 0;
file_ptr->next_file = gdb_notifier.first_file_handler;
gdb_notifier.first_file_handler = file_ptr;
}
file_ptr->proc = proc;
file_ptr->client_data = client_data;
file_ptr->mask = mask;
#ifdef HAVE_POLL
gdb_notifier.num_fds++;
gdb_notifier.poll_fds =
(struct pollfd *) realloc (gdb_notifier.poll_fds,
(gdb_notifier.num_fds) * sizeof (struct pollfd));
(gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->fd = fd;
(gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->events = mask;
(gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->revents = 0;
#else /* ! HAVE_POLL */
index = fd / (NBBY * sizeof (fd_mask));
bit = 1 << (fd % (NBBY * sizeof (fd_mask)));
if (mask & GDB_READABLE)
gdb_notifier.check_masks[index] |= bit;
else
gdb_notifier.check_masks[index] &= ~bit;
if (mask & GDB_WRITABLE)
(gdb_notifier.check_masks + MASK_SIZE)[index] |= bit;
else
(gdb_notifier.check_masks + MASK_SIZE)[index] &= ~bit;
if (mask & GDB_EXCEPTION)
(gdb_notifier.check_masks + 2 * (MASK_SIZE))[index] |= bit;
else
(gdb_notifier.check_masks + 2 * (MASK_SIZE))[index] &= ~bit;
if (gdb_notifier.num_fds <= fd)
gdb_notifier.num_fds = fd + 1;
#endif /* HAVE_POLL */
}
/* Remove the file descriptor FD from the list of monitored fd's:
i.e. we don't care anymore about events on the FD. */
void
delete_file_handler (fd)
int fd;
{
file_handler *file_ptr, *prev_ptr = NULL;
int i, j;
struct pollfd *new_poll_fds;
#ifndef HAVE_POLL
int index, bit;
unsigned long flags;
#endif
/* Find the entry for the given file. */
for (file_ptr = gdb_notifier.first_file_handler; file_ptr != NULL;
file_ptr = file_ptr->next_file)
{
if (file_ptr->fd == fd)
break;
}
if (file_ptr == NULL)
return;
/* Deactivate the file descriptor, by clearing its mask,
so that it will not fire again. */
file_ptr->mask = 0;
#ifdef HAVE_POLL
/* Create a new poll_fds array by copying every fd's information but the
one we want to get rid of. */
new_poll_fds =
(struct pollfd *) xmalloc ((gdb_notifier.num_fds - 1) * sizeof (struct pollfd));
for (i = 0, j = 0; i < gdb_notifier.num_fds; i++)
{
if ((gdb_notifier.poll_fds + i)->fd != fd)
{
(new_poll_fds + j)->fd = (gdb_notifier.poll_fds + i)->fd;
(new_poll_fds + j)->events = (gdb_notifier.poll_fds + i)->events;
(new_poll_fds + j)->revents = (gdb_notifier.poll_fds + i)->revents;
j++;
}
}
free (gdb_notifier.poll_fds);
gdb_notifier.poll_fds = new_poll_fds;
gdb_notifier.num_fds--;
#else /* ! HAVE_POLL */
index = fd / (NBBY * sizeof (fd_mask));
bit = 1 << (fd % (NBBY * sizeof (fd_mask)));
if (file_ptr->mask & GDB_READABLE)
gdb_notifier.check_masks[index] &= ~bit;
if (file_ptr->mask & GDB_WRITABLE)
(gdb_notifier.check_masks + MASK_SIZE)[index] &= ~bit;
if (file_ptr->mask & GDB_EXCEPTION)
(gdb_notifier.check_masks + 2 * (MASK_SIZE))[index] &= ~bit;
/* Find current max fd. */
if ((fd + 1) == gdb_notifier.num_fds)
{
for (gdb_notifier.num_fds = 0; index >= 0; index--)
{
flags = gdb_notifier.check_masks[index]
| (gdb_notifier.check_masks + MASK_SIZE)[index]
| (gdb_notifier.check_masks + 2 * (MASK_SIZE))[index];
if (flags)
{
for (i = (NBBY * sizeof (fd_mask)); i > 0; i--)
{
if (flags & (((unsigned long) 1) << (i - 1)))
break;
}
gdb_notifier.num_fds = index * (NBBY * sizeof (fd_mask)) + i;
break;
}
}
}
#endif /* HAVE_POLL */
/* Get rid of the file handler in the file handler list. */
if (file_ptr == gdb_notifier.first_file_handler)
gdb_notifier.first_file_handler = file_ptr->next_file;
else
{
for (prev_ptr = gdb_notifier.first_file_handler;
prev_ptr->next_file == file_ptr;
prev_ptr = prev_ptr->next_file)
;
prev_ptr->next_file = file_ptr->next_file;
}
free ((char *) file_ptr);
}
/* Handle the given event by calling the procedure associated to the
corresponding file handler. Called by process_event indirectly,
through event_ptr->proc. EVENT_FILE_DESC is file descriptor of the
event in the front of the event queue. */
static void
handle_file_event (event_file_desc)
int event_file_desc;
{
file_handler *file_ptr;
int mask, error_mask;
/* Search the file handler list to find one that matches the fd in
the event. */
for (file_ptr = gdb_notifier.first_file_handler; file_ptr != NULL;
file_ptr = file_ptr->next_file)
{
if (file_ptr->fd == event_file_desc)
{
/* With poll, the ready_mask could have any of three events
set to 1: POLLHUP, POLLERR, POLLNVAL. These events cannot
be used in the requested event mask (events), but they
can be returned in the return mask (revents). We need to
check for those event too, and add them to the mask which
will be passed to the handler. */
/* See if the desired events (mask) match the received
events (ready_mask). */
#ifdef HAVE_POLL
error_mask = POLLHUP | POLLERR | POLLNVAL;
mask = (file_ptr->ready_mask & file_ptr->mask) |
(file_ptr->ready_mask & error_mask);
#else /* ! HAVE_POLL */
mask = file_ptr->ready_mask & file_ptr->mask;
#endif /* HAVE_POLL */
/* Clear the received events for next time around. */
file_ptr->ready_mask = 0;
/* If there was a match, then call the handler. */
if (mask != 0)
(*file_ptr->proc) (file_ptr->client_data, mask);
break;
}
}
}
/* Called by gdb_do_one_event to wait for new events on the
monitored file descriptors. Queue file events as they are
detected by the poll.
If there are no events, this function will block in the
call to poll.
Return -1 if there are no files descriptors to monitor,
otherwise return 0. */
static int
gdb_wait_for_event ()
{
file_handler *file_ptr;
gdb_event *file_event_ptr;
int num_found, i;
#ifndef HAVE_POLL
int mask, bit, index;
#endif
if (gdb_notifier.num_fds == 0)
return -1;
#ifdef HAVE_POLL
num_found =
poll (gdb_notifier.poll_fds, (unsigned long) gdb_notifier.num_fds, -1);
#else /* ! HAVE_POLL */
memcpy (gdb_notifier.ready_masks,
gdb_notifier.check_masks,
3 * MASK_SIZE * sizeof (fd_mask));
num_found = select (gdb_notifier.num_fds,
(SELECT_MASK *) & gdb_notifier.ready_masks[0],
(SELECT_MASK *) & gdb_notifier.ready_masks[MASK_SIZE],
(SELECT_MASK *) & gdb_notifier.ready_masks[2 * MASK_SIZE],
NULL);
/* Clear the masks after an error from select. */
if (num_found == -1)
memset (gdb_notifier.ready_masks,
0, 3 * MASK_SIZE * sizeof (fd_mask));
#endif /* HAVE_POLL */
/* Enqueue all detected file events. */
#ifdef HAVE_POLL
for (i = 0; (i < gdb_notifier.num_fds) && (num_found > 0); i++)
{
if ((gdb_notifier.poll_fds + i)->revents)
num_found--;
else
continue;
for (file_ptr = gdb_notifier.first_file_handler;
file_ptr != NULL;
file_ptr = file_ptr->next_file)
{
if (file_ptr->fd == (gdb_notifier.poll_fds + i)->fd)
break;
}
if (file_ptr)
{
/* Enqueue an event only if this is still a new event for
this fd. */
if (file_ptr->ready_mask == 0)
{
file_event_ptr =
(gdb_event *) xmalloc (sizeof (gdb_event));
file_event_ptr->proc = handle_file_event;
file_event_ptr->fd = file_ptr->fd;
async_queue_event (file_event_ptr, TAIL);
}
}
file_ptr->ready_mask = (gdb_notifier.poll_fds + i)->revents;
}
#else /* ! HAVE_POLL */
for (file_ptr = gdb_notifier.first_file_handler;
(file_ptr != NULL) && (num_found > 0);
file_ptr = file_ptr->next_file)
{
index = file_ptr->fd / (NBBY * sizeof (fd_mask));
bit = 1 << (file_ptr->fd % (NBBY * sizeof (fd_mask)));
mask = 0;
if (gdb_notifier.ready_masks[index] & bit)
mask |= GDB_READABLE;
if ((gdb_notifier.ready_masks + MASK_SIZE)[index] & bit)
mask |= GDB_WRITABLE;
if ((gdb_notifier.ready_masks + 2 * (MASK_SIZE))[index] & bit)
mask |= GDB_EXCEPTION;
if (!mask)
continue;
else
num_found--;
/* Enqueue an event only if this is still a new event for
this fd. */
if (file_ptr->ready_mask == 0)
{
file_event_ptr =
(gdb_event *) xmalloc (sizeof (gdb_event));
file_event_ptr->proc = handle_file_event;
file_event_ptr->fd = file_ptr->fd;
async_queue_event (file_event_ptr, TAIL);
}
file_ptr->ready_mask = mask;
}
#endif /* HAVE_POLL */
return 0;
}
/* Create an asynchronous handler, allocating memory for it.
Return a pointer to the newly created handler.
This pointer will be used to invoke the handler by
invoke_async_signal_handler.
PROC is the function to call with CLIENT_DATA argument
whenever the handler is invoked. */
async_signal_handler *
create_async_signal_handler (proc, client_data)
async_handler_func *proc;
gdb_client_data client_data;
{
async_signal_handler *async_handler_ptr;
async_handler_ptr =
(async_signal_handler *) xmalloc (sizeof (async_signal_handler));
async_handler_ptr->ready = 0;
async_handler_ptr->next_handler = NULL;
async_handler_ptr->proc = proc;
async_handler_ptr->client_data = client_data;
if (sighandler_list.first_handler == NULL)
sighandler_list.first_handler = async_handler_ptr;
else
sighandler_list.last_handler->next_handler = async_handler_ptr;
sighandler_list.last_handler = async_handler_ptr;
return async_handler_ptr;
}
/* Mark the handler (ASYNC_HANDLER_PTR) as ready. This information will
be used when the handlers are invoked, after we have waited for
some event. The caller of this function is the interrupt handler
associated with a signal. */
void
mark_async_signal_handler (async_handler_ptr)
async_signal_handler *async_handler_ptr;
{
((async_signal_handler *) async_handler_ptr)->ready = 1;
async_handler_ready = 1;
}
/* Call all the handlers that are ready. */
static void
invoke_async_signal_handler ()
{
async_signal_handler *async_handler_ptr;
if (async_handler_ready == 0)
return;
async_handler_ready = 0;
/* Invoke ready handlers. */
while (1)
{
for (async_handler_ptr = sighandler_list.first_handler;
async_handler_ptr != NULL;
async_handler_ptr = async_handler_ptr->next_handler)
{
if (async_handler_ptr->ready)
break;
}
if (async_handler_ptr == NULL)
break;
async_handler_ptr->ready = 0;
(*async_handler_ptr->proc) (async_handler_ptr->client_data);
}
return;
}
/* Delete an asynchronous handler (ASYNC_HANDLER_PTR).
Free the space allocated for it. */
void
delete_async_signal_handler (async_handler_ptr)
async_signal_handler *async_handler_ptr;
{
async_signal_handler *prev_ptr;
if (sighandler_list.first_handler == async_handler_ptr)
{
sighandler_list.first_handler = async_handler_ptr->next_handler;
if (sighandler_list.first_handler == NULL)
sighandler_list.last_handler = NULL;
}
else
{
prev_ptr = sighandler_list.first_handler;
while (prev_ptr->next_handler != async_handler_ptr)
prev_ptr = prev_ptr->next_handler;
prev_ptr->next_handler = async_handler_ptr->next_handler;
if (sighandler_list.last_handler == async_handler_ptr)
sighandler_list.last_handler = prev_ptr;
}
free ((char *) async_handler_ptr);
}
/* Is it necessary to call invoke_async_signal_handler? */
static int
check_async_ready ()
{
return async_handler_ready;
}

253
gdb/event-loop.h Normal file
View File

@@ -0,0 +1,253 @@
/* Definitions used by the GDB event loop.
Copyright 1999 Free Software Foundation, Inc.
Written by Elena Zannoni <ezannoni@cygnus.com> of 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 <stdlib.h>
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
#include <unistd.h>
#include <fcntl.h>
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#include "defs.h"
/* An event loop listens for events from multiple event sources. When
an event arrives, it is queued and processed by calling the
appropriate event handler. The event loop then continues to listen
for more events. An event loop completes when there are no event
sources to listen on. External event sources can be plugged into
the loop.
There are 3 main components:
- a list of file descriptors to be monitored, GDB_NOTIFIER.
- a list of events that have occurred, EVENT_QUEUE.
- a list of signal handling functions, SIGHANDLER_LIST.
GDB_NOTIFIER keeps track of the event sources. Event sources for
gdb are currently the UI and the target. Gdb communicates with the
command line user interface via the readline library and usually
communicates with remote targets via a serial port. Serial ports
are represented in GDB as file descriptors and select/poll calls.
For native targets instead, the communication consists of calls to
ptrace and waits (via signals) or calls to poll/select (via file
descriptors). In the current gdb, the code handling events related
to the target resides in the wait_for_inferior function and in
various target specific files (*-tdep.c).
EVENT_QUEUE keeps track of the events that have happened during the
last iteration of the event loop, and need to be processed. An
event is represented by a procedure to be invoked in order to
process the event. The queue is scanned head to tail. If the
event of interest is a change of state in a file descriptor, then a
call to poll or select will be made to detect it.
If the events generate signals, they are also queued by special
functions that are invoked through traditional signal handlers.
The actions to be taken is response to such events will be executed
when the SIGHANDLER_LIST is scanned, the next time through the
infinite loop.
Corollary tasks are the creation and deletion of event sources. */
typedef PTR gdb_client_data;
typedef struct gdb_event gdb_event;
typedef void (file_handler_func) PARAMS ((gdb_client_data, int mask));
typedef void (async_handler_func) PARAMS ((gdb_client_data));
typedef void (event_handler_func) PARAMS ((int));
/* Event for the GDB event system. Events are queued by calling
async_queue_event and serviced later on by gdb_do_one_event. An
event can be, for instance, a file descriptor becoming ready to be
read. Servicing an event simply means that the procedure PROC will
be called. We have 2 queues, one for file handlers that we listen
to in the event loop, and one for the file handlers+events that are
ready. The procedure PROC associated with each event is always the
same (handle_file_event). Its duty is to invoke the handler
associated with the file descriptor whose state change generated
the event, plus doing other cleanups adn such. */
struct gdb_event
{
event_handler_func *proc; /* Procedure to call to service this event. */
int fd; /* File descriptor that is ready. */
struct gdb_event *next_event; /* Next in list of events or NULL. */
};
/* Information about each file descriptor we register with the event
loop. */
typedef struct file_handler
{
int fd; /* File descriptor. */
int mask; /* Events we want to monitor: POLLIN, etc. */
int ready_mask; /* Events that have been seen since
the last time. */
file_handler_func *proc; /* Procedure to call when fd is ready. */
gdb_client_data client_data; /* Argument to pass to proc. */
struct file_handler *next_file; /* Next registered file descriptor. */
}
file_handler;
/* PROC is a function to be invoked when the READY flag is set. This
happens when there has been a signal and the corresponding signal
handler has 'triggered' this async_signal_handler for
execution. The actual work to be done in response to a signal will
be carried out by PROC at a later time, within process_event. This
provides a deferred execution of signal handlers.
Async_init_signals takes care of setting up such an
asyn_signal_handler for each interesting signal. */
typedef struct async_signal_handler
{
int ready; /* If ready, call this handler from the main event loop,
using invoke_async_handler. */
struct async_signal_handler *next_handler; /* Ptr to next handler */
async_handler_func *proc; /* Function to call to do the work */
gdb_client_data client_data; /* Argument to async_handler_func */
}
async_signal_handler;
/* Where to add an event onto the event queue, by queue_event. */
typedef enum
{
/* Add at tail of queue. It will be processed in first in first
out order. */
TAIL,
/* Add at head of queue. It will be processed in last in first out
order. */
HEAD
}
queue_position;
/* Tell create_file_handler what events we are interested in.
This is used by the select version of the event loop. */
#define GDB_READABLE (1<<1)
#define GDB_WRITABLE (1<<2)
#define GDB_EXCEPTION (1<<3)
/* Type of the mask arguments to select. */
#ifndef NO_FD_SET
#define SELECT_MASK fd_set
#else
#ifndef _AIX
typedef long fd_mask;
#endif
#if defined(_IBMR2)
#define SELECT_MASK void
#else
#define SELECT_MASK int
#endif
#endif
/* Define "NBBY" (number of bits per byte) if it's not already defined. */
#ifndef NBBY
#define NBBY 8
#endif
/* Define the number of fd_masks in an fd_set */
#ifndef FD_SETSIZE
#ifdef OPEN_MAX
#define FD_SETSIZE OPEN_MAX
#else
#define FD_SETSIZE 256
#endif
#endif
#if !defined(howmany)
#define howmany(x, y) (((x)+((y)-1))/(y))
#endif
#ifndef NFDBITS
#define NFDBITS NBBY*sizeof(fd_mask)
#endif
#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS)
/* Stack for prompts. Each prompt is composed as a prefix, a prompt
and a suffix. The prompt to be displayed at any given time is the
one on top of the stack. A stack is necessary because of cases in
which the execution of a gdb command requires further input from
the user, like for instance 'commands' for breakpoints and
'actions' for tracepoints. In these cases, the prompt is '>' and
gdb should process input using the asynchronous readline interface
and the event loop. In order to achieve this, we need to save
somewhere the state of GDB, i.e. that it is processing user input
as part of a command and not as part of the top level command loop.
The prompt stack represents part of the saved state. Another part
would be the function that readline would invoke after a whole line
of input has ben entered. This second piece would be something
like, for instance, where to return within the code for the actions
commands after a line has been read. This latter portion has not
beeen implemented yet. The need for a 3-part prompt arises from
the annotation level. When this is set to 2, the prompt is actually
composed of a prefix, the prompt itself and a suffix. */
/* At any particular time there will be always at least one prompt on
the stack, the one being currently displayed by gdb. If gdb is
using annotation level equal 2, there will be 2 prompts on the
stack: the usual one, w/o prefix and suffix (at top - 1), and the
'composite' one with prefix and suffix added (at top). At this
time, this is the only use of the prompt stack. Resetting annotate
to 0 or 1, pops the top of the stack, resetting its size to one
element. The MAXPROMPTS limit is safe, for now. Once other cases
are dealt with (like the different prompts used for 'commands' or
'actions') this array implementation of the prompt stack may have
to change. */
#define MAXPROMPTS 10
struct prompts
{
struct
{
char *prefix;
char *prompt;
char *suffix;
}
prompt_stack[MAXPROMPTS];
int top;
};
#define PROMPT(X) the_prompts.prompt_stack[the_prompts.top + X].prompt
#define PREFIX(X) the_prompts.prompt_stack[the_prompts.top + X].prefix
#define SUFFIX(X) the_prompts.prompt_stack[the_prompts.top + X].suffix
extern void delete_file_handler PARAMS ((int));
extern void
create_file_handler PARAMS ((int, int, file_handler_func, gdb_client_data));
extern int gdb_do_one_event PARAMS ((void));
extern void mark_async_signal_handler PARAMS ((async_signal_handler *));
extern async_signal_handler *
create_async_signal_handler PARAMS ((async_handler_func *, gdb_client_data));
extern void delete_async_signal_handler PARAMS ((async_signal_handler *async_handler_ptr));
extern void display_gdb_prompt PARAMS ((char*));
extern void setup_event_loop PARAMS ((void));
extern void async_init_signals PARAMS ((void));
extern void set_async_editing_command PARAMS ((char *, int, struct cmd_list_element *));
extern void set_async_annotation_level PARAMS ((char *, int, struct cmd_list_element *));
extern void set_async_prompt PARAMS ((char *, int, struct cmd_list_element *));

953
gdb/event-top.c Normal file
View File

@@ -0,0 +1,953 @@
/* Top level stuff for GDB, the GNU debugger.
Copyright 1999 Free Software Foundation, Inc.
Written by Elena Zannoni <ezannoni@cygnus.com> of 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 "event-loop.h"
#ifdef HAVE_POLL
#include <sys/poll.h>
#endif
#include "inferior.h"
/* readline include files */
#include <readline/readline.h>
#include <readline/history.h>
/* readline defines this. */
#undef savestring
extern FILE *instream;
static void command_line_handler PARAMS ((char *));
static void gdb_readline2 PARAMS ((void));
static void pop_prompt PARAMS ((void));
static void push_prompt PARAMS ((char *, char *, char *));
static void change_line_handler PARAMS ((void));
static void change_annotation_level PARAMS ((void));
static void command_handler PARAMS ((char *));
/* Signal handlers. */
void handle_sigint PARAMS ((int));
void handle_sigquit PARAMS ((int));
void handle_sighup PARAMS ((int));
void handle_sigfpe PARAMS ((int));
void handle_sigwinch PARAMS ((int));
/* Functions to be invoked by the event loop in response to
signals. */
void async_request_quit PARAMS ((void));
void async_do_nothing PARAMS ((void));
void async_disconnect PARAMS ((void));
void async_float_handler PARAMS ((void));
/* Functions from top.c. */
extern void command_loop_marker PARAMS ((int));
extern int quit_cover PARAMS ((PTR));
extern void quit_command PARAMS ((char *, int));
extern void execute_command PARAMS ((char *, int));
/* Variables from top.c. */
extern int source_line_number;
extern char *source_file_name;
extern char *source_error;
extern char *source_pre_error;
extern int history_expansion_p;
extern int server_command;
/* If this definition isn't overridden by the header files, assume
that isatty and fileno exist on this system. */
#ifndef ISATTY
#define ISATTY(FP) (isatty (fileno (FP)))
#endif
/* Hook for alternate command interface. */
void (*async_hook) PARAMS ((void));
/* Readline offers an alternate interface, via callback
functions. These are all included in the file callback.c in the
readline distribution. This file provides (mainly) a function, which
the event loop uses as callback (i.e. event handler) whenever an event
is detected on the standard input file descriptor.
readline_callback_read_char is called (by the GDB event loop) whenever
there is a new character ready on the input stream. This function
incrementally builds a buffer internal to readline where it
accumulates the line read up to the point of invocation. In the
special case in which the character read is newline, the function
invokes a GDB supplied callback routine, which does the processing of
a full command line. This latter routine is the asynchronous analog
of the old command_line_input in gdb. Instead of invoking (and waiting
for) readline to read the command line and pass it back to
command_loop for processing, the new command_line_handler function has
the command line already available as its parameter. INPUT_HANDLER is
to be set to the function that readline will invoke when a complete
line of input is ready. CALL_READLINE is to be set to the function
that readline offers as callback to the event_loop. */
void (*input_handler) PARAMS ((char *));
void (*call_readline) PARAMS ((void));
/* Important variables for the event loop. */
/* This is used to determine if GDB is using the readline library or
its own simplified form of readline. It is used by the asynchronous
form of the set editing command.
ezannoni: as of 1999-04-29 I expect that this
variable will not be used after gdb is changed to use the event
loop as default engine, and event-top.c is merged into top.c. */
int async_command_editing_p;
/* This variable contains the new prompt that the user sets with the
set prompt command. */
char *new_async_prompt;
/* This is the annotation suffix that will be used when the
annotation_level is 2. */
char *async_annotation_suffix;
/* This is the file descriptor for the input stream that GDB uses to
read commands from. */
int input_fd;
/* This is the prompt stack. Prompts will be pushed on the stack as
needed by the different 'kinds' of user inputs GDB is asking
for. See event-loop.h. */
struct prompts the_prompts;
/* signal handling variables */
/* Each of these is a pointer to a function that the event loop will
invoke if the corresponding signal has received. The real signal
handlers mark these functions as ready to be executed and the event
loop, in a later iteration, calls them. See the function
invoke_async_signal_handler. */
async_signal_handler *sigint_token;
#ifdef SIGHUP
async_signal_handler *sighup_token;
#endif
async_signal_handler *sigquit_token;
async_signal_handler *sigfpe_token;
#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
async_signal_handler *sigwinch_token;
#endif
/* Structure to save a partially entered command. This is used when
the user types '\' at the end of a command line. This is necessary
because each line of input is handled by a different call to
command_line_handler, and normally there is no state retained
between different calls. */
int more_to_come = 0;
struct readline_input_state
{
char *linebuffer;
char *linebuffer_ptr;
}
readline_input_state;
/* Initialize all the necessary variables, start the event loop,
register readline, and stdin. */
void
setup_event_loop ()
{
int length = strlen (PREFIX (0)) + strlen (PROMPT (0)) + strlen (SUFFIX (0)) + 1;
char *a_prompt = (char *) xmalloc (length);
/* Set things up for readline to be invoked via the alternate
interface, i.e. via a callback function (rl_callback_read_char). */
call_readline = rl_callback_read_char;
/* When readline has read an end-of-line character, it passes the
complete line to gdb for processing. command_line_handler is the
function that does this. */
input_handler = command_line_handler;
/* Tell readline what the prompt to display is and what function it
will need to call after a whole line is read. */
strcpy (a_prompt, PREFIX (0));
strcat (a_prompt, PROMPT (0));
strcat (a_prompt, SUFFIX (0));
rl_callback_handler_install (a_prompt, input_handler);
/* Tell readline to use the same input stream that gdb uses. */
rl_instream = instream;
/* Get a file descriptor for the input stream, so that we can
register it with the event loop. */
input_fd = fileno (instream);
/* Now we need to create the event sources for the input file descriptor. */
/* At this point in time, this is the only event source that we
register with the even loop. Another source is going to be the
target program (inferior), but that must be registered only when
it actually exists (I.e. after we say 'run' or after we connect
to a remote target. */
#ifdef HAVE_POLL
create_file_handler (input_fd, POLLIN,
(file_handler_func *) call_readline, 0);
#else
create_file_handler (input_fd, GDB_READABLE,
(file_handler_func *) call_readline, 0);
#endif
/* Loop until there is something to do. This is the entry point to
the event loop engine. gdb_do_one_event will process one event
for each invocation. It always returns 1, unless there are no
more event sources registered. In this case it returns 0. */
while (gdb_do_one_event () != 0)
;
/* We are done with the event loop. There are no more event sources
to listen to. So we exit GDB. */
return;
}
/* Change the function to be invoked every time there is a character
ready on stdin. This is used when the user sets the editing off,
therefore bypassing readline, and letting gdb handle the input
itself, via gdb_readline2. Also it is used in the opposite case in
which the user sets editing on again, by restoring readline
handling of the input. */
static void
change_line_handler ()
{
if (async_command_editing_p)
{
/* Turn on editing by using readline. */
call_readline = rl_callback_read_char;
}
else
{
/* Turn off editing by using gdb_readline2. */
rl_callback_handler_remove ();
call_readline = gdb_readline2;
}
/* To tell the event loop to change the handler associated with the
input file descriptor, we need to create a new event source,
corresponding to the same fd, but with a new event handler
function. */
delete_file_handler (input_fd);
#ifdef HAVE_POLL
create_file_handler (input_fd, POLLIN,
(file_handler_func *) call_readline, 0);
#else
create_file_handler (input_fd, GDB_READABLE,
(file_handler_func *) call_readline, 0);
#endif
}
/* Displays the prompt. The prompt that is displayed is the current
top of the prompt stack, if the argument NEW_PROMPT is
0. Otherwise, it displays whatever NEW_PROMPT is. This is used
after each gdb command has completed, and in the following cases:
1. when the user enters a command line which is ended by '\'
indicating that the command will continue on the next line.
In that case the prompt that is displayed is the empty string.
2. When the user is entering 'commands' for a breakpoint, or
actions for a tracepoint. In this case the prompt will be '>'
3. Other????
FIXME: 2. & 3. not implemented yet for async. */
void
display_gdb_prompt (new_prompt)
char *new_prompt;
{
int prompt_length = 0;
if (!new_prompt)
{
/* Just use the top of the prompt stack. */
prompt_length = strlen (PREFIX (0)) +
strlen (SUFFIX (0)) +
strlen (PROMPT (0)) + 1;
new_prompt = (char *) alloca (prompt_length);
/* Prefix needs to have new line at end. */
strcpy (new_prompt, PREFIX (0));
strcat (new_prompt, PROMPT (0));
/* Suffix needs to have a new line at end and \032 \032 at
beginning. */
strcat (new_prompt, SUFFIX (0));
}
if (async_command_editing_p)
{
rl_callback_handler_remove ();
rl_callback_handler_install (new_prompt, input_handler);
}
else if (new_prompt)
{
/* Don't use a _filtered function here. It causes the assumed
character position to be off, since the newline we read from
the user is not accounted for. */
fputs_unfiltered (new_prompt, gdb_stdout);
#ifdef MPW
/* Move to a new line so the entered line doesn't have a prompt
on the front of it. */
fputs_unfiltered ("\n", gdb_stdout);
#endif /* MPW */
gdb_flush (gdb_stdout);
}
}
/* Used when the user requests a different annotation level, with
'set annotate'. It pushes a new prompt (with prefix and suffix) on top
of the prompt stack, if the annotation level desired is 2, otherwise
it pops the top of the prompt stack when we want the annotation level
to be the normal ones (1 or 2). */
static void
change_annotation_level ()
{
char *prefix, *suffix;
if (!PREFIX (0) || !PROMPT (0) || !SUFFIX (0))
{
/* The prompt stack has not been initialized to "", we are
using gdb w/o the --async switch */
warning ("Command has same effect as set annotate");
return;
}
if (annotation_level > 1)
{
if (!strcmp (PREFIX (0), "") && !strcmp (SUFFIX (0), ""))
{
/* Push a new prompt if the previous annotation_level was not >1. */
prefix = (char *) alloca (strlen (async_annotation_suffix) + 10);
strcpy (prefix, "\n\032\032pre-");
strcat (prefix, async_annotation_suffix);
strcat (prefix, "\n");
suffix = (char *) alloca (strlen (async_annotation_suffix) + 6);
strcpy (suffix, "\n\032\032");
strcat (suffix, async_annotation_suffix);
strcat (suffix, "\n");
push_prompt (prefix, (char *) 0, suffix);
}
}
else
{
if (strcmp (PREFIX (0), "") && strcmp (SUFFIX (0), ""))
{
/* Pop the top of the stack, we are going back to annotation < 1. */
pop_prompt ();
}
}
}
/* Pushes a new prompt on the prompt stack. Each prompt has three
parts: prefix, prompt, suffix. Usually prefix and suffix are empty
strings, except when the annotation level is 2. Memory is allocated
within savestring for the new prompt. */
static void
push_prompt (prefix, prompt, suffix)
char *prefix;
char *prompt;
char *suffix;
{
the_prompts.top++;
PREFIX (0) = savestring (prefix, strlen (prefix));
if (prompt)
PROMPT (0) = savestring (prompt, strlen (prompt));
else
PROMPT (0) = savestring (PROMPT (-1), strlen (PROMPT (-1)));
SUFFIX (0) = savestring (suffix, strlen (suffix));
}
/* Pops the top of the prompt stack, and frees the memory allocated for it. */
static void
pop_prompt ()
{
if (strcmp (PROMPT (0), PROMPT (-1)))
{
free (PROMPT (-1));
PROMPT (-1) = savestring (PROMPT (0), strlen (PROMPT (0)));
}
free (PREFIX (0));
free (PROMPT (0));
free (SUFFIX (0));
the_prompts.top--;
}
/* Handles a gdb command. This function is called by
command_line_handler, which has processed one or more input lines
into COMMAND. */
/* NOTE: 1999-04-30 This is the asynchronous version of the command_loop
function. The command_loop function will be obsolete when we
switch to use the event loop at every execution of gdb. */
static void
command_handler (command)
char *command;
{
struct cleanup *old_chain;
int stdin_is_tty = ISATTY (stdin);
long time_at_cmd_start;
#ifdef HAVE_SBRK
long space_at_cmd_start = 0;
#endif
extern int display_time;
extern int display_space;
#if defined(TUI)
extern int insert_mode;
#endif
quit_flag = 0;
if (instream == stdin && stdin_is_tty)
reinitialize_more_filter ();
old_chain = make_cleanup ((make_cleanup_func) command_loop_marker, 0);
#if defined(TUI)
insert_mode = 0;
#endif
/* If readline returned a NULL command, it means that the
connection with the terminal is gone. This happens at the
end of a testsuite run, after Expect has hung up
but GDB is still alive. In such a case, we just quit gdb
killing the inferior program too. */
if (command == 0)
quit_command ((char *) 0, stdin == instream);
time_at_cmd_start = get_run_time ();
if (display_space)
{
#ifdef HAVE_SBRK
extern char **environ;
char *lim = (char *) sbrk (0);
space_at_cmd_start = (long) (lim - (char *) &environ);
#endif
}
execute_command (command, instream == stdin);
/* Do any commands attached to breakpoint we stopped at. */
bpstat_do_actions (&stop_bpstat);
do_cleanups (old_chain);
if (display_time)
{
long cmd_time = get_run_time () - time_at_cmd_start;
printf_unfiltered ("Command execution time: %ld.%06ld\n",
cmd_time / 1000000, cmd_time % 1000000);
}
if (display_space)
{
#ifdef HAVE_SBRK
extern char **environ;
char *lim = (char *) sbrk (0);
long space_now = lim - (char *) &environ;
long space_diff = space_now - space_at_cmd_start;
printf_unfiltered ("Space used: %ld (%c%ld for this command)\n",
space_now,
(space_diff >= 0 ? '+' : '-'),
space_diff);
#endif
}
}
/* Handle a complete line of input. This is called by the callback
mechanism within the readline library. Deal with incomplete commands
as well, by saving the partial input in a global buffer. */
/* NOTE: 1999-04-30 This is the asynchronous version of the
command_line_input function. command_line_input will become
obsolete once we use the event loop as the default mechanism in
GDB. */
static void
command_line_handler (rl)
char *rl;
{
static char *linebuffer = 0;
static unsigned linelength = 0;
register char *p;
char *p1;
int change_prompt = 0;
extern char *line;
extern int linesize;
char *nline;
char got_eof = 0;
int repeat = (instream == stdin);
if (annotation_level > 1 && instream == stdin)
{
printf_unfiltered ("\n\032\032post-");
printf_unfiltered (async_annotation_suffix);
printf_unfiltered ("\n");
}
if (linebuffer == 0)
{
linelength = 80;
linebuffer = (char *) xmalloc (linelength);
}
p = linebuffer;
if (more_to_come)
{
strcpy (linebuffer, readline_input_state.linebuffer);
p = readline_input_state.linebuffer_ptr;
free (readline_input_state.linebuffer);
more_to_come = 0;
change_prompt = 1;
}
#ifdef STOP_SIGNAL
if (job_control)
signal (STOP_SIGNAL, stop_sig);
#endif
/* Make sure that all output has been output. Some machines may let
you get away with leaving out some of the gdb_flush, but not all. */
wrap_here ("");
gdb_flush (gdb_stdout);
gdb_flush (gdb_stderr);
if (source_file_name != NULL)
{
++source_line_number;
sprintf (source_error,
"%s%s:%d: Error in sourced command file:\n",
source_pre_error,
source_file_name,
source_line_number);
error_pre_print = source_error;
}
/* If we are in this case, then command_handler will call quit
and exit from gdb. */
if (!rl || rl == (char *) EOF)
{
got_eof = 1;
command_handler (0);
}
if (strlen (rl) + 1 + (p - linebuffer) > linelength)
{
linelength = strlen (rl) + 1 + (p - linebuffer);
nline = (char *) xrealloc (linebuffer, linelength);
p += nline - linebuffer;
linebuffer = nline;
}
p1 = rl;
/* Copy line. Don't copy null at end. (Leaves line alone
if this was just a newline) */
while (*p1)
*p++ = *p1++;
free (rl); /* Allocated in readline. */
if (p == linebuffer || *(p - 1) == '\\')
{
/* We come here also if the line entered is empty (just a 'return') */
p--; /* Put on top of '\'. */
if (*p == '\\')
{
readline_input_state.linebuffer = savestring (linebuffer,
strlen (linebuffer));
readline_input_state.linebuffer_ptr = p;
/* We will not invoke a execute_command if there is more
input expected to complete the command. So, we need to
print an empty prompt here. */
display_gdb_prompt ("");
more_to_come = 1;
}
}
#ifdef STOP_SIGNAL
if (job_control)
signal (STOP_SIGNAL, SIG_DFL);
#endif
#define SERVER_COMMAND_LENGTH 7
server_command =
(p - linebuffer > SERVER_COMMAND_LENGTH)
&& STREQN (linebuffer, "server ", SERVER_COMMAND_LENGTH);
if (server_command)
{
/* Note that we don't set `line'. Between this and the check in
dont_repeat, this insures that repeating will still do the
right thing. */
*p = '\0';
command_handler (linebuffer + SERVER_COMMAND_LENGTH);
display_gdb_prompt (0);
return;
}
/* Do history expansion if that is wished. */
if (history_expansion_p && instream == stdin
&& ISATTY (instream))
{
char *history_value;
int expanded;
*p = '\0'; /* Insert null now. */
expanded = history_expand (linebuffer, &history_value);
if (expanded)
{
/* Print the changes. */
printf_unfiltered ("%s\n", history_value);
/* If there was an error, call this function again. */
if (expanded < 0)
{
free (history_value);
return;
}
if (strlen (history_value) > linelength)
{
linelength = strlen (history_value) + 1;
linebuffer = (char *) xrealloc (linebuffer, linelength);
}
strcpy (linebuffer, history_value);
p = linebuffer + strlen (linebuffer);
free (history_value);
}
}
/* If we just got an empty line, and that is supposed
to repeat the previous command, return the value in the
global buffer. */
if (repeat && p == linebuffer && *p != '\\')
{
command_handler (line);
display_gdb_prompt (0);
return;
}
for (p1 = linebuffer; *p1 == ' ' || *p1 == '\t'; p1++);
if (repeat && !*p1)
{
command_handler (line);
display_gdb_prompt (0);
return;
}
*p = 0;
/* Add line to history if appropriate. */
if (instream == stdin
&& ISATTY (stdin) && *linebuffer)
add_history (linebuffer);
/* Note: lines consisting solely of comments are added to the command
history. This is useful when you type a command, and then
realize you don't want to execute it quite yet. You can comment
out the command and then later fetch it from the value history
and remove the '#'. The kill ring is probably better, but some
people are in the habit of commenting things out. */
if (*p1 == '#')
*p1 = '\0'; /* Found a comment. */
/* Save into global buffer if appropriate. */
if (repeat)
{
if (linelength > linesize)
{
line = xrealloc (line, linelength);
linesize = linelength;
}
strcpy (line, linebuffer);
if (!more_to_come)
{
command_handler (line);
display_gdb_prompt (0);
}
return;
}
command_handler (linebuffer);
display_gdb_prompt (0);
return;
}
/* Does reading of input from terminal w/o the editing features
provided by the readline library. */
/* NOTE: 1999-04-30 Asynchronous version of gdb_readline. gdb_readline
will become obsolete when the event loop is made the default
execution for gdb. */
static void
gdb_readline2 ()
{
int c;
char *result;
int input_index = 0;
int result_size = 80;
result = (char *) xmalloc (result_size);
/* We still need the while loop here, even though it would seem
obvious to invoke gdb_readline2 at every character entered. If
not using the readline library, the terminal is in cooked mode,
which sends the characters all at once. Poll will notice that the
input fd has changed state only after enter is pressed. At this
point we still need to fetch all the chars entered. */
while (1)
{
/* Read from stdin if we are executing a user defined command.
This is the right thing for prompt_for_continue, at least. */
c = fgetc (instream ? instream : stdin);
if (c == EOF)
{
if (input_index > 0)
/* The last line does not end with a newline. Return it, and
if we are called again fgetc will still return EOF and
we'll return NULL then. */
break;
free (result);
command_line_handler (0);
}
if (c == '\n')
#ifndef CRLF_SOURCE_FILES
break;
#else
{
if (input_index > 0 && result[input_index - 1] == '\r')
input_index--;
break;
}
#endif
result[input_index++] = c;
while (input_index >= result_size)
{
result_size *= 2;
result = (char *) xrealloc (result, result_size);
}
}
result[input_index++] = '\0';
command_line_handler (result);
}
/* Initialization of signal handlers and tokens. There is a function
handle_sig* for each of the signals GDB cares about. Specifically:
SIGINT, SIGFPE, SIGQUIT, SIGTSTP, SIGHUP, SIGWINCH. These
functions are the actual signal handlers associated to the signals
via calls to signal(). The only job for these functions is to
enqueue the appropriate event/procedure with the event loop. Such
procedures are the old signal handlers. The event loop will take
care of invoking the queued procedures to perform the usual tasks
associated with the reception of the signal. */
/* NOTE: 1999-04-30 This is the asynchronous version of init_signals.
init_signals will become obsolete as we move to have to event loop
as the default for gdb. */
void
async_init_signals ()
{
signal (SIGINT, handle_sigint);
sigint_token =
create_async_signal_handler ((async_handler_func *) async_request_quit, NULL);
/* If SIGTRAP was set to SIG_IGN, then the SIG_IGN will get passed
to the inferior and breakpoints will be ignored. */
#ifdef SIGTRAP
signal (SIGTRAP, SIG_DFL);
#endif
/* If we initialize SIGQUIT to SIG_IGN, then the SIG_IGN will get
passed to the inferior, which we don't want. It would be
possible to do a "signal (SIGQUIT, SIG_DFL)" after we fork, but
on BSD4.3 systems using vfork, that can affect the
GDB process as well as the inferior (the signal handling tables
might be in memory, shared between the two). Since we establish
a handler for SIGQUIT, when we call exec it will set the signal
to SIG_DFL for us. */
signal (SIGQUIT, handle_sigquit);
sigquit_token =
create_async_signal_handler ((async_handler_func *) async_do_nothing, NULL);
#ifdef SIGHUP
if (signal (SIGHUP, handle_sighup) != SIG_IGN)
sighup_token =
create_async_signal_handler ((async_handler_func *) async_disconnect, NULL);
else
sighup_token =
create_async_signal_handler ((async_handler_func *) async_do_nothing, NULL);
#endif
signal (SIGFPE, handle_sigfpe);
sigfpe_token =
create_async_signal_handler ((async_handler_func *) async_float_handler, NULL);
#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
signal (SIGWINCH, handle_sigwinch);
sigwinch_token =
create_async_signal_handler ((async_handler_func *) SIGWINCH_HANDLER, NULL);
#endif
}
/* Tell the event loop what to do if SIGINT is received.
See event-signal.c. */
void
handle_sigint (sig)
int sig;
{
signal (sig, handle_sigint);
/* If immediate_quit is set, we go ahead and process the SIGINT right
away, even if we usually would defer this to the event loop. The
assumption here is that it is safe to process ^C immediately if
immediate_quit is set. If we didn't, SIGINT would be really
processed only the next time through the event loop. To get to
that point, though, the command that we want to interrupt needs to
finish first, which is unacceptable. */
if (immediate_quit)
async_request_quit ();
else
/* If immediate quit is not set, we process SIGINT the next time
through the loop, which is fine. */
mark_async_signal_handler (sigint_token);
}
/* Do the quit. All the checks have been done by the caller. */
void
async_request_quit ()
{
quit_flag = 1;
#ifdef REQUEST_QUIT
REQUEST_QUIT;
#else
quit ();
#endif
}
/* Tell the event loop what to do if SIGQUIT is received.
See event-signal.c. */
void
handle_sigquit (sig)
int sig;
{
mark_async_signal_handler (sigquit_token);
signal (sig, handle_sigquit);
}
/* Called by the event loop in response to a SIGQUIT. */
void
async_do_nothing ()
{
/* Empty function body. */
}
#ifdef SIGHUP
/* Tell the event loop what to do if SIGHUP is received.
See event-signal.c. */
void
handle_sighup (sig)
int sig;
{
mark_async_signal_handler (sighup_token);
signal (sig, handle_sighup);
}
/* Called by the event loop to process a SIGHUP. */
void
async_disconnect ()
{
catch_errors (quit_cover, NULL,
"Could not kill the program being debugged",
RETURN_MASK_ALL);
signal (SIGHUP, SIG_DFL); /*FIXME: ??????????? */
kill (getpid (), SIGHUP);
}
#endif
/* Tell the event loop what to do if SIGFPE is received.
See event-signal.c. */
void
handle_sigfpe (sig)
int sig;
{
mark_async_signal_handler (sigfpe_token);
signal (sig, handle_sigfpe);
}
/* Event loop will call this functin to process a SIGFPE. */
void
async_float_handler ()
{
/* This message is based on ANSI C, section 4.7. Note that integer
divide by zero causes this, so "float" is a misnomer. */
error ("Erroneous arithmetic operation.");
}
/* Tell the event loop what to do if SIGWINCH is received.
See event-signal.c. */
#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
void
handle_sigwinch (sig)
int sig;
{
mark_async_signal_handler (sigwinch_token);
signal (sig, handle_sigwinch);
}
#endif
/* Called by do_setshow_command. */
/* ARGSUSED */
void
set_async_editing_command (args, from_tty, c)
char *args;
int from_tty;
struct cmd_list_element *c;
{
change_line_handler ();
}
/* Called by do_setshow_command. */
/* ARGSUSED */
void
set_async_annotation_level (args, from_tty, c)
char *args;
int from_tty;
struct cmd_list_element *c;
{
change_annotation_level ();
}
/* Called by do_setshow_command. */
/* ARGSUSED */
void
set_async_prompt (args, from_tty, c)
char *args;
int from_tty;
struct cmd_list_element *c;
{
PROMPT (0) = savestring (new_async_prompt, strlen (new_async_prompt));
}

View File

@@ -66,6 +66,7 @@ typedef struct saved_bf_symnum SAVED_BF, *SAVED_BF_PTR;
/* Local functions */
extern void _initialize_f_language PARAMS ((void));
#if 0
static void clear_function_list PARAMS ((void));
static long get_bf_for_fcn PARAMS ((long));

View File

@@ -37,6 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static int there_is_a_visible_common_named PARAMS ((char *));
#endif
extern void _initialize_f_valprint PARAMS ((void));
static void info_common_command PARAMS ((char *, int));
static void list_all_visible_commons PARAMS ((char *));
static void f77_print_array PARAMS ((struct type *, char *, CORE_ADDR,

View File

@@ -595,21 +595,18 @@ value_of_register (regnum)
/* Convert raw data to virtual format if necessary. */
#ifdef REGISTER_CONVERTIBLE
if (REGISTER_CONVERTIBLE (regnum))
{
REGISTER_CONVERT_TO_VIRTUAL (regnum, REGISTER_VIRTUAL_TYPE (regnum),
raw_buffer, VALUE_CONTENTS_RAW (reg_val));
}
else if (REGISTER_RAW_SIZE (regnum) == REGISTER_VIRTUAL_SIZE (regnum))
memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer,
REGISTER_RAW_SIZE (regnum));
else
#endif
if (REGISTER_RAW_SIZE (regnum) == REGISTER_VIRTUAL_SIZE (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));
fatal ("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;
@@ -1553,14 +1550,12 @@ value_from_register (type, regnum, frame)
/* Convert raw data to virtual format if necessary. */
#ifdef REGISTER_CONVERTIBLE
if (REGISTER_CONVERTIBLE (regnum))
{
REGISTER_CONVERT_TO_VIRTUAL (regnum, type,
raw_buffer, VALUE_CONTENTS_RAW (v));
}
else
#endif
{
/* Raw and virtual formats are the same for this register. */

View File

@@ -28,6 +28,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "gdbcore.h"
#include "symfile.h"
/* An expression that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. */
int
fr30_frameless_function_invocation (fi)
struct frame_info *fi;
{
int frameless;
CORE_ADDR func_start, after_prologue;
func_start = (get_pc_function_start ((fi)->pc) +
FUNCTION_START_OFFSET);
after_prologue = func_start;
after_prologue = SKIP_PROLOGUE (after_prologue);
frameless = (after_prologue == func_start);
return frameless;
}
/* Function: pop_frame
This routine gets called when either the user uses the `return'
command, or the call dummy breakpoint gets hit. */

View File

@@ -37,10 +37,6 @@ extern char *strchr PARAMS ((const char *, int)); /* X3.159-1989 4.11.5.2 */
extern char *strrchr PARAMS ((const char *, int)); /* X3.159-1989 4.11.5.5 */
#endif
#ifndef strstr
extern char *strstr PARAMS ((const char *, const char *)); /* X3.159-1989 4.11.5.7 */
#endif
#ifndef strtok
extern char *strtok PARAMS ((char *, const char *)); /* X3.159-1989 4.11.5.8 */
#endif
@@ -65,4 +61,10 @@ extern char *strerror PARAMS ((int)); /* X3.159-1989 4.11.6.2 */
extern char *strdup (); /* full prototype collides w/ some OSes (AIX 3.2.5) */
#endif
#ifdef NEED_DECLARATION_STRSTR
#ifndef strstr
extern char *strstr PARAMS ((const char *, const char *)); /* X3.159-1989 4.11.5.7 */
#endif
#endif
#endif /* !defined(GDB_STRING_H) */

View File

@@ -1,5 +1,5 @@
/* Semi-dynamic architecture support for GDB, the GNU debugger.
Copyright 1998, Free Software Foundation, Inc.
Copyright 1998-1999, Free Software Foundation, Inc.
This file is part of GDB.
@@ -196,27 +196,37 @@ const struct bfd_arch_info *target_architecture = &bfd_default_arch_struct;
int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *ap));
/* Do the real work of changing the current architecture */
static int arch_ok PARAMS ((const struct bfd_arch_info *arch));
static int
arch_ok (arch)
const struct bfd_arch_info *arch;
{
/* Should be performing the more basic check that the binary is
compatible with GDB. */
/* Check with the target that the architecture is valid. */
return (target_architecture_hook == NULL
|| target_architecture_hook (arch));
}
enum set_arch { set_arch_auto, set_arch_manual };
static void set_arch PARAMS ((const struct bfd_arch_info *arch, enum set_arch type));
static void
set_arch (arch, type)
const struct bfd_arch_info *arch;
enum set_arch type;
{
/* FIXME: Should be performing the more basic check that the binary
is compatible with GDB. */
/* Check with the target that the architecture is valid. */
int arch_valid = (target_architecture_hook != NULL
&& !target_architecture_hook (arch));
switch (type)
{
case set_arch_auto:
if (!arch_valid)
if (!arch_ok (arch))
warning ("Target may not support %s architecture",
arch->printable_name);
target_architecture = arch;
break;
case set_arch_manual:
if (!arch_valid)
if (!arch_ok (arch))
{
printf_unfiltered ("Target does not support `%s' architecture.\n",
arch->printable_name);

View File

@@ -1,5 +1,5 @@
/* Architecture commands for GDB, the GNU debugger.
Copyright 1998, Free Software Foundation, Inc.
Copyright 1998-1999, Free Software Foundation, Inc.
This file is part of GDB.
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* The target-system-dependant byte order is dynamic */
/* TARGET_BYTE_ORDER_SELECTABLE_P determines if the target endianness
is selectable at runtime. The user can use the `set endian'
is selectable at runtime. The user can use the ``set endian''
command to change it. TARGET_BYTE_ORDER_AUTO is nonzero when
target_byte_order should be auto-detected (from the program image
say). */
@@ -111,8 +111,23 @@ extern disassemble_info tm_print_insn_info;
#endif
/* Fallback definition of FRAMELESS_FUNCTION_INVOCATION */
#ifndef FRAMELESS_FUNCTION_INVOCATION
#define FRAMELESS_FUNCTION_INVOCATION(FI) (0)
#endif
/* Fallback definition of REGISTER_CONVERTIBLE etc */
#ifndef REGISTER_CONVERTIBLE
#define REGISTER_CONVERTIBLE(x) (0)
#endif
#ifndef REGISTER_CONVERT_TO_VIRTUAL
#define REGISTER_CONVERT_TO_VIRTUAL(x, y, z, a)
#endif
#ifndef REGISTER_CONVERT_TO_RAW
#define REGISTER_CONVERT_TO_RAW(x, y, z, a)
#endif
/* Set the dynamic target-system-dependant parameters (architecture,
byte-order, ...) using information found in the BFD */

View File

@@ -105,7 +105,8 @@ execute_command PARAMS ((char *, int));
enum command_control_type
execute_control_command PARAMS ((struct command_line *));
void print_command_line PARAMS ((struct command_line *, unsigned int));
extern void
print_command_line PARAMS ((struct command_line *, unsigned int, GDB_FILE *));
extern char **noop_completer PARAMS ((char *, char *));

View File

@@ -2004,6 +2004,10 @@ gnu_attach (args, from_tty)
attach_flag = 1;
push_target (&gnu_ops);
/* We have to initialize the terminal settings now, since the code
below might try to restore them. */
target_terminal_init ();
inf_update_signal_thread (inf);
inf_set_traced (inf, inf->want_signals);

View File

@@ -29,12 +29,72 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "command.h"
#include "floatformat.h"
#include <stdio.h> /* required for __DJGPP_MINOR__ */
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <debug/v2load.h>
#include <debug/dbgcom.h>
#if __DJGPP_MINOR__ < 3
/* This code will be provided from DJGPP 2.03 on. Until then I code it
here */
typedef struct {
unsigned short sig0;
unsigned short sig1;
unsigned short sig2;
unsigned short sig3;
unsigned short exponent:15;
unsigned short sign:1;
} NPXREG;
typedef struct {
unsigned int control;
unsigned int status;
unsigned int tag;
unsigned int eip;
unsigned int cs;
unsigned int dataptr;
unsigned int datasel;
NPXREG reg[8];
} NPX;
static NPX npx;
static void save_npx (void); /* Save the FPU of the debugged program */
static void load_npx (void); /* Restore the FPU of the debugged program */
/* ------------------------------------------------------------------------- */
/* Store the contents of the NPX in the global variable `npx'. */
static void
save_npx (void)
{
asm ("inb $0xa0, %%al
testb $0x20, %%al
jz 1f
xorb %%al, %%al
outb %%al, $0xf0
movb $0x20, %%al
outb %%al, $0xa0
outb %%al, $0x20
1:
fnsave %0
fwait"
: "=m" (npx)
: /* No input */
: "%eax");
}
/* ------------------------------------------------------------------------- */
/* Reload the contents of the NPX from the global variable `npx'. */
static void
load_npx (void)
{
asm ("frstor %0" : "=m" (npx));
}
#endif /* __DJGPP_MINOR < 3 */
extern void _initialize_go32_nat (void);
struct env387
@@ -58,9 +118,54 @@ extern char **environ;
#define SOME_PID 42
/* FIXME add decls of all static functions here */
static int prog_has_started = 0;
static void
print_387_status (unsigned short status, struct env387 *ep);
static void
go32_open (char *name, int from_tty);
static void
go32_close (int quitting);
static void
go32_attach (char *args, int from_tty);
static void
go32_detach (char *args, int from_tty);
static void
go32_resume (int pid, int step, enum target_signal siggnal);
static int
go32_wait (int pid, struct target_waitstatus *status);
static void
go32_fetch_registers (int regno);
static void
store_register (int regno);
static void
go32_store_registers (int regno);
static void
go32_prepare_to_store (void);
static int
go32_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
struct target_ops *target);
static void
go32_files_info (struct target_ops *target);
static void
go32_stop (void);
static void
go32_kill_inferior (void);
static void
go32_create_inferior (char *exec_file, char *args, char **env);
static void
go32_mourn_inferior (void);
static int
go32_can_run (void);
static void
ignore (void);
static void
ignore2 (char *a, int b);
static int go32_insert_aligned_watchpoint (int pid, CORE_ADDR waddr,
CORE_ADDR addr, int len, int rw);
static int go32_insert_nonaligned_watchpoint (int pid, CORE_ADDR waddr,
CORE_ADDR addr, int len, int rw);
static struct target_ops go32_ops;
static void
print_387_status (unsigned short status, struct env387 *ep)
@@ -245,7 +350,13 @@ go32_wait (int pid, struct target_waitstatus *status)
else
a_tss.tss_eflags &= 0xfeff;
#if __DJGPP_MINOR__ < 3
save_npx ();
#endif
run_child ();
#if __DJGPP_MINOR__ < 3
load_npx ();
#endif
if (a_tss.tss_irqn == 0x21)
{
@@ -388,7 +499,6 @@ go32_stop (void)
static void
go32_kill_inferior (void)
{
go32_stop ();
unpush_target (&go32_ops);
}
@@ -401,6 +511,7 @@ go32_create_inferior (char *exec_file, char *args, char **env)
if (prog_has_started)
{
go32_stop ();
go32_kill_inferior ();
}
@@ -426,6 +537,7 @@ go32_create_inferior (char *exec_file, char *args, char **env)
clear_proceed_status ();
insert_breakpoints ();
proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_0, 0);
prog_has_started = 1;
}
static void
@@ -522,12 +634,6 @@ do { \
#define SHOW_DR(text) do {} while (0)
#endif
static int go32_insert_aligned_watchpoint (int pid, CORE_ADDR waddr,
CORE_ADDR addr, int len, int rw);
static int go32_insert_nonaligned_watchpoint (int pid, CORE_ADDR waddr,
CORE_ADDR addr, int len, int rw);
/* Insert a watchpoint. */
int
@@ -706,8 +812,6 @@ go32_insert_hw_breakpoint (CORE_ADDR addr, CORE_ADDR shadow)
return 0;
}
static struct target_ops go32_ops;
static void
init_go32_ops (void)
{

View File

@@ -3513,7 +3513,7 @@ after_prologue (pc)
stuff some day. */
CORE_ADDR
skip_prologue (pc)
hppa_skip_prologue (pc)
CORE_ADDR pc;
{
unsigned long inst;

View File

@@ -1,5 +1,5 @@
/* Native support code for HPUX PA-RISC.
Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1998
Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1998, 1999
Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
@@ -66,24 +66,24 @@ store_inferior_registers (regno)
regaddr = register_addr (regno, offset);
errno = 0;
if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM)
{
scratch = *(int *) &registers[REGISTER_BYTE (regno)] | 0x3;
call_ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
scratch);
if (errno != 0)
{
{
scratch = *(int *) &registers[REGISTER_BYTE (regno)] | 0x3;
call_ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
scratch);
if (errno != 0)
{
/* Error, even if attached. Failing to write these two
registers is pretty serious. */
sprintf (buf, "writing register number %d", regno);
perror_with_name (buf);
}
}
sprintf (buf, "writing register number %d", regno);
perror_with_name (buf);
}
}
else
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int))
{
errno = 0;
call_ptrace (PT_WUREGS, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
*(int *) &registers[REGISTER_BYTE (regno) + i]);
*(int *) &registers[REGISTER_BYTE (regno) + i]);
if (errno != 0)
{
/* Warning, not error, in case we are attached; sometimes the
@@ -123,13 +123,12 @@ fetch_register (regno)
{
errno = 0;
*(int *) &buf[i] = call_ptrace (PT_RUREGS, inferior_pid,
(PTRACE_ARG3_TYPE) regaddr, 0);
(PTRACE_ARG3_TYPE) regaddr, 0);
regaddr += sizeof (int);
if (errno != 0)
{
/* Warning, not error, in case we are attached; sometimes the
* kernel doesn't let us at the registers.
*/
kernel doesn't let us at the registers. */
char *err = safe_strerror (errno);
char *msg = alloca (strlen (err) + 128);
sprintf (msg, "reading register %s: %s", REGISTER_NAME (regno), err);
@@ -167,77 +166,75 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
register int count
= (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
/* Allocate buffer of that many longwords. */
/* Note (RT) - This code formerly used alloca, which I have
* replaced with xmalloc and a matching free() at the end.
* The problem with alloca() is that there is no guarantee of
* when it'll be freed, and we were seeing cases of memory
* leaks on:
* (gdb) watch x
* (gdb) cont
* where the piled-up alloca's for the child_xfer_memory buffers
* were not getting freed.
*/
/* Allocate buffer of that many longwords.
Note -- do not use alloca to allocate this buffer since there is no
guarantee of when the buffer will actually be deallocated.
This routine can be called over and over with the same call chain;
this (in effect) would pile up all those alloca requests until a call
to alloca was made from a point higher than this routine in the
call chain. */
register int *buffer = (int *) xmalloc (count * sizeof (int));
if (write)
{
/* Fill start and end extra bytes of buffer with existing memory data. */
if (addr != memaddr || len < (int)sizeof (int)) {
/* Need part of initial word -- fetch it. */
buffer[0] = call_ptrace (addr < text_end ? PT_RIUSER : PT_RDUSER,
inferior_pid, (PTRACE_ARG3_TYPE) addr, 0);
}
if (addr != memaddr || len < (int)sizeof (int))
{
/* Need part of initial word -- fetch it. */
buffer[0] = call_ptrace (addr < text_end ? PT_RIUSER : PT_RDUSER,
inferior_pid, (PTRACE_ARG3_TYPE) addr, 0);
}
if (count > 1) /* FIXME, avoid if even boundary */
{
buffer[count - 1]
= call_ptrace (addr < text_end ? PT_RIUSER : PT_RDUSER, inferior_pid,
(PTRACE_ARG3_TYPE) (addr + (count - 1) * sizeof (int)),
0);
= call_ptrace (addr < text_end ? PT_RIUSER : PT_RDUSER,
inferior_pid,
(PTRACE_ARG3_TYPE) (addr
+ (count - 1) * sizeof (int)),
0);
}
/* Copy data to be written over corresponding part of buffer */
memcpy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len);
/* Write the entire buffer. */
for (i = 0; i < count; i++, addr += sizeof (int))
{
int pt_status;
int pt_request;
/* The HP-UX kernel crashes if you use PT_WDUSER to write into the text
segment. FIXME -- does it work to write into the data segment using
WIUSER, or do these idiots really expect us to figure out which segment
the address is in, so we can use a separate system call for it??! */
int pt_status;
int pt_request;
/* The HP-UX kernel crashes if you use PT_WDUSER to write into the
text segment. FIXME -- does it work to write into the data
segment using WIUSER, or do these idiots really expect us to
figure out which segment the address is in, so we can use a
separate system call for it??! */
errno = 0;
pt_request = (addr < text_end) ? PT_WIUSER : PT_WDUSER;
pt_request = (addr < text_end) ? PT_WIUSER : PT_WDUSER;
pt_status = call_ptrace (pt_request,
inferior_pid,
(PTRACE_ARG3_TYPE) addr,
buffer[i]);
inferior_pid,
(PTRACE_ARG3_TYPE) addr,
buffer[i]);
/* Did we fail? Might we've guessed wrong about which
segment this address resides in? Try the other request,
and see if that works...
*/
if ((pt_status == -1) && errno) {
errno = 0;
pt_request = (pt_request == PT_WIUSER) ? PT_WDUSER : PT_WIUSER;
pt_status = call_ptrace (pt_request,
inferior_pid,
(PTRACE_ARG3_TYPE) addr,
buffer[i]);
/* Did we fail? Might we've guessed wrong about which
segment this address resides in? Try the other request,
and see if that works... */
if ((pt_status == -1) && errno)
{
errno = 0;
pt_request = (pt_request == PT_WIUSER) ? PT_WDUSER : PT_WIUSER;
pt_status = call_ptrace (pt_request,
inferior_pid,
(PTRACE_ARG3_TYPE) addr,
buffer[i]);
/* No, we still fail. Okay, time to punt. */
if ((pt_status == -1) && errno)
{
free(buffer);
return 0;
}
}
/* No, we still fail. Okay, time to punt. */
if ((pt_status == -1) && errno)
{
free(buffer);
return 0;
}
}
}
}
else
@@ -247,11 +244,12 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
{
errno = 0;
buffer[i] = call_ptrace (addr < text_end ? PT_RIUSER : PT_RDUSER,
inferior_pid, (PTRACE_ARG3_TYPE) addr, 0);
if (errno) {
free(buffer);
return 0;
}
inferior_pid, (PTRACE_ARG3_TYPE) addr, 0);
if (errno)
{
free(buffer);
return 0;
}
QUIT;
}
@@ -266,7 +264,7 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
void
child_post_follow_inferior_by_clone ()
{
int status;
int status;
/* This function is used when following both the parent and child
of a fork. In this case, the debugger clones itself. The original
@@ -283,12 +281,11 @@ child_post_follow_inferior_by_clone ()
void
child_post_follow_vfork (parent_pid, followed_parent, child_pid, followed_child)
int parent_pid;
int followed_parent;
int child_pid;
int followed_child;
int parent_pid;
int followed_parent;
int child_pid;
int followed_child;
{
/* Are we a debugger that followed the parent of a vfork? If so,
then recall that the child's vfork event was delivered to us
first. And, that the parent was suspended by the OS until the
@@ -312,48 +309,46 @@ child_post_follow_vfork (parent_pid, followed_parent, child_pid, followed_child)
/* Are we a debugger that followed the child of a vfork? If so,
then recall that we don't actually acquire control of the child
until after it has exec'd or exited.
*/
until after it has exec'd or exited. */
if (followed_child)
{
/* If the child has exited, then there's nothing for us to do.
In the case of an exec event, we'll let that be handled by
the normal mechanism that notices and handles exec events, in
resume(). */
In the case of an exec event, we'll let that be handled by
the normal mechanism that notices and handles exec events, in
resume(). */
}
}
/* Format a process id, given a pid. Be sure to terminate
* this with a null--it's going to be printed via a "%s".
*/
/* Format a process id, given PID. Be sure to terminate
this with a null--it's going to be printed via a "%s". */
char *
hppa_pid_to_str( pid )
hppa_pid_to_str (pid)
pid_t pid;
{
static char buf[30]; /* Static because address returned */
/* Static because address returned */
static char buf[30];
sprintf( buf, "process %d\0\0\0\0", pid );
/* Extra NULLs for paranoia's sake */
/* Extra NULLs for paranoia's sake */
sprintf (buf, "process %d\0\0\0\0", pid);
return buf;
}
/* Format a thread id, given a tid. Be sure to terminate
* this with a null--it's going to be printed via a "%s".
*
* Note: This is a core-gdb tid, not the actual system tid.
* See infttrace.c for details.
*/
/* Format a thread id, given TID. Be sure to terminate
this with a null--it's going to be printed via a "%s".
Note: This is a core-gdb tid, not the actual system tid.
See infttrace.c for details. */
char *
hppa_tid_to_str( tid )
hppa_tid_to_str (tid)
pid_t tid;
{
static char buf[30]; /* Static because address returned */
/* Static because address returned */
static char buf[30];
sprintf( buf, "system thread %d\0\0\0\0", tid );
/* Extra NULLs for paranoia's sake */
/* Extra NULLs for paranoia's sake */
sprintf (buf, "system thread %d\0\0\0\0", tid);
return buf;
}
@@ -420,13 +415,13 @@ parent_attach_all (pid, addr, data)
/* Notify the parent that we're potentially ready to exec(). */
write (startup_semaphore.child_channel[SEM_TALK],
&tc_magic_child,
sizeof (tc_magic_child));
&tc_magic_child,
sizeof (tc_magic_child));
/* Wait for acknowledgement from the parent. */
read (startup_semaphore.parent_channel[SEM_LISTEN],
&tc_magic_parent,
sizeof (tc_magic_parent));
&tc_magic_parent,
sizeof (tc_magic_parent));
if (tc_magic_child != tc_magic_parent)
warning ("mismatched semaphore magic");
@@ -446,8 +441,8 @@ hppa_require_attach (pid)
int pid;
{
int pt_status;
CORE_ADDR pc;
CORE_ADDR pc_addr;
CORE_ADDR pc;
CORE_ADDR pc_addr;
unsigned int regs_offset;
/* Are we already attached? There appears to be no explicit way to
@@ -466,7 +461,7 @@ hppa_require_attach (pid)
pt_status = call_ptrace (PT_ATTACH, pid, (PTRACE_ARG3_TYPE) 0, 0);
if (errno)
return -1;
return -1;
/* Now we really are attached. */
errno = 0;
@@ -580,7 +575,7 @@ hppa_resume_execd_vforking_child_to_get_parent_vfork ()
void
require_notification_of_events (pid)
int pid;
int pid;
{
#if defined(PT_SET_EVENT_MASK)
int pt_status;
@@ -589,15 +584,13 @@ require_notification_of_events (pid)
/* Instruct the kernel as to the set of events we wish to be
informed of. (This support does not exist before HPUX 10.0.
We'll assume if PT_SET_EVENT_MASK has not been defined by
<sys/ptrace.h>, then we're being built on pre-10.0.)
*/
<sys/ptrace.h>, then we're being built on pre-10.0.) */
memset (&ptrace_events, 0, sizeof (ptrace_events));
/* Note: By default, all signals are visible to us. If we wish
the kernel to keep certain signals hidden from us, we do it
by calling sigdelset (ptrace_events.pe_signals, signal) for
each such signal here, before doing PT_SET_EVENT_MASK.
*/
each such signal here, before doing PT_SET_EVENT_MASK. */
sigemptyset (&ptrace_events.pe_signals);
ptrace_events.pe_set_event = 0;
@@ -612,9 +605,9 @@ require_notification_of_events (pid)
errno = 0;
pt_status = call_ptrace (PT_SET_EVENT_MASK,
pid,
(PTRACE_ARG3_TYPE) &ptrace_events,
sizeof (ptrace_events));
pid,
(PTRACE_ARG3_TYPE) &ptrace_events,
sizeof (ptrace_events));
if (errno)
perror_with_name ("ptrace");
if (pt_status < 0)
@@ -624,7 +617,7 @@ require_notification_of_events (pid)
void
require_notification_of_exec_events (pid)
int pid;
int pid;
{
#if defined(PT_SET_EVENT_MASK)
int pt_status;
@@ -633,15 +626,13 @@ require_notification_of_exec_events (pid)
/* Instruct the kernel as to the set of events we wish to be
informed of. (This support does not exist before HPUX 10.0.
We'll assume if PT_SET_EVENT_MASK has not been defined by
<sys/ptrace.h>, then we're being built on pre-10.0.)
*/
<sys/ptrace.h>, then we're being built on pre-10.0.) */
memset (&ptrace_events, 0, sizeof (ptrace_events));
/* Note: By default, all signals are visible to us. If we wish
the kernel to keep certain signals hidden from us, we do it
by calling sigdelset (ptrace_events.pe_signals, signal) for
each such signal here, before doing PT_SET_EVENT_MASK.
*/
each such signal here, before doing PT_SET_EVENT_MASK. */
sigemptyset (&ptrace_events.pe_signals);
ptrace_events.pe_set_event = 0;
@@ -653,9 +644,9 @@ require_notification_of_exec_events (pid)
errno = 0;
pt_status = call_ptrace (PT_SET_EVENT_MASK,
pid,
(PTRACE_ARG3_TYPE) &ptrace_events,
sizeof (ptrace_events));
pid,
(PTRACE_ARG3_TYPE) &ptrace_events,
sizeof (ptrace_events));
if (errno)
perror_with_name ("ptrace");
if (pt_status < 0)
@@ -668,26 +659,29 @@ require_notification_of_exec_events (pid)
void
child_acknowledge_created_inferior (pid)
int pid;
int pid;
{
/* We need a memory home for a constant. */
int tc_magic_parent = PT_VERSION;
int tc_magic_child = 0;
/* The remainder of this function is only useful for HPUX 10.0 and
later, as it depends upon the ability to request notification
of specific kinds of events by the kernel. */
#if defined(PT_SET_EVENT_MASK)
/* Wait for the child to tell us that it has forked. */
read (startup_semaphore.child_channel[SEM_LISTEN],
&tc_magic_child,
sizeof(tc_magic_child));
&tc_magic_child,
sizeof(tc_magic_child));
/* Notify the child that it can exec.
In the infttrace.c variant of this function, we set the child's
event mask after the fork but before the exec. In the ptrace
world, it seems we can't set the event mask until after the exec. */
write (startup_semaphore.parent_channel[SEM_TALK],
&tc_magic_parent,
sizeof (tc_magic_parent));
&tc_magic_parent,
sizeof (tc_magic_parent));
/* We'd better pause a bit before trying to set the event mask,
though, to ensure that the exec has happened. We don't want to
@@ -697,12 +691,10 @@ child_acknowledge_created_inferior (pid)
After an exec, the child is no longer executing gdb code. Hence,
we can't have yet another synchronization via the pipes. We'll
just sleep for a second, and hope that's enough delay... */
sleep (1);
/* Instruct the kernel as to the set of events we wish to be
informed of. */
require_notification_of_exec_events (pid);
/* Discard our copy of the semaphore. */
@@ -710,26 +702,26 @@ child_acknowledge_created_inferior (pid)
(void) close (startup_semaphore.parent_channel[SEM_TALK]);
(void) close (startup_semaphore.child_channel[SEM_LISTEN]);
(void) close (startup_semaphore.child_channel[SEM_TALK]);
#endif
}
void
child_post_startup_inferior (pid)
int pid;
int pid;
{
require_notification_of_events (pid);
}
void
child_post_attach (pid)
int pid;
int pid;
{
require_notification_of_events (pid);
}
int
child_insert_fork_catchpoint (pid)
int pid;
int pid;
{
/* This request is only available on HPUX 10.0 and later. */
#if !defined(PT_SET_EVENT_MASK)
@@ -737,15 +729,14 @@ child_insert_fork_catchpoint (pid)
#else
/* Enable reporting of fork events from the kernel. */
/* ??rehrauer: For the moment, we're always enabling these events,
and just ignoring them if there's no catchpoint to catch them.
*/
and just ignoring them if there's no catchpoint to catch them. */
return 0;
#endif
}
int
child_remove_fork_catchpoint (pid)
int pid;
int pid;
{
/* This request is only available on HPUX 10.0 and later. */
#if !defined(PT_SET_EVENT_MASK)
@@ -760,7 +751,7 @@ child_remove_fork_catchpoint (pid)
int
child_insert_vfork_catchpoint (pid)
int pid;
int pid;
{
/* This request is only available on HPUX 10.0 and later. */
#if !defined(PT_SET_EVENT_MASK)
@@ -775,7 +766,7 @@ child_insert_vfork_catchpoint (pid)
int
child_remove_vfork_catchpoint (pid)
int pid;
int pid;
{
/* This request is only available on HPUX 10.0 and later. */
#if !defined(PT_SET_EVENT_MASK)
@@ -790,8 +781,8 @@ child_remove_vfork_catchpoint (pid)
int
child_has_forked (pid, childpid)
int pid;
int * childpid;
int pid;
int *childpid;
{
/* This request is only available on HPUX 10.0 and later. */
#if !defined(PT_GET_PROCESS_STATE)
@@ -803,9 +794,9 @@ child_has_forked (pid, childpid)
errno = 0;
pt_status = call_ptrace (PT_GET_PROCESS_STATE,
pid,
(PTRACE_ARG3_TYPE) &ptrace_state,
sizeof (ptrace_state));
pid,
(PTRACE_ARG3_TYPE) &ptrace_state,
sizeof (ptrace_state));
if (errno)
perror_with_name ("ptrace");
if (pt_status < 0)
@@ -823,8 +814,8 @@ child_has_forked (pid, childpid)
int
child_has_vforked (pid, childpid)
int pid;
int * childpid;
int pid;
int *childpid;
{
/* This request is only available on HPUX 10.0 and later. */
#if !defined(PT_GET_PROCESS_STATE)
@@ -837,9 +828,9 @@ child_has_vforked (pid, childpid)
errno = 0;
pt_status = call_ptrace (PT_GET_PROCESS_STATE,
pid,
(PTRACE_ARG3_TYPE) &ptrace_state,
sizeof (ptrace_state));
pid,
(PTRACE_ARG3_TYPE) &ptrace_state,
sizeof (ptrace_state));
if (errno)
perror_with_name ("ptrace");
if (pt_status < 0)
@@ -864,48 +855,42 @@ child_can_follow_vfork_prior_to_exec ()
int
child_insert_exec_catchpoint (pid)
int pid;
int pid;
{
/* This request is only available on HPUX 10.0 and later.
*/
/* This request is only available on HPUX 10.0 and later. */
#if !defined(PT_SET_EVENT_MASK)
error ("Unable to catch execs prior to HPUX 10.0");
#else
/* Enable reporting of exec events from the kernel. */
/* Enable reporting of exec events from the kernel. */
/* ??rehrauer: For the moment, we're always enabling these events,
and just ignoring them if there's no catchpoint to catch them.
*/
and just ignoring them if there's no catchpoint to catch them. */
return 0;
#endif
}
int
child_remove_exec_catchpoint (pid)
int pid;
int pid;
{
/* This request is only available on HPUX 10.0 and later.
*/
/* This request is only available on HPUX 10.0 and later. */
#if !defined(PT_SET_EVENT_MASK)
error ("Unable to catch execs prior to HPUX 10.0");
#else
/* Disable reporting of exec events from the kernel. */
/* ??rehrauer: For the moment, we're always enabling these events,
and just ignoring them if there's no catchpoint to catch them.
*/
and just ignoring them if there's no catchpoint to catch them. */
return 0;
#endif
}
int
child_has_execd (pid, execd_pathname)
int pid;
char ** execd_pathname;
int pid;
char **execd_pathname;
{
/* This request is only available on HPUX 10.0 and later.
*/
/* This request is only available on HPUX 10.0 and later. */
#if !defined(PT_GET_PROCESS_STATE)
*execd_pathname = NULL;
return 0;
@@ -916,9 +901,9 @@ child_has_execd (pid, execd_pathname)
errno = 0;
pt_status = call_ptrace (PT_GET_PROCESS_STATE,
pid,
(PTRACE_ARG3_TYPE) &ptrace_state,
sizeof (ptrace_state));
pid,
(PTRACE_ARG3_TYPE) &ptrace_state,
sizeof (ptrace_state));
if (errno)
perror_with_name ("ptrace");
if (pt_status < 0)
@@ -957,23 +942,23 @@ child_has_syscall_event (pid, kind, syscall_id)
char *
child_pid_to_exec_file (pid)
int pid;
int pid;
{
static char exec_file_buffer[1024];
static char exec_file_buffer[1024];
int pt_status;
CORE_ADDR top_of_stack;
char four_chars[4];
CORE_ADDR top_of_stack;
char four_chars[4];
int name_index;
int i;
int saved_inferior_pid;
boolean done;
boolean done;
#ifdef PT_GET_PROCESS_PATHNAME
/* As of 10.x HP-UX, there's an explicit request to get the pathname. */
pt_status = call_ptrace (PT_GET_PROCESS_PATHNAME,
pid,
(PTRACE_ARG3_TYPE) exec_file_buffer,
sizeof (exec_file_buffer) - 1);
pid,
(PTRACE_ARG3_TYPE) exec_file_buffer,
sizeof (exec_file_buffer) - 1);
if (pt_status == 0)
return exec_file_buffer;
#endif

View File

@@ -620,7 +620,7 @@ init_hpux_thread_ops ()
hpux_thread_ops.to_mourn_inferior = hpux_thread_mourn_inferior;
hpux_thread_ops.to_can_run = hpux_thread_can_run;
hpux_thread_ops.to_notice_signals = hpux_thread_notice_signals;
hpux_thread_ops.to_thread_alive = hpux_thread_thread_alive;
hpux_thread_ops.to_thread_alive = hpux_thread_alive;
hpux_thread_ops.to_stop = hpux_thread_stop;
hpux_thread_ops.to_stratum = process_stratum;
hpux_thread_ops.to_has_all_memory = 1;

View File

@@ -365,7 +365,7 @@ i386_frame_num_args (fi)
int frameless;
FRAMELESS_FUNCTION_INVOCATION (fi, frameless);
frameless = FRAMELESS_FUNCTION_INVOCATION (fi);
if (frameless)
/* In the absence of a frame pointer, GDB doesn't get correct values
for nameless arguments. Return -1, so it doesn't print any

View File

@@ -312,7 +312,7 @@ examine_prologue (ip, limit, frame_addr, fsr)
prologue. */
CORE_ADDR
skip_prologue (ip)
i960_skip_prologue (ip)
CORE_ADDR (ip);
{
struct frame_saved_regs saved_regs_dummy;

View File

@@ -90,6 +90,10 @@ static void step_command PARAMS ((char *, int));
static void run_command PARAMS ((char *, int));
static void run_no_args_command PARAMS ((char *args, int from_tty));
static void go_command PARAMS ((char *line_no, int from_tty));
void _initialize_infcmd PARAMS ((void));
#define GO_USAGE "Usage: go <location>\n"
@@ -503,16 +507,16 @@ jump_command (arg, from_tty)
/* Go to line or address in current procedure */
static void
go_command(line_no, from_tty)
go_command (line_no, from_tty)
char *line_no;
int from_tty;
{
if (line_no == (char *)NULL || !*line_no)
printf_filtered(GO_USAGE);
printf_filtered (GO_USAGE);
else
{
tbreak_command(line_no, from_tty);
jump_command(line_no, from_tty);
tbreak_command (line_no, from_tty);
jump_command (line_no, from_tty);
}
}
@@ -1098,16 +1102,16 @@ do_registers_info (regnum, fpregs)
}
/* Convert raw data to virtual format if necessary. */
#ifdef REGISTER_CONVERTIBLE
if (REGISTER_CONVERTIBLE (i))
{
REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i),
raw_buffer, virtual_buffer);
}
else
#endif
memcpy (virtual_buffer, raw_buffer,
REGISTER_VIRTUAL_SIZE (i));
{
memcpy (virtual_buffer, raw_buffer,
REGISTER_VIRTUAL_SIZE (i));
}
/* If virtual format is floating, print it that way, and in raw hex. */
if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
@@ -1164,8 +1168,6 @@ do_registers_info (regnum, fpregs)
}
#endif /* no DO_REGISTERS_INFO. */
extern int target_map_name_to_register PARAMS ((char *, int));
void
registers_info (addr_exp, fpregs)
char *addr_exp;
@@ -1496,15 +1498,17 @@ Execution will also stop upon exit from the current stack frame.");
Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\
for an address to start at.");
add_com ("go", class_run, go_command,
"Usage: go <location>\n\
if (xdb_commands)
add_com ("go", class_run, go_command,
"Usage: go <location>\n\
Continue program being debugged, stopping at specified line or \n\
address.\n\
Give as argument either LINENUM or *ADDR, where ADDR is an \n\
expression for an address to start at.\n\
This command is a combination of tbreak and jump.");
if (xdb_commands)
add_com_alias("g", "g", class_run, 1);
add_com_alias("g", "go", class_run, 1);
add_com ("continue", class_run, continue_command,
"Continue program being debugged, after signal or breakpoint.\n\

View File

@@ -59,6 +59,8 @@ static void
handle_sigio PARAMS ((int));
#endif
extern void _initialize_inflow PARAMS ((void));
static void
pass_signal PARAMS ((int));

File diff suppressed because it is too large Load Diff

View File

@@ -804,11 +804,7 @@ child_has_exited (pid, wait_status, exit_status)
static void
child_mourn_inferior ()
{
/* FIXME: Should be in a header file */
extern void proc_remove_foreign PARAMS ((int));
unpush_target (&child_ops);
proc_remove_foreign (inferior_pid);
generic_mourn_inferior ();
}

View File

@@ -44,9 +44,19 @@ struct type *java_float_type;
struct type *java_double_type;
struct type *java_void_type;
/* Local functions */
extern void _initialize_java_language PARAMS ((void));
static int java_demangled_signature_length PARAMS ((char*));
static void java_demangled_signature_copy PARAMS ((char*, char*));
static struct symtab *get_java_class_symtab PARAMS ((void));
static char *get_java_utf8_name PARAMS ((struct obstack *obstack, value_ptr name));
static int java_class_is_primitive PARAMS ((value_ptr clas));
static struct type *java_lookup_type PARAMS ((char *signature));
static value_ptr java_value_string PARAMS ((char *ptr, int len));
static void java_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
/* This objfile contains symtabs that have been dynamically created
@@ -76,7 +86,7 @@ static struct symtab *class_symtab = NULL;
static int class_symtab_space;
struct symtab *
static struct symtab *
get_java_class_symtab ()
{
if (class_symtab == NULL)
@@ -234,7 +244,7 @@ java_class_from_object (obj_val)
}
/* Check if CLASS_IS_PRIMITIVE(value of clas): */
int
static int
java_class_is_primitive (clas)
value_ptr clas;
{
@@ -800,7 +810,7 @@ java_array_type (type, dims)
/* Create a Java string in the inferior from a (Utf8) literal. */
value_ptr
static value_ptr
java_value_string (ptr, len)
char *ptr;
int len;
@@ -1071,7 +1081,9 @@ _initialize_java_language ()
We should use make_run_cleanup to have this be called.
But will that mess up values in value histry? FIXME */
void java_rerun_cleanup ()
extern void java_rerun_cleanup PARAMS ((void));
void
java_rerun_cleanup ()
{
if (class_symtab != NULL)
{

View File

@@ -28,6 +28,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "typeprint.h"
#include "c-lang.h"
/* Local functions */
static void java_type_print_base PARAMS ((struct type *type, GDB_FILE *stream, int show, int level));
static void
java_type_print_derivation_info (stream, type)
GDB_FILE *stream;
@@ -76,7 +80,7 @@ java_type_print_derivation_info (stream, type)
LEVEL is the number of spaces to indent by.
We increase it for some recursive calls. */
void
static void
java_type_print_base (type, stream, show, level)
struct type *type;
GDB_FILE *stream;

View File

@@ -30,6 +30,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "c-lang.h"
#include "annotate.h"
/* Local functions */
static void java_print_value_fields PARAMS ((struct type *type, char *valaddr, CORE_ADDR address, GDB_FILE *stream, int format, int recurse, enum val_prettyprint pretty));
int
java_value_print (val, stream, format, pretty)
value_ptr val;
@@ -230,7 +235,7 @@ java_value_print (val, stream, format, pretty)
DONT_PRINT is an array of baseclass types that we
should not print, or zero if called from top level. */
void
static void
java_print_value_fields (type, valaddr, address, stream,
format, recurse, pretty)
struct type *type;

View File

@@ -41,6 +41,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "target.h"
#include "parser-defs.h"
extern void _initialize_language PARAMS ((void));
static void
show_language_command PARAMS ((char *, int));

View File

@@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "m2-lang.h"
#include "c-lang.h"
extern void _initialize_m2_language PARAMS ((void));
static struct type *m2_create_fundamental_type PARAMS ((struct objfile *, int));
static void m2_printstr PARAMS ((GDB_FILE *stream, char *string, unsigned int length, int width, int force_ellipses));
static void m2_printchar PARAMS ((int, GDB_FILE *));

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