diff options
author | Jason Molenda <jsm@bugshack.cygnus.com> | 1999-05-25 18:00:33 +0000 |
---|---|---|
committer | Jason Molenda <jsm@bugshack.cygnus.com> | 1999-05-25 18:00:33 +0000 |
commit | 87b23cbadc6ef3943f848530c349183eb5bccc69 (patch) | |
tree | 3b0be454f51791dbcbc2d8b697c55ce8df6e2a3b | |
parent | c250861f05257f6eaaf07305f216dfec0b5caf43 (diff) | |
download | gdb-87b23cbadc6ef3943f848530c349183eb5bccc69.tar.gz |
import gdb-1999-05-25 snapshot
119 files changed, 1283 insertions, 524 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1801eaed2e3..8bd37ad8f89 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,256 @@ +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 @@ -22,10 +275,10 @@ 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. + * 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> diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 3616cb455ac..3a76eee82a5 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -219,7 +219,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \ ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) -VERSION = 19990519 +VERSION = 19990525 DIST=gdb LINT=/usr/5bin/lint @@ -1255,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 diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 9b4716a59af..99fde377a75 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -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. */ @@ -1395,7 +1399,6 @@ alpha_call_dummy_address () return SYMBOL_VALUE_ADDRESS (sym) + 4; } -void _initialize_alpha_tdep PARAMS ((void)); void _initialize_alpha_tdep () { diff --git a/gdb/annotate.c b/gdb/annotate.c index 5cde62607c0..3b4ab3c8411 100644 --- a/gdb/annotate.c +++ b/gdb/annotate.c @@ -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 *)); diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index d6970a2d9b8..993e4bfe858 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -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 diff --git a/gdb/ax-general.c b/gdb/ax-general.c index 30022a376e2..072817d73d4 100644 --- a/gdb/ax-general.c +++ b/gdb/ax-general.c @@ -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. */ diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 71d19e3cdfe..0ead9483fa9 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -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) { diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index d410a577524..b73305ad19c 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -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) diff --git a/gdb/c-lang.c b/gdb/c-lang.c index e7aa05574ca..efed49dbdf8 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -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 diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index c0d0333eb6a..52569f8fc53 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -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; diff --git a/gdb/ch-lang.c b/gdb/ch-lang.c index c54e8bb3619..d151749f03f 100644 --- a/gdb/ch-lang.c +++ b/gdb/ch-lang.c @@ -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)); diff --git a/gdb/coffread.c b/gdb/coffread.c index ae1decaf728..1a63cfb7552 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -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 */ diff --git a/gdb/command.c b/gdb/command.c index fc758e5f5fb..0b095d9afad 100644 --- a/gdb/command.c +++ b/gdb/command.c @@ -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; diff --git a/gdb/complaints.c b/gdb/complaints.c index e38038d26fb..0a838a3a709 100644 --- a/gdb/complaints.c +++ b/gdb/complaints.c @@ -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] = { diff --git a/gdb/config/a29k/tm-a29k.h b/gdb/config/a29k/tm-a29k.h index cef9345f94b..8fae020d403 100644 --- a/gdb/config/a29k/tm-a29k.h +++ b/gdb/config/a29k/tm-a29k.h @@ -471,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) \ @@ -494,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) diff --git a/gdb/config/alpha/tm-alpha.h b/gdb/config/alpha/tm-alpha.h index 51c8dcec9c0..bbfd2d846e0 100644 --- a/gdb/config/alpha/tm-alpha.h +++ b/gdb/config/alpha/tm-alpha.h @@ -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)); diff --git a/gdb/config/arc/tm-arc.h b/gdb/config/arc/tm-arc.h index e170d2d10ad..6eb5d81139e 100644 --- a/gdb/config/arc/tm-arc.h +++ b/gdb/config/arc/tm-arc.h @@ -265,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. */ - -#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \ - do { \ - if ((FI)->signal_handler_caller) \ - (FRAMELESS) = 0; \ - else \ - (FRAMELESS) = frameless_look_for_prologue (FI); \ - } while (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) \ + (((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. */ @@ -300,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. */ diff --git a/gdb/config/arm/tm-arm.h b/gdb/config/arm/tm-arm.h index 54e0954b249..cc3a27f66c4 100644 --- a/gdb/config/arm/tm-arm.h +++ b/gdb/config/arm/tm-arm.h @@ -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. */ diff --git a/gdb/config/convex/tm-convex.h b/gdb/config/convex/tm-convex.h index 6558859a53d..212f39da29b 100644 --- a/gdb/config/convex/tm-convex.h +++ b/gdb/config/convex/tm-convex.h @@ -260,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)) @@ -283,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. */ diff --git a/gdb/config/d10v/tm-d10v.h b/gdb/config/d10v/tm-d10v.h index d0c1a506e2c..f0760dcda76 100644 --- a/gdb/config/d10v/tm-d10v.h +++ b/gdb/config/d10v/tm-d10v.h @@ -50,24 +50,19 @@ struct value; extern CORE_ADDR d10v_skip_prologue (); #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 @@ -94,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. */ @@ -118,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 */ @@ -139,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 @@ -158,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 @@ -167,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 @@ -208,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. */ @@ -282,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)); @@ -330,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)) diff --git a/gdb/config/d30v/tm-d30v.h b/gdb/config/d30v/tm-d30v.h index 1ce9ccce3a4..dda61b6adfa 100644 --- a/gdb/config/d30v/tm-d30v.h +++ b/gdb/config/d30v/tm-d30v.h @@ -212,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 *)); @@ -235,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. */ @@ -283,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)); diff --git a/gdb/config/fr30/tm-fr30.h b/gdb/config/fr30/tm-fr30.h index d03f8453ba6..93aa9cb8f7f 100644 --- a/gdb/config/fr30/tm-fr30.h +++ b/gdb/config/fr30/tm-fr30.h @@ -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; @@ -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; \ - after_prologue = 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) diff --git a/gdb/config/gould/tm-np1.h b/gdb/config/gould/tm-np1.h index 7287155dd36..cbd05b1bb97 100644 --- a/gdb/config/gould/tm-np1.h +++ b/gdb/config/gould/tm-np1.h @@ -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 */ diff --git a/gdb/config/gould/tm-pn.h b/gdb/config/gould/tm-pn.h index b44d4ee3aa8..6d685d6e400 100644 --- a/gdb/config/gould/tm-pn.h +++ b/gdb/config/gould/tm-pn.h @@ -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 */ diff --git a/gdb/config/h8300/tm-h8300.h b/gdb/config/h8300/tm-h8300.h index f8f1f643675..b402181905d 100644 --- a/gdb/config/h8300/tm-h8300.h +++ b/gdb/config/h8300/tm-h8300.h @@ -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. */ diff --git a/gdb/config/h8500/tm-h8500.h b/gdb/config/h8500/tm-h8500.h index 2dded7cf380..0f34a00923f 100644 --- a/gdb/config/h8500/tm-h8500.h +++ b/gdb/config/h8500/tm-h8500.h @@ -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. */ diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/i386/tm-i386.h index 06d9f855290..11a7a2023d2 100644 --- a/gdb/config/i386/tm-i386.h +++ b/gdb/config/i386/tm-i386.h @@ -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 *)); diff --git a/gdb/config/i386/tm-i386v.h b/gdb/config/i386/tm-i386v.h index bb31cb0c796..05caf9bbe06 100644 --- a/gdb/config/i386/tm-i386v.h +++ b/gdb/config/i386/tm-i386v.h @@ -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; diff --git a/gdb/config/i386/tm-sun386.h b/gdb/config/i386/tm-sun386.h index 259fd518238..1f60b982714 100644 --- a/gdb/config/i386/tm-sun386.h +++ b/gdb/config/i386/tm-sun386.h @@ -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)) diff --git a/gdb/config/i960/tm-i960.h b/gdb/config/i960/tm-i960.h index dcd24e5ee20..d5b78f264b4 100644 --- a/gdb/config/i960/tm-i960.h +++ b/gdb/config/i960/tm-i960.h @@ -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. */ diff --git a/gdb/config/m32r/tm-m32r.h b/gdb/config/m32r/tm-m32r.h index 3a6f231a43e..5c8fb237ee4 100644 --- a/gdb/config/m32r/tm-m32r.h +++ b/gdb/config/m32r/tm-m32r.h @@ -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) diff --git a/gdb/config/m68k/tm-delta68.h b/gdb/config/m68k/tm-delta68.h index 5965bb56f9c..e0692fbe714 100644 --- a/gdb/config/m68k/tm-delta68.h +++ b/gdb/config/m68k/tm-delta68.h @@ -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. */ diff --git a/gdb/config/m68k/tm-isi.h b/gdb/config/m68k/tm-isi.h index ae8ccbf05fe..5653fe657dd 100644 --- a/gdb/config/m68k/tm-isi.h +++ b/gdb/config/m68k/tm-isi.h @@ -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. diff --git a/gdb/config/m68k/tm-m68k.h b/gdb/config/m68k/tm-m68k.h index 9cbb41f0801..4835b39872e 100644 --- a/gdb/config/m68k/tm-m68k.h +++ b/gdb/config/m68k/tm-m68k.h @@ -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. */ diff --git a/gdb/config/m68k/tm-news.h b/gdb/config/m68k/tm-news.h index 9fca4467659..b9736a06ccb 100644 --- a/gdb/config/m68k/tm-news.h +++ b/gdb/config/m68k/tm-news.h @@ -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" diff --git a/gdb/config/m88k/tm-m88k.h b/gdb/config/m88k/tm-m88k.h index be9ffba2c16..0259c0b6291 100644 --- a/gdb/config/m88k/tm-m88k.h +++ b/gdb/config/m88k/tm-m88k.h @@ -445,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. */ @@ -465,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. */ diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h index 601d8754f55..108a203f7f0 100644 --- a/gdb/config/mips/tm-mips.h +++ b/gdb/config/mips/tm-mips.h @@ -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)); diff --git a/gdb/config/mn10200/tm-mn10200.h b/gdb/config/mn10200/tm-mn10200.h index 99b8f6113ea..94cd6ea3367 100644 --- a/gdb/config/mn10200/tm-mn10200.h +++ b/gdb/config/mn10200/tm-mn10200.h @@ -172,7 +172,7 @@ extern CORE_ADDR mn10200_skip_prologue PARAMS ((CORE_ADDR)); #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) diff --git a/gdb/config/mn10300/tm-mn10300.h b/gdb/config/mn10300/tm-mn10300.h index 42b73415d28..ae5f0aa2e5b 100644 --- a/gdb/config/mn10300/tm-mn10300.h +++ b/gdb/config/mn10300/tm-mn10300.h @@ -119,7 +119,7 @@ extern CORE_ADDR mn10300_skip_prologue PARAMS ((CORE_ADDR)); #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) diff --git a/gdb/config/ns32k/tm-merlin.h b/gdb/config/ns32k/tm-merlin.h index d5864307162..9a3edb9cc8a 100644 --- a/gdb/config/ns32k/tm-merlin.h +++ b/gdb/config/ns32k/tm-merlin.h @@ -192,30 +192,8 @@ extern CORE_ADDR merlin_skip_prologue PARAMS ((CORE_ADDR)); /* 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. */ diff --git a/gdb/config/ns32k/tm-umax.h b/gdb/config/ns32k/tm-umax.h index 925a3e97b24..d4ea4edfcd0 100644 --- a/gdb/config/ns32k/tm-umax.h +++ b/gdb/config/ns32k/tm-umax.h @@ -271,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. */ diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 2fcae42e2b7..169a8178010 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -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)); diff --git a/gdb/config/powerpc/tm-ppc-eabi.h b/gdb/config/powerpc/tm-ppc-eabi.h index cd0ec32ed6f..41b80a82a81 100644 --- a/gdb/config/powerpc/tm-ppc-eabi.h +++ b/gdb/config/powerpc/tm-ppc-eabi.h @@ -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 () diff --git a/gdb/config/pyr/tm-pyr.h b/gdb/config/pyr/tm-pyr.h index fbfe87c3748..b1deeed775f 100644 --- a/gdb/config/pyr/tm-pyr.h +++ b/gdb/config/pyr/tm-pyr.h @@ -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. */ diff --git a/gdb/config/rs6000/tm-rs6000.h b/gdb/config/rs6000/tm-rs6000.h index 159ebc63ffe..34fe391d849 100644 --- a/gdb/config/rs6000/tm-rs6000.h +++ b/gdb/config/rs6000/tm-rs6000.h @@ -156,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 */ @@ -378,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 *)); @@ -421,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. */ diff --git a/gdb/config/sh/tm-sh.h b/gdb/config/sh/tm-sh.h index 2d5f8bd2b3b..3552300c0d8 100644 --- a/gdb/config/sh/tm-sh.h +++ b/gdb/config/sh/tm-sh.h @@ -46,11 +46,10 @@ struct type; 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 */ @@ -63,7 +62,7 @@ extern CORE_ADDR sh_skip_prologue PARAMS ((CORE_ADDR)); /* 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 } @@ -77,7 +76,7 @@ extern CORE_ADDR sh_skip_prologue PARAMS ((CORE_ADDR)); #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. */ @@ -147,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 */ @@ -166,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 */ @@ -181,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) @@ -210,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, @@ -232,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)); @@ -243,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)); @@ -256,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) diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h index 40a9a626d0d..693fa082685 100644 --- a/gdb/config/sparc/tm-sp64.h +++ b/gdb/config/sparc/tm-sp64.h @@ -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) \ diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h index b2bc3c04312..f3a9c662d74 100644 --- a/gdb/config/sparc/tm-sparc.h +++ b/gdb/config/sparc/tm-sparc.h @@ -362,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 @@ -390,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. */ @@ -583,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)); diff --git a/gdb/config/tahoe/tm-tahoe.h b/gdb/config/tahoe/tm-tahoe.h index 8c8321f371c..8711d2457a4 100644 --- a/gdb/config/tahoe/tm-tahoe.h +++ b/gdb/config/tahoe/tm-tahoe.h @@ -189,8 +189,8 @@ extern CORE_ADDR tahoe_skip_prologue PARAMS ((CORE_ADDR)); /* 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. */ diff --git a/gdb/config/tic80/tm-tic80.h b/gdb/config/tic80/tm-tic80.h index 8b33381ae19..567beb061f7 100644 --- a/gdb/config/tic80/tm-tic80.h +++ b/gdb/config/tic80/tm-tic80.h @@ -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 @@ -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)); diff --git a/gdb/config/v850/tm-v850.h b/gdb/config/v850/tm-v850.h index 5a11451b1ed..05fa79db36a 100644 --- a/gdb/config/v850/tm-v850.h +++ b/gdb/config/v850/tm-v850.h @@ -132,7 +132,7 @@ extern CORE_ADDR v850_skip_prologue PARAMS ((CORE_ADDR pc)); #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) diff --git a/gdb/config/vax/tm-vax.h b/gdb/config/vax/tm-vax.h index 62729b370ce..277aa8b8a41 100644 --- a/gdb/config/vax/tm-vax.h +++ b/gdb/config/vax/tm-vax.h @@ -173,7 +173,7 @@ extern CORE_ADDR vax_skip_prologue PARAMS ((CORE_ADDR)); 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. */ @@ -213,8 +213,8 @@ extern CORE_ADDR vax_skip_prologue PARAMS ((CORE_ADDR)); /* 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. */ diff --git a/gdb/config/w65/tm-w65.h b/gdb/config/w65/tm-w65.h index 2e354bbb18f..05d93c3c7b3 100644 --- a/gdb/config/w65/tm-w65.h +++ b/gdb/config/w65/tm-w65.h @@ -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. */ diff --git a/gdb/config/z8k/tm-z8k.h b/gdb/config/z8k/tm-z8k.h index 1a34b0fcab6..3b38d75f1b0 100644 --- a/gdb/config/z8k/tm-z8k.h +++ b/gdb/config/z8k/tm-z8k.h @@ -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. */ diff --git a/gdb/convex-tdep.c b/gdb/convex-tdep.c index fd490b107ed..66161e7930e 100644 --- a/gdb/convex-tdep.c +++ b/gdb/convex-tdep.c @@ -80,6 +80,27 @@ convex_skip_prologue (pc) 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; diff --git a/gdb/corefile.c b/gdb/corefile.c index 6a0bea4f944..b720b50323a 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -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. diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index eeeb79e010b..ecec1d900dd 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -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)); diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 7f6060337c8..0ceee9f9e47 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -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; diff --git a/gdb/dbxread.c b/gdb/dbxread.c index f7521307026..e61bef926cd 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -261,6 +261,8 @@ static int bincls_allocated; /* Local function prototypes */ +extern void _initialize_dbxread PARAMS ((void)); + static void process_now PARAMS ((struct objfile *)); diff --git a/gdb/defs.h b/gdb/defs.h index e63fb1520d5..a65baaba003 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -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 *)); diff --git a/gdb/demangle.c b/gdb/demangle.c index 669d9abcd28..0f054ba66f8 100644 --- a/gdb/demangle.c +++ b/gdb/demangle.c @@ -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. */ diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index ab547e8656c..87c39209b43 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,12 @@ +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): diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 6dffb98cd91..d8299584e0d 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -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. diff --git a/gdb/elfread.c b/gdb/elfread.c index 417039e044d..9c13b00bf48 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -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. */ diff --git a/gdb/event-loop.c b/gdb/event-loop.c index fe1d0f5bd12..26930343fbd 100644 --- a/gdb/event-loop.c +++ b/gdb/event-loop.c @@ -59,7 +59,7 @@ event_queue; basically a description of what kind of events gdb is interested in, for each fd. */ -/* As of 4/30/99 only the input file descriptor is registered with the +/* As of 1999-04-30 only the input file descriptor is registered with the event loop. */ #ifdef HAVE_POLL @@ -124,7 +124,6 @@ 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)); -extern display_gdb_prompt PARAMS ((char *)); /* Insert an event object into the gdb event queue at diff --git a/gdb/event-loop.h b/gdb/event-loop.h index 69c38e704a0..a366ed3a113 100644 --- a/gdb/event-loop.h +++ b/gdb/event-loop.h @@ -241,3 +241,13 @@ 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 *)); + diff --git a/gdb/event-top.c b/gdb/event-top.c index 5851fd2aa41..d241dda7ad4 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -38,6 +38,9 @@ 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)); @@ -104,7 +107,7 @@ void (*call_readline) PARAMS ((void)); /* This is used to determine if GDB is using the readline library or its own simplified form of readline. It is used by the asynchronous form of the set editing command. - ezannoni: as of 4/29/99 I expect that this + 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; @@ -219,7 +222,7 @@ setup_event_loop () 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. */ -void +static void change_line_handler () { if (async_command_editing_p) @@ -308,7 +311,7 @@ display_gdb_prompt (new_prompt) 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). */ -void +static void change_annotation_level () { char *prefix, *suffix; @@ -389,10 +392,10 @@ pop_prompt () /* Handles a gdb command. This function is called by command_line_handler, which has processed one or more input lines into COMMAND. */ -/* NOTE: 4/30/99 This is the asynchronous version of the command_loop +/* 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. */ -void +static void command_handler (command) char *command; { @@ -471,7 +474,7 @@ command_handler (command) mechanism within the readline library. Deal with incomplete commands as well, by saving the partial input in a global buffer. */ -/* NOTE: 4/30/99 This is the asynchronous version of the +/* 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. */ @@ -689,7 +692,7 @@ command_line_handler (rl) /* Does reading of input from terminal w/o the editing features provided by the readline library. */ -/* NOTE: 4/30/99 Asynchronous version of gdb_readline. gdb_readline +/* 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 @@ -759,7 +762,7 @@ gdb_readline2 () 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: 4/30/99 This is the asynchronous version of init_signals. +/* 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 diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 4ee66d58c3f..53dce631981 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -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)); diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index bb0b1d0efb1..c1a9e1757d3 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -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, diff --git a/gdb/findvar.c b/gdb/findvar.c index 74be8c7c5d7..8cfead6618d 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -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. */ diff --git a/gdb/fr30-tdep.c b/gdb/fr30-tdep.c index ae3b886f9a9..13d94264514 100644 --- a/gdb/fr30-tdep.c +++ b/gdb/fr30-tdep.c @@ -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. */ diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 87d19069e4e..fa92a660a04 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -197,7 +197,7 @@ int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *ap)); /* Do the real work of changing the current architecture */ -static int arch_valid PARAMS ((const struct bfd_arch_info *arch)); +static int arch_ok PARAMS ((const struct bfd_arch_info *arch)); static int arch_ok (arch) const struct bfd_arch_info *arch; @@ -211,6 +211,7 @@ arch_ok (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; diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index f2380db6f59..3caa0448366 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -111,7 +111,22 @@ 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, diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 228b1acdde7..436fd5ee9ab 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -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 diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 16ec0b7c355..eb111694ae2 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -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" @@ -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; diff --git a/gdb/inflow.c b/gdb/inflow.c index d6a3bb1421a..6ce7721a93b 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -59,6 +59,8 @@ static void handle_sigio PARAMS ((int)); #endif +extern void _initialize_inflow PARAMS ((void)); + static void pass_signal PARAMS ((int)); diff --git a/gdb/infrun.c b/gdb/infrun.c index 81b288d247d..a051ec1c670 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -104,6 +104,32 @@ static int thread_step_needed = 0; static int use_thread_step_needed = USE_THREAD_STEP_NEEDED; +static void follow_inferior_fork PARAMS ((int parent_pid, + int child_pid, + int has_forked, + int has_vforked)); + +static void follow_fork PARAMS ((int parent_pid, int child_pid)); + +static void follow_vfork PARAMS ((int parent_pid, int child_pid)); + +static void set_schedlock_func PARAMS ((char *args, int from_tty, + struct cmd_list_element *c)); + +static int is_internal_shlib_eventpoint PARAMS ((struct breakpoint *ep)); + +static int stopped_for_internal_shlib_event PARAMS ((bpstat bs)); + +static int stopped_for_shlib_catchpoint PARAMS ((bpstat bs, + struct breakpoint **cp_p)); + +#if __STDC__ +struct execution_control_state; +#endif +static int currently_stepping PARAMS ((struct execution_control_state *ecs)); + +static void xdb_handle_command PARAMS ((char *args, int from_tty)); + void _initialize_infrun PARAMS ((void)); /* GET_LONGJMP_TARGET returns the PC at which longjmp() will resume the @@ -2907,7 +2933,7 @@ stop_stepping: /* Are we in the middle of stepping? */ -int +static int currently_stepping (ecs) struct execution_control_state *ecs; { diff --git a/gdb/inftarg.c b/gdb/inftarg.c index 43c22481723..70d854125f4 100644 --- a/gdb/inftarg.c +++ b/gdb/inftarg.c @@ -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 (); } diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index a98147aaf49..049d10b9d9f 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -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) { diff --git a/gdb/jv-typeprint.c b/gdb/jv-typeprint.c index cddf758f73e..822b586508a 100644 --- a/gdb/jv-typeprint.c +++ b/gdb/jv-typeprint.c @@ -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; diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c index 797c16a9123..a19245a937a 100644 --- a/gdb/jv-valprint.c +++ b/gdb/jv-valprint.c @@ -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; diff --git a/gdb/language.c b/gdb/language.c index 225d423ec01..394a500f02b 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -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)); diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index f5f38a9d3ed..a93e5f0ba58 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -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 *)); diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index 56e55526f6b..769ffe80b50 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -72,6 +72,77 @@ isi_skip_prologue (pc) return pc; } +/* Return number of args passed to a frame. + Can return -1, meaning no way to tell. */ + +int +isi_frame_num_args (fi) + struct frame_info *fi; +{ + int val; + CORE_ADDR pc = FRAME_SAVED_PC (fi); + 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; + return val; +} + +int +delta68_frame_num_args (fi) + struct frame_info *fi; +{ + int val; + CORE_ADDR pc = FRAME_SAVED_PC (fi); + 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; + return val; +} + +int +news_frame_num_args (fi) + struct frame_info *fi; +{ + int val; + CORE_ADDR pc = FRAME_SAVED_PC (fi); + 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; + return val; +} /* Push an empty stack frame, to record the current PC, etc. */ diff --git a/gdb/main.c b/gdb/main.c index 6e94c29ba94..9d85aaba9a0 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "defs.h" #include "top.h" +#include "event-loop.h" #include "target.h" #include "inferior.h" #include "call-cmds.h" @@ -65,7 +66,6 @@ GDB_FILE *gdb_stderr; extern int write_files; static void print_gdb_help PARAMS ((GDB_FILE *)); -extern void gdb_init PARAMS ((char *)); /* These two are used to set the external editor commands when gdb is farming out files to be edited by another program. */ @@ -571,7 +571,7 @@ main (argc, argv) { /* NOTE: I am commenting this out, because it is not clear where this feature is used. It is very old and - undocumented. ezannoni: 5/4/99*/ + undocumented. ezannoni: 1999-05-04*/ #if 0 if (cmdarg[i][0] == '-' && cmdarg[i][1] == '\0') read_command_file (stdin); @@ -715,17 +715,6 @@ Report bugs to \"bug-gdb@prep.ai.mit.edu\".\ } -void -init_proc () -{ -} - -void -proc_remove_foreign (pid) - int pid; -{ -} - /* All I/O sent to the *_filtered and *_unfiltered functions eventually ends up here. The fputs_unfiltered_hook is primarily used by GUIs to collect all output and send it to the GUI, instead of the controlling terminal. Only diff --git a/gdb/maint.c b/gdb/maint.c index f32b159d36f..46e96d9fb60 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -38,6 +38,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <unistd.h> #endif +extern void _initialize_maint_cmds PARAMS ((void)); + static void maintenance_command PARAMS ((char *, int)); static void maintenance_dump_me PARAMS ((char *, int)); diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 6b6c86e7534..12b84553b0f 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -88,6 +88,7 @@ typedef struct mips_extra_func_info { #include "expression.h" #include "language.h" /* Needed inside partial-stab.h */ +extern void _initialize_mdebugread PARAMS ((void)); /* Provide a default mapping from a ecoff register number to a gdb REGNUM. */ #ifndef ECOFF_REG_TO_REGNUM diff --git a/gdb/mipsread.c b/gdb/mipsread.c index 614c27ec91f..343a7b1027a 100644 --- a/gdb/mipsread.c +++ b/gdb/mipsread.c @@ -41,6 +41,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf/common.h" #include "elf/mips.h" +extern void _initialize_mipsread PARAMS ((void)); + static void mipscoff_new_init PARAMS ((struct objfile *)); diff --git a/gdb/nlmread.c b/gdb/nlmread.c index afdea43a6b0..f85d2b5ea09 100644 --- a/gdb/nlmread.c +++ b/gdb/nlmread.c @@ -28,6 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "buildsym.h" #include "stabsread.h" +extern void _initialize_nlmread PARAMS ((void)); + static void nlm_new_init PARAMS ((struct objfile *)); diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c index 775e8afd53a..7946521f8f6 100644 --- a/gdb/ns32k-tdep.c +++ b/gdb/ns32k-tdep.c @@ -64,6 +64,80 @@ umax_skip_prologue (pc) return pc; } +/* Return number of args passed to a frame. + Can return -1, meaning no way to tell. */ + +int +merlin_frame_num_args (fi) + struct frame_info *fi; +{ + int numargs; + 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; + return numargs; +} + +int +umax_frame_num_args (fi) + struct frame_info *fi; +{ + int numargs; + CORE_ADDR pc; + CORE_ADDR enter_addr; + unsigned int insn; + unsigned int addr_mode; + int width; + + numargs = -1; + enter_addr = ns32k_get_enter_addr ((fi)->pc); + if (enter_addr > 0) + { + pc = ((enter_addr == 1) + ? SAVED_PC_AFTER_CALL (fi) + : 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; + } + } + return numargs; +} sign_extend (value, bits) diff --git a/gdb/os9kread.c b/gdb/os9kread.c index 673d415c6e2..a9193388d27 100644 --- a/gdb/os9kread.c +++ b/gdb/os9kread.c @@ -60,6 +60,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "os9k.h" #include "stabsread.h" +extern void _initialize_os9kread PARAMS ((void)); + /* Each partial symbol table entry contains a pointer to private data for the read_symtab() function to use when expanding a partial symbol table entry to a full symbol table entry. diff --git a/gdb/parse.c b/gdb/parse.c index 76ed1b6f324..42b0f3b6a38 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -70,6 +70,8 @@ prefixify_expression PARAMS ((struct expression *)); static void prefixify_subexp PARAMS ((struct expression *, struct expression *, int, int)); +void _initialize_parse PARAMS ((void)); + /* Data structure for saving values of arglist_len for function calls whose arguments contain other function calls. */ diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h index 3226fdd8ad1..f417692e2d6 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h @@ -195,4 +195,10 @@ struct op_print int right_assoc; }; +/* The generic method for targets to specify how their registers are + named. The mapping can be derived from three sources: + REGISTER_NAME; std_regs; or a target specific alias hook. */ + +extern int target_map_name_to_register PARAMS ((char *, int)); + #endif /* PARSER_DEFS_H */ diff --git a/gdb/remote-d10v.c b/gdb/remote-d10v.c index d529b2180f6..aaf9d6899fa 100644 --- a/gdb/remote-d10v.c +++ b/gdb/remote-d10v.c @@ -44,6 +44,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Prototypes for local functions */ +extern void _initialize_remote_d10v PARAMS ((void)); + static void remote_d10v_open PARAMS ((char *name, int from_tty)); /* Define the target subroutine names */ @@ -65,11 +67,12 @@ remote_d10v_open (name, from_tty) /* Translate a GDB virtual ADDR/LEN into a format the remote target understands. Returns number of bytes that can be transfered starting at taddr, ZERO if no bytes can be transfered. */ -int -remote_d10v_translate_xfer_address (memaddr, nr_bytes, taddr) +void +remote_d10v_translate_xfer_address (memaddr, nr_bytes, targ_addr, targ_len) CORE_ADDR memaddr; int nr_bytes; - CORE_ADDR *taddr; + CORE_ADDR *targ_addr; + int *targ_len; { CORE_ADDR phys; CORE_ADDR seg; @@ -141,7 +144,8 @@ remote_d10v_translate_xfer_address (memaddr, nr_bytes, taddr) else { /* Logical address out side of data segments, not supported */ - return (0); + *targ_len = 0; + return; } break; } @@ -162,7 +166,8 @@ remote_d10v_translate_xfer_address (memaddr, nr_bytes, taddr) { /* Logical address outside of IMAP[01] segment, not supported */ - return (0); + *targ_len = 0; + return; } if ((off & 0x1ffff) + nr_bytes > 0x1ffffL) { @@ -179,8 +184,11 @@ remote_d10v_translate_xfer_address (memaddr, nr_bytes, taddr) { phys = ((map & 0x7fL) << 17) + (off & 0x1ffffL); if (phys > 0xffffffL) - /* Address outside of unified address segment */ - return (0); + { + /* Address outside of unified address segment */ + *targ_len = 0; + return; + } phys |= targ_unified; to = "unified"; } @@ -206,12 +214,13 @@ remote_d10v_translate_xfer_address (memaddr, nr_bytes, taddr) break; default: - return (0); + *targ_len = 0; + return; } - *taddr = phys; - return nr_bytes; + *targ_addr = phys; + *targ_len = nr_bytes; } diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index cf41b40ae7a..b8ced919847 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -39,6 +39,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Prototypes */ +extern void _initialize_remote_sim PARAMS ((void)); + extern int (*ui_loop_hook) PARAMS ((int signo)); static void dump_mem PARAMS ((char *buf, int len)); diff --git a/gdb/remote.c b/gdb/remote.c index 6ec108c9a32..5bcff883cfe 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -2347,31 +2347,32 @@ remote_read_bytes (memaddr, myaddr, len) } /* Read or write LEN bytes from inferior memory at MEMADDR, - transferring to or from debugger address MYADDR. Write to inferior - if SHOULD_WRITE is nonzero. Returns length of data written or - read; 0 for error. */ + transferring to or from debugger address BUFFER. Write to inferior if + SHOULD_WRITE is nonzero. Returns length of data written or read; 0 + for error. */ + +#ifndef REMOTE_TRANSLATE_XFER_ADDRESS +#define REMOTE_TRANSLATE_XFER_ADDRESS(MEM_ADDR, MEM_LEN, TARG_ADDR, TARG_LEN) \ + (*(TARG_ADDR) = (MEM_ADDR), *(TARG_LEN) = (MEM_LEN)) +#endif /* ARGSUSED */ static int -remote_xfer_memory (memaddr, myaddr, len, should_write, target) - CORE_ADDR memaddr; - char *myaddr; - int len; +remote_xfer_memory (mem_addr, buffer, mem_len, should_write, target) + CORE_ADDR mem_addr; + char *buffer; + int mem_len; int should_write; struct target_ops *target; /* ignored */ { -#ifdef REMOTE_TRANSLATE_XFER_ADDRESS - CORE_ADDR targaddr; - int targlen; - REMOTE_TRANSLATE_XFER_ADDRESS (memaddr, len, targaddr, targlen); - if (targlen == 0) + CORE_ADDR targ_addr; + int targ_len; + REMOTE_TRANSLATE_XFER_ADDRESS (mem_addr, mem_len, &targ_addr, &targ_len); + if (targ_len <= 0) return 0; - memaddr = targaddr; - len = targlen; -#endif - return dcache_xfer_memory (remote_dcache, memaddr, myaddr, - len, should_write); + return dcache_xfer_memory (remote_dcache, targ_addr, buffer, + targ_len, should_write); } @@ -3384,7 +3385,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya)."; remote_ops.to_load = generic_load; remote_ops.to_mourn_inferior = remote_mourn; remote_ops.to_thread_alive = remote_thread_alive; - remote_ops.to_find_new_threads = remote_find_new_threads; + remote_ops.to_find_new_threads = (void*) remote_find_new_threads; remote_ops.to_stop = remote_stop; remote_ops.to_query = remote_query; remote_ops.to_stratum = process_stratum; diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index a0e744491e8..2a9d255d0ca 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -812,7 +812,7 @@ rs6000_fix_call_dummy (dummyname, pc, fun, nargs, args, type, gcc_p) starting from r4. */ CORE_ADDR -push_arguments (nargs, args, sp, struct_return, struct_addr) +rs6000_push_arguments (nargs, args, sp, struct_return, struct_addr) int nargs; value_ptr *args; CORE_ADDR sp; diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c index 7f31ba43483..e72a88b010b 100644 --- a/gdb/scm-lang.c +++ b/gdb/scm-lang.c @@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "gdb_string.h" #include "gdbcore.h" +extern void _initialize_scheme_language PARAMS ((void)); static value_ptr evaluate_subexp_scm PARAMS ((struct type *, struct expression *, int *, enum noside)); static value_ptr scm_lookup_name PARAMS ((char *)); diff --git a/gdb/serial.c b/gdb/serial.c index ce420eeadd2..75a221cbc7a 100644 --- a/gdb/serial.c +++ b/gdb/serial.c @@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "gdb_string.h" #include "gdbcmd.h" +extern void _initialize_serial PARAMS ((void)); + /* Linked list of serial I/O handlers */ static struct serial_ops *serial_ops_list = NULL; diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 2b25f0d505e..fa0ecb84c3e 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -88,7 +88,6 @@ static char *sh3e_reg_names[] = { char **sh_register_names = sh_generic_reg_names; - struct { char **regnames; int mach; diff --git a/gdb/stabsread.c b/gdb/stabsread.c index a143dba42d5..9e1217b6529 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -49,6 +49,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "stabsread.h" /* Our own declarations */ #undef EXTERN +extern void _initialize_stabsread PARAMS ((void)); + /* The routines that read and process a complete stabs for a C struct or C++ class pass lists of data member fields and lists of member function fields in an instance of a field_info structure, as defined below. diff --git a/gdb/stack.c b/gdb/stack.c index 20a6124da5f..a3f302dbca0 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -318,7 +318,7 @@ print_args_stub (args) int numargs; struct print_args_args *p = (struct print_args_args *)args; - FRAME_NUM_ARGS (numargs, (p->fi)); + numargs = FRAME_NUM_ARGS (p->fi); print_frame_args (p->func, p->fi, numargs, gdb_stdout); return 0; } @@ -838,10 +838,8 @@ frame_info (addr_exp, from_tty) printf_filtered ("\n"); { - int frameless = 0; -#ifdef FRAMELESS_FUNCTION_INVOCATION - FRAMELESS_FUNCTION_INVOCATION (fi, frameless); -#endif + int frameless; + frameless = FRAMELESS_FUNCTION_INVOCATION (fi); if (frameless) printf_filtered (" (FRAMELESS),"); } @@ -882,7 +880,7 @@ frame_info (addr_exp, from_tty) print_address_numeric (arg_list, 1, gdb_stdout); printf_filtered (","); - FRAME_NUM_ARGS (numargs, fi); + numargs = FRAME_NUM_ARGS (fi); if (numargs < 0) puts_filtered (" args: "); else if (numargs == 0) diff --git a/gdb/symfile.c b/gdb/symfile.c index 5082f39e4ab..91431505489 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -142,6 +142,14 @@ static int simple_read_overlay_table PARAMS ((void)); static int simple_overlay_update_1 PARAMS ((struct obj_section *)); +static void add_filename_language PARAMS ((char *ext, enum language lang)); + +static void set_ext_lang_command PARAMS ((char *args, int from_tty)); + +static void info_ext_lang_command PARAMS ((char *args, int from_tty)); + +static void init_filename_language_table PARAMS ((void)); + void _initialize_symfile PARAMS ((void)); /* List of all available sym_fns. On gdb startup, each object file reader diff --git a/gdb/symtab.c b/gdb/symtab.c index 15685398b59..4da73617345 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -108,6 +108,9 @@ static void print_msymbol_info PARAMS ((struct minimal_symbol *)); static void symtab_symbol_info PARAMS ((char *, namespace_enum, int)); +static void overload_list_add_symbol PARAMS ((struct symbol *sym, + char *oload_name)); + void _initialize_symtab PARAMS ((void)); /* */ diff --git a/gdb/tahoe-tdep.c b/gdb/tahoe-tdep.c index c57bc353a8b..8bf851d0f4b 100644 --- a/gdb/tahoe-tdep.c +++ b/gdb/tahoe-tdep.c @@ -61,6 +61,15 @@ tahoe_skip_prologue (pc) return pc; } +/* Return number of args passed to a frame. + Can return -1, meaning no way to tell. */ + +int +tahoe_frame_num_args (fi) + struct frame_info *fi; +{ + return (((0xffff & read_memory_integer(((fi)->frame-4),4)) - 4) >> 2); +} /* Print the Tahoe instruction at address MEMADDR in debugged memory, on STREAM. Returns length of the instruction, in bytes. */ diff --git a/gdb/target.c b/gdb/target.c index fe0e0c001b2..d8899439660 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -82,6 +82,10 @@ find_default_run_target PARAMS ((char *)); static void update_current_target PARAMS ((void)); +static void nosupport_runtime PARAMS ((void)); + +static void normal_target_post_startup_inferior PARAMS ((int pid)); + /* Transfer LEN bytes between target address MEMADDR and GDB address MYADDR. Returns 0 for success, errno code for failure (which includes partial transfers--if you want a more useful response to partial transfers, try @@ -302,7 +306,7 @@ nosymbol (name, addrp) } /* ARGSUSED */ -void +static void nosupport_runtime () { if (!inferior_pid) @@ -1782,7 +1786,7 @@ normal_pid_to_str (pid) notification of forks, etc at inferior creation time; e.g., in target_acknowledge_forked_child. */ -void +static void normal_target_post_startup_inferior (pid) int pid; { diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 8fb2db41741..cf0e78da3fe 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +1999-05-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com> + + * gdb.base/annota1.exp: Allow any number of "frames-invalid" and + "breakpoint-invalid" to be printed. + * gdb.base/annota2.exp: Revise line number for main breakpoint. Allow any + number of "frames-invalid" and "breakpoint-invalid" to be printed. + * gdb.base/annota2.cc: Initialize a.x to 0. + 1999-05-17 Keith Seitz <keiths@cygnus.com> * gdb.base/call-ar-st.exp: Skip "print print_double_array (double_array)" diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp index fb3703edc31..b2d0dd04157 100644 --- a/gdb/testsuite/gdb.base/annota1.exp +++ b/gdb/testsuite/gdb.base/annota1.exp @@ -140,14 +140,16 @@ gdb_expect { # annotate-frame-end # annotate-stopped # +#exp_internal 1 send_gdb "run\n" gdb_expect { - -re "\r\n\032\032post-prompt\r\nStarting program: $binfile \r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoints-invalid\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota1.c\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ + -re "\r\n\032\032post-prompt\r\nStarting program: $binfile \(\r\n\r\n\032\032frames-invalid\)+\(\r\n\r\n\032\032breakpoints-invalid\)*.*\(\r\n\r\n\032\032frames-invalid\)*\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota1.c\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ { pass "run until main breakpoint" } -re ".*$gdb_prompt$" { fail "run until main breakpoint" } timeout { fail "run until main breakpoint (timeout)" } } - +#exp_internal 0 +#exit 0 # # Let's do a next, to get to a point where the array is initialized @@ -256,7 +258,7 @@ gdb_expect { # send_gdb "signal SIGUSR1\n" gdb_expect { - -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n16\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${srcdir}/${subdir}/${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:185:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ + -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${srcdir}/${subdir}/${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:185:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ { pass "send SIGUSR1" } -re ".*$gdb_prompt$" { fail "send SIGUSR1" } timeout { fail "send SIGUSR1 (timeout)" } diff --git a/gdb/testsuite/gdb.base/annota2.cc b/gdb/testsuite/gdb.base/annota2.cc index f8a25f94d5e..234752e49af 100644 --- a/gdb/testsuite/gdb.base/annota2.cc +++ b/gdb/testsuite/gdb.base/annota2.cc @@ -18,6 +18,7 @@ int main() { A a; + a.x = 0; a.x = 1; a.y = 2; diff --git a/gdb/testsuite/gdb.base/annota2.exp b/gdb/testsuite/gdb.base/annota2.exp index 7c9116bdb7a..aabc551f6fe 100644 --- a/gdb/testsuite/gdb.base/annota2.exp +++ b/gdb/testsuite/gdb.base/annota2.exp @@ -61,7 +61,7 @@ if [target_info exists gdb_stub] { # # line number where we need to stop in main # -set main_line 22 +set main_line 25 # The commands we test here produce many lines of output; disable "press # <return> to continue" prompts. @@ -71,7 +71,7 @@ gdb_expect -re "$gdb_prompt $" # # break at main # -gdb_test "break 22" \ +gdb_test "break 25" \ "Breakpoint.*at.* file .*$srcfile, line.*" \ "breakpoint main" @@ -95,7 +95,7 @@ gdb_expect { send_gdb "run\n" gdb_expect { - -re "\r\n\032\032post-prompt\r\nStarting program: $binfile \r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoints-invalid\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota2.cc\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ + -re "\r\n\032\032post-prompt\r\nStarting program: $binfile \(\r\n\r\n\032\032frames-invalid\)+\(\r\n\r\n\032\032breakpoints-invalid\)*.*\(\r\n\r\n\032\032frames-invalid\)*\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota2.cc\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ { pass "run until main breakpoint" } -re ".*$gdb_prompt$" { fail "run until main breakpoint" } timeout { fail "run until main breakpoint (timeout)" } @@ -150,7 +150,7 @@ gdb_expect { # # break at first line of main. # -send_gdb "break main\n" +send_gdb "break 22\n" gdb_expect { -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\nBreakpoint.*at $hex: file.*$srcfile, line.*\r\n$gdb_prompt$" \ { pass "breakpoint at main" } @@ -161,14 +161,14 @@ gdb_expect { # # change value of main_line # -set main_line 19 +set main_line 22 # # run program up to breakpoint. # send_gdb "run\n" gdb_expect { - -re "\r\n\032\032post-prompt\r\n.*Starting program: $binfile \r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoints-invalid\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota2.cc\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ + -re "\r\n\032\032post-prompt\r\n.*Starting program: $binfile \(\r\n\r\n\032\032frames-invalid\)+\(\r\n\r\n\032\032breakpoints-invalid\)*.*\(\r\n\r\n\032\032frames-invalid\)*\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota2.cc\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ { pass "run until main breakpoint" } -re ".*$gdb_prompt$" { fail "run until main breakpoint" } timeout { fail "run until main breakpoint (timeout)" } @@ -191,7 +191,7 @@ gdb_expect { # send_gdb "next\n" gdb_expect { - -re "\r\n\032\032post-prompt\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032watchpoint 3\r\nWatchpoint 3: a.x\r\n\r\nOld value = 4\r\nNew value = 1\r\n\r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*$srcfile\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n20\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source .*$srcfile.*beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ + -re "\r\n\032\032post-prompt\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032watchpoint 3\r\nWatchpoint 3: a.x\r\n\r\nOld value = 0\r\nNew value = 1\r\n\r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*$srcfile\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$decimal\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source .*$srcfile.*beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ { pass "watch triggered on a.x" } -re ".*$gdb_prompt$" { fail "watch triggered on a.x" } timeout { fail "watch triggered on a.x (timeout)" } diff --git a/gdb/thread.c b/gdb/thread.c index 9f68547636d..01d152f2d54 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -96,6 +96,7 @@ static void thread_apply_command PARAMS ((char *, int)); static void restore_current_thread PARAMS ((int)); static void switch_to_thread PARAMS ((int pid)); static void prune_threads PARAMS ((void)); +static int local_find_new_threads PARAMS ((void)); /* If the host has threads, the host machine definition may set this macro. But, for remote thread debugging, it gets more complex and diff --git a/gdb/top.c b/gdb/top.c index 60be3cf6754..d487193ec74 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -51,8 +51,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "gdb_stat.h" #include <ctype.h> -extern void initialize_utils PARAMS ((void)); - /* Prototypes for local functions */ static void dont_repeat_command PARAMS ((char *, int)); @@ -71,17 +69,11 @@ static char * line_completion_function PARAMS ((char *, int, char *, int)); static char * readline_line_completion_function PARAMS ((char *, int)); -/* NOTE 4/29/99: this function will be static again, after we make the +/* NOTE 1999-04-29: this function will be static again, after we make the event loop be the default command loop for gdb, and we merge event-top.c into this file, top.c */ /* static */ void command_loop_marker PARAMS ((int)); -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 *)); - static void while_command PARAMS ((char *, int)); static void if_command PARAMS ((char *, int)); @@ -149,7 +141,7 @@ static void complete_command PARAMS ((char *, int)); static void do_nothing PARAMS ((int)); #ifdef SIGHUP -/* NOTE 4/29/99: This function will be static again, once we modify +/* NOTE 1999-04-29: This function will be static again, once we modify gdb to use the event loop as the default command loop and we merge event-top.c into this file, top.c */ /* static */ int quit_cover PARAMS ((PTR)); @@ -599,7 +591,7 @@ int signo; /* Just a little helper function for disconnect(). */ -/* NOTE 4/29/99: This function will be static again, once we modify +/* NOTE 1999-04-29: This function will be static again, once we modify gdb to use the event loop as the default command loop and we merge event-top.c into this file, top.c */ /* static */ int @@ -614,20 +606,20 @@ quit_cover (s) #endif /* defined SIGHUP */ /* Line number we are currently in in a file which is being sourced. */ -/* NOTE 4/29/99: This variable will be static again, once we modify +/* NOTE 1999-04-29: This variable will be static again, once we modify gdb to use the event loop as the default command loop and we merge event-top.c into this file, top.c */ /* static */ int source_line_number; /* Name of the file we are sourcing. */ -/* NOTE 4/29/99: This variable will be static again, once we modify +/* NOTE 1999-04-29: This variable will be static again, once we modify gdb to use the event loop as the default command loop and we merge event-top.c into this file, top.c */ /* static */ char *source_file_name; /* Buffer containing the error_pre_print used by the source stuff. Malloc'd. */ -/* NOTE 4/29/99: This variable will be static again, once we modify +/* NOTE 1999-04-29: This variable will be static again, once we modify gdb to use the event loop as the default command loop and we merge event-top.c into this file, top.c */ /* static */ char *source_error; @@ -635,7 +627,7 @@ static int source_error_allocated; /* Something to glom on to the start of error_pre_print if source_file_name is set. */ -/* NOTE 4/29/99: This variable will be static again, once we modify +/* NOTE 1999-04-29: This variable will be static again, once we modify gdb to use the event loop as the default command loop and we merge event-top.c into this file, top.c */ /* static */ char *source_pre_error; @@ -695,8 +687,6 @@ gdb_init (argv0) else init_signals (); - init_proc (); - /* We need a default language for parsing expressions, so simple things like "set width 0" won't fail if no language is explicitly set in a config file or implicitly set by reading an executable during startup. */ @@ -1330,7 +1320,7 @@ execute_command (p, from_tty) } /* ARGSUSED */ -/* NOTE 4/29/99: This function will be static again, once we modify +/* NOTE 1999-04-29: This function will be static again, once we modify gdb to use the event loop as the default command loop and we merge event-top.c into this file, top.c */ /* static */ void @@ -1427,6 +1417,7 @@ command_loop () } } } + /* Commands call this if they do not want to be repeated by null lines. */ @@ -1519,7 +1510,7 @@ gdb_readline (prrompt) substitution. These variables are given default values at the end of this file. */ static int command_editing_p; -/* NOTE 4/29/99: This variable will be static again, once we modify +/* NOTE 1999-04-29: This variable will be static again, once we modify gdb to use the event loop as the default command loop and we merge event-top.c into this file, top.c */ /* static */ int history_expansion_p; diff --git a/gdb/top.h b/gdb/top.h index 188d184f91f..57e15b9cd88 100644 --- a/gdb/top.h +++ b/gdb/top.h @@ -68,9 +68,6 @@ extern int quit_confirm PARAMS ((void)); extern void quit_force PARAMS ((char *, int)); extern void quit_command PARAMS ((char *, int)); -extern void setup_event_loop PARAMS ((void)); -extern void async_init_signals PARAMS ((void)); - /* This function returns a pointer to the string that is used by gdb for its command prompt. */ extern char *get_prompt PARAMS((void)); @@ -83,3 +80,6 @@ extern void set_prompt PARAMS ((char *)); extern int mapped_symbol_files; extern int readnow_symbol_files; #define ALL_CLEANUPS ((struct cleanup *)0) + +/* Perform _initialize initialization */ +extern void gdb_init PARAMS ((char *)); diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 65ce851dcc2..4c27d5153b9 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -139,9 +139,16 @@ static void trace_dump_command PARAMS ((char *, int)); /* support routines */ static void trace_mention PARAMS ((struct tracepoint *)); +#if __STDC__ struct collection_list; +#endif static void add_aexpr PARAMS ((struct collection_list *, struct agent_expr *)); static unsigned char *mem2hex(unsigned char *, unsigned char *, int); +static void add_register PARAMS ((struct collection_list *collection, unsigned long regno)); +static void free_actions_list PARAMS ((char **actions_list)); +static void free_actions_list_cleanup_wrapper PARAMS ((void*)); + +extern void _initialize_tracepoint PARAMS ((void)); /* Utility: returns true if "target remote" */ static int @@ -1122,7 +1129,7 @@ memrange_sortmerge (memranges) } /* Add a register to a collection list */ -void +static void add_register (collection, regno) struct collection_list *collection; unsigned long regno; @@ -1431,7 +1438,14 @@ stringify_collection_list (list, string) return *str_list; } -void +static void +free_actions_list_cleanup_wrapper (al) + void *al; +{ + free_actions_list (al); +} + +static void free_actions_list(actions_list) char **actions_list; { @@ -1724,8 +1738,10 @@ trace_start_command (args, from_tty) if (t->actions) { encode_actions (t, &tdp_actions, &stepping_actions); - old_chain = make_cleanup (free_actions_list, tdp_actions); - (void) make_cleanup (free_actions_list, stepping_actions); + old_chain = make_cleanup (free_actions_list_cleanup_wrapper, + tdp_actions); + (void) make_cleanup (free_actions_list_cleanup_wrapper, + stepping_actions); /* do_single_steps (t); */ if (tdp_actions) diff --git a/gdb/typeprint.c b/gdb/typeprint.c index 3ace7beeef3..9f8bd4f6ae7 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -38,6 +38,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ extern int objectprint; /* Controls looking up an object's derived type using what we find in its vtables. */ +extern void _initialize_typeprint PARAMS ((void)); + static void ptype_command PARAMS ((char *, int)); diff --git a/gdb/utils.c b/gdb/utils.c index 400210bc5be..9ccdfed12de 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -716,14 +716,6 @@ void notice_quit() #endif /* !defined(__GO32__) && !defined(_MSC_VER) */ -void -pollquit() -{ - notice_quit (); - if (quit_flag || immediate_quit) - quit (); -} - /* Control C comes here */ void @@ -1003,21 +995,7 @@ print_spaces (n, file) register int n; register GDB_FILE *file; { - if (file->ts_streamtype == astring) - { - char *p; - - gdb_file_adjust_strbuf (n, file); - p = file->ts_strbuf + strlen (file->ts_strbuf); - - memset (p, ' ', n); - p[n] = '\000'; - } - else - { - while (n-- > 0) - fputc (' ', file->ts_filestream); - } + fputs_unfiltered (n_spaces (n), file); } /* Print a host address. */ @@ -1288,36 +1266,6 @@ gdb_printchar (c, stream, quoter) } } - - - -static char * hexlate = "0123456789abcdef" ; -int fmthex(inbuf,outbuff,length,linelength) - unsigned char * inbuf ; - unsigned char * outbuff; - int length; - int linelength; -{ - unsigned char byte , nib ; - int outlength = 0 ; - - while (length) - { - if (outlength >= linelength) break ; - byte = *inbuf ; - inbuf++ ; - nib = byte >> 4 ; - *outbuff++ = hexlate[nib] ; - nib = byte &0x0f ; - *outbuff++ = hexlate[nib] ; - *outbuff++ = ' ' ; - length-- ; - outlength += 3 ; - } - *outbuff = '\0' ; /* null terminate our output line */ - return outlength ; -} - /* Number of lines per page or UINT_MAX if paging is disabled. */ static unsigned int lines_per_page; @@ -1651,14 +1599,24 @@ gdb_file_adjust_strbuf (n, stream) GDB_FILE *stream; { int non_null_chars; + + if (stream->ts_streamtype != astring) + return; - non_null_chars = strlen(stream->ts_strbuf); - - if (n > (stream->ts_buflen - non_null_chars - 1)) + if (stream->ts_strbuf) { - stream->ts_buflen = n + non_null_chars + 1; - stream->ts_strbuf = xrealloc (stream->ts_strbuf, stream->ts_buflen); + /* There is already a buffer allocated */ + non_null_chars = strlen(stream->ts_strbuf); + + if (n > (stream->ts_buflen - non_null_chars - 1)) + { + stream->ts_buflen = n + non_null_chars + 1; + stream->ts_strbuf = xrealloc (stream->ts_strbuf, stream->ts_buflen); + } } + else + /* No buffer yet, so allocate one of the desired size */ + stream->ts_strbuf = xmalloc ((n + 1) * sizeof (char)); } GDB_FILE * @@ -2201,9 +2159,9 @@ char * n_spaces (n) int n; { - register char *t; - static char *spaces; - static int max_spaces; + char *t; + static char *spaces = 0; + static int max_spaces = -1; if (n > max_spaces) { @@ -2946,3 +2904,22 @@ preg_nz(reg) } return preg_str; } + +/* Helper functions for INNER_THAN */ +int +core_addr_lessthan (lhs, rhs) + CORE_ADDR lhs; + CORE_ADDR rhs; +{ + return (lhs < rhs); +} + +int +core_addr_greaterthan (lhs, rhs) + CORE_ADDR lhs; + CORE_ADDR rhs; +{ + return (lhs > rhs); +} + + diff --git a/gdb/valops.c b/gdb/valops.c index 643db86abb7..79f5b516b6a 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -55,9 +55,7 @@ static CORE_ADDR find_function_addr PARAMS ((value_ptr, struct type **)); static value_ptr value_arg_coerce PARAMS ((value_ptr, struct type *, int)); -#ifndef PUSH_ARGUMENTS static CORE_ADDR value_push PARAMS ((CORE_ADDR, value_ptr)); -#endif static value_ptr search_struct_field PARAMS ((char *, value_ptr, int, struct type *, int)); @@ -577,7 +575,6 @@ value_assign (toval, fromval) convert FROMVAL's contents now, with result in `raw_buffer', and set USE_BUFFER to the number of bytes to write. */ -#ifdef REGISTER_CONVERTIBLE if (VALUE_REGNO (toval) >= 0 && REGISTER_CONVERTIBLE (VALUE_REGNO (toval))) { @@ -590,7 +587,6 @@ value_assign (toval, fromval) use_buffer = REGISTER_RAW_SIZE (regno); } } -#endif switch (VALUE_LVAL (toval)) { @@ -1072,8 +1068,6 @@ push_bytes (sp, buffer, len) /* Push onto the stack the specified value VALUE. */ -#ifndef PUSH_ARGUMENTS - static CORE_ADDR value_push (sp, arg) register CORE_ADDR sp; @@ -1097,7 +1091,25 @@ value_push (sp, arg) return sp; } -#endif /* !PUSH_ARGUMENTS */ +#ifndef PUSH_ARGUMENTS +#define PUSH_ARGUMENTS default_push_arguments +#endif + +CORE_ADDR +default_push_arguments (nargs, args, struct_return, sp, struct_addr) + int nargs; + value_ptr *args; + int struct_return; + CORE_ADDR sp; + CORE_ADDR struct_addr; +{ + /* ASSERT ( !struct_return); */ + int i; + for (i = nargs - 1; i >= 0; i--) + sp = value_push (sp, args[i]); + return sp; +} + /* Perform the standard coercions that are specified for arguments to be passed to C functions. @@ -1370,7 +1382,7 @@ hand_function_call (function, nargs, args) /* Convex Unix prohibits executing in the stack segment. */ /* Hope there is empty room at the top of the text segment. */ extern CORE_ADDR text_end; - static checked = 0; + static int checked = 0; if (!checked) for (start_sp = text_end - sizeof_dummy1; start_sp < text_end; ++start_sp) if (read_memory_integer (start_sp, 1) != 0) @@ -1569,12 +1581,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name); #endif /* STACK_ALIGN */ #endif /* NO_EXTRA_ALIGNMENT_NEEDED */ -#ifdef PUSH_ARGUMENTS - PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr); -#else /* !PUSH_ARGUMENTS */ - for (i = nargs - 1; i >= 0; i--) - sp = value_push (sp, args[i]); -#endif /* !PUSH_ARGUMENTS */ + sp = PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr); #ifdef PUSH_RETURN_ADDRESS /* for targets that use no CALL_DUMMY */ /* There are a number of targets now which actually don't write any diff --git a/gdb/value.h b/gdb/value.h index d3d262a20a8..1ea48d2b50e 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -566,4 +566,9 @@ extern value_ptr find_function_in_inferior PARAMS ((char *)); extern value_ptr value_allocate_space_in_inferior PARAMS ((int)); +extern CORE_ADDR default_push_arguments PARAMS ((int nargs, value_ptr *args, + int struct_return, + CORE_ADDR sp, + CORE_ADDR struct_addr)); + #endif /* !defined (VALUE_H) */ diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index 7e0426035f1..a629da6f369 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -59,6 +59,18 @@ vax_skip_prologue (pc) return pc; } +/* Return number of args passed to a frame. + Can return -1, meaning no way to tell. */ + +int +vax_frame_num_args (fi) + struct frame_info *fi; +{ + return (0xff & read_memory_integer (FRAME_ARGS_ADDRESS (fi), 1)); +} + + + /* Print the vax instruction at address MEMADDR in debugged memory, from disassembler info INFO. Returns length of the instruction, in bytes. */ |