diff options
Diffstat (limited to 'gdb')
83 files changed, 6168 insertions, 5051 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a0f2770..35babd6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,4 +1,4 @@ -2003-03-26 Andrew Cagney <cagney@redhat.com> +2003-03-30 Andrew Cagney <cagney@redhat.com> Add frame debug info addresses: * frame-base.c: New file. @@ -36,6 +36,240 @@ (d10v_frame_base): New variable. (d10v_gdbarch_init): Set frame_base default. +2003-03-30 Mark Kettenis <kettenis@gnu.org> + + * i386-tdep.c (i386_store_struct_return): Removed. + (i386_gdbarch_init): Don't set deprecated_store_struct_return. + +2003-03-30 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (DEPRECATED_DUMMY_WRITE_SP): Replace TARGET_WRITE_SP. + * gdbarch.h, gdbarch.c: Regenerate. + * v850-tdep.c (v850_gdbarch_init): Set deprecated_dummy_write_sp. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * m68k-tdep.c (m68k_gdbarch_init): Ditto. + * i386-tdep.c (i386_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + * vax-tdep.c (vax_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * ns32k-tdep.c (ns32k_gdbarch_init): Ditto. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * alpha-tdep.c (alpha_gdbarch_init): Ditto. + * sparc-tdep.c (sparc_push_dummy_frame, sparc_pop_frame): Update. + * config/sparc/tm-sp64.h (DEPRECATED_DUMMY_WRITE_SP): Update. + * config/pa/tm-hppa.h (DEPRECATED_DUMMY_WRITE_SP): Define. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * avr-tdep.c (avr_gdbarch_init): Update. + * valops.c (hand_function_call): Replace TARGET_WRITE_SP with + DEPRECATED_DUMMY_WRITE_SP. Call when the method is available, + instead of when push_dummy_call is not available. + +2003-03-30 Andrew Cagney <cagney@redhat.com> + + * infttrace.c: Include "gdbthread.h". + (parent_attach_all): Fix function signature. + (call_ptrace): Update call. + * Makefile.in (infttrace.o): Update dependencies. + +2003-03-30 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (DEPRECATED_PUSH_RETURN_ADDRESS): Replace + PUSH_RETURN_ADDRESS. + * gdbarch.h, gdbarch.c: Regenerate. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_init_abi): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * mcore-tdep.c (mcore_gdbarch_init): Update. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * i386-tdep.c (i386_gdbarch_init): Update. + * h8300-tdep.c (h8300_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * avr-tdep.c (avr_gdbarch_init): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * valops.c (hand_function_call): Update. + +2003-03-29 Andrew Cagney <cagney@redhat.com> + + * d10v-tdep.c (d10v_gdbarch_init): Do not set call_dummy_words or + sizeof_call_dummy_words. + * gdbarch.sh (CALL_DUMMY_WORDS, SIZEOF_CALL_DUMMY_WORDS): Always + define. + * gdbarch.h: Regenerate. + +2003-03-29 Andrew Cagney <cagney@redhat.com> + + * infttrace.h: New file. + * hpread.c: Include "gdb_assert.h" and "somsolib.h". + (hpread_get_textlow): Detect an uninitialized dn_bufp. + (hpread_read_doc_function_type): Detect an initialized type1. + (hpread_quick_traverse): Initialize mod_name_string. + * somsolib.h: Add #ifdef SOMSOLIB_H wrapper. + (som_solib_get_solib_by_pc): Declare. + (so_lib_thread_start_addr): Declare. + (no_shared_libraries): Declare. + * somread.c (init_import_symbols): Make static. Add forward + declaration. + * config/pa/nm-hppah.h: Include "infttrace.h" for + parent_attach_all. + (hppa_insert_hw_watchpoint): Declare. + (hppa_can_use_hw_watchpoint, hppa_remove_hw_watchpoint): Declare. + * hppah-nat.c: Include "gdb_string.h". + (parent_attach_all): Delete extern declaration, moved to + "infttrace.h". + (hppa_can_use_hw_watchpoint): Change type of "type" parameter to + int. + (hppa_remove_hw_watchpoint, hppa_insert_hw_watchpoint): Ditto. + * Makefile.in (infttrace_h): Define. + (hpread.o): Update dependencies. + (hppah-nat.o, hppa-hpux-tdep.o, hppa-tdep.o): Ditto. + * hppa-hpux-tdep.c: Include "gdb_string.h". + * hppa-tdep.c (hppa_frame_saved_pc): Initialize "old_pc". + * infrun.c (handle_inferior_event): Always initialize + stepped_after_stopped_by_watchpoint. Add default and remove + fallthrough in switch statement. + * infttrace.c (hppa_can_use_hw_watchpoint): Change type of "type" + parameter to int. + (hppa_remove_hw_watchpoint): Ditto. + +2003-03-29 Andrew Cagney <cagney@redhat.com> + + * ns32k-tdep.c (ns32k_gdbarch_init): Set the call dummy breakpoint + offset. + +2003-03-29 Richard Earnshaw <rearnsha@arm.com> + + * arm-tdep.c (arm_push_arguments): Delete. + (struct stack_item): New type. + (push_stack_item, pop_stack_item, arm_push_dummy_call): New functions. + (arm_store_struct_return): Delte. + (arm_gdbarch_init): Register arm_push_dummy_call. Don't register + arm_push_arguments or arm_store_struct_return. + +2003-03-28 Andrew Cagney <cagney@redhat.com> + + * Makefile.in (d10v-tdep.o): Update dependencies. + * remote.h (target_resume_hook, target_wait_loop_hook): Declare. + * d10v-tdep.c: Include "remote.h". + (target_resume_hook): Delete extern declaration. + (target_wait_loop_hook): Ditto. + (tdisassemble_command): Eliminate assignment in "if" conditional. + (d10v_ts2_register_sim_regno): Eliminate call to + legacy_register_sim_regno. + (d10v_ts3_register_sim_regno): Ditto. + +2003-03-28 Jeff Johnston <jjohnstn@redhat.com> + + * thread.c: Reindented. + * lin-lwp.c: Ditto. + * linux-proc.c: Ditto. + +2003-03-28 Bob Rossi <bob_rossi@cox.net> + + * MAINTAINERS (write after approval): Add myself. + +2003-03-27 Theodore A. Roth <troth@openavr.org> + + * objc-exp.y: Add missing semi-colons. + +2003-03-27 Andrew Cagney <cagney@redhat.com> + + * regcache.c (write_sp): Delete function and references. + * inferior.h (write_sp): Delete declaration. + * valops.c (hand_function_call): Replace write_sp with + TARGET_WRITE_SP. + * sparc-tdep.c (sparc_push_dummy_frame): Ditto. + (sparc_pop_frame): Ditto. + +2003-03-27 Andrew Cagney <cagney@redhat.com> + + * NEWS: Mention removal of support for hppa*-*-bsd* and + hppa*-*-osf* natives, and hppa*-*-pro* target. + * config/pa/xm-hppah.h: Do not include "pa/xm-pa.h". + * config/pa/xm-pa.h: Obsolete file. + * config/pa/xm-hppab.h: Obsolete file. + * config/pa/nm-hppab.h: Obsolete file. + * config/pa/tm-hppab.h: Obsolete file. + * config/pa/tm-hppao.h: Obsolete file. + * config/pa/nm-hppao.h: Obsolete file. + * config/pa/tm-pro.h: Obsolete file. + * config/pa/hppaosf.mt: Obsolete file. + * config/pa/hppaosf.mh: Obsolete file. + * config/pa/hppapro.mt: Obsolete file. + * config/pa/hppabsd.mt: Obsolete file. + * config/pa/hppabsd.mh: Obsolete file. + * configure.host: Disable hppa*-*-bsd* and hppa*-*-osf*. + * configure.tgt: Disable hppa*-*-bsd*, hppa*-*-pro* and + hppa*-*-osf*. + +2003-03-27 Andrew Cagney <cagney@redhat.com> + + * d10v-tdep.c (d10v_gdbarch_init): Set push_dummy_call instead of + push_arguments. Don't set push_return_address or write_sp. + (d10v_push_dummy_call): Replace d10v_push_arguments. + (d10v_push_return_address, d10v_write_sp): Delete function, + handled by push_dummy_call. + +2003-03-26 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (DEPRECATED_PUSH_ARGUMENTS): Rename PUSH_ARGUMENTS. + (push_dummy_call): New pure multi-arch replacement with gdbarch, + regcache and dummy_addr parameters. + * gdbarch.h, gdbarch.c: Re-generate. + * valops.c (hand_function_call): Use gdbarch_push_dummy_call when + available; assume it will handle stack alignment and return + address issues. Fall back to DEPRECATED_PUSH_ARGUMENTS and + legacy_push_arguments. + (legacy_push_arguments): Rename default_push_arguments. + * value.h (legacy_push_arguments): Rename default_push_arguments. + * i386-tdep.c (i386_push_arguments): Call legacy_push_arguments. + * config/sparc/tm-sparc.h (DEPRECATED_PUSH_ARGUMENTS): Update. + * config/sparc/tm-sp64.h (DEPRECATED_PUSH_ARGUMENTS): Update. + * config/pa/tm-hppa.h (DEPRECATED_PUSH_ARGUMENTS): Update. + * config/i386/tm-symmetry.h: Update. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_init_abi): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * mcore-tdep.c (mcore_gdbarch_init): Update. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * i386-tdep.c (i386_gdbarch_init): Update. + * hppa-tdep.c (hppa_gdbarch_init): Update. + * h8300-tdep.c (h8300_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * d10v-tdep.c (d10v_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * avr-tdep.c (avr_gdbarch_init): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * arm-linux-tdep.c (arm_linux_init_abi): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + +2003-03-26 Daniel Jacobowitz <drow@mvista.com> + + * signals/signals.c (do_target_signal_to_host): Correct realtime + signal range test. + 2003-03-26 Daniel Jacobowitz <drow@mvista.com> * breakpoint.c (handle_gnu_4_16_catch_command, get_catch_sals) @@ -78,7 +312,7 @@ * objc-lang.c (objc_skip_trampoline): New function. (objc_language_defn): Add objc_skip_trampoline. -I2003-03-25 Andrew Cagney <cagney@redhat.com> +2003-03-25 Andrew Cagney <cagney@redhat.com> * frame.c (get_prev_frame): Delay validating a frame's ID - non-NULL, didn't go backwards - until an attempt to unwind it to diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS index 0adfcb6..15a0ea8 100644 --- a/gdb/MAINTAINERS +++ b/gdb/MAINTAINERS @@ -367,6 +367,7 @@ Hans-Peter Nilsson hp@bitrange.com David O'Brien obrien@freebsd.org Alexandre Oliva aoliva@redhat.com Tom Rix trix@redhat.com +Bob Rossi bob_rossi@cox.net Theodore A. Roth troth@verinet.com Ian Roxborough irox@redhat.com Grace Sainsbury graces@redhat.com diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 5449392..c1bd030 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -724,6 +724,7 @@ symtab_h = symtab.h target_h = target.h $(bfd_h) $(symtab_h) $(dcache_h) $(memattr_h) terminal_h = terminal.h top_h = top.h +infttrace_h = infttrace.h tracepoint_h = tracepoint.h typeprint_h = typeprint.h ui_file_h = ui-file.h @@ -1624,7 +1625,7 @@ cris-tdep.o: cris-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(inferior_h) \ d10v-tdep.o: d10v-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \ $(frame_base_h) $(symtab_h) $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) \ $(gdb_string_h) $(value_h) $(inferior_h) $(dis_asm_h) $(symfile_h) \ - $(objfiles_h) $(language_h) $(arch_utils_h) $(regcache_h) \ + $(objfiles_h) $(language_h) $(arch_utils_h) $(regcache_h) $(remote_h) \ $(floatformat_h) $(gdb_sim_d10v_h) $(sim_regno_h) $(gdb_assert_h) dbug-rom.o: dbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ $(serial_h) $(regcache_h) $(m68k_tdep_h) @@ -1748,11 +1749,12 @@ h8500-tdep.o: h8500-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbtypes_h) \ hpacc-abi.o: hpacc-abi.c $(defs_h) $(value_h) $(gdb_regex_h) $(gdb_string_h) \ $(gdbtypes_h) $(gdbcore_h) $(cp_abi_h) hppa-tdep.o: hppa-tdep.c $(defs_h) $(frame_h) $(bfd_h) $(inferior_h) \ - $(value_h) $(regcache_h) $(completer_h) $(symtab_h) $(a_out_encap_h) \ + $(value_h) $(regcache_h) $(completer_h) $(language_h) $(osabi_h) \ + $(gdb_assert_h) $(infttrace_h) $(symtab_h) $(a_out_encap_h) \ $(gdb_stat_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) \ - $(symfile_h) $(objfiles_h) $(language_h) $(osabi_h) $(gdb_assert_h) + $(symfile_h) $(objfiles_h) hppa-hpux-tdep.o: hppa-hpux-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \ - $(osabi_h) + $(osabi_h) $(gdb_string_h) hppab-nat.o: hppab-nat.c $(defs_h) $(inferior_h) $(target_h) $(regcache_h) hppah-nat.o: hppah-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ $(gdb_wait_h) $(regcache_h) @@ -1761,7 +1763,7 @@ hppam3-nat.o: hppam3-nat.c $(defs_h) $(inferior_h) $(floatformat_h) \ hpread.o: hpread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(hp_symtab_h) \ $(syms_h) $(symtab_h) $(symfile_h) $(objfiles_h) $(buildsym_h) \ $(complaints_h) $(gdb_stabs_h) $(gdbtypes_h) $(demangle_h) \ - $(gdb_string_h) + $(somsolib_h) $(gdb_assert_h) $(gdb_string_h) hpux-thread.o: hpux-thread.c $(defs_h) $(gdbthread_h) $(target_h) \ $(inferior_h) $(regcache_h) $(gdb_stat_h) $(gdbcore_h) i386-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ @@ -1839,7 +1841,7 @@ infrun.o: infrun.c $(defs_h) $(gdb_string_h) $(symtab_h) $(frame_h) \ inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ $(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h) $(inflow_h) infttrace.o: infttrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ - $(gdb_string_h) $(gdb_wait_h) $(command_h) $(gdbcore_h) + $(gdb_string_h) $(gdb_wait_h) $(command_h) $(gdbthread_h) $(gdbcore_h) interps.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \ $(event_top_h) $(interps_h) $(completer_h) $(gdb_string_h) \ $(gdb_events_h) $(gdb_assert_h) $(top_h) @@ -2117,7 +2119,7 @@ remote.o: remote.c $(defs_h) $(gdb_string_h) $(inferior_h) $(bfd_h) \ $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) $(gdb_stabs_h) \ $(gdbthread_h) $(remote_h) $(regcache_h) $(value_h) $(gdb_assert_h) \ $(event_loop_h) $(event_top_h) $(inf_loop_h) $(serial_h) \ - $(gdbcore_h) + $(gdbcore_h) $(solib_h) rom68k-rom.o: rom68k-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ $(serial_h) $(regcache_h) $(value_h) $(m68k_tdep_h) rs6000-nat.o: rs6000-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ @@ -41,6 +41,9 @@ Mitsubishi M32R/D w/simulator m32r-*-elf* Z8000 simulator z8k-zilog-none or z8ksim Matsushita MN10200 w/simulator mn10200-*-* H8/500 simulator h8500-hitachi-hms or h8500hms +HP/PA running BSD hppa*-*-bsd* +HP/PA running OSF/1 hppa*-*-osf* +HP/PA Pro target hppa*-*-pro* * REMOVED configurations and files diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index a6449e1..1a19257 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -67,7 +67,6 @@ static gdbarch_frame_locals_address_ftype alpha_frame_locals_address; static gdbarch_skip_prologue_ftype alpha_skip_prologue; static gdbarch_saved_pc_after_call_ftype alpha_saved_pc_after_call; -static gdbarch_push_arguments_ftype alpha_push_arguments; static gdbarch_fix_call_dummy_ftype alpha_fix_call_dummy; static gdbarch_get_longjmp_target_ftype alpha_get_longjmp_target; @@ -1853,7 +1852,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Settings for calling functions in the inferior. */ set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_push_arguments (gdbarch, alpha_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, alpha_push_arguments); set_gdbarch_deprecated_pop_frame (gdbarch, alpha_pop_frame); /* On the Alpha, the call dummy code is never copied to user space, @@ -1876,6 +1875,8 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_deprecated_push_dummy_frame (gdbarch, alpha_push_dummy_frame); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); set_gdbarch_fix_call_dummy (gdbarch, alpha_fix_call_dummy); set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop); set_gdbarch_deprecated_init_frame_pc_first (gdbarch, alpha_init_frame_pc_first); diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index 01b45f1..fa4d8fa 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -536,7 +536,7 @@ arm_linux_init_abi (struct gdbarch_info info, /* The following two overrides shouldn't be needed. */ set_gdbarch_deprecated_extract_return_value (gdbarch, arm_linux_extract_return_value); - set_gdbarch_push_arguments (gdbarch, arm_linux_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, arm_linux_push_arguments); /* Shared library handling. */ set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section); diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index dbe1483..ca15251 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -1334,137 +1334,6 @@ arm_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, write_register (4, fun); } -/* Note: ScottB - - This function does not support passing parameters using the FPA - variant of the APCS. It passes any floating point arguments in the - general registers and/or on the stack. */ - -static CORE_ADDR -arm_push_arguments (int nargs, struct value **args, CORE_ADDR sp, - int struct_return, CORE_ADDR struct_addr) -{ - CORE_ADDR fp; - int argnum; - int argreg; - int nstack; - int simd_argreg; - int second_pass; - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - - /* Walk through the list of args and determine how large a temporary - stack is required. Need to take care here as structs may be - passed on the stack, and we have to to push them. On the second - pass, do the store. */ - nstack = 0; - fp = sp; - for (second_pass = 0; second_pass < 2; second_pass++) - { - /* Compute the FP using the information computed during the - first pass. */ - if (second_pass) - fp = sp - nstack; - - simd_argreg = 0; - argreg = ARM_A1_REGNUM; - nstack = 0; - - /* The struct_return pointer occupies the first parameter - passing register. */ - if (struct_return) - { - if (second_pass) - { - if (arm_debug) - fprintf_unfiltered (gdb_stdlog, - "struct return in %s = 0x%s\n", - REGISTER_NAME (argreg), - paddr (struct_addr)); - write_register (argreg, struct_addr); - } - argreg++; - } - - for (argnum = 0; argnum < nargs; argnum++) - { - int len; - struct type *arg_type; - struct type *target_type; - enum type_code typecode; - char *val; - - arg_type = check_typedef (VALUE_TYPE (args[argnum])); - len = TYPE_LENGTH (arg_type); - target_type = TYPE_TARGET_TYPE (arg_type); - typecode = TYPE_CODE (arg_type); - val = VALUE_CONTENTS (args[argnum]); - - /* If the argument is a pointer to a function, and it is a - Thumb function, create a LOCAL copy of the value and set - the THUMB bit in it. */ - if (second_pass - && TYPE_CODE_PTR == typecode - && target_type != NULL - && TYPE_CODE_FUNC == TYPE_CODE (target_type)) - { - CORE_ADDR regval = extract_address (val, len); - if (arm_pc_is_thumb (regval)) - { - val = alloca (len); - store_address (val, len, MAKE_THUMB_ADDR (regval)); - } - } - - /* Copy the argument to general registers or the stack in - register-sized pieces. Large arguments are split between - registers and stack. */ - while (len > 0) - { - int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE; - - if (argreg <= ARM_LAST_ARG_REGNUM) - { - /* The argument is being passed in a general purpose - register. */ - if (second_pass) - { - CORE_ADDR regval = extract_address (val, - partial_len); - if (arm_debug) - fprintf_unfiltered (gdb_stdlog, - "arg %d in %s = 0x%s\n", - argnum, - REGISTER_NAME (argreg), - phex (regval, REGISTER_SIZE)); - write_register (argreg, regval); - } - argreg++; - } - else - { - if (second_pass) - { - /* Push the arguments onto the stack. */ - if (arm_debug) - fprintf_unfiltered (gdb_stdlog, - "arg %d @ 0x%s + %d\n", - argnum, paddr (fp), nstack); - write_memory (fp + nstack, val, REGISTER_SIZE); - } - nstack += REGISTER_SIZE; - } - - len -= partial_len; - val += partial_len; - } - - } - } - - /* Return the bottom of the argument list (pointed to by fp). */ - return fp; -} - /* Pop the current frame. So long as the frame info has been initialized properly (see arm_init_extra_frame_info), this code works for dummy frames as well as regular frames. I.e, there's no @@ -1499,6 +1368,161 @@ arm_pop_frame (void) flush_cached_frames (); } +/* When arguments must be pushed onto the stack, they go on in reverse + order. The code below implements a FILO (stack) to do this. */ + +struct stack_item +{ + int len; + struct stack_item *prev; + void *data; +}; + +static struct stack_item * +push_stack_item (struct stack_item *prev, void *contents, int len) +{ + struct stack_item *si; + si = xmalloc (sizeof (struct stack_item)); + si->data = malloc (len); + si->len = len; + si->prev = prev; + memcpy (si->data, contents, len); + return si; +} + +static struct stack_item * +pop_stack_item (struct stack_item *si) +{ + struct stack_item *dead = si; + si = si->prev; + xfree (dead->data); + xfree (dead); + return si; +} + +/* We currently only support passing parameters in integer registers. This + conforms with GCC's default model. Several other variants exist and + we should probably support some of them based on the selected ABI. */ + +static CORE_ADDR +arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, + CORE_ADDR dummy_addr, int nargs, struct value **args, + CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) +{ + int argnum; + int argreg; + int nstack; + struct stack_item *si = NULL; + + /* Set the return address. For the ARM, the return breakpoint is always + at DUMMY_ADDR. */ + /* XXX Fix for Thumb. */ + regcache_cooked_write_unsigned (regcache, ARM_LR_REGNUM, dummy_addr); + + /* Walk through the list of args and determine how large a temporary + stack is required. Need to take care here as structs may be + passed on the stack, and we have to to push them. */ + nstack = 0; + + argreg = ARM_A1_REGNUM; + nstack = 0; + + /* Some platforms require a double-word aligned stack. Make sure sp + is correctly aligned before we start. We always do this even if + it isn't really needed -- it can never hurt things. */ + sp &= ~(CORE_ADDR)(2 * REGISTER_SIZE - 1); + + /* The struct_return pointer occupies the first parameter + passing register. */ + if (struct_return) + { + if (arm_debug) + fprintf_unfiltered (gdb_stdlog, "struct return in %s = 0x%s\n", + REGISTER_NAME (argreg), paddr (struct_addr)); + regcache_cooked_write_unsigned (regcache, argreg, struct_addr); + argreg++; + } + + for (argnum = 0; argnum < nargs; argnum++) + { + int len; + struct type *arg_type; + struct type *target_type; + enum type_code typecode; + char *val; + + arg_type = check_typedef (VALUE_TYPE (args[argnum])); + len = TYPE_LENGTH (arg_type); + target_type = TYPE_TARGET_TYPE (arg_type); + typecode = TYPE_CODE (arg_type); + val = VALUE_CONTENTS (args[argnum]); + + /* If the argument is a pointer to a function, and it is a + Thumb function, create a LOCAL copy of the value and set + the THUMB bit in it. */ + if (TYPE_CODE_PTR == typecode + && target_type != NULL + && TYPE_CODE_FUNC == TYPE_CODE (target_type)) + { + CORE_ADDR regval = extract_address (val, len); + if (arm_pc_is_thumb (regval)) + { + val = alloca (len); + store_address (val, len, MAKE_THUMB_ADDR (regval)); + } + } + + /* Copy the argument to general registers or the stack in + register-sized pieces. Large arguments are split between + registers and stack. */ + while (len > 0) + { + int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE; + + if (argreg <= ARM_LAST_ARG_REGNUM) + { + /* The argument is being passed in a general purpose + register. */ + CORE_ADDR regval = extract_address (val, partial_len); + if (arm_debug) + fprintf_unfiltered (gdb_stdlog, "arg %d in %s = 0x%s\n", + argnum, REGISTER_NAME (argreg), + phex (regval, REGISTER_SIZE)); + regcache_cooked_write_unsigned (regcache, argreg, regval); + argreg++; + } + else + { + /* Push the arguments onto the stack. */ + if (arm_debug) + fprintf_unfiltered (gdb_stdlog, "arg %d @ sp + %d\n", + argnum, nstack); + si = push_stack_item (si, val, REGISTER_SIZE); + nstack += REGISTER_SIZE; + } + + len -= partial_len; + val += partial_len; + } + } + /* If we have an odd number of words to push, then decrement the stack + by one word now, so first stack argument will be dword aligned. */ + if (nstack & 4) + sp -= 4; + + while (si) + { + sp -= si->len; + write_memory (sp, si->data, si->len); + si = pop_stack_item (si); + } + + /* Finally, update teh SP register. */ + regcache_cooked_write_unsigned (regcache, ARM_SP_REGNUM, sp); + + return sp; +} + static void print_fpu_flags (int flags) { @@ -2456,15 +2480,6 @@ arm_store_return_value (struct type *type, struct regcache *regs, } } -/* Store the address of the place in which to copy the structure the - subroutine will return. This is called from call_function. */ - -static void -arm_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) -{ - write_register (ARM_A1_REGNUM, addr); -} - static int arm_get_longjmp_target (CORE_ADDR *pc) { @@ -2928,9 +2943,8 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); - set_gdbarch_push_return_address (gdbarch, arm_push_return_address); - set_gdbarch_push_arguments (gdbarch, arm_push_arguments); + set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call); /* Frame handling. */ set_gdbarch_deprecated_frame_chain_valid (gdbarch, arm_frame_chain_valid); @@ -2994,7 +3008,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Returning results. */ set_gdbarch_extract_return_value (gdbarch, arm_extract_return_value); set_gdbarch_store_return_value (gdbarch, arm_store_return_value); - set_gdbarch_deprecated_store_struct_return (gdbarch, arm_store_struct_return); set_gdbarch_use_struct_convention (gdbarch, arm_use_struct_convention); set_gdbarch_extract_struct_value_address (gdbarch, arm_extract_struct_value_address); diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 7358837..d3da3aa 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -1147,7 +1147,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_pc (gdbarch, avr_write_pc); set_gdbarch_read_fp (gdbarch, avr_read_fp); set_gdbarch_read_sp (gdbarch, avr_read_sp); - set_gdbarch_write_sp (gdbarch, avr_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, avr_write_sp); set_gdbarch_num_regs (gdbarch, AVR_NUM_REGS); @@ -1180,8 +1180,8 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_address_to_pointer (gdbarch, avr_address_to_pointer); set_gdbarch_pointer_to_address (gdbarch, avr_pointer_to_address); - set_gdbarch_push_arguments (gdbarch, avr_push_arguments); - set_gdbarch_push_return_address (gdbarch, avr_push_return_address); + set_gdbarch_deprecated_push_arguments (gdbarch, avr_push_arguments); + set_gdbarch_deprecated_push_return_address (gdbarch, avr_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, avr_pop_frame); set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention); diff --git a/gdb/config/i386/tm-symmetry.h b/gdb/config/i386/tm-symmetry.h index a15f45f..ea22290 100644 --- a/gdb/config/i386/tm-symmetry.h +++ b/gdb/config/i386/tm-symmetry.h @@ -266,7 +266,7 @@ switch (regno) { \ passes it on the stack. gcc should be fixed in future versions to adopt native cc conventions. */ -#undef PUSH_ARGUMENTS +#undef DEPRECATED_PUSH_ARGUMENTS #undef STORE_STRUCT_RETURN #define STORE_STRUCT_RETURN(ADDR, SP) write_register(0, (ADDR)) diff --git a/gdb/config/pa/hppabsd.mh b/gdb/config/pa/hppabsd.mh index d4a152d..e4d0215 100644 --- a/gdb/config/pa/hppabsd.mh +++ b/gdb/config/pa/hppabsd.mh @@ -1,4 +1,4 @@ -# Host: Hewlett-Packard PA-RISC machine, running BSD -XM_FILE= xm-hppab.h -NAT_FILE= nm-hppab.h -NATDEPFILES= hppab-nat.o corelow.o core-aout.o inftarg.o fork-child.o somread.o infptrace.o hpread.o somsolib.o +# OBSOLETE # Host: Hewlett-Packard PA-RISC machine, running BSD +# OBSOLETE XM_FILE= xm-hppab.h +# OBSOLETE NAT_FILE= nm-hppab.h +# OBSOLETE NATDEPFILES= hppab-nat.o corelow.o core-aout.o inftarg.o fork-child.o somread.o infptrace.o hpread.o somsolib.o diff --git a/gdb/config/pa/hppabsd.mt b/gdb/config/pa/hppabsd.mt index 0fc0380..e63f9b8 100644 --- a/gdb/config/pa/hppabsd.mt +++ b/gdb/config/pa/hppabsd.mt @@ -1,3 +1,3 @@ -# Target: HP PA-RISC running bsd -TDEPFILES= hppa-tdep.o -TM_FILE= tm-hppab.h +# OBSOLETE # Target: HP PA-RISC running bsd +# OBSOLETE TDEPFILES= hppa-tdep.o +# OBSOLETE TM_FILE= tm-hppab.h diff --git a/gdb/config/pa/hppaosf.mh b/gdb/config/pa/hppaosf.mh index d6dd282..0e82dc1 100644 --- a/gdb/config/pa/hppaosf.mh +++ b/gdb/config/pa/hppaosf.mh @@ -1,5 +1,5 @@ -# Host: Hewlett-Packard PA-RISC machine, running BSD -XM_FILE= xm-hppab.h -NAT_FILE= nm-hppao.h -NATDEPFILES= fork-child.o m3-nat.o hppam3-nat.o somread.o hpread.o somsolib.o -NAT_CLIBS= -lmachid -lnetname -lmach +# OBSOLETE # Host: Hewlett-Packard PA-RISC machine, running BSD +# OBSOLETE XM_FILE= xm-hppab.h +# OBSOLETE NAT_FILE= nm-hppao.h +# OBSOLETE NATDEPFILES= fork-child.o m3-nat.o hppam3-nat.o somread.o hpread.o somsolib.o +# OBSOLETE NAT_CLIBS= -lmachid -lnetname -lmach diff --git a/gdb/config/pa/hppaosf.mt b/gdb/config/pa/hppaosf.mt index 6754023..4a54c79 100644 --- a/gdb/config/pa/hppaosf.mt +++ b/gdb/config/pa/hppaosf.mt @@ -1,3 +1,3 @@ -# Target: HP PA-RISC running OSF1 -TDEPFILES= hppa-tdep.o -TM_FILE= tm-hppao.h +# OBSOLETE # Target: HP PA-RISC running OSF1 +# OBSOLETE TDEPFILES= hppa-tdep.o +# OBSOLETE TM_FILE= tm-hppao.h diff --git a/gdb/config/pa/hppapro.mt b/gdb/config/pa/hppapro.mt index 4851b18..cfd9969 100644 --- a/gdb/config/pa/hppapro.mt +++ b/gdb/config/pa/hppapro.mt @@ -1,3 +1,3 @@ -# Target: PA based debug monitor -TDEPFILES= hppa-tdep.o op50-rom.o w89k-rom.o monitor.o xmodem.o dsrec.o -TM_FILE= tm-pro.h +# OBSOLETE # Target: PA based debug monitor +# OBSOLETE TDEPFILES= hppa-tdep.o op50-rom.o w89k-rom.o monitor.o xmodem.o dsrec.o +# OBSOLETE TM_FILE= tm-pro.h diff --git a/gdb/config/pa/nm-hppab.h b/gdb/config/pa/nm-hppab.h index d9827dc..96dea6e 100644 --- a/gdb/config/pa/nm-hppab.h +++ b/gdb/config/pa/nm-hppab.h @@ -1,123 +1,123 @@ -/* HPPA PA-RISC machine native support for BSD, for GDB. - Copyright 1991, 1992, 1993, 1994, 1995, 2002 Free Software Foundation, Inc. - - This file is part of GDB. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include "somsolib.h" -#include "regcache.h" - -#define U_REGS_OFFSET 0 - -#define KERNEL_U_ADDR 0 - -/* What a coincidence! */ -#define REGISTER_U_ADDR(addr, blockend, regno) \ -{ addr = (int)(blockend) + REGISTER_BYTE (regno);} - -/* 3rd argument to ptrace is supposed to be a caddr_t. */ - -#define PTRACE_ARG3_TYPE caddr_t - -/* HPUX 8.0, in its infinite wisdom, has chosen to prototype ptrace - with five arguments, so programs written for normal ptrace lose. */ -#define FIVE_ARG_PTRACE - - -/* fetch_inferior_registers is in hppab-nat.c. */ -#define FETCH_INFERIOR_REGISTERS - -/* attach/detach works to some extent under BSD and HPUX. So long - as the process you're attaching to isn't blocked waiting on io, - blocked waiting on a signal, or in a system call things work - fine. (The problems in those cases are related to the fact that - the kernel can't provide complete register information for the - target process... Which really pisses off GDB.) */ - -#define ATTACH_DETACH - -/* The PA-BSD kernel has support for using the data memory break bit - to implement fast watchpoints. - - Watchpoints on the PA act much like traditional page protection - schemes, but with some notable differences. - - First, a special bit in the page table entry is used to cause - a trap when a specific page is written to. This avoids having - to overload watchpoints on the page protection bits. This makes - it possible for the kernel to easily decide if a trap was caused - by a watchpoint or by the user writing to protected memory and can - signal the user program differently in each case. - - Second, the PA has a bit in the processor status word which causes - data memory breakpoints (aka watchpoints) to be disabled for a single - instruction. This bit can be used to avoid the overhead of unprotecting - and reprotecting pages when it becomes necessary to step over a watchpoint. - - - When the kernel receives a trap indicating a write to a page which - is being watched, the kernel performs a couple of simple actions. First - is sets the magic "disable memory breakpoint" bit in the processor - status word, it then sends a SIGTRAP to the process which caused the - trap. - - GDB will take control and catch the signal for the inferior. GDB then - examines the PSW-X bit to determine if the SIGTRAP was caused by a - watchpoint firing. If so GDB single steps the inferior over the - instruction which caused the watchpoint to trigger (note because the - kernel disabled the data memory break bit for one instruction no trap - will be taken!). GDB will then determines the appropriate action to - take. (this may include restarting the inferior if the watchpoint - fired because of a write to an address on the same page as a watchpoint, - but no write to the watched address occured). */ - -#define TARGET_HAS_HARDWARE_WATCHPOINTS /* Enable the code in procfs.c */ - -/* The PA can watch any number of locations, there's no need for it to reject - anything (generic routines already check that all intermediates are - in memory). */ -#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \ - ((type) == bp_hardware_watchpoint) - -/* When a hardware watchpoint fires off the PC will be left at the - instruction which caused the watchpoint. It will be necessary for - GDB to step over the watchpoint. - - On a PA running BSD, it is trivial to identify when it will be - necessary to step over a hardware watchpoint as we can examine - the PSW-X bit. If the bit is on, then we trapped because of a - watchpoint, else we trapped for some other reason. */ -#define STOPPED_BY_WATCHPOINT(W) \ - ((W).kind == TARGET_WAITKIND_STOPPED \ - && (W).value.sig == TARGET_SIGNAL_TRAP \ - && ((int) read_register (IPSW_REGNUM) & 0x00100000)) - -/* The PA can single step over a watchpoint if the kernel has set the - "X" bit in the processor status word (disable data memory breakpoint - for one instruction). - - The kernel will always set this bit before notifying the inferior - that it hit a watchpoint. Thus, the inferior can single step over - the instruction which caused the watchpoint to fire. This avoids - the traditional need to disable the watchpoint, step the inferior, - then enable the watchpoint again. */ -#define HAVE_STEPPABLE_WATCHPOINT - -/* Use these macros for watchpoint insertion/deletion. */ -/* type can be 0: write watch, 1: read watch, 2: access watch (read/write) */ -#define target_insert_watchpoint(addr, len, type) hppa_set_watchpoint (addr, len, 1) -#define target_remove_watchpoint(addr, len, type) hppa_set_watchpoint (addr, len, 0) +// OBSOLETE /* HPPA PA-RISC machine native support for BSD, for GDB. +// OBSOLETE Copyright 1991, 1992, 1993, 1994, 1995, 2002 Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE #include "somsolib.h" +// OBSOLETE #include "regcache.h" +// OBSOLETE +// OBSOLETE #define U_REGS_OFFSET 0 +// OBSOLETE +// OBSOLETE #define KERNEL_U_ADDR 0 +// OBSOLETE +// OBSOLETE /* What a coincidence! */ +// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \ +// OBSOLETE { addr = (int)(blockend) + REGISTER_BYTE (regno);} +// OBSOLETE +// OBSOLETE /* 3rd argument to ptrace is supposed to be a caddr_t. */ +// OBSOLETE +// OBSOLETE #define PTRACE_ARG3_TYPE caddr_t +// OBSOLETE +// OBSOLETE /* HPUX 8.0, in its infinite wisdom, has chosen to prototype ptrace +// OBSOLETE with five arguments, so programs written for normal ptrace lose. */ +// OBSOLETE #define FIVE_ARG_PTRACE +// OBSOLETE +// OBSOLETE +// OBSOLETE /* fetch_inferior_registers is in hppab-nat.c. */ +// OBSOLETE #define FETCH_INFERIOR_REGISTERS +// OBSOLETE +// OBSOLETE /* attach/detach works to some extent under BSD and HPUX. So long +// OBSOLETE as the process you're attaching to isn't blocked waiting on io, +// OBSOLETE blocked waiting on a signal, or in a system call things work +// OBSOLETE fine. (The problems in those cases are related to the fact that +// OBSOLETE the kernel can't provide complete register information for the +// OBSOLETE target process... Which really pisses off GDB.) */ +// OBSOLETE +// OBSOLETE #define ATTACH_DETACH +// OBSOLETE +// OBSOLETE /* The PA-BSD kernel has support for using the data memory break bit +// OBSOLETE to implement fast watchpoints. +// OBSOLETE +// OBSOLETE Watchpoints on the PA act much like traditional page protection +// OBSOLETE schemes, but with some notable differences. +// OBSOLETE +// OBSOLETE First, a special bit in the page table entry is used to cause +// OBSOLETE a trap when a specific page is written to. This avoids having +// OBSOLETE to overload watchpoints on the page protection bits. This makes +// OBSOLETE it possible for the kernel to easily decide if a trap was caused +// OBSOLETE by a watchpoint or by the user writing to protected memory and can +// OBSOLETE signal the user program differently in each case. +// OBSOLETE +// OBSOLETE Second, the PA has a bit in the processor status word which causes +// OBSOLETE data memory breakpoints (aka watchpoints) to be disabled for a single +// OBSOLETE instruction. This bit can be used to avoid the overhead of unprotecting +// OBSOLETE and reprotecting pages when it becomes necessary to step over a watchpoint. +// OBSOLETE +// OBSOLETE +// OBSOLETE When the kernel receives a trap indicating a write to a page which +// OBSOLETE is being watched, the kernel performs a couple of simple actions. First +// OBSOLETE is sets the magic "disable memory breakpoint" bit in the processor +// OBSOLETE status word, it then sends a SIGTRAP to the process which caused the +// OBSOLETE trap. +// OBSOLETE +// OBSOLETE GDB will take control and catch the signal for the inferior. GDB then +// OBSOLETE examines the PSW-X bit to determine if the SIGTRAP was caused by a +// OBSOLETE watchpoint firing. If so GDB single steps the inferior over the +// OBSOLETE instruction which caused the watchpoint to trigger (note because the +// OBSOLETE kernel disabled the data memory break bit for one instruction no trap +// OBSOLETE will be taken!). GDB will then determines the appropriate action to +// OBSOLETE take. (this may include restarting the inferior if the watchpoint +// OBSOLETE fired because of a write to an address on the same page as a watchpoint, +// OBSOLETE but no write to the watched address occured). */ +// OBSOLETE +// OBSOLETE #define TARGET_HAS_HARDWARE_WATCHPOINTS /* Enable the code in procfs.c */ +// OBSOLETE +// OBSOLETE /* The PA can watch any number of locations, there's no need for it to reject +// OBSOLETE anything (generic routines already check that all intermediates are +// OBSOLETE in memory). */ +// OBSOLETE #define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \ +// OBSOLETE ((type) == bp_hardware_watchpoint) +// OBSOLETE +// OBSOLETE /* When a hardware watchpoint fires off the PC will be left at the +// OBSOLETE instruction which caused the watchpoint. It will be necessary for +// OBSOLETE GDB to step over the watchpoint. +// OBSOLETE +// OBSOLETE On a PA running BSD, it is trivial to identify when it will be +// OBSOLETE necessary to step over a hardware watchpoint as we can examine +// OBSOLETE the PSW-X bit. If the bit is on, then we trapped because of a +// OBSOLETE watchpoint, else we trapped for some other reason. */ +// OBSOLETE #define STOPPED_BY_WATCHPOINT(W) \ +// OBSOLETE ((W).kind == TARGET_WAITKIND_STOPPED \ +// OBSOLETE && (W).value.sig == TARGET_SIGNAL_TRAP \ +// OBSOLETE && ((int) read_register (IPSW_REGNUM) & 0x00100000)) +// OBSOLETE +// OBSOLETE /* The PA can single step over a watchpoint if the kernel has set the +// OBSOLETE "X" bit in the processor status word (disable data memory breakpoint +// OBSOLETE for one instruction). +// OBSOLETE +// OBSOLETE The kernel will always set this bit before notifying the inferior +// OBSOLETE that it hit a watchpoint. Thus, the inferior can single step over +// OBSOLETE the instruction which caused the watchpoint to fire. This avoids +// OBSOLETE the traditional need to disable the watchpoint, step the inferior, +// OBSOLETE then enable the watchpoint again. */ +// OBSOLETE #define HAVE_STEPPABLE_WATCHPOINT +// OBSOLETE +// OBSOLETE /* Use these macros for watchpoint insertion/deletion. */ +// OBSOLETE /* type can be 0: write watch, 1: read watch, 2: access watch (read/write) */ +// OBSOLETE #define target_insert_watchpoint(addr, len, type) hppa_set_watchpoint (addr, len, 1) +// OBSOLETE #define target_remove_watchpoint(addr, len, type) hppa_set_watchpoint (addr, len, 0) diff --git a/gdb/config/pa/nm-hppah.h b/gdb/config/pa/nm-hppah.h index 8387115..2cc1e30 100644 --- a/gdb/config/pa/nm-hppah.h +++ b/gdb/config/pa/nm-hppah.h @@ -117,6 +117,7 @@ extern int hppa_require_detach (int, int); /* The PA can watch any number of locations (generic routines already check that all intermediates are in watchable memory locations). */ +extern int hppa_can_use_hw_watchpoint (int type, int cnt, int ot); #define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \ hppa_can_use_hw_watchpoint(type, cnt, ot) @@ -198,9 +199,13 @@ extern void hppa_enable_page_protection_events (int); extern void hppa_disable_page_protection_events (int); /* Use these macros for watchpoint insertion/deletion. */ +extern int hppa_insert_hw_watchpoint (int pid, CORE_ADDR start, LONGEST len, + int type); #define target_insert_watchpoint(addr, len, type) \ hppa_insert_hw_watchpoint (PIDGET (inferior_ptid), addr, (LONGEST)(len), type) +extern int hppa_remove_hw_watchpoint (int pid, CORE_ADDR start, LONGEST len, + int type); #define target_remove_watchpoint(addr, len, type) \ hppa_remove_hw_watchpoint (PIDGET (inferior_ptid), addr, (LONGEST)(len), type) @@ -265,3 +270,5 @@ extern int hppa_resume_execd_vforking_child_to_get_parent_vfork (void); #define MAY_FOLLOW_EXEC (1) #define USE_THREAD_STEP_NEEDED (1) + +#include "infttrace.h" /* For parent_attach_all. */ diff --git a/gdb/config/pa/nm-hppao.h b/gdb/config/pa/nm-hppao.h index 6389b2c..0a6b810 100644 --- a/gdb/config/pa/nm-hppao.h +++ b/gdb/config/pa/nm-hppao.h @@ -1,43 +1,43 @@ -/* HPPA PA-RISC machine native support for Lites, for GDB. - Copyright 1995, 2002 Free Software Foundation, Inc. - - This file is part of GDB. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include "config/nm-m3.h" -#define U_REGS_OFFSET 0 - -#define KERNEL_U_ADDR 0 - -/* What a coincidence! */ -#define REGISTER_U_ADDR(addr, blockend, regno) \ -{ addr = (int)(blockend) + REGISTER_BYTE (regno);} - -/* fetch_inferior_registers is in hppab-nat.c. */ -#define FETCH_INFERIOR_REGISTERS - -/* attach/detach works to some extent under BSD and HPUX. So long - as the process you're attaching to isn't blocked waiting on io, - blocked waiting on a signal, or in a system call things work - fine. (The problems in those cases are related to the fact that - the kernel can't provide complete register information for the - target process... Which really pisses off GDB.) */ - -#define ATTACH_DETACH - -#define EMULATOR_BASE 0x90100000 -#define EMULATOR_END 0x90200000 +// OBSOLETE /* HPPA PA-RISC machine native support for Lites, for GDB. +// OBSOLETE Copyright 1995, 2002 Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE #include "config/nm-m3.h" +// OBSOLETE #define U_REGS_OFFSET 0 +// OBSOLETE +// OBSOLETE #define KERNEL_U_ADDR 0 +// OBSOLETE +// OBSOLETE /* What a coincidence! */ +// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \ +// OBSOLETE { addr = (int)(blockend) + REGISTER_BYTE (regno);} +// OBSOLETE +// OBSOLETE /* fetch_inferior_registers is in hppab-nat.c. */ +// OBSOLETE #define FETCH_INFERIOR_REGISTERS +// OBSOLETE +// OBSOLETE /* attach/detach works to some extent under BSD and HPUX. So long +// OBSOLETE as the process you're attaching to isn't blocked waiting on io, +// OBSOLETE blocked waiting on a signal, or in a system call things work +// OBSOLETE fine. (The problems in those cases are related to the fact that +// OBSOLETE the kernel can't provide complete register information for the +// OBSOLETE target process... Which really pisses off GDB.) */ +// OBSOLETE +// OBSOLETE #define ATTACH_DETACH +// OBSOLETE +// OBSOLETE #define EMULATOR_BASE 0x90100000 +// OBSOLETE #define EMULATOR_END 0x90200000 diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 64a4fe1..9c26c79 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -24,6 +24,9 @@ #include "regcache.h" +/* Wonder if this is correct? Should be using push_dummy_call(). */ +#define DEPRECATED_DUMMY_WRITE_SP(SP) generic_target_write_sp (SP) + #define GDB_MULTI_ARCH 0 /* NOTE: cagney/2002-11-24: This is a guess. */ @@ -614,7 +617,7 @@ extern CORE_ADDR hppa_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, int, struct value **, struct type *, int); #if !GDB_MULTI_ARCH -#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \ +#define DEPRECATED_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 (int, struct value **, CORE_ADDR, int, CORE_ADDR); diff --git a/gdb/config/pa/tm-hppab.h b/gdb/config/pa/tm-hppab.h index 1cd438d..edacdbf 100644 --- a/gdb/config/pa/tm-hppab.h +++ b/gdb/config/pa/tm-hppab.h @@ -1,47 +1,47 @@ -/* Parameters for execution on an HP PA-RISC machine running BSD, for GDB. - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.edu). */ - -/* For BSD: - - The signal context structure pointer is always saved at the base - of the frame + 0x4. - - We get the PC & SP directly from the sigcontext structure itself. - For other registers we have to dive in a little deeper: - - The hardware save state pointer is at offset 0x10 within the - signal context structure. - - Within the hardware save state, registers are found in the same order - as the register numbers in GDB. */ - -#define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \ -{ \ - *(TMP) = read_memory_integer ((FRAME)->frame + 0x4, 4); \ - *(TMP) = read_memory_integer (*(TMP) + 0x18, 4); \ -} - -#define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \ -{ \ - *(TMP) = read_memory_integer ((FRAME)->frame + 0x4, 4); \ - *(TMP) = read_memory_integer (*(TMP) + 0x8, 4); \ -} - -#define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \ -{ \ - int i; \ - CORE_ADDR TMP; \ - TMP = read_memory_integer ((FRAME)->frame + 0x4, 4); \ - TMP = read_memory_integer (TMP + 0x10, 4); \ - for (i = 0; i < NUM_REGS; i++) \ - { \ - if (i == SP_REGNUM) \ - (FSR)->regs[SP_REGNUM] = read_memory_integer (TMP + SP_REGNUM * 4, 4); \ - else \ - (FSR)->regs[i] = TMP + i * 4; \ - } \ -} - -/* It's mostly just the common stuff. */ -#include "pa/tm-hppa.h" +// OBSOLETE /* Parameters for execution on an HP PA-RISC machine running BSD, for GDB. +// OBSOLETE Contributed by the Center for Software Science at the +// OBSOLETE University of Utah (pa-gdb-bugs@cs.utah.edu). */ +// OBSOLETE +// OBSOLETE /* For BSD: +// OBSOLETE +// OBSOLETE The signal context structure pointer is always saved at the base +// OBSOLETE of the frame + 0x4. +// OBSOLETE +// OBSOLETE We get the PC & SP directly from the sigcontext structure itself. +// OBSOLETE For other registers we have to dive in a little deeper: +// OBSOLETE +// OBSOLETE The hardware save state pointer is at offset 0x10 within the +// OBSOLETE signal context structure. +// OBSOLETE +// OBSOLETE Within the hardware save state, registers are found in the same order +// OBSOLETE as the register numbers in GDB. */ +// OBSOLETE +// OBSOLETE #define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \ +// OBSOLETE { \ +// OBSOLETE *(TMP) = read_memory_integer ((FRAME)->frame + 0x4, 4); \ +// OBSOLETE *(TMP) = read_memory_integer (*(TMP) + 0x18, 4); \ +// OBSOLETE } +// OBSOLETE +// OBSOLETE #define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \ +// OBSOLETE { \ +// OBSOLETE *(TMP) = read_memory_integer ((FRAME)->frame + 0x4, 4); \ +// OBSOLETE *(TMP) = read_memory_integer (*(TMP) + 0x8, 4); \ +// OBSOLETE } +// OBSOLETE +// OBSOLETE #define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \ +// OBSOLETE { \ +// OBSOLETE int i; \ +// OBSOLETE CORE_ADDR TMP; \ +// OBSOLETE TMP = read_memory_integer ((FRAME)->frame + 0x4, 4); \ +// OBSOLETE TMP = read_memory_integer (TMP + 0x10, 4); \ +// OBSOLETE for (i = 0; i < NUM_REGS; i++) \ +// OBSOLETE { \ +// OBSOLETE if (i == SP_REGNUM) \ +// OBSOLETE (FSR)->regs[SP_REGNUM] = read_memory_integer (TMP + SP_REGNUM * 4, 4); \ +// OBSOLETE else \ +// OBSOLETE (FSR)->regs[i] = TMP + i * 4; \ +// OBSOLETE } \ +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* It's mostly just the common stuff. */ +// OBSOLETE #include "pa/tm-hppa.h" diff --git a/gdb/config/pa/tm-hppao.h b/gdb/config/pa/tm-hppao.h index e6fae89..a466287 100644 --- a/gdb/config/pa/tm-hppao.h +++ b/gdb/config/pa/tm-hppao.h @@ -1,98 +1,98 @@ -/* Parameters for execution on an HP PA-RISC machine running OSF1, for GDB. - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.edu). */ - -#include "regcache.h" - -/* Define offsets to access CPROC stack when it does not have - * a kernel thread. - */ -#define MACHINE_CPROC_SP_OFFSET 20 -#define MACHINE_CPROC_PC_OFFSET 16 -#define MACHINE_CPROC_FP_OFFSET 12 - -/* - * Software defined PSW masks. - */ -#define PSW_SS 0x10000000 /* Kernel managed single step */ - -/* Thread flavors used in re-setting the T bit. - * @@ this is also bad for cross debugging. - */ -#define TRACE_FLAVOR HP800_THREAD_STATE -#define TRACE_FLAVOR_SIZE HP800_THREAD_STATE_COUNT -#define TRACE_SET(x,state) \ - ((struct hp800_thread_state *)state)->cr22 |= PSW_SS -#define TRACE_CLEAR(x,state) \ - ((((struct hp800_thread_state *)state)->cr22 &= ~PSW_SS), 1) - -/* For OSF1 (Should be close if not identical to BSD, but I haven't - tested it yet): - - The signal context structure pointer is always saved at the base - of the frame + 0x4. - - We get the PC & SP directly from the sigcontext structure itself. - For other registers we have to dive in a little deeper: - - The hardware save state pointer is at offset 0x10 within the - signal context structure. - - Within the hardware save state, registers are found in the same order - as the register numbers in GDB. */ - -#define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \ -{ \ - *(TMP) = read_memory_integer ((FRAME)->frame + 0x4, 4); \ - *(TMP) = read_memory_integer (*(TMP) + 0x18, 4); \ -} - -#define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \ -{ \ - *(TMP) = read_memory_integer ((FRAME)->frame + 0x4, 4); \ - *(TMP) = read_memory_integer (*(TMP) + 0x8, 4); \ -} - -#define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \ -{ \ - int i; \ - CORE_ADDR TMP; \ - TMP = read_memory_integer ((FRAME)->frame + 0x4, 4); \ - TMP = read_memory_integer (TMP + 0x10, 4); \ - for (i = 0; i < NUM_REGS; i++) \ - { \ - if (i == SP_REGNUM) \ - (FSR)->regs[SP_REGNUM] = read_memory_integer (TMP + SP_REGNUM * 4, 4); \ - else \ - (FSR)->regs[i] = TMP + i * 4; \ - } \ -} - -/* OSF1 does not need the pc space queue restored. */ -#define NO_PC_SPACE_QUEUE_RESTORE - -/* The mach kernel uses the recovery counter to implement single - stepping. While this greatly simplifies the kernel support - necessary for single stepping, it unfortunately does the wrong - thing in the presense of a nullified instruction (gives control - back two insns after the nullifed insn). This is an artifact - of the HP architecture (recovery counter doesn't tick for - nullified insns). - - Do our best to avoid losing in such situations. */ -#define INSTRUCTION_NULLIFIED \ -(({ \ - int ipsw = (int)read_register(IPSW_REGNUM); \ - if (ipsw & PSW_N) \ - { \ - int pcoqt = (int)read_register(PCOQ_TAIL_REGNUM); \ - write_register(PCOQ_HEAD_REGNUM, pcoqt); \ - write_register(PCOQ_TAIL_REGNUM, pcoqt + 0x4); \ - write_register(IPSW_REGNUM, ipsw & ~(PSW_N | PSW_B | PSW_X)); \ - stop_pc = pcoqt; \ - } \ - }), 0) - -/* It's mostly just the common stuff. */ - -#include "pa/tm-hppa.h" +// OBSOLETE /* Parameters for execution on an HP PA-RISC machine running OSF1, for GDB. +// OBSOLETE Contributed by the Center for Software Science at the +// OBSOLETE University of Utah (pa-gdb-bugs@cs.utah.edu). */ +// OBSOLETE +// OBSOLETE #include "regcache.h" +// OBSOLETE +// OBSOLETE /* Define offsets to access CPROC stack when it does not have +// OBSOLETE * a kernel thread. +// OBSOLETE */ +// OBSOLETE #define MACHINE_CPROC_SP_OFFSET 20 +// OBSOLETE #define MACHINE_CPROC_PC_OFFSET 16 +// OBSOLETE #define MACHINE_CPROC_FP_OFFSET 12 +// OBSOLETE +// OBSOLETE /* +// OBSOLETE * Software defined PSW masks. +// OBSOLETE */ +// OBSOLETE #define PSW_SS 0x10000000 /* Kernel managed single step */ +// OBSOLETE +// OBSOLETE /* Thread flavors used in re-setting the T bit. +// OBSOLETE * @@ this is also bad for cross debugging. +// OBSOLETE */ +// OBSOLETE #define TRACE_FLAVOR HP800_THREAD_STATE +// OBSOLETE #define TRACE_FLAVOR_SIZE HP800_THREAD_STATE_COUNT +// OBSOLETE #define TRACE_SET(x,state) \ +// OBSOLETE ((struct hp800_thread_state *)state)->cr22 |= PSW_SS +// OBSOLETE #define TRACE_CLEAR(x,state) \ +// OBSOLETE ((((struct hp800_thread_state *)state)->cr22 &= ~PSW_SS), 1) +// OBSOLETE +// OBSOLETE /* For OSF1 (Should be close if not identical to BSD, but I haven't +// OBSOLETE tested it yet): +// OBSOLETE +// OBSOLETE The signal context structure pointer is always saved at the base +// OBSOLETE of the frame + 0x4. +// OBSOLETE +// OBSOLETE We get the PC & SP directly from the sigcontext structure itself. +// OBSOLETE For other registers we have to dive in a little deeper: +// OBSOLETE +// OBSOLETE The hardware save state pointer is at offset 0x10 within the +// OBSOLETE signal context structure. +// OBSOLETE +// OBSOLETE Within the hardware save state, registers are found in the same order +// OBSOLETE as the register numbers in GDB. */ +// OBSOLETE +// OBSOLETE #define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \ +// OBSOLETE { \ +// OBSOLETE *(TMP) = read_memory_integer ((FRAME)->frame + 0x4, 4); \ +// OBSOLETE *(TMP) = read_memory_integer (*(TMP) + 0x18, 4); \ +// OBSOLETE } +// OBSOLETE +// OBSOLETE #define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \ +// OBSOLETE { \ +// OBSOLETE *(TMP) = read_memory_integer ((FRAME)->frame + 0x4, 4); \ +// OBSOLETE *(TMP) = read_memory_integer (*(TMP) + 0x8, 4); \ +// OBSOLETE } +// OBSOLETE +// OBSOLETE #define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \ +// OBSOLETE { \ +// OBSOLETE int i; \ +// OBSOLETE CORE_ADDR TMP; \ +// OBSOLETE TMP = read_memory_integer ((FRAME)->frame + 0x4, 4); \ +// OBSOLETE TMP = read_memory_integer (TMP + 0x10, 4); \ +// OBSOLETE for (i = 0; i < NUM_REGS; i++) \ +// OBSOLETE { \ +// OBSOLETE if (i == SP_REGNUM) \ +// OBSOLETE (FSR)->regs[SP_REGNUM] = read_memory_integer (TMP + SP_REGNUM * 4, 4); \ +// OBSOLETE else \ +// OBSOLETE (FSR)->regs[i] = TMP + i * 4; \ +// OBSOLETE } \ +// OBSOLETE } +// OBSOLETE +// OBSOLETE /* OSF1 does not need the pc space queue restored. */ +// OBSOLETE #define NO_PC_SPACE_QUEUE_RESTORE +// OBSOLETE +// OBSOLETE /* The mach kernel uses the recovery counter to implement single +// OBSOLETE stepping. While this greatly simplifies the kernel support +// OBSOLETE necessary for single stepping, it unfortunately does the wrong +// OBSOLETE thing in the presense of a nullified instruction (gives control +// OBSOLETE back two insns after the nullifed insn). This is an artifact +// OBSOLETE of the HP architecture (recovery counter doesn't tick for +// OBSOLETE nullified insns). +// OBSOLETE +// OBSOLETE Do our best to avoid losing in such situations. */ +// OBSOLETE #define INSTRUCTION_NULLIFIED \ +// OBSOLETE (({ \ +// OBSOLETE int ipsw = (int)read_register(IPSW_REGNUM); \ +// OBSOLETE if (ipsw & PSW_N) \ +// OBSOLETE { \ +// OBSOLETE int pcoqt = (int)read_register(PCOQ_TAIL_REGNUM); \ +// OBSOLETE write_register(PCOQ_HEAD_REGNUM, pcoqt); \ +// OBSOLETE write_register(PCOQ_TAIL_REGNUM, pcoqt + 0x4); \ +// OBSOLETE write_register(IPSW_REGNUM, ipsw & ~(PSW_N | PSW_B | PSW_X)); \ +// OBSOLETE stop_pc = pcoqt; \ +// OBSOLETE } \ +// OBSOLETE }), 0) +// OBSOLETE +// OBSOLETE /* It's mostly just the common stuff. */ +// OBSOLETE +// OBSOLETE #include "pa/tm-hppa.h" diff --git a/gdb/config/pa/tm-pro.h b/gdb/config/pa/tm-pro.h index 05ecb62..c4f2b77 100644 --- a/gdb/config/pa/tm-pro.h +++ b/gdb/config/pa/tm-pro.h @@ -1,14 +1,14 @@ -/* Parameters for execution on an HP PA-RISC level 0 embedded system. - This is based on tm-hppab.h. - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.edu). */ - -#define PA_LEVEL_0 /* Disables touching space regs and fp */ - -/* All the PRO targets use software floating point at the moment. */ -#define SOFT_FLOAT 1 - -/* It's mostly just the common stuff. */ -#include "pa/tm-hppa.h" - -#define GDB_TARGET_IS_PA_ELF +// OBSOLETE /* Parameters for execution on an HP PA-RISC level 0 embedded system. +// OBSOLETE This is based on tm-hppab.h. +// OBSOLETE Contributed by the Center for Software Science at the +// OBSOLETE University of Utah (pa-gdb-bugs@cs.utah.edu). */ +// OBSOLETE +// OBSOLETE #define PA_LEVEL_0 /* Disables touching space regs and fp */ +// OBSOLETE +// OBSOLETE /* All the PRO targets use software floating point at the moment. */ +// OBSOLETE #define SOFT_FLOAT 1 +// OBSOLETE +// OBSOLETE /* It's mostly just the common stuff. */ +// OBSOLETE #include "pa/tm-hppa.h" +// OBSOLETE +// OBSOLETE #define GDB_TARGET_IS_PA_ELF diff --git a/gdb/config/pa/xm-hppab.h b/gdb/config/pa/xm-hppab.h index d2561df..d46e5ad 100644 --- a/gdb/config/pa/xm-hppab.h +++ b/gdb/config/pa/xm-hppab.h @@ -1,24 +1,24 @@ -/* Parameters for hosting on an HPPA PA-RISC machine, running BSD, for GDB. - Copyright 1991, 1992, 1993, 1996, 1998 Free Software Foundation, Inc. - - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.edu). - - This file is part of GDB. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include "pa/xm-pa.h" +// OBSOLETE /* Parameters for hosting on an HPPA PA-RISC machine, running BSD, for GDB. +// OBSOLETE Copyright 1991, 1992, 1993, 1996, 1998 Free Software Foundation, Inc. +// OBSOLETE +// OBSOLETE Contributed by the Center for Software Science at the +// OBSOLETE University of Utah (pa-gdb-bugs@cs.utah.edu). +// OBSOLETE +// OBSOLETE This file is part of GDB. +// OBSOLETE +// OBSOLETE This program is free software; you can redistribute it and/or modify +// OBSOLETE it under the terms of the GNU General Public License as published by +// OBSOLETE the Free Software Foundation; either version 2 of the License, or +// OBSOLETE (at your option) any later version. +// OBSOLETE +// OBSOLETE This program is distributed in the hope that it will be useful, +// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of +// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// OBSOLETE GNU General Public License for more details. +// OBSOLETE +// OBSOLETE You should have received a copy of the GNU General Public License +// OBSOLETE along with this program; if not, write to the Free Software +// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, +// OBSOLETE Boston, MA 02111-1307, USA. */ +// OBSOLETE +// OBSOLETE #include "pa/xm-pa.h" diff --git a/gdb/config/pa/xm-hppah.h b/gdb/config/pa/xm-hppah.h index b1c26dd..a2ed9ba 100644 --- a/gdb/config/pa/xm-hppah.h +++ b/gdb/config/pa/xm-hppah.h @@ -22,8 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "pa/xm-pa.h" - #define USG #define HAVE_TERMIOS diff --git a/gdb/config/pa/xm-pa.h b/gdb/config/pa/xm-pa.h index 979609d..0095003 100644 --- a/gdb/config/pa/xm-pa.h +++ b/gdb/config/pa/xm-pa.h @@ -1,5 +1,5 @@ -/* Definitions for all PA machines. */ - -/* This was created for "makeva", which is obsolete. This file can - probably go away (unless someone can think of some other host thing - which is common to various pa machines). */ +// OBSOLETE /* Definitions for all PA machines. */ +// OBSOLETE +// OBSOLETE /* This was created for "makeva", which is obsolete. This file can +// OBSOLETE probably go away (unless someone can think of some other host thing +// OBSOLETE which is common to various pa machines). */ diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h index 8abec1c..b4417b8 100644 --- a/gdb/config/sparc/tm-sp64.h +++ b/gdb/config/sparc/tm-sp64.h @@ -208,8 +208,8 @@ void sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, CORE_ADDR sparc64_push_arguments (int, struct value **, CORE_ADDR, int, CORE_ADDR); -#undef PUSH_ARGUMENTS -#define PUSH_ARGUMENTS(A,B,C,D,E) \ +#undef DEPRECATED_PUSH_ARGUMENTS +#define DEPRECATED_PUSH_ARGUMENTS(A,B,C,D,E) \ (sparc64_push_arguments ((A), (B), (C), (D), (E))) /* Store the address of the place in which to copy the structure the @@ -274,7 +274,7 @@ extern void sparc64_write_sp (CORE_ADDR); #define TARGET_READ_SP() (sparc64_read_sp ()) #define TARGET_READ_FP() (sparc64_read_fp ()) -#define TARGET_WRITE_SP(X) (sparc64_write_sp (X)) +#define DEPRECATED_DUMMY_WRITE_SP(X) (sparc64_write_sp (X)) #undef DEPRECATED_EXTRACT_RETURN_VALUE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h index 7b11c4f..ef39962 100644 --- a/gdb/config/sparc/tm-sparc.h +++ b/gdb/config/sparc/tm-sparc.h @@ -688,7 +688,7 @@ void sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, void sparc_push_dummy_frame (void); void sparc_pop_frame (void); -#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \ +#define DEPRECATED_PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \ sparc32_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) extern CORE_ADDR sparc32_push_arguments (int, struct value **, CORE_ADDR, int, diff --git a/gdb/configure.host b/gdb/configure.host index b309a33..98acc7e 100644 --- a/gdb/configure.host +++ b/gdb/configure.host @@ -40,13 +40,13 @@ arm*-*-linux*) gdb_host=linux ;; arm*-*-netbsdelf*) gdb_host=nbsdelf ;; arm*-*-netbsd*) gdb_host=nbsdaout ;; -hppa*-*-bsd*) gdb_host=hppabsd ;; +# OBSOLETE hppa*-*-bsd*) gdb_host=hppabsd ;; hppa*-*-hiux*) gdb_host=hppahpux ;; hppa*-*-hpux10.20) gdb_host=hpux1020 ;; hppa*64*-*-hpux11*) gdb_host=hpux11w ;; hppa*-*-hpux11*) gdb_host=hpux11 ;; hppa*-*-hpux*) gdb_host=hppahpux ;; -hppa*-*-osf*) gdb_host=hppaosf ;; +# OBSOLETE hppa*-*-osf*) gdb_host=hppaosf ;; i[3456]86-ncr-*) gdb_host=ncr3000 ;; i[3456]86-sequent-bsd*) gdb_host=symmetry ;; # dynix diff --git a/gdb/configure.tgt b/gdb/configure.tgt index 17ac70f..9a4dba3 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -73,12 +73,12 @@ h8300-*-*) gdb_target=h8300 ;; frv-*-*) gdb_target=frv ;; -hppa*-*-bsd*) gdb_target=hppabsd ;; -hppa*-*-pro*) gdb_target=hppapro ;; +# OBSOLETE hppa*-*-bsd*) gdb_target=hppabsd ;; +# OBSOLETE hppa*-*-pro*) gdb_target=hppapro ;; hppa*64*-*-hpux11*) gdb_target=hppa64 ;; hppa*-*-hpux*) gdb_target=hppahpux ;; hppa*-*-hiux*) gdb_target=hppahpux ;; -hppa*-*-osf*) gdb_target=hppaosf ;; +# OBSOLETE hppa*-*-osf*) gdb_target=hppaosf ;; hppa*-*-*) gdb_target=hppa ;; i[3456]86-sequent-bsd*) gdb_target=symmetry ;; diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 8bf0646..a618f55 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -4154,7 +4154,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (tdep->cris_abi == CRIS_ABI_ORIGINAL) { set_gdbarch_double_bit (gdbarch, 32); - set_gdbarch_push_arguments (gdbarch, cris_abi_original_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, cris_abi_original_push_arguments); set_gdbarch_deprecated_store_return_value (gdbarch, cris_abi_original_store_return_value); set_gdbarch_deprecated_extract_return_value @@ -4165,7 +4165,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) else if (tdep->cris_abi == CRIS_ABI_V2) { set_gdbarch_double_bit (gdbarch, 64); - set_gdbarch_push_arguments (gdbarch, cris_abi_v2_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, cris_abi_v2_push_arguments); set_gdbarch_deprecated_store_return_value (gdbarch, cris_abi_v2_store_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, cris_abi_v2_extract_return_value); @@ -4283,7 +4283,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* No register requires conversion from raw format to virtual format. */ set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not); - set_gdbarch_push_return_address (gdbarch, cris_push_return_address); + set_gdbarch_deprecated_push_return_address (gdbarch, cris_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, cris_pop_frame); set_gdbarch_deprecated_store_struct_return (gdbarch, cris_store_struct_return); @@ -4323,6 +4323,9 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Helpful for backtracing and returning in a call dummy. */ set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + /* Use target_specific function to define link map offsets. */ set_solib_svr4_fetch_link_map_offsets (gdbarch, cris_linux_svr4_fetch_link_map_offsets); diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 31b4989..56a7260 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -39,7 +39,7 @@ #include "language.h" #include "arch-utils.h" #include "regcache.h" - +#include "remote.h" #include "floatformat.h" #include "gdb/sim-d10v.h" #include "sim-regno.h" @@ -277,8 +277,8 @@ d10v_imap_register (int reg_nr) static int d10v_ts2_register_sim_regno (int nr) { - if (legacy_register_sim_regno (nr) < 0) - return legacy_register_sim_regno (nr); + /* Only makes sense to supply raw registers. */ + gdb_assert (nr >= 0 && nr < NUM_REGS); if (nr >= TS2_IMAP0_REGNUM && nr < TS2_IMAP0_REGNUM + NR_IMAP_REGS) return nr - TS2_IMAP0_REGNUM + SIM_D10V_IMAP0_REGNUM; @@ -293,8 +293,8 @@ d10v_ts2_register_sim_regno (int nr) static int d10v_ts3_register_sim_regno (int nr) { - if (legacy_register_sim_regno (nr) < 0) - return legacy_register_sim_regno (nr); + /* Only makes sense to supply raw registers. */ + gdb_assert (nr >= 0 && nr < NUM_REGS); if (nr >= TS3_IMAP0_REGNUM && nr < TS3_IMAP0_REGNUM + NR_IMAP_REGS) return nr - TS3_IMAP0_REGNUM + SIM_D10V_IMAP0_REGNUM; @@ -950,30 +950,12 @@ d10v_read_sp (void) return (d10v_make_daddr (read_register (SP_REGNUM))); } -static void -d10v_write_sp (CORE_ADDR val) -{ - write_register (SP_REGNUM, d10v_convert_daddr_to_raw (val)); -} - static CORE_ADDR d10v_read_fp (void) { return (d10v_make_daddr (read_register (FP_REGNUM))); } -/* Function: push_return_address (pc) - Set up the return address for the inferior function call. - Needed for targets where we don't actually execute a JSR/BSR instruction */ - -static CORE_ADDR -d10v_push_return_address (CORE_ADDR pc, CORE_ADDR sp) -{ - write_register (LR_REGNUM, d10v_convert_iaddr_to_raw (CALL_DUMMY_ADDRESS ())); - return sp; -} - - /* When arguments must be pushed onto the stack, they go on in reverse order. The below implements a FILO (stack) to do this. */ @@ -1011,20 +993,26 @@ pop_stack_item (struct stack_item *si) static CORE_ADDR -d10v_push_arguments (int nargs, struct value **args, CORE_ADDR sp, - int struct_return, CORE_ADDR struct_addr) +d10v_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, + CORE_ADDR dummy_addr, int nargs, struct value **args, + CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { int i; int regnum = ARG1_REGNUM; struct stack_item *si = NULL; long val; + /* Set the return address. For the d10v, the return breakpoint is + always at DUMMY_ADDR. */ + regcache_cooked_write_unsigned (regcache, LR_REGNUM, + d10v_convert_iaddr_to_raw (dummy_addr)); + /* If STRUCT_RETURN is true, then the struct return address (in STRUCT_ADDR) will consume the first argument-passing register. Both adjust the register count and store that value. */ if (struct_return) { - write_register (regnum, struct_addr); + regcache_cooked_write_unsigned (regcache, regnum, struct_addr); regnum++; } @@ -1042,7 +1030,7 @@ d10v_push_arguments (int nargs, struct value **args, CORE_ADDR sp, /* fits in a single register, do not align */ { val = extract_unsigned_integer (contents, len); - write_register (regnum++, val); + regcache_cooked_write_unsigned (regcache, regnum++, val); } else if (len <= (ARGN_REGNUM - aligned_regnum + 1) * 2) /* value fits in remaining registers, store keeping left @@ -1053,12 +1041,12 @@ d10v_push_arguments (int nargs, struct value **args, CORE_ADDR sp, for (b = 0; b < (len & ~1); b += 2) { val = extract_unsigned_integer (&contents[b], 2); - write_register (regnum++, val); + regcache_cooked_write_unsigned (regcache, regnum++, val); } if (b < len) { val = extract_unsigned_integer (&contents[b], 1); - write_register (regnum++, (val << 8)); + regcache_cooked_write_unsigned (regcache, regnum++, (val << 8)); } } else @@ -1076,6 +1064,10 @@ d10v_push_arguments (int nargs, struct value **args, CORE_ADDR sp, si = pop_stack_item (si); } + /* Finally, update the SP register. */ + regcache_cooked_write_unsigned (regcache, SP_REGNUM, + d10v_convert_daddr_to_raw (sp)); + return sp; } @@ -1348,26 +1340,29 @@ tdisassemble_command (char *arg, int from_tty) { int i, count; CORE_ADDR low, high; - char *space_index; if (!arg) { low = 0; high = trace_data.size; } - else if (!(space_index = (char *) strchr (arg, ' '))) - { - low = parse_and_eval_address (arg); - high = low + 5; - } else - { - /* Two arguments. */ - *space_index = '\0'; - low = parse_and_eval_address (arg); - high = parse_and_eval_address (space_index + 1); - if (high < low) - high = low; + { + char *space_index = strchr (arg, ' '); + if (space_index == NULL) + { + low = parse_and_eval_address (arg); + high = low + 5; + } + else + { + /* Two arguments. */ + *space_index = '\0'; + low = parse_and_eval_address (arg); + high = parse_and_eval_address (space_index + 1); + if (high < low) + high = low; + } } printf_filtered ("Dump of trace from %s to %s:\n", paddr_u (low), paddr_u (high)); @@ -1606,8 +1601,6 @@ static gdbarch_init_ftype d10v_gdbarch_init; static struct gdbarch * d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { - static LONGEST d10v_call_dummy_words[] = - {0}; struct gdbarch *gdbarch; int d10v_num_regs; struct gdbarch_tdep *tdep; @@ -1651,7 +1644,6 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_pc (gdbarch, d10v_write_pc); set_gdbarch_read_fp (gdbarch, d10v_read_fp); set_gdbarch_read_sp (gdbarch, d10v_read_sp); - set_gdbarch_write_sp (gdbarch, d10v_write_sp); set_gdbarch_num_regs (gdbarch, d10v_num_regs); set_gdbarch_sp_regnum (gdbarch, 15); @@ -1701,15 +1693,11 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_call_dummy_words (gdbarch, d10v_call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (d10v_call_dummy_words)); set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_extract_return_value (gdbarch, d10v_extract_return_value); - set_gdbarch_push_arguments (gdbarch, d10v_push_arguments); - set_gdbarch_push_return_address (gdbarch, d10v_push_return_address); - + set_gdbarch_push_dummy_call (gdbarch, d10v_push_dummy_call); set_gdbarch_store_return_value (gdbarch, d10v_store_return_value); set_gdbarch_extract_struct_value_address (gdbarch, d10v_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, d10v_use_struct_convention); @@ -1746,10 +1734,6 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return gdbarch; } - -extern void (*target_resume_hook) (void); -extern void (*target_wait_loop_hook) (void); - void _initialize_d10v_tdep (void) { diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 3aeadd3..4286726 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,27 @@ +2003-03-30 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Remove + reference to TARGET_WRITE_SP. + +2003-03-27 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Remove + references to write_sp. + +2003-03-27 Andrew Cagney <cagney@redhat.com> + + * gdb.texinfo (GDB/MI Variable Objects): Replace @include with + chapter body. Use @smallexample instead of @example. + (Annotations): Ditto. + * Makefile.in (GDB_DOC_SOURCE_INCLUDES): Remove gdbmi.texinfo and + annotate.texi. + +2003-03-26 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Replace + PUSH_ARGUMENTS with push_dummy_call, add gdbarch, regcache and + dummy_addr parameters. + 2003-03-25 Andrew Cagney <cagney@redhat.com> * gdbint.texinfo (Target Architecture Definition): Delete diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index db74889..5221314 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -98,10 +98,8 @@ DVIPS = dvips # Main GDB manual GDB_DOC_SOURCE_INCLUDES = \ - $(srcdir)/annotate.texi \ $(srcdir)/fdl.texi \ $(srcdir)/gpl.texi \ - $(GDBMI_DIR)/gdbmi.texinfo \ $(READLINE_DIR)/rluser.texinfo \ $(READLINE_DIR)/inc-hist.texinfo GDB_DOC_BUILD_INCLUDES = \ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 8c38e87..5c4eb95 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -14045,8 +14045,4544 @@ environment. Users of this environment can use a new command, each value is printed in its own window. @end ignore -@include annotate.texi -@include gdbmi.texinfo + +@node GDB/MI +@chapter The @sc{gdb/mi} Interface + +@unnumberedsec Function and Purpose + +@cindex @sc{gdb/mi}, its purpose +@sc{gdb/mi} is a line based machine oriented text interface to @value{GDBN}. It is +specifically intended to support the development of systems which use +the debugger as just one small component of a larger system. + +This chapter is a specification of the @sc{gdb/mi} interface. It is written +in the form of a reference manual. + +Note that @sc{gdb/mi} is still under construction, so some of the +features described below are incomplete and subject to change. + +@unnumberedsec Notation and Terminology + +@cindex notational conventions, for @sc{gdb/mi} +This chapter uses the following notation: + +@itemize @bullet +@item +@code{|} separates two alternatives. + +@item +@code{[ @var{something} ]} indicates that @var{something} is optional: +it may or may not be given. + +@item +@code{( @var{group} )*} means that @var{group} inside the parentheses +may repeat zero or more times. + +@item +@code{( @var{group} )+} means that @var{group} inside the parentheses +may repeat one or more times. + +@item +@code{"@var{string}"} means a literal @var{string}. +@end itemize + +@ignore +@heading Dependencies +@end ignore + +@heading Acknowledgments + +In alphabetic order: Andrew Cagney, Fernando Nasser, Stan Shebs and +Elena Zannoni. + +@menu +* GDB/MI Command Syntax:: +* GDB/MI Compatibility with CLI:: +* GDB/MI Output Records:: +* GDB/MI Command Description Format:: +* GDB/MI Breakpoint Table Commands:: +* GDB/MI Data Manipulation:: +* GDB/MI Program Control:: +* GDB/MI Miscellaneous Commands:: +@ignore +* GDB/MI Kod Commands:: +* GDB/MI Memory Overlay Commands:: +* GDB/MI Signal Handling Commands:: +@end ignore +* GDB/MI Stack Manipulation:: +* GDB/MI Symbol Query:: +* GDB/MI Target Manipulation:: +* GDB/MI Thread Commands:: +* GDB/MI Tracepoint Commands:: +* GDB/MI Variable Objects:: +@end menu + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Command Syntax +@section @sc{gdb/mi} Command Syntax + +@menu +* GDB/MI Input Syntax:: +* GDB/MI Output Syntax:: +* GDB/MI Simple Examples:: +@end menu + +@node GDB/MI Input Syntax +@subsection @sc{gdb/mi} Input Syntax + +@cindex input syntax for @sc{gdb/mi} +@cindex @sc{gdb/mi}, input syntax +@table @code +@item @var{command} @expansion{} +@code{@var{cli-command} | @var{mi-command}} + +@item @var{cli-command} @expansion{} +@code{[ @var{token} ] @var{cli-command} @var{nl}}, where +@var{cli-command} is any existing @value{GDBN} CLI command. + +@item @var{mi-command} @expansion{} +@code{[ @var{token} ] "-" @var{operation} ( " " @var{option} )* +@code{[} " --" @code{]} ( " " @var{parameter} )* @var{nl}} + +@item @var{token} @expansion{} +"any sequence of digits" + +@item @var{option} @expansion{} +@code{"-" @var{parameter} [ " " @var{parameter} ]} + +@item @var{parameter} @expansion{} +@code{@var{non-blank-sequence} | @var{c-string}} + +@item @var{operation} @expansion{} +@emph{any of the operations described in this chapter} + +@item @var{non-blank-sequence} @expansion{} +@emph{anything, provided it doesn't contain special characters such as +"-", @var{nl}, """ and of course " "} + +@item @var{c-string} @expansion{} +@code{""" @var{seven-bit-iso-c-string-content} """} + +@item @var{nl} @expansion{} +@code{CR | CR-LF} +@end table + +@noindent +Notes: + +@itemize @bullet +@item +The CLI commands are still handled by the @sc{mi} interpreter; their +output is described below. + +@item +The @code{@var{token}}, when present, is passed back when the command +finishes. + +@item +Some @sc{mi} commands accept optional arguments as part of the parameter +list. Each option is identified by a leading @samp{-} (dash) and may be +followed by an optional argument parameter. Options occur first in the +parameter list and can be delimited from normal parameters using +@samp{--} (this is useful when some parameters begin with a dash). +@end itemize + +Pragmatics: + +@itemize @bullet +@item +We want easy access to the existing CLI syntax (for debugging). + +@item +We want it to be easy to spot a @sc{mi} operation. +@end itemize + +@node GDB/MI Output Syntax +@subsection @sc{gdb/mi} Output Syntax + +@cindex output syntax of @sc{gdb/mi} +@cindex @sc{gdb/mi}, output syntax +The output from @sc{gdb/mi} consists of zero or more out-of-band records +followed, optionally, by a single result record. This result record +is for the most recent command. The sequence of output records is +terminated by @samp{(@value{GDBP})}. + +If an input command was prefixed with a @code{@var{token}} then the +corresponding output for that command will also be prefixed by that same +@var{token}. + +@table @code +@item @var{output} @expansion{} +@code{( @var{out-of-band-record} )* [ @var{result-record} ] "(gdb)" @var{nl}} + +@item @var{result-record} @expansion{} +@code{ [ @var{token} ] "^" @var{result-class} ( "," @var{result} )* @var{nl}} + +@item @var{out-of-band-record} @expansion{} +@code{@var{async-record} | @var{stream-record}} + +@item @var{async-record} @expansion{} +@code{@var{exec-async-output} | @var{status-async-output} | @var{notify-async-output}} + +@item @var{exec-async-output} @expansion{} +@code{[ @var{token} ] "*" @var{async-output}} + +@item @var{status-async-output} @expansion{} +@code{[ @var{token} ] "+" @var{async-output}} + +@item @var{notify-async-output} @expansion{} +@code{[ @var{token} ] "=" @var{async-output}} + +@item @var{async-output} @expansion{} +@code{@var{async-class} ( "," @var{result} )* @var{nl}} + +@item @var{result-class} @expansion{} +@code{"done" | "running" | "connected" | "error" | "exit"} + +@item @var{async-class} @expansion{} +@code{"stopped" | @var{others}} (where @var{others} will be added +depending on the needs---this is still in development). + +@item @var{result} @expansion{} +@code{ @var{variable} "=" @var{value}} + +@item @var{variable} @expansion{} +@code{ @var{string} } + +@item @var{value} @expansion{} +@code{ @var{const} | @var{tuple} | @var{list} } + +@item @var{const} @expansion{} +@code{@var{c-string}} + +@item @var{tuple} @expansion{} +@code{ "@{@}" | "@{" @var{result} ( "," @var{result} )* "@}" } + +@item @var{list} @expansion{} +@code{ "[]" | "[" @var{value} ( "," @var{value} )* "]" | "[" +@var{result} ( "," @var{result} )* "]" } + +@item @var{stream-record} @expansion{} +@code{@var{console-stream-output} | @var{target-stream-output} | @var{log-stream-output}} + +@item @var{console-stream-output} @expansion{} +@code{"~" @var{c-string}} + +@item @var{target-stream-output} @expansion{} +@code{"@@" @var{c-string}} + +@item @var{log-stream-output} @expansion{} +@code{"&" @var{c-string}} + +@item @var{nl} @expansion{} +@code{CR | CR-LF} + +@item @var{token} @expansion{} +@emph{any sequence of digits}. +@end table + +@noindent +Notes: + +@itemize @bullet +@item +All output sequences end in a single line containing a period. + +@item +The @code{@var{token}} is from the corresponding request. If an execution +command is interrupted by the @samp{-exec-interrupt} command, the +@var{token} associated with the @samp{*stopped} message is the one of the +original execution command, not the one of the interrupt command. + +@item +@cindex status output in @sc{gdb/mi} +@var{status-async-output} contains on-going status information about the +progress of a slow operation. It can be discarded. All status output is +prefixed by @samp{+}. + +@item +@cindex async output in @sc{gdb/mi} +@var{exec-async-output} contains asynchronous state change on the target +(stopped, started, disappeared). All async output is prefixed by +@samp{*}. + +@item +@cindex notify output in @sc{gdb/mi} +@var{notify-async-output} contains supplementary information that the +client should handle (e.g., a new breakpoint information). All notify +output is prefixed by @samp{=}. + +@item +@cindex console output in @sc{gdb/mi} +@var{console-stream-output} is output that should be displayed as is in the +console. It is the textual response to a CLI command. All the console +output is prefixed by @samp{~}. + +@item +@cindex target output in @sc{gdb/mi} +@var{target-stream-output} is the output produced by the target program. +All the target output is prefixed by @samp{@@}. + +@item +@cindex log output in @sc{gdb/mi} +@var{log-stream-output} is output text coming from @value{GDBN}'s internals, for +instance messages that should be displayed as part of an error log. All +the log output is prefixed by @samp{&}. + +@item +@cindex list output in @sc{gdb/mi} +New @sc{gdb/mi} commands should only output @var{lists} containing +@var{values}. + + +@end itemize + +@xref{GDB/MI Stream Records, , @sc{gdb/mi} Stream Records}, for more +details about the various output records. + +@node GDB/MI Simple Examples +@subsection Simple Examples of @sc{gdb/mi} Interaction +@cindex @sc{gdb/mi}, simple examples + +This subsection presents several simple examples of interaction using +the @sc{gdb/mi} interface. In these examples, @samp{->} means that the +following line is passed to @sc{gdb/mi} as input, while @samp{<-} means +the output received from @sc{gdb/mi}. + +@subsubheading Target Stop +@c Ummm... There is no "-stop" command. This assumes async, no? +Here's an example of stopping the inferior process: + +@smallexample +-> -stop +<- (@value{GDBP}) +@end smallexample + +@noindent +and later: + +@smallexample +<- *stop,reason="stop",address="0x123",source="a.c:123" +<- (@value{GDBP}) +@end smallexample + +@subsubheading Simple CLI Command + +Here's an example of a simple CLI command being passed through +@sc{gdb/mi} and on to the CLI. + +@smallexample +-> print 1+2 +<- &"print 1+2\n" +<- ~"$1 = 3\n" +<- ^done +<- (@value{GDBP}) +@end smallexample + +@subsubheading Command With Side Effects + +@smallexample +-> -symbol-file xyz.exe +<- *breakpoint,nr="3",address="0x123",source="a.c:123" +<- (@value{GDBP}) +@end smallexample + +@subsubheading A Bad Command + +Here's what happens if you pass a non-existent command: + +@smallexample +-> -rubbish +<- ^error,msg="Undefined MI command: rubbish" +<- (@value{GDBP}) +@end smallexample + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Compatibility with CLI +@section @sc{gdb/mi} Compatibility with CLI + +@cindex compatibility, @sc{gdb/mi} and CLI +@cindex @sc{gdb/mi}, compatibility with CLI +To help users familiar with @value{GDBN}'s existing CLI interface, @sc{gdb/mi} +accepts existing CLI commands. As specified by the syntax, such +commands can be directly entered into the @sc{gdb/mi} interface and @value{GDBN} will +respond. + +This mechanism is provided as an aid to developers of @sc{gdb/mi} +clients and not as a reliable interface into the CLI. Since the command +is being interpreteted in an environment that assumes @sc{gdb/mi} +behaviour, the exact output of such commands is likely to end up being +an un-supported hybrid of @sc{gdb/mi} and CLI output. + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Output Records +@section @sc{gdb/mi} Output Records + +@menu +* GDB/MI Result Records:: +* GDB/MI Stream Records:: +* GDB/MI Out-of-band Records:: +@end menu + +@node GDB/MI Result Records +@subsection @sc{gdb/mi} Result Records + +@cindex result records in @sc{gdb/mi} +@cindex @sc{gdb/mi}, result records +In addition to a number of out-of-band notifications, the response to a +@sc{gdb/mi} command includes one of the following result indications: + +@table @code +@findex ^done +@item "^done" [ "," @var{results} ] +The synchronous operation was successful, @code{@var{results}} are the return +values. + +@item "^running" +@findex ^running +@c Is this one correct? Should it be an out-of-band notification? +The asynchronous operation was successfully started. The target is +running. + +@item "^error" "," @var{c-string} +@findex ^error +The operation failed. The @code{@var{c-string}} contains the corresponding +error message. +@end table + +@node GDB/MI Stream Records +@subsection @sc{gdb/mi} Stream Records + +@cindex @sc{gdb/mi}, stream records +@cindex stream records in @sc{gdb/mi} +@value{GDBN} internally maintains a number of output streams: the console, the +target, and the log. The output intended for each of these streams is +funneled through the @sc{gdb/mi} interface using @dfn{stream records}. + +Each stream record begins with a unique @dfn{prefix character} which +identifies its stream (@pxref{GDB/MI Output Syntax, , @sc{gdb/mi} Output +Syntax}). In addition to the prefix, each stream record contains a +@code{@var{string-output}}. This is either raw text (with an implicit new +line) or a quoted C string (which does not contain an implicit newline). + +@table @code +@item "~" @var{string-output} +The console output stream contains text that should be displayed in the +CLI console window. It contains the textual responses to CLI commands. + +@item "@@" @var{string-output} +The target output stream contains any textual output from the running +target. + +@item "&" @var{string-output} +The log stream contains debugging messages being produced by @value{GDBN}'s +internals. +@end table + +@node GDB/MI Out-of-band Records +@subsection @sc{gdb/mi} Out-of-band Records + +@cindex out-of-band records in @sc{gdb/mi} +@cindex @sc{gdb/mi}, out-of-band records +@dfn{Out-of-band} records are used to notify the @sc{gdb/mi} client of +additional changes that have occurred. Those changes can either be a +consequence of @sc{gdb/mi} (e.g., a breakpoint modified) or a result of +target activity (e.g., target stopped). + +The following is a preliminary list of possible out-of-band records. + +@table @code +@item "*" "stop" +@end table + + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Command Description Format +@section @sc{gdb/mi} Command Description Format + +The remaining sections describe blocks of commands. Each block of +commands is laid out in a fashion similar to this section. + +Note the the line breaks shown in the examples are here only for +readability. They don't appear in the real output. +Also note that the commands with a non-available example (N.A.@:) are +not yet implemented. + +@subheading Motivation + +The motivation for this collection of commands. + +@subheading Introduction + +A brief introduction to this collection of commands as a whole. + +@subheading Commands + +For each command in the block, the following is described: + +@subsubheading Synopsis + +@smallexample + -command @var{args}@dots{} +@end smallexample + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} CLI command. + +@subsubheading Result + +@subsubheading Out-of-band + +@subsubheading Notes + +@subsubheading Example + + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Breakpoint Table Commands +@section @sc{gdb/mi} Breakpoint table commands + +@cindex breakpoint commands for @sc{gdb/mi} +@cindex @sc{gdb/mi}, breakpoint commands +This section documents @sc{gdb/mi} commands for manipulating +breakpoints. + +@subheading The @code{-break-after} Command +@findex -break-after + +@subsubheading Synopsis + +@smallexample + -break-after @var{number} @var{count} +@end smallexample + +The breakpoint number @var{number} is not in effect until it has been +hit @var{count} times. To see how this is reflected in the output of +the @samp{-break-list} command, see the description of the +@samp{-break-list} command below. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{ignore}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-break-insert main +^done,bkpt=@{number="1",addr="0x000100d0",file="hello.c",line="5"@} +(@value{GDBP}) +-break-after 1 3 +~ +^done +(@value{GDBP}) +-break-list +^done,BreakpointTable=@{nr_rows="1",nr_cols="6", +hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, +@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, +@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, +@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, +@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, +@{width="40",alignment="2",col_name="what",colhdr="What"@}], +body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", +addr="0x000100d0",func="main",file="hello.c",line="5",times="0", +ignore="3"@}]@} +(@value{GDBP}) +@end smallexample + +@ignore +@subheading The @code{-break-catch} Command +@findex -break-catch + +@subheading The @code{-break-commands} Command +@findex -break-commands +@end ignore + + +@subheading The @code{-break-condition} Command +@findex -break-condition + +@subsubheading Synopsis + +@smallexample + -break-condition @var{number} @var{expr} +@end smallexample + +Breakpoint @var{number} will stop the program only if the condition in +@var{expr} is true. The condition becomes part of the +@samp{-break-list} output (see the description of the @samp{-break-list} +command below). + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{condition}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-break-condition 1 1 +^done +(@value{GDBP}) +-break-list +^done,BreakpointTable=@{nr_rows="1",nr_cols="6", +hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, +@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, +@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, +@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, +@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, +@{width="40",alignment="2",col_name="what",colhdr="What"@}], +body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", +addr="0x000100d0",func="main",file="hello.c",line="5",cond="1", +times="0",ignore="3"@}]@} +(@value{GDBP}) +@end smallexample + +@subheading The @code{-break-delete} Command +@findex -break-delete + +@subsubheading Synopsis + +@smallexample + -break-delete ( @var{breakpoint} )+ +@end smallexample + +Delete the breakpoint(s) whose number(s) are specified in the argument +list. This is obviously reflected in the breakpoint list. + +@subsubheading @value{GDBN} command + +The corresponding @value{GDBN} command is @samp{delete}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-break-delete 1 +^done +(@value{GDBP}) +-break-list +^done,BreakpointTable=@{nr_rows="0",nr_cols="6", +hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, +@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, +@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, +@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, +@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, +@{width="40",alignment="2",col_name="what",colhdr="What"@}], +body=[]@} +(@value{GDBP}) +@end smallexample + +@subheading The @code{-break-disable} Command +@findex -break-disable + +@subsubheading Synopsis + +@smallexample + -break-disable ( @var{breakpoint} )+ +@end smallexample + +Disable the named @var{breakpoint}(s). The field @samp{enabled} in the +break list is now set to @samp{n} for the named @var{breakpoint}(s). + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{disable}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-break-disable 2 +^done +(@value{GDBP}) +-break-list +^done,BreakpointTable=@{nr_rows="1",nr_cols="6", +hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, +@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, +@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, +@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, +@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, +@{width="40",alignment="2",col_name="what",colhdr="What"@}], +body=[bkpt=@{number="2",type="breakpoint",disp="keep",enabled="n", +addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}]@} +(@value{GDBP}) +@end smallexample + +@subheading The @code{-break-enable} Command +@findex -break-enable + +@subsubheading Synopsis + +@smallexample + -break-enable ( @var{breakpoint} )+ +@end smallexample + +Enable (previously disabled) @var{breakpoint}(s). + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{enable}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-break-enable 2 +^done +(@value{GDBP}) +-break-list +^done,BreakpointTable=@{nr_rows="1",nr_cols="6", +hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, +@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, +@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, +@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, +@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, +@{width="40",alignment="2",col_name="what",colhdr="What"@}], +body=[bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y", +addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}]@} +(@value{GDBP}) +@end smallexample + +@subheading The @code{-break-info} Command +@findex -break-info + +@subsubheading Synopsis + +@smallexample + -break-info @var{breakpoint} +@end smallexample + +@c REDUNDANT??? +Get information about a single breakpoint. + +@subsubheading @value{GDBN} command + +The corresponding @value{GDBN} command is @samp{info break @var{breakpoint}}. + +@subsubheading Example +N.A. + +@subheading The @code{-break-insert} Command +@findex -break-insert + +@subsubheading Synopsis + +@smallexample + -break-insert [ -t ] [ -h ] [ -r ] + [ -c @var{condition} ] [ -i @var{ignore-count} ] + [ -p @var{thread} ] [ @var{line} | @var{addr} ] +@end smallexample + +@noindent +If specified, @var{line}, can be one of: + +@itemize @bullet +@item function +@c @item +offset +@c @item -offset +@c @item linenum +@item filename:linenum +@item filename:function +@item *address +@end itemize + +The possible optional parameters of this command are: + +@table @samp +@item -t +Insert a tempoary breakpoint. +@item -h +Insert a hardware breakpoint. +@item -c @var{condition} +Make the breakpoint conditional on @var{condition}. +@item -i @var{ignore-count} +Initialize the @var{ignore-count}. +@item -r +Insert a regular breakpoint in all the functions whose names match the +given regular expression. Other flags are not applicable to regular +expresson. +@end table + +@subsubheading Result + +The result is in the form: + +@smallexample + ^done,bkptno="@var{number}",func="@var{funcname}", + file="@var{filename}",line="@var{lineno}" +@end smallexample + +@noindent +where @var{number} is the @value{GDBN} number for this breakpoint, @var{funcname} +is the name of the function where the breakpoint was inserted, +@var{filename} is the name of the source file which contains this +function, and @var{lineno} is the source line number within that file. + +Note: this format is open to change. +@c An out-of-band breakpoint instead of part of the result? + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} commands are @samp{break}, @samp{tbreak}, +@samp{hbreak}, @samp{thbreak}, and @samp{rbreak}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-break-insert main +^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@} +(@value{GDBP}) +-break-insert -t foo +^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",line="11"@} +(@value{GDBP}) +-break-list +^done,BreakpointTable=@{nr_rows="2",nr_cols="6", +hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, +@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, +@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, +@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, +@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, +@{width="40",alignment="2",col_name="what",colhdr="What"@}], +body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", +addr="0x0001072c", func="main",file="recursive2.c",line="4",times="0"@}, +bkpt=@{number="2",type="breakpoint",disp="del",enabled="y", +addr="0x00010774",func="foo",file="recursive2.c",line="11",times="0"@}]@} +(@value{GDBP}) +-break-insert -r foo.* +~int foo(int, int); +^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c",line="11"@} +(@value{GDBP}) +@end smallexample + +@subheading The @code{-break-list} Command +@findex -break-list + +@subsubheading Synopsis + +@smallexample + -break-list +@end smallexample + +Displays the list of inserted breakpoints, showing the following fields: + +@table @samp +@item Number +number of the breakpoint +@item Type +type of the breakpoint: @samp{breakpoint} or @samp{watchpoint} +@item Disposition +should the breakpoint be deleted or disabled when it is hit: @samp{keep} +or @samp{nokeep} +@item Enabled +is the breakpoint enabled or no: @samp{y} or @samp{n} +@item Address +memory location at which the breakpoint is set +@item What +logical location of the breakpoint, expressed by function name, file +name, line number +@item Times +number of times the breakpoint has been hit +@end table + +If there are no breakpoints or watchpoints, the @code{BreakpointTable} +@code{body} field is an empty list. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{info break}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-break-list +^done,BreakpointTable=@{nr_rows="2",nr_cols="6", +hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, +@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, +@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, +@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, +@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, +@{width="40",alignment="2",col_name="what",colhdr="What"@}], +body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", +addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}, +bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y", +addr="0x00010114",func="foo",file="hello.c",line="13",times="0"@}]@} +(@value{GDBP}) +@end smallexample + +Here's an example of the result when there are no breakpoints: + +@smallexample +(@value{GDBP}) +-break-list +^done,BreakpointTable=@{nr_rows="0",nr_cols="6", +hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, +@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, +@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, +@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, +@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, +@{width="40",alignment="2",col_name="what",colhdr="What"@}], +body=[]@} +(@value{GDBP}) +@end smallexample + +@subheading The @code{-break-watch} Command +@findex -break-watch + +@subsubheading Synopsis + +@smallexample + -break-watch [ -a | -r ] +@end smallexample + +Create a watchpoint. With the @samp{-a} option it will create an +@dfn{access} watchpoint, i.e. a watchpoint that triggers either on a +read from or on a write to the memory location. With the @samp{-r} +option, the watchpoint created is a @dfn{read} watchpoint, i.e. it will +trigger only when the memory location is accessed for reading. Without +either of the options, the watchpoint created is a regular watchpoint, +i.e. it will trigger when the memory location is accessed for writing. +@xref{Set Watchpoints, , Setting watchpoints}. + +Note that @samp{-break-list} will report a single list of watchpoints and +breakpoints inserted. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} commands are @samp{watch}, @samp{awatch}, and +@samp{rwatch}. + +@subsubheading Example + +Setting a watchpoint on a variable in the @code{main} function: + +@smallexample +(@value{GDBP}) +-break-watch x +^done,wpt=@{number="2",exp="x"@} +(@value{GDBP}) +-exec-continue +^running +^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@}, +value=@{old="-268439212",new="55"@}, +frame=@{func="main",args=[],file="recursive2.c",line="5"@} +(@value{GDBP}) +@end smallexample + +Setting a watchpoint on a variable local to a function. @value{GDBN} will stop +the program execution twice: first for the variable changing value, then +for the watchpoint going out of scope. + +@smallexample +(@value{GDBP}) +-break-watch C +^done,wpt=@{number="5",exp="C"@} +(@value{GDBP}) +-exec-continue +^running +^done,reason="watchpoint-trigger", +wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@}, +frame=@{func="callee4",args=[], +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@} +(@value{GDBP}) +-exec-continue +^running +^done,reason="watchpoint-scope",wpnum="5", +frame=@{func="callee3",args=[@{name="strarg", +value="0x11940 \"A string argument.\""@}], +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@} +(@value{GDBP}) +@end smallexample + +Listing breakpoints and watchpoints, at different points in the program +execution. Note that once the watchpoint goes out of scope, it is +deleted. + +@smallexample +(@value{GDBP}) +-break-watch C +^done,wpt=@{number="2",exp="C"@} +(@value{GDBP}) +-break-list +^done,BreakpointTable=@{nr_rows="2",nr_cols="6", +hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, +@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, +@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, +@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, +@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, +@{width="40",alignment="2",col_name="what",colhdr="What"@}], +body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", +addr="0x00010734",func="callee4", +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@}, +bkpt=@{number="2",type="watchpoint",disp="keep", +enabled="y",addr="",what="C",times="0"@}]@} +(@value{GDBP}) +-exec-continue +^running +^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@}, +value=@{old="-276895068",new="3"@}, +frame=@{func="callee4",args=[], +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@} +(@value{GDBP}) +-break-list +^done,BreakpointTable=@{nr_rows="2",nr_cols="6", +hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, +@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, +@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, +@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, +@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, +@{width="40",alignment="2",col_name="what",colhdr="What"@}], +body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", +addr="0x00010734",func="callee4", +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@}, +bkpt=@{number="2",type="watchpoint",disp="keep", +enabled="y",addr="",what="C",times="-5"@}]@} +(@value{GDBP}) +-exec-continue +^running +^done,reason="watchpoint-scope",wpnum="2", +frame=@{func="callee3",args=[@{name="strarg", +value="0x11940 \"A string argument.\""@}], +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@} +(@value{GDBP}) +-break-list +^done,BreakpointTable=@{nr_rows="1",nr_cols="6", +hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, +@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, +@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, +@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, +@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, +@{width="40",alignment="2",col_name="what",colhdr="What"@}], +body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", +addr="0x00010734",func="callee4", +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@}]@} +(@value{GDBP}) +@end smallexample + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Data Manipulation +@section @sc{gdb/mi} Data Manipulation + +@cindex data manipulation, in @sc{gdb/mi} +@cindex @sc{gdb/mi}, data manipulation +This section describes the @sc{gdb/mi} commands that manipulate data: +examine memory and registers, evaluate expressions, etc. + +@c REMOVED FROM THE INTERFACE. +@c @subheading -data-assign +@c Change the value of a program variable. Plenty of side effects. +@c @subsubheading GDB command +@c set variable +@c @subsubheading Example +@c N.A. + +@subheading The @code{-data-disassemble} Command +@findex -data-disassemble + +@subsubheading Synopsis + +@smallexample + -data-disassemble + [ -s @var{start-addr} -e @var{end-addr} ] + | [ -f @var{filename} -l @var{linenum} [ -n @var{lines} ] ] + -- @var{mode} +@end smallexample + +@noindent +Where: + +@table @samp +@item @var{start-addr} +is the beginning address (or @code{$pc}) +@item @var{end-addr} +is the end address +@item @var{filename} +is the name of the file to disassemble +@item @var{linenum} +is the line number to disassemble around +@item @var{lines} +is the the number of disassembly lines to be produced. If it is -1, +the whole function will be disassembled, in case no @var{end-addr} is +specified. If @var{end-addr} is specified as a non-zero value, and +@var{lines} is lower than the number of disassembly lines between +@var{start-addr} and @var{end-addr}, only @var{lines} lines are +displayed; if @var{lines} is higher than the number of lines between +@var{start-addr} and @var{end-addr}, only the lines up to @var{end-addr} +are displayed. +@item @var{mode} +is either 0 (meaning only disassembly) or 1 (meaning mixed source and +disassembly). +@end table + +@subsubheading Result + +The output for each instruction is composed of four fields: + +@itemize @bullet +@item Address +@item Func-name +@item Offset +@item Instruction +@end itemize + +Note that whatever included in the instruction field, is not manipulated +directely by @sc{gdb/mi}, i.e. it is not possible to adjust its format. + +@subsubheading @value{GDBN} Command + +There's no direct mapping from this command to the CLI. + +@subsubheading Example + +Disassemble from the current value of @code{$pc} to @code{$pc + 20}: + +@smallexample +(@value{GDBP}) +-data-disassemble -s $pc -e "$pc + 20" -- 0 +^done, +asm_insns=[ +@{address="0x000107c0",func-name="main",offset="4", +inst="mov 2, %o0"@}, +@{address="0x000107c4",func-name="main",offset="8", +inst="sethi %hi(0x11800), %o2"@}, +@{address="0x000107c8",func-name="main",offset="12", +inst="or %o2, 0x140, %o1\t! 0x11940 <_lib_version+8>"@}, +@{address="0x000107cc",func-name="main",offset="16", +inst="sethi %hi(0x11800), %o2"@}, +@{address="0x000107d0",func-name="main",offset="20", +inst="or %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"@}] +(@value{GDBP}) +@end smallexample + +Disassemble the whole @code{main} function. Line 32 is part of +@code{main}. + +@smallexample +-data-disassemble -f basics.c -l 32 -- 0 +^done,asm_insns=[ +@{address="0x000107bc",func-name="main",offset="0", +inst="save %sp, -112, %sp"@}, +@{address="0x000107c0",func-name="main",offset="4", +inst="mov 2, %o0"@}, +@{address="0x000107c4",func-name="main",offset="8", +inst="sethi %hi(0x11800), %o2"@}, +[@dots{}] +@{address="0x0001081c",func-name="main",offset="96",inst="ret "@}, +@{address="0x00010820",func-name="main",offset="100",inst="restore "@}] +(@value{GDBP}) +@end smallexample + +Disassemble 3 instructions from the start of @code{main}: + +@smallexample +(@value{GDBP}) +-data-disassemble -f basics.c -l 32 -n 3 -- 0 +^done,asm_insns=[ +@{address="0x000107bc",func-name="main",offset="0", +inst="save %sp, -112, %sp"@}, +@{address="0x000107c0",func-name="main",offset="4", +inst="mov 2, %o0"@}, +@{address="0x000107c4",func-name="main",offset="8", +inst="sethi %hi(0x11800), %o2"@}] +(@value{GDBP}) +@end smallexample + +Disassemble 3 instructions from the start of @code{main} in mixed mode: + +@smallexample +(@value{GDBP}) +-data-disassemble -f basics.c -l 32 -n 3 -- 1 +^done,asm_insns=[ +src_and_asm_line=@{line="31", +file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \ + testsuite/gdb.mi/basics.c",line_asm_insn=[ +@{address="0x000107bc",func-name="main",offset="0", +inst="save %sp, -112, %sp"@}]@}, +src_and_asm_line=@{line="32", +file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \ + testsuite/gdb.mi/basics.c",line_asm_insn=[ +@{address="0x000107c0",func-name="main",offset="4", +inst="mov 2, %o0"@}, +@{address="0x000107c4",func-name="main",offset="8", +inst="sethi %hi(0x11800), %o2"@}]@}] +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-data-evaluate-expression} Command +@findex -data-evaluate-expression + +@subsubheading Synopsis + +@smallexample + -data-evaluate-expression @var{expr} +@end smallexample + +Evaluate @var{expr} as an expression. The expression could contain an +inferior function call. The function call will execute synchronously. +If the expression contains spaces, it must be enclosed in double quotes. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} commands are @samp{print}, @samp{output}, and +@samp{call}. In @code{gdbtk} only, there's a corresponding +@samp{gdb_eval} command. + +@subsubheading Example + +In the following example, the numbers that precede the commands are the +@dfn{tokens} described in @ref{GDB/MI Command Syntax, ,@sc{gdb/mi} +Command Syntax}. Notice how @sc{gdb/mi} returns the same tokens in its +output. + +@smallexample +211-data-evaluate-expression A +211^done,value="1" +(@value{GDBP}) +311-data-evaluate-expression &A +311^done,value="0xefffeb7c" +(@value{GDBP}) +411-data-evaluate-expression A+3 +411^done,value="4" +(@value{GDBP}) +511-data-evaluate-expression "A + 3" +511^done,value="4" +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-data-list-changed-registers} Command +@findex -data-list-changed-registers + +@subsubheading Synopsis + +@smallexample + -data-list-changed-registers +@end smallexample + +Display a list of the registers that have changed. + +@subsubheading @value{GDBN} Command + +@value{GDBN} doesn't have a direct analog for this command; @code{gdbtk} +has the corresponding command @samp{gdb_changed_register_list}. + +@subsubheading Example + +On a PPC MBX board: + +@smallexample +(@value{GDBP}) +-exec-continue +^running + +(@value{GDBP}) +*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main", +args=[],file="try.c",line="5"@} +(@value{GDBP}) +-data-list-changed-registers +^done,changed-registers=["0","1","2","4","5","6","7","8","9", +"10","11","13","14","15","16","17","18","19","20","21","22","23", +"24","25","26","27","28","30","31","64","65","66","67","69"] +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-data-list-register-names} Command +@findex -data-list-register-names + +@subsubheading Synopsis + +@smallexample + -data-list-register-names [ ( @var{regno} )+ ] +@end smallexample + +Show a list of register names for the current target. If no arguments +are given, it shows a list of the names of all the registers. If +integer numbers are given as arguments, it will print a list of the +names of the registers corresponding to the arguments. To ensure +consistency between a register name and its number, the output list may +include empty register names. + +@subsubheading @value{GDBN} Command + +@value{GDBN} does not have a command which corresponds to +@samp{-data-list-register-names}. In @code{gdbtk} there is a +corresponding command @samp{gdb_regnames}. + +@subsubheading Example + +For the PPC MBX board: +@smallexample +(@value{GDBP}) +-data-list-register-names +^done,register-names=["r0","r1","r2","r3","r4","r5","r6","r7", +"r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18", +"r19","r20","r21","r22","r23","r24","r25","r26","r27","r28","r29", +"r30","r31","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9", +"f10","f11","f12","f13","f14","f15","f16","f17","f18","f19","f20", +"f21","f22","f23","f24","f25","f26","f27","f28","f29","f30","f31", +"", "pc","ps","cr","lr","ctr","xer"] +(@value{GDBP}) +-data-list-register-names 1 2 3 +^done,register-names=["r1","r2","r3"] +(@value{GDBP}) +@end smallexample + +@subheading The @code{-data-list-register-values} Command +@findex -data-list-register-values + +@subsubheading Synopsis + +@smallexample + -data-list-register-values @var{fmt} [ ( @var{regno} )*] +@end smallexample + +Display the registers' contents. @var{fmt} is the format according to +which the registers' contents are to be returned, followed by an optional +list of numbers specifying the registers to display. A missing list of +numbers indicates that the contents of all the registers must be returned. + +Allowed formats for @var{fmt} are: + +@table @code +@item x +Hexadecimal +@item o +Octal +@item t +Binary +@item d +Decimal +@item r +Raw +@item N +Natural +@end table + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} commands are @samp{info reg}, @samp{info +all-reg}, and (in @code{gdbtk}) @samp{gdb_fetch_registers}. + +@subsubheading Example + +For a PPC MBX board (note: line breaks are for readability only, they +don't appear in the actual output): + +@smallexample +(@value{GDBP}) +-data-list-register-values r 64 65 +^done,register-values=[@{number="64",value="0xfe00a300"@}, +@{number="65",value="0x00029002"@}] +(@value{GDBP}) +-data-list-register-values x +^done,register-values=[@{number="0",value="0xfe0043c8"@}, +@{number="1",value="0x3fff88"@},@{number="2",value="0xfffffffe"@}, +@{number="3",value="0x0"@},@{number="4",value="0xa"@}, +@{number="5",value="0x3fff68"@},@{number="6",value="0x3fff58"@}, +@{number="7",value="0xfe011e98"@},@{number="8",value="0x2"@}, +@{number="9",value="0xfa202820"@},@{number="10",value="0xfa202808"@}, +@{number="11",value="0x1"@},@{number="12",value="0x0"@}, +@{number="13",value="0x4544"@},@{number="14",value="0xffdfffff"@}, +@{number="15",value="0xffffffff"@},@{number="16",value="0xfffffeff"@}, +@{number="17",value="0xefffffed"@},@{number="18",value="0xfffffffe"@}, +@{number="19",value="0xffffffff"@},@{number="20",value="0xffffffff"@}, +@{number="21",value="0xffffffff"@},@{number="22",value="0xfffffff7"@}, +@{number="23",value="0xffffffff"@},@{number="24",value="0xffffffff"@}, +@{number="25",value="0xffffffff"@},@{number="26",value="0xfffffffb"@}, +@{number="27",value="0xffffffff"@},@{number="28",value="0xf7bfffff"@}, +@{number="29",value="0x0"@},@{number="30",value="0xfe010000"@}, +@{number="31",value="0x0"@},@{number="32",value="0x0"@}, +@{number="33",value="0x0"@},@{number="34",value="0x0"@}, +@{number="35",value="0x0"@},@{number="36",value="0x0"@}, +@{number="37",value="0x0"@},@{number="38",value="0x0"@}, +@{number="39",value="0x0"@},@{number="40",value="0x0"@}, +@{number="41",value="0x0"@},@{number="42",value="0x0"@}, +@{number="43",value="0x0"@},@{number="44",value="0x0"@}, +@{number="45",value="0x0"@},@{number="46",value="0x0"@}, +@{number="47",value="0x0"@},@{number="48",value="0x0"@}, +@{number="49",value="0x0"@},@{number="50",value="0x0"@}, +@{number="51",value="0x0"@},@{number="52",value="0x0"@}, +@{number="53",value="0x0"@},@{number="54",value="0x0"@}, +@{number="55",value="0x0"@},@{number="56",value="0x0"@}, +@{number="57",value="0x0"@},@{number="58",value="0x0"@}, +@{number="59",value="0x0"@},@{number="60",value="0x0"@}, +@{number="61",value="0x0"@},@{number="62",value="0x0"@}, +@{number="63",value="0x0"@},@{number="64",value="0xfe00a300"@}, +@{number="65",value="0x29002"@},@{number="66",value="0x202f04b5"@}, +@{number="67",value="0xfe0043b0"@},@{number="68",value="0xfe00b3e4"@}, +@{number="69",value="0x20002b03"@}] +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-data-read-memory} Command +@findex -data-read-memory + +@subsubheading Synopsis + +@smallexample + -data-read-memory [ -o @var{byte-offset} ] + @var{address} @var{word-format} @var{word-size} + @var{nr-rows} @var{nr-cols} [ @var{aschar} ] +@end smallexample + +@noindent +where: + +@table @samp +@item @var{address} +An expression specifying the address of the first memory word to be +read. Complex expressions containing embedded white space should be +quoted using the C convention. + +@item @var{word-format} +The format to be used to print the memory words. The notation is the +same as for @value{GDBN}'s @code{print} command (@pxref{Output Formats, +,Output formats}). + +@item @var{word-size} +The size of each memory word in bytes. + +@item @var{nr-rows} +The number of rows in the output table. + +@item @var{nr-cols} +The number of columns in the output table. + +@item @var{aschar} +If present, indicates that each row should include an @sc{ascii} dump. The +value of @var{aschar} is used as a padding character when a byte is not a +member of the printable @sc{ascii} character set (printable @sc{ascii} +characters are those whose code is between 32 and 126, inclusively). + +@item @var{byte-offset} +An offset to add to the @var{address} before fetching memory. +@end table + +This command displays memory contents as a table of @var{nr-rows} by +@var{nr-cols} words, each word being @var{word-size} bytes. In total, +@code{@var{nr-rows} * @var{nr-cols} * @var{word-size}} bytes are read +(returned as @samp{total-bytes}). Should less than the requested number +of bytes be returned by the target, the missing words are identified +using @samp{N/A}. The number of bytes read from the target is returned +in @samp{nr-bytes} and the starting address used to read memory in +@samp{addr}. + +The address of the next/previous row or page is available in +@samp{next-row} and @samp{prev-row}, @samp{next-page} and +@samp{prev-page}. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{x}. @code{gdbtk} has +@samp{gdb_get_mem} memory read command. + +@subsubheading Example + +Read six bytes of memory starting at @code{bytes+6} but then offset by +@code{-6} bytes. Format as three rows of two columns. One byte per +word. Display each word in hex. + +@smallexample +(@value{GDBP}) +9-data-read-memory -o -6 -- bytes+6 x 1 3 2 +9^done,addr="0x00001390",nr-bytes="6",total-bytes="6", +next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396", +prev-page="0x0000138a",memory=[ +@{addr="0x00001390",data=["0x00","0x01"]@}, +@{addr="0x00001392",data=["0x02","0x03"]@}, +@{addr="0x00001394",data=["0x04","0x05"]@}] +(@value{GDBP}) +@end smallexample + +Read two bytes of memory starting at address @code{shorts + 64} and +display as a single word formatted in decimal. + +@smallexample +(@value{GDBP}) +5-data-read-memory shorts+64 d 2 1 1 +5^done,addr="0x00001510",nr-bytes="2",total-bytes="2", +next-row="0x00001512",prev-row="0x0000150e", +next-page="0x00001512",prev-page="0x0000150e",memory=[ +@{addr="0x00001510",data=["128"]@}] +(@value{GDBP}) +@end smallexample + +Read thirty two bytes of memory starting at @code{bytes+16} and format +as eight rows of four columns. Include a string encoding with @samp{x} +used as the non-printable character. + +@smallexample +(@value{GDBP}) +4-data-read-memory bytes+16 x 1 8 4 x +4^done,addr="0x000013a0",nr-bytes="32",total-bytes="32", +next-row="0x000013c0",prev-row="0x0000139c", +next-page="0x000013c0",prev-page="0x00001380",memory=[ +@{addr="0x000013a0",data=["0x10","0x11","0x12","0x13"],ascii="xxxx"@}, +@{addr="0x000013a4",data=["0x14","0x15","0x16","0x17"],ascii="xxxx"@}, +@{addr="0x000013a8",data=["0x18","0x19","0x1a","0x1b"],ascii="xxxx"@}, +@{addr="0x000013ac",data=["0x1c","0x1d","0x1e","0x1f"],ascii="xxxx"@}, +@{addr="0x000013b0",data=["0x20","0x21","0x22","0x23"],ascii=" !\"#"@}, +@{addr="0x000013b4",data=["0x24","0x25","0x26","0x27"],ascii="$%&'"@}, +@{addr="0x000013b8",data=["0x28","0x29","0x2a","0x2b"],ascii="()*+"@}, +@{addr="0x000013bc",data=["0x2c","0x2d","0x2e","0x2f"],ascii=",-./"@}] +(@value{GDBP}) +@end smallexample + +@subheading The @code{-display-delete} Command +@findex -display-delete + +@subsubheading Synopsis + +@smallexample + -display-delete @var{number} +@end smallexample + +Delete the display @var{number}. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{delete display}. + +@subsubheading Example +N.A. + + +@subheading The @code{-display-disable} Command +@findex -display-disable + +@subsubheading Synopsis + +@smallexample + -display-disable @var{number} +@end smallexample + +Disable display @var{number}. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{disable display}. + +@subsubheading Example +N.A. + + +@subheading The @code{-display-enable} Command +@findex -display-enable + +@subsubheading Synopsis + +@smallexample + -display-enable @var{number} +@end smallexample + +Enable display @var{number}. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{enable display}. + +@subsubheading Example +N.A. + + +@subheading The @code{-display-insert} Command +@findex -display-insert + +@subsubheading Synopsis + +@smallexample + -display-insert @var{expression} +@end smallexample + +Display @var{expression} every time the program stops. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{display}. + +@subsubheading Example +N.A. + + +@subheading The @code{-display-list} Command +@findex -display-list + +@subsubheading Synopsis + +@smallexample + -display-list +@end smallexample + +List the displays. Do not show the current values. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{info display}. + +@subsubheading Example +N.A. + + +@subheading The @code{-environment-cd} Command +@findex -environment-cd + +@subsubheading Synopsis + +@smallexample + -environment-cd @var{pathdir} +@end smallexample + +Set @value{GDBN}'s working directory. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{cd}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb +^done +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-environment-directory} Command +@findex -environment-directory + +@subsubheading Synopsis + +@smallexample + -environment-directory [ -r ] [ @var{pathdir} ]+ +@end smallexample + +Add directories @var{pathdir} to beginning of search path for source files. +If the @samp{-r} option is used, the search path is reset to the default +search path. If directories @var{pathdir} are supplied in addition to the +@samp{-r} option, the search path is first reset and then addition +occurs as normal. +Multiple directories may be specified, separated by blanks. Specifying +multiple directories in a single command +results in the directories added to the beginning of the +search path in the same order they were presented in the command. +If blanks are needed as +part of a directory name, double-quotes should be used around +the name. In the command output, the path will show up separated +by the system directory-separator character. The directory-seperator +character must not be used +in any directory name. +If no directories are specified, the current search path is displayed. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{dir}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb +^done,source-path="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd" +(@value{GDBP}) +-environment-directory "" +^done,source-path="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd" +(@value{GDBP}) +-environment-directory -r /home/jjohnstn/src/gdb /usr/src +^done,source-path="/home/jjohnstn/src/gdb:/usr/src:$cdir:$cwd" +(@value{GDBP}) +-environment-directory -r +^done,source-path="$cdir:$cwd" +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-environment-path} Command +@findex -environment-path + +@subsubheading Synopsis + +@smallexample + -environment-path [ -r ] [ @var{pathdir} ]+ +@end smallexample + +Add directories @var{pathdir} to beginning of search path for object files. +If the @samp{-r} option is used, the search path is reset to the original +search path that existed at gdb start-up. If directories @var{pathdir} are +supplied in addition to the +@samp{-r} option, the search path is first reset and then addition +occurs as normal. +Multiple directories may be specified, separated by blanks. Specifying +multiple directories in a single command +results in the directories added to the beginning of the +search path in the same order they were presented in the command. +If blanks are needed as +part of a directory name, double-quotes should be used around +the name. In the command output, the path will show up separated +by the system directory-separator character. The directory-seperator +character must not be used +in any directory name. +If no directories are specified, the current path is displayed. + + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{path}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-environment-path +^done,path="/usr/bin" +(@value{GDBP}) +-environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb /bin +^done,path="/kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb:/bin:/usr/bin" +(@value{GDBP}) +-environment-path -r /usr/local/bin +^done,path="/usr/local/bin:/usr/bin" +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-environment-pwd} Command +@findex -environment-pwd + +@subsubheading Synopsis + +@smallexample + -environment-pwd +@end smallexample + +Show the current working directory. + +@subsubheading @value{GDBN} command + +The corresponding @value{GDBN} command is @samp{pwd}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-environment-pwd +^done,cwd="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb" +(@value{GDBP}) +@end smallexample + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Program Control +@section @sc{gdb/mi} Program control + +@subsubheading Program termination + +As a result of execution, the inferior program can run to completion, if +it doesn't encounter any breakpoints. In this case the output will +include an exit code, if the program has exited exceptionally. + +@subsubheading Examples + +@noindent +Program exited normally: + +@smallexample +(@value{GDBP}) +-exec-run +^running +(@value{GDBP}) +x = 55 +*stopped,reason="exited-normally" +(@value{GDBP}) +@end smallexample + +@noindent +Program exited exceptionally: + +@smallexample +(@value{GDBP}) +-exec-run +^running +(@value{GDBP}) +x = 55 +*stopped,reason="exited",exit-code="01" +(@value{GDBP}) +@end smallexample + +Another way the program can terminate is if it receives a signal such as +@code{SIGINT}. In this case, @sc{gdb/mi} displays this: + +@smallexample +(@value{GDBP}) +*stopped,reason="exited-signalled",signal-name="SIGINT", +signal-meaning="Interrupt" +@end smallexample + + +@subheading The @code{-exec-abort} Command +@findex -exec-abort + +@subsubheading Synopsis + +@smallexample + -exec-abort +@end smallexample + +Kill the inferior running program. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{kill}. + +@subsubheading Example +N.A. + + +@subheading The @code{-exec-arguments} Command +@findex -exec-arguments + +@subsubheading Synopsis + +@smallexample + -exec-arguments @var{args} +@end smallexample + +Set the inferior program arguments, to be used in the next +@samp{-exec-run}. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{set args}. + +@subsubheading Example + +@c FIXME! +Don't have one around. + + +@subheading The @code{-exec-continue} Command +@findex -exec-continue + +@subsubheading Synopsis + +@smallexample + -exec-continue +@end smallexample + +Asynchronous command. Resumes the execution of the inferior program +until a breakpoint is encountered, or until the inferior exits. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} corresponding is @samp{continue}. + +@subsubheading Example + +@smallexample +-exec-continue +^running +(@value{GDBP}) +@@Hello world +*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=[], +file="hello.c",line="13"@} +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-exec-finish} Command +@findex -exec-finish + +@subsubheading Synopsis + +@smallexample + -exec-finish +@end smallexample + +Asynchronous command. Resumes the execution of the inferior program +until the current function is exited. Displays the results returned by +the function. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{finish}. + +@subsubheading Example + +Function returning @code{void}. + +@smallexample +-exec-finish +^running +(@value{GDBP}) +@@hello from foo +*stopped,reason="function-finished",frame=@{func="main",args=[], +file="hello.c",line="7"@} +(@value{GDBP}) +@end smallexample + +Function returning other than @code{void}. The name of the internal +@value{GDBN} variable storing the result is printed, together with the +value itself. + +@smallexample +-exec-finish +^running +(@value{GDBP}) +*stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo", +args=[@{name="a",value="1"],@{name="b",value="9"@}@}, +file="recursive2.c",line="14"@}, +gdb-result-var="$1",return-value="0" +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-exec-interrupt} Command +@findex -exec-interrupt + +@subsubheading Synopsis + +@smallexample + -exec-interrupt +@end smallexample + +Asynchronous command. Interrupts the background execution of the target. +Note how the token associated with the stop message is the one for the +execution command that has been interrupted. The token for the interrupt +itself only appears in the @samp{^done} output. If the user is trying to +interrupt a non-running program, an error message will be printed. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{interrupt}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +111-exec-continue +111^running + +(@value{GDBP}) +222-exec-interrupt +222^done +(@value{GDBP}) +111*stopped,signal-name="SIGINT",signal-meaning="Interrupt", +frame=@{addr="0x00010140",func="foo",args=[],file="try.c",line="13"@} +(@value{GDBP}) + +(@value{GDBP}) +-exec-interrupt +^error,msg="mi_cmd_exec_interrupt: Inferior not executing." +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-exec-next} Command +@findex -exec-next + +@subsubheading Synopsis + +@smallexample + -exec-next +@end smallexample + +Asynchronous command. Resumes execution of the inferior program, stopping +when the beginning of the next source line is reached. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{next}. + +@subsubheading Example + +@smallexample +-exec-next +^running +(@value{GDBP}) +*stopped,reason="end-stepping-range",line="8",file="hello.c" +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-exec-next-instruction} Command +@findex -exec-next-instruction + +@subsubheading Synopsis + +@smallexample + -exec-next-instruction +@end smallexample + +Asynchronous command. Executes one machine instruction. If the +instruction is a function call continues until the function returns. If +the program stops at an instruction in the middle of a source line, the +address will be printed as well. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{nexti}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-exec-next-instruction +^running + +(@value{GDBP}) +*stopped,reason="end-stepping-range", +addr="0x000100d4",line="5",file="hello.c" +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-exec-return} Command +@findex -exec-return + +@subsubheading Synopsis + +@smallexample + -exec-return +@end smallexample + +Makes current function return immediately. Doesn't execute the inferior. +Displays the new current frame. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{return}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +200-break-insert callee4 +200^done,bkpt=@{number="1",addr="0x00010734", +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@} +(@value{GDBP}) +000-exec-run +000^running +(@value{GDBP}) +000*stopped,reason="breakpoint-hit",bkptno="1", +frame=@{func="callee4",args=[], +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@} +(@value{GDBP}) +205-break-delete +205^done +(@value{GDBP}) +111-exec-return +111^done,frame=@{level="0",func="callee3", +args=[@{name="strarg", +value="0x11940 \"A string argument.\""@}], +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@} +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-exec-run} Command +@findex -exec-run + +@subsubheading Synopsis + +@smallexample + -exec-run +@end smallexample + +Asynchronous command. Starts execution of the inferior from the +beginning. The inferior executes until either a breakpoint is +encountered or the program exits. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{run}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-break-insert main +^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@} +(@value{GDBP}) +-exec-run +^running +(@value{GDBP}) +*stopped,reason="breakpoint-hit",bkptno="1", +frame=@{func="main",args=[],file="recursive2.c",line="4"@} +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-exec-show-arguments} Command +@findex -exec-show-arguments + +@subsubheading Synopsis + +@smallexample + -exec-show-arguments +@end smallexample + +Print the arguments of the program. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{show args}. + +@subsubheading Example +N.A. + +@c @subheading -exec-signal + +@subheading The @code{-exec-step} Command +@findex -exec-step + +@subsubheading Synopsis + +@smallexample + -exec-step +@end smallexample + +Asynchronous command. Resumes execution of the inferior program, stopping +when the beginning of the next source line is reached, if the next +source line is not a function call. If it is, stop at the first +instruction of the called function. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{step}. + +@subsubheading Example + +Stepping into a function: + +@smallexample +-exec-step +^running +(@value{GDBP}) +*stopped,reason="end-stepping-range", +frame=@{func="foo",args=[@{name="a",value="10"@}, +@{name="b",value="0"@}],file="recursive2.c",line="11"@} +(@value{GDBP}) +@end smallexample + +Regular stepping: + +@smallexample +-exec-step +^running +(@value{GDBP}) +*stopped,reason="end-stepping-range",line="14",file="recursive2.c" +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-exec-step-instruction} Command +@findex -exec-step-instruction + +@subsubheading Synopsis + +@smallexample + -exec-step-instruction +@end smallexample + +Asynchronous command. Resumes the inferior which executes one machine +instruction. The output, once @value{GDBN} has stopped, will vary depending on +whether we have stopped in the middle of a source line or not. In the +former case, the address at which the program stopped will be printed as +well. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{stepi}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-exec-step-instruction +^running + +(@value{GDBP}) +*stopped,reason="end-stepping-range", +frame=@{func="foo",args=[],file="try.c",line="10"@} +(@value{GDBP}) +-exec-step-instruction +^running + +(@value{GDBP}) +*stopped,reason="end-stepping-range", +frame=@{addr="0x000100f4",func="foo",args=[],file="try.c",line="10"@} +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-exec-until} Command +@findex -exec-until + +@subsubheading Synopsis + +@smallexample + -exec-until [ @var{location} ] +@end smallexample + +Asynchronous command. Executes the inferior until the @var{location} +specified in the argument is reached. If there is no argument, the inferior +executes until a source line greater than the current one is reached. +The reason for stopping in this case will be @samp{location-reached}. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{until}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-exec-until recursive2.c:6 +^running +(@value{GDBP}) +x = 55 +*stopped,reason="location-reached",frame=@{func="main",args=[], +file="recursive2.c",line="6"@} +(@value{GDBP}) +@end smallexample + +@ignore +@subheading -file-clear +Is this going away???? +@end ignore + + +@subheading The @code{-file-exec-and-symbols} Command +@findex -file-exec-and-symbols + +@subsubheading Synopsis + +@smallexample + -file-exec-and-symbols @var{file} +@end smallexample + +Specify the executable file to be debugged. This file is the one from +which the symbol table is also read. If no file is specified, the +command clears the executable and symbol information. If breakpoints +are set when using this command with no arguments, @value{GDBN} will produce +error messages. Otherwise, no output is produced, except a completion +notification. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{file}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx +^done +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-file-exec-file} Command +@findex -file-exec-file + +@subsubheading Synopsis + +@smallexample + -file-exec-file @var{file} +@end smallexample + +Specify the executable file to be debugged. Unlike +@samp{-file-exec-and-symbols}, the symbol table is @emph{not} read +from this file. If used without argument, @value{GDBN} clears the information +about the executable file. No output is produced, except a completion +notification. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{exec-file}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx +^done +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-file-list-exec-sections} Command +@findex -file-list-exec-sections + +@subsubheading Synopsis + +@smallexample + -file-list-exec-sections +@end smallexample + +List the sections of the current executable file. + +@subsubheading @value{GDBN} Command + +The @value{GDBN} command @samp{info file} shows, among the rest, the same +information as this command. @code{gdbtk} has a corresponding command +@samp{gdb_load_info}. + +@subsubheading Example +N.A. + + +@subheading The @code{-file-list-exec-source-files} Command +@findex -file-list-exec-source-files + +@subsubheading Synopsis + +@smallexample + -file-list-exec-source-files +@end smallexample + +List the source files for the current executable. + +@subsubheading @value{GDBN} Command + +There's no @value{GDBN} command which directly corresponds to this one. +@code{gdbtk} has an analogous command @samp{gdb_listfiles}. + +@subsubheading Example +N.A. + + +@subheading The @code{-file-list-shared-libraries} Command +@findex -file-list-shared-libraries + +@subsubheading Synopsis + +@smallexample + -file-list-shared-libraries +@end smallexample + +List the shared libraries in the program. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{info shared}. + +@subsubheading Example +N.A. + + +@subheading The @code{-file-list-symbol-files} Command +@findex -file-list-symbol-files + +@subsubheading Synopsis + +@smallexample + -file-list-symbol-files +@end smallexample + +List symbol files. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{info file} (part of it). + +@subsubheading Example +N.A. + + +@subheading The @code{-file-symbol-file} Command +@findex -file-symbol-file + +@subsubheading Synopsis + +@smallexample + -file-symbol-file @var{file} +@end smallexample + +Read symbol table info from the specified @var{file} argument. When +used without arguments, clears @value{GDBN}'s symbol table info. No output is +produced, except for a completion notification. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{symbol-file}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx +^done +(@value{GDBP}) +@end smallexample + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Miscellaneous Commands +@section Miscellaneous @value{GDBN} commands in @sc{gdb/mi} + +@c @subheading -gdb-complete + +@subheading The @code{-gdb-exit} Command +@findex -gdb-exit + +@subsubheading Synopsis + +@smallexample + -gdb-exit +@end smallexample + +Exit @value{GDBN} immediately. + +@subsubheading @value{GDBN} Command + +Approximately corresponds to @samp{quit}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-gdb-exit +@end smallexample + +@subheading The @code{-gdb-set} Command +@findex -gdb-set + +@subsubheading Synopsis + +@smallexample + -gdb-set +@end smallexample + +Set an internal @value{GDBN} variable. +@c IS THIS A DOLLAR VARIABLE? OR SOMETHING LIKE ANNOTATE ????? + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{set}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-gdb-set $foo=3 +^done +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-gdb-show} Command +@findex -gdb-show + +@subsubheading Synopsis + +@smallexample + -gdb-show +@end smallexample + +Show the current value of a @value{GDBN} variable. + +@subsubheading @value{GDBN} command + +The corresponding @value{GDBN} command is @samp{show}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-gdb-show annotate +^done,value="0" +(@value{GDBP}) +@end smallexample + +@c @subheading -gdb-source + + +@subheading The @code{-gdb-version} Command +@findex -gdb-version + +@subsubheading Synopsis + +@smallexample + -gdb-version +@end smallexample + +Show version information for @value{GDBN}. Used mostly in testing. + +@subsubheading @value{GDBN} Command + +There's no equivalent @value{GDBN} command. @value{GDBN} by default shows this +information when you start an interactive session. + +@subsubheading Example + +@c This example modifies the actual output from GDB to avoid overfull +@c box in TeX. +@smallexample +(@value{GDBP}) +-gdb-version +~GNU gdb 5.2.1 +~Copyright 2000 Free Software Foundation, Inc. +~GDB is free software, covered by the GNU General Public License, and +~you are welcome to change it and/or distribute copies of it under +~ certain conditions. +~Type "show copying" to see the conditions. +~There is absolutely no warranty for GDB. Type "show warranty" for +~ details. +~This GDB was configured as + "--host=sparc-sun-solaris2.5.1 --target=ppc-eabi". +^done +(@value{GDBP}) +@end smallexample + +@subheading The @code{-interpreter-exec} Command +@findex -interpreter-exec + +@subheading Synopsis + +@smallexample +-interpreter-exec @var{interpreter} @var{command} +@end smallexample + +Execute the specified @var{command} in the given @var{interpreter}. + +@subheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{interpreter-exec}. + +@subheading Example + +@smallexample +(@value{GDBP}) +-interpreter-exec console "break main" +&"During symbol reading, couldn't parse type; debugger out of date?.\n" +&"During symbol reading, bad structure-type format.\n" +~"Breakpoint 1 at 0x8074fc6: file ../../src/gdb/main.c, line 743.\n" +^done +(@value{GDBP}) +@end smallexample + +@ignore +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Kod Commands +@section @sc{gdb/mi} Kod Commands + +The Kod commands are not implemented. + +@c @subheading -kod-info + +@c @subheading -kod-list + +@c @subheading -kod-list-object-types + +@c @subheading -kod-show + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Memory Overlay Commands +@section @sc{gdb/mi} Memory Overlay Commands + +The memory overlay commands are not implemented. + +@c @subheading -overlay-auto + +@c @subheading -overlay-list-mapping-state + +@c @subheading -overlay-list-overlays + +@c @subheading -overlay-map + +@c @subheading -overlay-off + +@c @subheading -overlay-on + +@c @subheading -overlay-unmap + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Signal Handling Commands +@section @sc{gdb/mi} Signal Handling Commands + +Signal handling commands are not implemented. + +@c @subheading -signal-handle + +@c @subheading -signal-list-handle-actions + +@c @subheading -signal-list-signal-types +@end ignore + + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Stack Manipulation +@section @sc{gdb/mi} Stack Manipulation Commands + + +@subheading The @code{-stack-info-frame} Command +@findex -stack-info-frame + +@subsubheading Synopsis + +@smallexample + -stack-info-frame +@end smallexample + +Get info on the current frame. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{info frame} or @samp{frame} +(without arguments). + +@subsubheading Example +N.A. + +@subheading The @code{-stack-info-depth} Command +@findex -stack-info-depth + +@subsubheading Synopsis + +@smallexample + -stack-info-depth [ @var{max-depth} ] +@end smallexample + +Return the depth of the stack. If the integer argument @var{max-depth} +is specified, do not count beyond @var{max-depth} frames. + +@subsubheading @value{GDBN} Command + +There's no equivalent @value{GDBN} command. + +@subsubheading Example + +For a stack with frame levels 0 through 11: + +@smallexample +(@value{GDBP}) +-stack-info-depth +^done,depth="12" +(@value{GDBP}) +-stack-info-depth 4 +^done,depth="4" +(@value{GDBP}) +-stack-info-depth 12 +^done,depth="12" +(@value{GDBP}) +-stack-info-depth 11 +^done,depth="11" +(@value{GDBP}) +-stack-info-depth 13 +^done,depth="12" +(@value{GDBP}) +@end smallexample + +@subheading The @code{-stack-list-arguments} Command +@findex -stack-list-arguments + +@subsubheading Synopsis + +@smallexample + -stack-list-arguments @var{show-values} + [ @var{low-frame} @var{high-frame} ] +@end smallexample + +Display a list of the arguments for the frames between @var{low-frame} +and @var{high-frame} (inclusive). If @var{low-frame} and +@var{high-frame} are not provided, list the arguments for the whole call +stack. + +The @var{show-values} argument must have a value of 0 or 1. A value of +0 means that only the names of the arguments are listed, a value of 1 +means that both names and values of the arguments are printed. + +@subsubheading @value{GDBN} Command + +@value{GDBN} does not have an equivalent command. @code{gdbtk} has a +@samp{gdb_get_args} command which partially overlaps with the +functionality of @samp{-stack-list-arguments}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-stack-list-frames +^done, +stack=[ +frame=@{level="0",addr="0x00010734",func="callee4", +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}, +frame=@{level="1",addr="0x0001076c",func="callee3", +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"@}, +frame=@{level="2",addr="0x0001078c",func="callee2", +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"@}, +frame=@{level="3",addr="0x000107b4",func="callee1", +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"@}, +frame=@{level="4",addr="0x000107e0",func="main", +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}] +(@value{GDBP}) +-stack-list-arguments 0 +^done, +stack-args=[ +frame=@{level="0",args=[]@}, +frame=@{level="1",args=[name="strarg"]@}, +frame=@{level="2",args=[name="intarg",name="strarg"]@}, +frame=@{level="3",args=[name="intarg",name="strarg",name="fltarg"]@}, +frame=@{level="4",args=[]@}] +(@value{GDBP}) +-stack-list-arguments 1 +^done, +stack-args=[ +frame=@{level="0",args=[]@}, +frame=@{level="1", + args=[@{name="strarg",value="0x11940 \"A string argument.\""@}]@}, +frame=@{level="2",args=[ +@{name="intarg",value="2"@}, +@{name="strarg",value="0x11940 \"A string argument.\""@}]@}, +@{frame=@{level="3",args=[ +@{name="intarg",value="2"@}, +@{name="strarg",value="0x11940 \"A string argument.\""@}, +@{name="fltarg",value="3.5"@}]@}, +frame=@{level="4",args=[]@}] +(@value{GDBP}) +-stack-list-arguments 0 2 2 +^done,stack-args=[frame=@{level="2",args=[name="intarg",name="strarg"]@}] +(@value{GDBP}) +-stack-list-arguments 1 2 2 +^done,stack-args=[frame=@{level="2", +args=[@{name="intarg",value="2"@}, +@{name="strarg",value="0x11940 \"A string argument.\""@}]@}] +(@value{GDBP}) +@end smallexample + +@c @subheading -stack-list-exception-handlers + + +@subheading The @code{-stack-list-frames} Command +@findex -stack-list-frames + +@subsubheading Synopsis + +@smallexample + -stack-list-frames [ @var{low-frame} @var{high-frame} ] +@end smallexample + +List the frames currently on the stack. For each frame it displays the +following info: + +@table @samp +@item @var{level} +The frame number, 0 being the topmost frame, i.e. the innermost function. +@item @var{addr} +The @code{$pc} value for that frame. +@item @var{func} +Function name. +@item @var{file} +File name of the source file where the function lives. +@item @var{line} +Line number corresponding to the @code{$pc}. +@end table + +If invoked without arguments, this command prints a backtrace for the +whole stack. If given two integer arguments, it shows the frames whose +levels are between the two arguments (inclusive). If the two arguments +are equal, it shows the single frame at the corresponding level. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} commands are @samp{backtrace} and @samp{where}. + +@subsubheading Example + +Full stack backtrace: + +@smallexample +(@value{GDBP}) +-stack-list-frames +^done,stack= +[frame=@{level="0",addr="0x0001076c",func="foo", + file="recursive2.c",line="11"@}, +frame=@{level="1",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}, +frame=@{level="2",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}, +frame=@{level="3",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}, +frame=@{level="4",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}, +frame=@{level="5",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}, +frame=@{level="6",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}, +frame=@{level="7",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}, +frame=@{level="8",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}, +frame=@{level="9",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}, +frame=@{level="10",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}, +frame=@{level="11",addr="0x00010738",func="main", + file="recursive2.c",line="4"@}] +(@value{GDBP}) +@end smallexample + +Show frames between @var{low_frame} and @var{high_frame}: + +@smallexample +(@value{GDBP}) +-stack-list-frames 3 5 +^done,stack= +[frame=@{level="3",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}, +frame=@{level="4",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}, +frame=@{level="5",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}] +(@value{GDBP}) +@end smallexample + +Show a single frame: + +@smallexample +(@value{GDBP}) +-stack-list-frames 3 3 +^done,stack= +[frame=@{level="3",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}] +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-stack-list-locals} Command +@findex -stack-list-locals + +@subsubheading Synopsis + +@smallexample + -stack-list-locals @var{print-values} +@end smallexample + +Display the local variable names for the current frame. With an +argument of 0 prints only the names of the variables, with argument of 1 +prints also their values. + +@subsubheading @value{GDBN} Command + +@samp{info locals} in @value{GDBN}, @samp{gdb_get_locals} in @code{gdbtk}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-stack-list-locals 0 +^done,locals=[name="A",name="B",name="C"] +(@value{GDBP}) +-stack-list-locals 1 +^done,locals=[@{name="A",value="1"@},@{name="B",value="2"@}, + @{name="C",value="3"@}] +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-stack-select-frame} Command +@findex -stack-select-frame + +@subsubheading Synopsis + +@smallexample + -stack-select-frame @var{framenum} +@end smallexample + +Change the current frame. Select a different frame @var{framenum} on +the stack. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} commands are @samp{frame}, @samp{up}, +@samp{down}, @samp{select-frame}, @samp{up-silent}, and @samp{down-silent}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-stack-select-frame 2 +^done +(@value{GDBP}) +@end smallexample + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Symbol Query +@section @sc{gdb/mi} Symbol Query Commands + + +@subheading The @code{-symbol-info-address} Command +@findex -symbol-info-address + +@subsubheading Synopsis + +@smallexample + -symbol-info-address @var{symbol} +@end smallexample + +Describe where @var{symbol} is stored. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{info address}. + +@subsubheading Example +N.A. + + +@subheading The @code{-symbol-info-file} Command +@findex -symbol-info-file + +@subsubheading Synopsis + +@smallexample + -symbol-info-file +@end smallexample + +Show the file for the symbol. + +@subsubheading @value{GDBN} Command + +There's no equivalent @value{GDBN} command. @code{gdbtk} has +@samp{gdb_find_file}. + +@subsubheading Example +N.A. + + +@subheading The @code{-symbol-info-function} Command +@findex -symbol-info-function + +@subsubheading Synopsis + +@smallexample + -symbol-info-function +@end smallexample + +Show which function the symbol lives in. + +@subsubheading @value{GDBN} Command + +@samp{gdb_get_function} in @code{gdbtk}. + +@subsubheading Example +N.A. + + +@subheading The @code{-symbol-info-line} Command +@findex -symbol-info-line + +@subsubheading Synopsis + +@smallexample + -symbol-info-line +@end smallexample + +Show the core addresses of the code for a source line. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} comamnd is @samp{info line}. +@code{gdbtk} has the @samp{gdb_get_line} and @samp{gdb_get_file} commands. + +@subsubheading Example +N.A. + + +@subheading The @code{-symbol-info-symbol} Command +@findex -symbol-info-symbol + +@subsubheading Synopsis + +@smallexample + -symbol-info-symbol @var{addr} +@end smallexample + +Describe what symbol is at location @var{addr}. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{info symbol}. + +@subsubheading Example +N.A. + + +@subheading The @code{-symbol-list-functions} Command +@findex -symbol-list-functions + +@subsubheading Synopsis + +@smallexample + -symbol-list-functions +@end smallexample + +List the functions in the executable. + +@subsubheading @value{GDBN} Command + +@samp{info functions} in @value{GDBN}, @samp{gdb_listfunc} and +@samp{gdb_search} in @code{gdbtk}. + +@subsubheading Example +N.A. + + +@subheading The @code{-symbol-list-types} Command +@findex -symbol-list-types + +@subsubheading Synopsis + +@smallexample + -symbol-list-types +@end smallexample + +List all the type names. + +@subsubheading @value{GDBN} Command + +The corresponding commands are @samp{info types} in @value{GDBN}, +@samp{gdb_search} in @code{gdbtk}. + +@subsubheading Example +N.A. + + +@subheading The @code{-symbol-list-variables} Command +@findex -symbol-list-variables + +@subsubheading Synopsis + +@smallexample + -symbol-list-variables +@end smallexample + +List all the global and static variable names. + +@subsubheading @value{GDBN} Command + +@samp{info variables} in @value{GDBN}, @samp{gdb_search} in @code{gdbtk}. + +@subsubheading Example +N.A. + + +@subheading The @code{-symbol-locate} Command +@findex -symbol-locate + +@subsubheading Synopsis + +@smallexample + -symbol-locate +@end smallexample + +@subsubheading @value{GDBN} Command + +@samp{gdb_loc} in @code{gdbtk}. + +@subsubheading Example +N.A. + + +@subheading The @code{-symbol-type} Command +@findex -symbol-type + +@subsubheading Synopsis + +@smallexample + -symbol-type @var{variable} +@end smallexample + +Show type of @var{variable}. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{ptype}, @code{gdbtk} has +@samp{gdb_obj_variable}. + +@subsubheading Example +N.A. + + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Target Manipulation +@section @sc{gdb/mi} Target Manipulation Commands + + +@subheading The @code{-target-attach} Command +@findex -target-attach + +@subsubheading Synopsis + +@smallexample + -target-attach @var{pid} | @var{file} +@end smallexample + +Attach to a process @var{pid} or a file @var{file} outside of @value{GDBN}. + +@subsubheading @value{GDBN} command + +The corresponding @value{GDBN} command is @samp{attach}. + +@subsubheading Example +N.A. + + +@subheading The @code{-target-compare-sections} Command +@findex -target-compare-sections + +@subsubheading Synopsis + +@smallexample + -target-compare-sections [ @var{section} ] +@end smallexample + +Compare data of section @var{section} on target to the exec file. +Without the argument, all sections are compared. + +@subsubheading @value{GDBN} Command + +The @value{GDBN} equivalent is @samp{compare-sections}. + +@subsubheading Example +N.A. + + +@subheading The @code{-target-detach} Command +@findex -target-detach + +@subsubheading Synopsis + +@smallexample + -target-detach +@end smallexample + +Disconnect from the remote target. There's no output. + +@subsubheading @value{GDBN} command + +The corresponding @value{GDBN} command is @samp{detach}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-target-detach +^done +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-target-download} Command +@findex -target-download + +@subsubheading Synopsis + +@smallexample + -target-download +@end smallexample + +Loads the executable onto the remote target. +It prints out an update message every half second, which includes the fields: + +@table @samp +@item section +The name of the section. +@item section-sent +The size of what has been sent so far for that section. +@item section-size +The size of the section. +@item total-sent +The total size of what was sent so far (the current and the previous sections). +@item total-size +The size of the overall executable to download. +@end table + +@noindent +Each message is sent as status record (@pxref{GDB/MI Output Syntax, , +@sc{gdb/mi} Output Syntax}). + +In addition, it prints the name and size of the sections, as they are +downloaded. These messages include the following fields: + +@table @samp +@item section +The name of the section. +@item section-size +The size of the section. +@item total-size +The size of the overall executable to download. +@end table + +@noindent +At the end, a summary is printed. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{load}. + +@subsubheading Example + +Note: each status message appears on a single line. Here the messages +have been broken down so that they can fit onto a page. + +@smallexample +(@value{GDBP}) +-target-download ++download,@{section=".text",section-size="6668",total-size="9880"@} ++download,@{section=".text",section-sent="512",section-size="6668", +total-sent="512",total-size="9880"@} ++download,@{section=".text",section-sent="1024",section-size="6668", +total-sent="1024",total-size="9880"@} ++download,@{section=".text",section-sent="1536",section-size="6668", +total-sent="1536",total-size="9880"@} ++download,@{section=".text",section-sent="2048",section-size="6668", +total-sent="2048",total-size="9880"@} ++download,@{section=".text",section-sent="2560",section-size="6668", +total-sent="2560",total-size="9880"@} ++download,@{section=".text",section-sent="3072",section-size="6668", +total-sent="3072",total-size="9880"@} ++download,@{section=".text",section-sent="3584",section-size="6668", +total-sent="3584",total-size="9880"@} ++download,@{section=".text",section-sent="4096",section-size="6668", +total-sent="4096",total-size="9880"@} ++download,@{section=".text",section-sent="4608",section-size="6668", +total-sent="4608",total-size="9880"@} ++download,@{section=".text",section-sent="5120",section-size="6668", +total-sent="5120",total-size="9880"@} ++download,@{section=".text",section-sent="5632",section-size="6668", +total-sent="5632",total-size="9880"@} ++download,@{section=".text",section-sent="6144",section-size="6668", +total-sent="6144",total-size="9880"@} ++download,@{section=".text",section-sent="6656",section-size="6668", +total-sent="6656",total-size="9880"@} ++download,@{section=".init",section-size="28",total-size="9880"@} ++download,@{section=".fini",section-size="28",total-size="9880"@} ++download,@{section=".data",section-size="3156",total-size="9880"@} ++download,@{section=".data",section-sent="512",section-size="3156", +total-sent="7236",total-size="9880"@} ++download,@{section=".data",section-sent="1024",section-size="3156", +total-sent="7748",total-size="9880"@} ++download,@{section=".data",section-sent="1536",section-size="3156", +total-sent="8260",total-size="9880"@} ++download,@{section=".data",section-sent="2048",section-size="3156", +total-sent="8772",total-size="9880"@} ++download,@{section=".data",section-sent="2560",section-size="3156", +total-sent="9284",total-size="9880"@} ++download,@{section=".data",section-sent="3072",section-size="3156", +total-sent="9796",total-size="9880"@} +^done,address="0x10004",load-size="9880",transfer-rate="6586", +write-rate="429" +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-target-exec-status} Command +@findex -target-exec-status + +@subsubheading Synopsis + +@smallexample + -target-exec-status +@end smallexample + +Provide information on the state of the target (whether it is running or +not, for instance). + +@subsubheading @value{GDBN} Command + +There's no equivalent @value{GDBN} command. + +@subsubheading Example +N.A. + + +@subheading The @code{-target-list-available-targets} Command +@findex -target-list-available-targets + +@subsubheading Synopsis + +@smallexample + -target-list-available-targets +@end smallexample + +List the possible targets to connect to. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{help target}. + +@subsubheading Example +N.A. + + +@subheading The @code{-target-list-current-targets} Command +@findex -target-list-current-targets + +@subsubheading Synopsis + +@smallexample + -target-list-current-targets +@end smallexample + +Describe the current target. + +@subsubheading @value{GDBN} Command + +The corresponding information is printed by @samp{info file} (among +other things). + +@subsubheading Example +N.A. + + +@subheading The @code{-target-list-parameters} Command +@findex -target-list-parameters + +@subsubheading Synopsis + +@smallexample + -target-list-parameters +@end smallexample + +@c ???? + +@subsubheading @value{GDBN} Command + +No equivalent. + +@subsubheading Example +N.A. + + +@subheading The @code{-target-select} Command +@findex -target-select + +@subsubheading Synopsis + +@smallexample + -target-select @var{type} @var{parameters @dots{}} +@end smallexample + +Connect @value{GDBN} to the remote target. This command takes two args: + +@table @samp +@item @var{type} +The type of target, for instance @samp{async}, @samp{remote}, etc. +@item @var{parameters} +Device names, host names and the like. @xref{Target Commands, , +Commands for managing targets}, for more details. +@end table + +The output is a connection notification, followed by the address at +which the target program is, in the following form: + +@smallexample +^connected,addr="@var{address}",func="@var{function name}", + args=[@var{arg list}] +@end smallexample + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{target}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-target-select async /dev/ttya +^connected,addr="0xfe00a300",func="??",args=[] +(@value{GDBP}) +@end smallexample + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Thread Commands +@section @sc{gdb/mi} Thread Commands + + +@subheading The @code{-thread-info} Command +@findex -thread-info + +@subsubheading Synopsis + +@smallexample + -thread-info +@end smallexample + +@subsubheading @value{GDBN} command + +No equivalent. + +@subsubheading Example +N.A. + + +@subheading The @code{-thread-list-all-threads} Command +@findex -thread-list-all-threads + +@subsubheading Synopsis + +@smallexample + -thread-list-all-threads +@end smallexample + +@subsubheading @value{GDBN} Command + +The equivalent @value{GDBN} command is @samp{info threads}. + +@subsubheading Example +N.A. + + +@subheading The @code{-thread-list-ids} Command +@findex -thread-list-ids + +@subsubheading Synopsis + +@smallexample + -thread-list-ids +@end smallexample + +Produces a list of the currently known @value{GDBN} thread ids. At the +end of the list it also prints the total number of such threads. + +@subsubheading @value{GDBN} Command + +Part of @samp{info threads} supplies the same information. + +@subsubheading Example + +No threads present, besides the main process: + +@smallexample +(@value{GDBP}) +-thread-list-ids +^done,thread-ids=@{@},number-of-threads="0" +(@value{GDBP}) +@end smallexample + + +Several threads: + +@smallexample +(@value{GDBP}) +-thread-list-ids +^done,thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@}, +number-of-threads="3" +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-thread-select} Command +@findex -thread-select + +@subsubheading Synopsis + +@smallexample + -thread-select @var{threadnum} +@end smallexample + +Make @var{threadnum} the current thread. It prints the number of the new +current thread, and the topmost frame for that thread. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{thread}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-exec-next +^running +(@value{GDBP}) +*stopped,reason="end-stepping-range",thread-id="2",line="187", +file="../../../devo/gdb/testsuite/gdb.threads/linux-dp.c" +(@value{GDBP}) +-thread-list-ids +^done, +thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@}, +number-of-threads="3" +(@value{GDBP}) +-thread-select 3 +^done,new-thread-id="3", +frame=@{level="0",func="vprintf", +args=[@{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""@}, +@{name="arg",value="0x2"@}],file="vprintf.c",line="31"@} +(@value{GDBP}) +@end smallexample + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Tracepoint Commands +@section @sc{gdb/mi} Tracepoint Commands + +The tracepoint commands are not yet implemented. + +@c @subheading -trace-actions + +@c @subheading -trace-delete + +@c @subheading -trace-disable + +@c @subheading -trace-dump + +@c @subheading -trace-enable + +@c @subheading -trace-exists + +@c @subheading -trace-find + +@c @subheading -trace-frame-number + +@c @subheading -trace-info + +@c @subheading -trace-insert + +@c @subheading -trace-list + +@c @subheading -trace-pass-count + +@c @subheading -trace-save + +@c @subheading -trace-start + +@c @subheading -trace-stop + + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Variable Objects +@section @sc{gdb/mi} Variable Objects + + +@subheading Motivation for Variable Objects in @sc{gdb/mi} + +For the implementation of a variable debugger window (locals, watched +expressions, etc.), we are proposing the adaptation of the existing code +used by @code{Insight}. + +The two main reasons for that are: + +@enumerate 1 +@item +It has been proven in practice (it is already on its second generation). + +@item +It will shorten development time (needless to say how important it is +now). +@end enumerate + +The original interface was designed to be used by Tcl code, so it was +slightly changed so it could be used through @sc{gdb/mi}. This section +describes the @sc{gdb/mi} operations that will be available and gives some +hints about their use. + +@emph{Note}: In addition to the set of operations described here, we +expect the @sc{gui} implementation of a variable window to require, at +least, the following operations: + +@itemize @bullet +@item @code{-gdb-show} @code{output-radix} +@item @code{-stack-list-arguments} +@item @code{-stack-list-locals} +@item @code{-stack-select-frame} +@end itemize + +@subheading Introduction to Variable Objects in @sc{gdb/mi} + +@cindex variable objects in @sc{gdb/mi} +The basic idea behind variable objects is the creation of a named object +to represent a variable, an expression, a memory location or even a CPU +register. For each object created, a set of operations is available for +examining or changing its properties. + +Furthermore, complex data types, such as C structures, are represented +in a tree format. For instance, the @code{struct} type variable is the +root and the children will represent the struct members. If a child +is itself of a complex type, it will also have children of its own. +Appropriate language differences are handled for C, C@t{++} and Java. + +When returning the actual values of the objects, this facility allows +for the individual selection of the display format used in the result +creation. It can be chosen among: binary, decimal, hexadecimal, octal +and natural. Natural refers to a default format automatically +chosen based on the variable type (like decimal for an @code{int}, hex +for pointers, etc.). + +The following is the complete set of @sc{gdb/mi} operations defined to +access this functionality: + +@multitable @columnfractions .4 .6 +@item @strong{Operation} +@tab @strong{Description} + +@item @code{-var-create} +@tab create a variable object +@item @code{-var-delete} +@tab delete the variable object and its children +@item @code{-var-set-format} +@tab set the display format of this variable +@item @code{-var-show-format} +@tab show the display format of this variable +@item @code{-var-info-num-children} +@tab tells how many children this object has +@item @code{-var-list-children} +@tab return a list of the object's children +@item @code{-var-info-type} +@tab show the type of this variable object +@item @code{-var-info-expression} +@tab print what this variable object represents +@item @code{-var-show-attributes} +@tab is this variable editable? does it exist here? +@item @code{-var-evaluate-expression} +@tab get the value of this variable +@item @code{-var-assign} +@tab set the value of this variable +@item @code{-var-update} +@tab update the variable and its children +@end multitable + +In the next subsection we describe each operation in detail and suggest +how it can be used. + +@subheading Description And Use of Operations on Variable Objects + +@subheading The @code{-var-create} Command +@findex -var-create + +@subsubheading Synopsis + +@smallexample + -var-create @{@var{name} | "-"@} + @{@var{frame-addr} | "*"@} @var{expression} +@end smallexample + +This operation creates a variable object, which allows the monitoring of +a variable, the result of an expression, a memory cell or a CPU +register. + +The @var{name} parameter is the string by which the object can be +referenced. It must be unique. If @samp{-} is specified, the varobj +system will generate a string ``varNNNNNN'' automatically. It will be +unique provided that one does not specify @var{name} on that format. +The command fails if a duplicate name is found. + +The frame under which the expression should be evaluated can be +specified by @var{frame-addr}. A @samp{*} indicates that the current +frame should be used. + +@var{expression} is any expression valid on the current language set (must not +begin with a @samp{*}), or one of the following: + +@itemize @bullet +@item +@samp{*@var{addr}}, where @var{addr} is the address of a memory cell + +@item +@samp{*@var{addr}-@var{addr}} --- a memory address range (TBD) + +@item +@samp{$@var{regname}} --- a CPU register name +@end itemize + +@subsubheading Result + +This operation returns the name, number of children and the type of the +object created. Type is returned as a string as the ones generated by +the @value{GDBN} CLI: + +@smallexample + name="@var{name}",numchild="N",type="@var{type}" +@end smallexample + + +@subheading The @code{-var-delete} Command +@findex -var-delete + +@subsubheading Synopsis + +@smallexample + -var-delete @var{name} +@end smallexample + +Deletes a previously created variable object and all of its children. + +Returns an error if the object @var{name} is not found. + + +@subheading The @code{-var-set-format} Command +@findex -var-set-format + +@subsubheading Synopsis + +@smallexample + -var-set-format @var{name} @var{format-spec} +@end smallexample + +Sets the output format for the value of the object @var{name} to be +@var{format-spec}. + +The syntax for the @var{format-spec} is as follows: + +@smallexample + @var{format-spec} @expansion{} + @{binary | decimal | hexadecimal | octal | natural@} +@end smallexample + + +@subheading The @code{-var-show-format} Command +@findex -var-show-format + +@subsubheading Synopsis + +@smallexample + -var-show-format @var{name} +@end smallexample + +Returns the format used to display the value of the object @var{name}. + +@smallexample + @var{format} @expansion{} + @var{format-spec} +@end smallexample + + +@subheading The @code{-var-info-num-children} Command +@findex -var-info-num-children + +@subsubheading Synopsis + +@smallexample + -var-info-num-children @var{name} +@end smallexample + +Returns the number of children of a variable object @var{name}: + +@smallexample + numchild=@var{n} +@end smallexample + + +@subheading The @code{-var-list-children} Command +@findex -var-list-children + +@subsubheading Synopsis + +@smallexample + -var-list-children @var{name} +@end smallexample + +Returns a list of the children of the specified variable object: + +@smallexample + numchild=@var{n},children=[@{name=@var{name}, + numchild=@var{n},type=@var{type}@},@r{(repeats N times)}] +@end smallexample + + +@subheading The @code{-var-info-type} Command +@findex -var-info-type + +@subsubheading Synopsis + +@smallexample + -var-info-type @var{name} +@end smallexample + +Returns the type of the specified variable @var{name}. The type is +returned as a string in the same format as it is output by the +@value{GDBN} CLI: + +@smallexample + type=@var{typename} +@end smallexample + + +@subheading The @code{-var-info-expression} Command +@findex -var-info-expression + +@subsubheading Synopsis + +@smallexample + -var-info-expression @var{name} +@end smallexample + +Returns what is represented by the variable object @var{name}: + +@smallexample + lang=@var{lang-spec},exp=@var{expression} +@end smallexample + +@noindent +where @var{lang-spec} is @code{@{"C" | "C++" | "Java"@}}. + +@subheading The @code{-var-show-attributes} Command +@findex -var-show-attributes + +@subsubheading Synopsis + +@smallexample + -var-show-attributes @var{name} +@end smallexample + +List attributes of the specified variable object @var{name}: + +@smallexample + status=@var{attr} [ ( ,@var{attr} )* ] +@end smallexample + +@noindent +where @var{attr} is @code{@{ @{ editable | noneditable @} | TBD @}}. + +@subheading The @code{-var-evaluate-expression} Command +@findex -var-evaluate-expression + +@subsubheading Synopsis + +@smallexample + -var-evaluate-expression @var{name} +@end smallexample + +Evaluates the expression that is represented by the specified variable +object and returns its value as a string in the current format specified +for the object: + +@smallexample + value=@var{value} +@end smallexample + +Note that one must invoke @code{-var-list-children} for a variable +before the value of a child variable can be evaluated. + +@subheading The @code{-var-assign} Command +@findex -var-assign + +@subsubheading Synopsis + +@smallexample + -var-assign @var{name} @var{expression} +@end smallexample + +Assigns the value of @var{expression} to the variable object specified +by @var{name}. The object must be @samp{editable}. If the variable's +value is altered by the assign, the variable will show up in any +subsequent @code{-var-update} list. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-var-assign var1 3 +^done,value="3" +(@value{GDBP}) +-var-update * +^done,changelist=[@{name="var1",in_scope="true",type_changed="false"@}] +(@value{GDBP}) +@end smallexample + +@subheading The @code{-var-update} Command +@findex -var-update + +@subsubheading Synopsis + +@smallexample + -var-update @{@var{name} | "*"@} +@end smallexample + +Update the value of the variable object @var{name} by evaluating its +expression after fetching all the new values from memory or registers. +A @samp{*} causes all existing variable objects to be updated. + + +@node Annotations +@chapter @value{GDBN} Annotations + +This chapter describes annotations in @value{GDBN}. Annotations are +designed to interface @value{GDBN} to graphical user interfaces or +other similar programs which want to interact with @value{GDBN} at a +relatively high level. + +@ignore +This is Edition @value{EDITION}, @value{DATE}. +@end ignore + +@menu +* Annotations Overview:: What annotations are; the general syntax. +* Server Prefix:: Issuing a command without affecting user state. +* Value Annotations:: Values are marked as such. +* Frame Annotations:: Stack frames are annotated. +* Displays:: @value{GDBN} can be told to display something periodically. +* Prompting:: Annotations marking @value{GDBN}'s need for input. +* Errors:: Annotations for error messages. +* Breakpoint Info:: Information on breakpoints. +* Invalidation:: Some annotations describe things now invalid. +* Annotations for Running:: + Whether the program is running, how it stopped, etc. +* Source Annotations:: Annotations describing source code. +* TODO:: Annotations which might be added in the future. +@end menu + +@node Annotations Overview +@section What is an Annotation? +@cindex annotations + +To produce annotations, start @value{GDBN} with the @code{--annotate=2} option. + +Annotations start with a newline character, two @samp{control-z} +characters, and the name of the annotation. If there is no additional +information associated with this annotation, the name of the annotation +is followed immediately by a newline. If there is additional +information, the name of the annotation is followed by a space, the +additional information, and a newline. The additional information +cannot contain newline characters. + +Any output not beginning with a newline and two @samp{control-z} +characters denotes literal output from @value{GDBN}. Currently there is +no need for @value{GDBN} to output a newline followed by two +@samp{control-z} characters, but if there was such a need, the +annotations could be extended with an @samp{escape} annotation which +means those three characters as output. + +A simple example of starting up @value{GDBN} with annotations is: + +@smallexample +$ gdb --annotate=2 +GNU GDB 5.0 +Copyright 2000 Free Software Foundation, Inc. +GDB is free software, covered by the GNU General Public License, +and you are welcome to change it and/or distribute copies of it +under certain conditions. +Type "show copying" to see the conditions. +There is absolutely no warranty for GDB. Type "show warranty" +for details. +This GDB was configured as "sparc-sun-sunos4.1.3" + +^Z^Zpre-prompt +(gdb) +^Z^Zprompt +quit + +^Z^Zpost-prompt +$ +@end smallexample + +Here @samp{quit} is input to @value{GDBN}; the rest is output from +@value{GDBN}. The three lines beginning @samp{^Z^Z} (where @samp{^Z} +denotes a @samp{control-z} character) are annotations; the rest is +output from @value{GDBN}. + +@node Server Prefix +@section The Server Prefix +@cindex server prefix for annotations + +To issue a command to @value{GDBN} without affecting certain aspects of +the state which is seen by users, prefix it with @samp{server }. This +means that this command will not affect the command history, nor will it +affect @value{GDBN}'s notion of which command to repeat if @key{RET} is +pressed on a line by itself. + +The server prefix does not affect the recording of values into the value +history; to print a value without recording it into the value history, +use the @code{output} command instead of the @code{print} command. + +@node Value Annotations +@section Values + +@cindex annotations for values +When a value is printed in various contexts, @value{GDBN} uses +annotations to delimit the value from the surrounding text. + +@findex value-history-begin +@findex value-history-value +@findex value-history-end +If a value is printed using @code{print} and added to the value history, +the annotation looks like + +@smallexample +^Z^Zvalue-history-begin @var{history-number} @var{value-flags} +@var{history-string} +^Z^Zvalue-history-value +@var{the-value} +^Z^Zvalue-history-end +@end smallexample + +@noindent +where @var{history-number} is the number it is getting in the value +history, @var{history-string} is a string, such as @samp{$5 = }, which +introduces the value to the user, @var{the-value} is the output +corresponding to the value itself, and @var{value-flags} is @samp{*} for +a value which can be dereferenced and @samp{-} for a value which cannot. + +@findex value-begin +@findex value-end +If the value is not added to the value history (it is an invalid float +or it is printed with the @code{output} command), the annotation is similar: + +@smallexample +^Z^Zvalue-begin @var{value-flags} +@var{the-value} +^Z^Zvalue-end +@end smallexample + +@findex arg-begin +@findex arg-name-end +@findex arg-value +@findex arg-end +When @value{GDBN} prints an argument to a function (for example, in the output +from the @code{backtrace} command), it annotates it as follows: + +@smallexample +^Z^Zarg-begin +@var{argument-name} +^Z^Zarg-name-end +@var{separator-string} +^Z^Zarg-value @var{value-flags} +@var{the-value} +^Z^Zarg-end +@end smallexample + +@noindent +where @var{argument-name} is the name of the argument, +@var{separator-string} is text which separates the name from the value +for the user's benefit (such as @samp{=}), and @var{value-flags} and +@var{the-value} have the same meanings as in a +@code{value-history-begin} annotation. + +@findex field-begin +@findex field-name-end +@findex field-value +@findex field-end +When printing a structure, @value{GDBN} annotates it as follows: + +@smallexample +^Z^Zfield-begin @var{value-flags} +@var{field-name} +^Z^Zfield-name-end +@var{separator-string} +^Z^Zfield-value +@var{the-value} +^Z^Zfield-end +@end smallexample + +@noindent +where @var{field-name} is the name of the field, @var{separator-string} +is text which separates the name from the value for the user's benefit +(such as @samp{=}), and @var{value-flags} and @var{the-value} have the +same meanings as in a @code{value-history-begin} annotation. + +When printing an array, @value{GDBN} annotates it as follows: + +@smallexample +^Z^Zarray-section-begin @var{array-index} @var{value-flags} +@end smallexample + +@noindent +where @var{array-index} is the index of the first element being +annotated and @var{value-flags} has the same meaning as in a +@code{value-history-begin} annotation. This is followed by any number +of elements, where is element can be either a single element: + +@findex elt +@smallexample +@samp{,} @var{whitespace} ; @r{omitted for the first element} +@var{the-value} +^Z^Zelt +@end smallexample + +or a repeated element + +@findex elt-rep +@findex elt-rep-end +@smallexample +@samp{,} @var{whitespace} ; @r{omitted for the first element} +@var{the-value} +^Z^Zelt-rep @var{number-of-repetitions} +@var{repetition-string} +^Z^Zelt-rep-end +@end smallexample + +In both cases, @var{the-value} is the output for the value of the +element and @var{whitespace} can contain spaces, tabs, and newlines. In +the repeated case, @var{number-of-repetitions} is the number of +consecutive array elements which contain that value, and +@var{repetition-string} is a string which is designed to convey to the +user that repetition is being depicted. + +@findex array-section-end +Once all the array elements have been output, the array annotation is +ended with + +@smallexample +^Z^Zarray-section-end +@end smallexample + +@node Frame Annotations +@section Frames + +@cindex annotations for frames +Whenever @value{GDBN} prints a frame, it annotates it. For example, this applies +to frames printed when @value{GDBN} stops, output from commands such as +@code{backtrace} or @code{up}, etc. + +@findex frame-begin +The frame annotation begins with + +@smallexample +^Z^Zframe-begin @var{level} @var{address} +@var{level-string} +@end smallexample + +@noindent +where @var{level} is the number of the frame (0 is the innermost frame, +and other frames have positive numbers), @var{address} is the address of +the code executing in that frame, and @var{level-string} is a string +designed to convey the level to the user. @var{address} is in the form +@samp{0x} followed by one or more lowercase hex digits (note that this +does not depend on the language). The frame ends with + +@findex frame-end +@smallexample +^Z^Zframe-end +@end smallexample + +Between these annotations is the main body of the frame, which can +consist of + +@itemize @bullet +@item +@findex function-call +@smallexample +^Z^Zfunction-call +@var{function-call-string} +@end smallexample + +where @var{function-call-string} is text designed to convey to the user +that this frame is associated with a function call made by @value{GDBN} to a +function in the program being debugged. + +@item +@findex signal-handler-caller +@smallexample +^Z^Zsignal-handler-caller +@var{signal-handler-caller-string} +@end smallexample + +where @var{signal-handler-caller-string} is text designed to convey to +the user that this frame is associated with whatever mechanism is used +by this operating system to call a signal handler (it is the frame which +calls the signal handler, not the frame for the signal handler itself). + +@item +A normal frame. + +@findex frame-address +@findex frame-address-end +This can optionally (depending on whether this is thought of as +interesting information for the user to see) begin with + +@smallexample +^Z^Zframe-address +@var{address} +^Z^Zframe-address-end +@var{separator-string} +@end smallexample + +where @var{address} is the address executing in the frame (the same +address as in the @code{frame-begin} annotation, but printed in a form +which is intended for user consumption---in particular, the syntax varies +depending on the language), and @var{separator-string} is a string +intended to separate this address from what follows for the user's +benefit. + +@findex frame-function-name +@findex frame-args +Then comes + +@smallexample +^Z^Zframe-function-name +@var{function-name} +^Z^Zframe-args +@var{arguments} +@end smallexample + +where @var{function-name} is the name of the function executing in the +frame, or @samp{??} if not known, and @var{arguments} are the arguments +to the frame, with parentheses around them (each argument is annotated +individually as well, @pxref{Value Annotations}). + +@findex frame-source-begin +@findex frame-source-file +@findex frame-source-file-end +@findex frame-source-line +@findex frame-source-end +If source information is available, a reference to it is then printed: + +@smallexample +^Z^Zframe-source-begin +@var{source-intro-string} +^Z^Zframe-source-file +@var{filename} +^Z^Zframe-source-file-end +: +^Z^Zframe-source-line +@var{line-number} +^Z^Zframe-source-end +@end smallexample + +where @var{source-intro-string} separates for the user's benefit the +reference from the text which precedes it, @var{filename} is the name of +the source file, and @var{line-number} is the line number within that +file (the first line is line 1). + +@findex frame-where +If @value{GDBN} prints some information about where the frame is from (which +library, which load segment, etc.; currently only done on the RS/6000), +it is annotated with + +@smallexample +^Z^Zframe-where +@var{information} +@end smallexample + +Then, if source is to actually be displayed for this frame (for example, +this is not true for output from the @code{backtrace} command), then a +@code{source} annotation (@pxref{Source Annotations}) is displayed. Unlike +most annotations, this is output instead of the normal text which would be +output, not in addition. +@end itemize + +@node Displays +@section Displays + +@findex display-begin +@findex display-number-end +@findex display-format +@findex display-expression +@findex display-expression-end +@findex display-value +@findex display-end +@cindex annotations for display +When @value{GDBN} is told to display something using the @code{display} command, +the results of the display are annotated: + +@smallexample +^Z^Zdisplay-begin +@var{number} +^Z^Zdisplay-number-end +@var{number-separator} +^Z^Zdisplay-format +@var{format} +^Z^Zdisplay-expression +@var{expression} +^Z^Zdisplay-expression-end +@var{expression-separator} +^Z^Zdisplay-value +@var{value} +^Z^Zdisplay-end +@end smallexample + +@noindent +where @var{number} is the number of the display, @var{number-separator} +is intended to separate the number from what follows for the user, +@var{format} includes information such as the size, format, or other +information about how the value is being displayed, @var{expression} is +the expression being displayed, @var{expression-separator} is intended +to separate the expression from the text that follows for the user, +and @var{value} is the actual value being displayed. + +@node Prompting +@section Annotation for @value{GDBN} Input + +@cindex annotations for prompts +When @value{GDBN} prompts for input, it annotates this fact so it is possible +to know when to send output, when the output from a given command is +over, etc. + +Different kinds of input each have a different @dfn{input type}. Each +input type has three annotations: a @code{pre-} annotation, which +denotes the beginning of any prompt which is being output, a plain +annotation, which denotes the end of the prompt, and then a @code{post-} +annotation which denotes the end of any echo which may (or may not) be +associated with the input. For example, the @code{prompt} input type +features the following annotations: + +@smallexample +^Z^Zpre-prompt +^Z^Zprompt +^Z^Zpost-prompt +@end smallexample + +The input types are + +@table @code +@findex pre-prompt +@findex prompt +@findex post-prompt +@item prompt +When @value{GDBN} is prompting for a command (the main @value{GDBN} prompt). + +@findex pre-commands +@findex commands +@findex post-commands +@item commands +When @value{GDBN} prompts for a set of commands, like in the @code{commands} +command. The annotations are repeated for each command which is input. + +@findex pre-overload-choice +@findex overload-choice +@findex post-overload-choice +@item overload-choice +When @value{GDBN} wants the user to select between various overloaded functions. + +@findex pre-query +@findex query +@findex post-query +@item query +When @value{GDBN} wants the user to confirm a potentially dangerous operation. + +@findex pre-prompt-for-continue +@findex prompt-for-continue +@findex post-prompt-for-continue +@item prompt-for-continue +When @value{GDBN} is asking the user to press return to continue. Note: Don't +expect this to work well; instead use @code{set height 0} to disable +prompting. This is because the counting of lines is buggy in the +presence of annotations. +@end table + +@node Errors +@section Errors +@cindex annotations for errors, warnings and interrupts + +@findex quit +@smallexample +^Z^Zquit +@end smallexample + +This annotation occurs right before @value{GDBN} responds to an interrupt. + +@findex error +@smallexample +^Z^Zerror +@end smallexample + +This annotation occurs right before @value{GDBN} responds to an error. + +Quit and error annotations indicate that any annotations which @value{GDBN} was +in the middle of may end abruptly. For example, if a +@code{value-history-begin} annotation is followed by a @code{error}, one +cannot expect to receive the matching @code{value-history-end}. One +cannot expect not to receive it either, however; an error annotation +does not necessarily mean that @value{GDBN} is immediately returning all the way +to the top level. + +@findex error-begin +A quit or error annotation may be preceded by + +@smallexample +^Z^Zerror-begin +@end smallexample + +Any output between that and the quit or error annotation is the error +message. + +Warning messages are not yet annotated. +@c If we want to change that, need to fix warning(), type_error(), +@c range_error(), and possibly other places. + +@node Breakpoint Info +@section Information on Breakpoints + +@cindex annotations for breakpoints +The output from the @code{info breakpoints} command is annotated as follows: + +@findex breakpoints-headers +@findex breakpoints-table +@smallexample +^Z^Zbreakpoints-headers +@var{header-entry} +^Z^Zbreakpoints-table +@end smallexample + +@noindent +where @var{header-entry} has the same syntax as an entry (see below) but +instead of containing data, it contains strings which are intended to +convey the meaning of each field to the user. This is followed by any +number of entries. If a field does not apply for this entry, it is +omitted. Fields may contain trailing whitespace. Each entry consists +of: + +@findex record +@findex field +@smallexample +^Z^Zrecord +^Z^Zfield 0 +@var{number} +^Z^Zfield 1 +@var{type} +^Z^Zfield 2 +@var{disposition} +^Z^Zfield 3 +@var{enable} +^Z^Zfield 4 +@var{address} +^Z^Zfield 5 +@var{what} +^Z^Zfield 6 +@var{frame} +^Z^Zfield 7 +@var{condition} +^Z^Zfield 8 +@var{ignore-count} +^Z^Zfield 9 +@var{commands} +@end smallexample + +Note that @var{address} is intended for user consumption---the syntax +varies depending on the language. + +The output ends with + +@findex breakpoints-table-end +@smallexample +^Z^Zbreakpoints-table-end +@end smallexample + +@node Invalidation +@section Invalidation Notices + +@cindex annotations for invalidation messages +The following annotations say that certain pieces of state may have +changed. + +@table @code +@findex frames-invalid +@item ^Z^Zframes-invalid + +The frames (for example, output from the @code{backtrace} command) may +have changed. + +@findex breakpoints-invalid +@item ^Z^Zbreakpoints-invalid + +The breakpoints may have changed. For example, the user just added or +deleted a breakpoint. +@end table + +@node Annotations for Running +@section Running the Program +@cindex annotations for running programs + +@findex starting +@findex stopping +When the program starts executing due to a @value{GDBN} command such as +@code{step} or @code{continue}, + +@smallexample +^Z^Zstarting +@end smallexample + +is output. When the program stops, + +@smallexample +^Z^Zstopped +@end smallexample + +is output. Before the @code{stopped} annotation, a variety of +annotations describe how the program stopped. + +@table @code +@findex exited +@item ^Z^Zexited @var{exit-status} +The program exited, and @var{exit-status} is the exit status (zero for +successful exit, otherwise nonzero). + +@findex signalled +@findex signal-name +@findex signal-name-end +@findex signal-string +@findex signal-string-end +@item ^Z^Zsignalled +The program exited with a signal. After the @code{^Z^Zsignalled}, the +annotation continues: + +@smallexample +@var{intro-text} +^Z^Zsignal-name +@var{name} +^Z^Zsignal-name-end +@var{middle-text} +^Z^Zsignal-string +@var{string} +^Z^Zsignal-string-end +@var{end-text} +@end smallexample + +@noindent +where @var{name} is the name of the signal, such as @code{SIGILL} or +@code{SIGSEGV}, and @var{string} is the explanation of the signal, such +as @code{Illegal Instruction} or @code{Segmentation fault}. +@var{intro-text}, @var{middle-text}, and @var{end-text} are for the +user's benefit and have no particular format. + +@findex signal +@item ^Z^Zsignal +The syntax of this annotation is just like @code{signalled}, but @value{GDBN} is +just saying that the program received the signal, not that it was +terminated with it. + +@findex breakpoint +@item ^Z^Zbreakpoint @var{number} +The program hit breakpoint number @var{number}. + +@findex watchpoint +@item ^Z^Zwatchpoint @var{number} +The program hit watchpoint number @var{number}. +@end table + +@node Source Annotations +@section Displaying Source +@cindex annotations for source display + +@findex source +The following annotation is used instead of displaying source code: + +@smallexample +^Z^Zsource @var{filename}:@var{line}:@var{character}:@var{middle}:@var{addr} +@end smallexample + +where @var{filename} is an absolute file name indicating which source +file, @var{line} is the line number within that file (where 1 is the +first line in the file), @var{character} is the character position +within the file (where 0 is the first character in the file) (for most +debug formats this will necessarily point to the beginning of a line), +@var{middle} is @samp{middle} if @var{addr} is in the middle of the +line, or @samp{beg} if @var{addr} is at the beginning of the line, and +@var{addr} is the address in the target program associated with the +source which is being displayed. @var{addr} is in the form @samp{0x} +followed by one or more lowercase hex digits (note that this does not +depend on the language). + +@node TODO +@section Annotations We Might Want in the Future + +@format + - target-invalid + the target might have changed (registers, heap contents, or + execution status). For performance, we might eventually want + to hit `registers-invalid' and `all-registers-invalid' with + greater precision + + - systematic annotation for set/show parameters (including + invalidation notices). + + - similarly, `info' returns a list of candidates for invalidation + notices. +@end format @node GDB Bugs @chapter Reporting Bugs in @value{GDBN} diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 0522d72..0530f81 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -3115,7 +3115,7 @@ See the file @file{inferior.h}. @item DEPRECATED_CALL_DUMMY_STACK_ADJUST @findex DEPRECATED_CALL_DUMMY_STACK_ADJUST Stack adjustment needed when performing an inferior function call. This -function is no longer needed. @xref{PUSH_ARGUMENTS}, which can handle +function is no longer needed. @xref{push_dummy_call}, which can handle all alignment directly. @item CANNOT_FETCH_REGISTER (@var{regno}) @@ -3703,14 +3703,21 @@ definition is only used in generic code when parsing "$ps".) If defined, used by @code{frame_pop} to remove a stack frame. This method has been superseeded by generic code. -@item PUSH_ARGUMENTS (@var{nargs}, @var{args}, @var{sp}, @var{struct_return}, @var{struct_addr}) -@findex PUSH_ARGUMENTS -@anchor{PUSH_ARGUMENTS} -Define this to push arguments onto the stack for inferior function -call. Returns the updated stack pointer value. +@item push_dummy_call (@var{gdbarch}, @var{regcache}, @var{dummy_addr}, @var{nargs}, @var{args}, @var{sp}, @var{struct_return}, @var{struct_addr}) +@findex push_dummy_call +@findex DEPRECATED_PUSH_ARGUMENTS. +@anchor{push_dummy_call} +Define this to push the dummy frame's call to the inferior function onto +the stack. In addition to pushing @var{nargs}, the code should push +@var{struct_addr} (when @var{struct_return}), and the return value (in +the call dummy at @var{dummy_addr}). -@item PUSH_DUMMY_FRAME -@findex PUSH_DUMMY_FRAME +Returns the updated top-of-stack pointer. + +This method replaces @code{DEPRECATED_PUSH_ARGUMENTS}. + +@item DEPRECATED_PUSH_DUMMY_FRAME +@findex DEPRECATED_PUSH_DUMMY_FRAME Used in @samp{call_function_by_hand} to create an artificial stack frame. @item REGISTER_BYTES @@ -3770,10 +3777,8 @@ that is at the start of the real function. @item SP_REGNUM @findex SP_REGNUM If the stack-pointer is kept in a register, then define this macro to be -the number (greater than or equal to zero) of that register. - -This should only need to be defined if @code{TARGET_WRITE_SP} and -@code{TARGET_WRITE_SP} are not defined. +the number (greater than or equal to zero) of that register, or -1 if +there is no such register. @item STAB_REG_TO_REGNUM @findex STAB_REG_TO_REGNUM @@ -3880,19 +3885,16 @@ Number of bits in a short integer; defaults to @code{2 * TARGET_CHAR_BIT}. @findex TARGET_WRITE_PC @itemx TARGET_READ_SP @findex TARGET_READ_SP -@itemx TARGET_WRITE_SP -@findex TARGET_WRITE_SP @itemx TARGET_READ_FP @findex TARGET_READ_FP @findex read_pc @findex write_pc @findex read_sp -@findex write_sp @findex read_fp These change the behavior of @code{read_pc}, @code{write_pc}, -@code{read_sp}, @code{write_sp} and @code{read_fp}. For most targets, -these may be left undefined. @value{GDBN} will call the read and write -register functions with the relevant @code{_REGNUM} argument. +@code{read_sp} and @code{read_fp}. For most targets, these may be left +undefined. @value{GDBN} will call the read and write register functions +with the relevant @code{_REGNUM} argument. These macros are useful when a target keeps one of these registers in a hard to get at place; for example, part in a segment register and part diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index cb8dc55..2711b52 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -42,7 +42,6 @@ static gdbarch_use_struct_convention_ftype frv_use_struct_convention; static gdbarch_frameless_function_invocation_ftype frv_frameless_function_invocation; static gdbarch_init_extra_frame_info_ftype stupid_useless_init_extra_frame_info; static gdbarch_push_arguments_ftype frv_push_arguments; -static gdbarch_push_return_address_ftype frv_push_return_address; static gdbarch_saved_pc_after_call_ftype frv_saved_pc_after_call; static void frv_pop_frame_regular (struct frame_info *frame); @@ -1090,8 +1089,8 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Settings for calling functions in the inferior. */ set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_push_arguments (gdbarch, frv_push_arguments); - set_gdbarch_push_return_address (gdbarch, frv_push_return_address); + set_gdbarch_deprecated_push_arguments (gdbarch, frv_push_arguments); + set_gdbarch_deprecated_push_return_address (gdbarch, frv_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, frv_pop_frame); set_gdbarch_call_dummy_p (gdbarch, 1); @@ -1107,7 +1106,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_pc (gdbarch, generic_target_write_pc); set_gdbarch_read_fp (gdbarch, generic_target_read_fp); set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index c45a70f..4d94614 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -148,7 +148,7 @@ struct gdbarch gdbarch_write_pc_ftype *write_pc; gdbarch_read_fp_ftype *read_fp; gdbarch_read_sp_ftype *read_sp; - gdbarch_write_sp_ftype *write_sp; + gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp; gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer; gdbarch_pseudo_register_read_ftype *pseudo_register_read; gdbarch_pseudo_register_write_ftype *pseudo_register_write; @@ -212,9 +212,10 @@ struct gdbarch gdbarch_address_to_pointer_ftype *address_to_pointer; gdbarch_integer_to_address_ftype *integer_to_address; gdbarch_return_value_on_stack_ftype *return_value_on_stack; - gdbarch_push_arguments_ftype *push_arguments; + gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments; + gdbarch_push_dummy_call_ftype *push_dummy_call; gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame; - gdbarch_push_return_address_ftype *push_return_address; + gdbarch_deprecated_push_return_address_ftype *deprecated_push_return_address; gdbarch_deprecated_pop_frame_ftype *deprecated_pop_frame; gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return; gdbarch_extract_return_value_ftype *extract_return_value; @@ -433,6 +434,7 @@ struct gdbarch startup_gdbarch = 0, 0, 0, + 0, generic_in_function_epilogue_p, construct_inferior_arguments, 0, @@ -502,7 +504,6 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->write_pc = generic_target_write_pc; current_gdbarch->read_fp = generic_target_read_fp; current_gdbarch->read_sp = generic_target_read_sp; - current_gdbarch->write_sp = generic_target_write_sp; current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer; current_gdbarch->num_regs = -1; current_gdbarch->sp_regnum = -1; @@ -543,7 +544,6 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->pointer_to_address = unsigned_pointer_to_address; current_gdbarch->address_to_pointer = unsigned_address_to_pointer; current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not; - current_gdbarch->push_arguments = default_push_arguments; current_gdbarch->extract_return_value = legacy_extract_return_value; current_gdbarch->store_return_value = legacy_store_return_value; current_gdbarch->use_struct_convention = generic_use_struct_convention; @@ -631,7 +631,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of write_pc, invalid_p == 0 */ /* Skip verify of read_fp, invalid_p == 0 */ /* Skip verify of read_sp, invalid_p == 0 */ - /* Skip verify of write_sp, invalid_p == 0 */ + /* Skip verify of deprecated_dummy_write_sp, has predicate */ /* Skip verify of virtual_frame_pointer, invalid_p == 0 */ /* Skip verify of pseudo_register_read, has predicate */ /* Skip verify of pseudo_register_write, has predicate */ @@ -713,9 +713,10 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of address_to_pointer, invalid_p == 0 */ /* Skip verify of integer_to_address, has predicate */ /* Skip verify of return_value_on_stack, invalid_p == 0 */ - /* Skip verify of push_arguments, invalid_p == 0 */ + /* Skip verify of deprecated_push_arguments, has predicate */ + /* Skip verify of push_dummy_call, has predicate */ /* Skip verify of deprecated_push_dummy_frame, has predicate */ - /* Skip verify of push_return_address, has predicate */ + /* Skip verify of deprecated_push_return_address, has predicate */ /* Skip verify of deprecated_pop_frame, has predicate */ /* Skip verify of deprecated_store_struct_return, has predicate */ /* Skip verify of extract_return_value, invalid_p == 0 */ @@ -1125,6 +1126,29 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->deprecated_do_registers_info /*DEPRECATED_DO_REGISTERS_INFO ()*/); #endif +#ifdef DEPRECATED_DUMMY_WRITE_SP_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_DUMMY_WRITE_SP_P()", + XSTRING (DEPRECATED_DUMMY_WRITE_SP_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_DUMMY_WRITE_SP_P() = %d\n", + DEPRECATED_DUMMY_WRITE_SP_P ()); +#endif +#ifdef DEPRECATED_DUMMY_WRITE_SP +#if GDB_MULTI_ARCH + /* Macro might contain `[{}]' when not multi-arch */ + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_DUMMY_WRITE_SP(val)", + XSTRING (DEPRECATED_DUMMY_WRITE_SP (val))); +#endif + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_DUMMY_WRITE_SP = <0x%08lx>\n", + (long) current_gdbarch->deprecated_dummy_write_sp + /*DEPRECATED_DUMMY_WRITE_SP ()*/); +#endif #ifdef DEPRECATED_EXTRACT_RETURN_VALUE #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -1413,6 +1437,26 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->deprecated_pop_frame /*DEPRECATED_POP_FRAME ()*/); #endif +#ifdef DEPRECATED_PUSH_ARGUMENTS_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_PUSH_ARGUMENTS_P()", + XSTRING (DEPRECATED_PUSH_ARGUMENTS_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_PUSH_ARGUMENTS_P() = %d\n", + DEPRECATED_PUSH_ARGUMENTS_P ()); +#endif +#ifdef DEPRECATED_PUSH_ARGUMENTS + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)", + XSTRING (DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_PUSH_ARGUMENTS = <0x%08lx>\n", + (long) current_gdbarch->deprecated_push_arguments + /*DEPRECATED_PUSH_ARGUMENTS ()*/); +#endif #ifdef DEPRECATED_PUSH_DUMMY_FRAME_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1436,6 +1480,26 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->deprecated_push_dummy_frame /*DEPRECATED_PUSH_DUMMY_FRAME ()*/); #endif +#ifdef DEPRECATED_PUSH_RETURN_ADDRESS_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_PUSH_RETURN_ADDRESS_P()", + XSTRING (DEPRECATED_PUSH_RETURN_ADDRESS_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_PUSH_RETURN_ADDRESS_P() = %d\n", + DEPRECATED_PUSH_RETURN_ADDRESS_P ()); +#endif +#ifdef DEPRECATED_PUSH_RETURN_ADDRESS + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp)", + XSTRING (DEPRECATED_PUSH_RETURN_ADDRESS (pc, sp))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_PUSH_RETURN_ADDRESS = <0x%08lx>\n", + (long) current_gdbarch->deprecated_push_return_address + /*DEPRECATED_PUSH_RETURN_ADDRESS ()*/); +#endif #ifdef DEPRECATED_STORE_RETURN_VALUE #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -1898,37 +1962,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: PS_REGNUM = %d\n", PS_REGNUM); #endif -#ifdef PUSH_ARGUMENTS - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)", - XSTRING (PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: PUSH_ARGUMENTS = <0x%08lx>\n", - (long) current_gdbarch->push_arguments - /*PUSH_ARGUMENTS ()*/); -#endif -#ifdef PUSH_RETURN_ADDRESS_P - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "PUSH_RETURN_ADDRESS_P()", - XSTRING (PUSH_RETURN_ADDRESS_P ())); - fprintf_unfiltered (file, - "gdbarch_dump: PUSH_RETURN_ADDRESS_P() = %d\n", - PUSH_RETURN_ADDRESS_P ()); -#endif -#ifdef PUSH_RETURN_ADDRESS - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "PUSH_RETURN_ADDRESS(pc, sp)", - XSTRING (PUSH_RETURN_ADDRESS (pc, sp))); + "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n", + gdbarch_push_dummy_call_p (current_gdbarch)); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: PUSH_RETURN_ADDRESS = <0x%08lx>\n", - (long) current_gdbarch->push_return_address - /*PUSH_RETURN_ADDRESS ()*/); -#endif + "gdbarch_dump: push_dummy_call = 0x%08lx\n", + (long) current_gdbarch->push_dummy_call); #ifdef REGISTER_BYTE fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2236,8 +2277,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS # %s\n", XSTRING (SIZEOF_CALL_DUMMY_WORDS)); fprintf_unfiltered (file, - "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = 0x%08lx\n", - (long) SIZEOF_CALL_DUMMY_WORDS); + "gdbarch_dump: SIZEOF_CALL_DUMMY_WORDS = %d\n", + SIZEOF_CALL_DUMMY_WORDS); #endif #ifdef SKIP_PROLOGUE fprintf_unfiltered (file, @@ -2557,20 +2598,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->write_pc /*TARGET_WRITE_PC ()*/); #endif -#ifdef TARGET_WRITE_SP -#if GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "TARGET_WRITE_SP(val)", - XSTRING (TARGET_WRITE_SP (val))); -#endif - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: TARGET_WRITE_SP = <0x%08lx>\n", - (long) current_gdbarch->write_sp - /*TARGET_WRITE_SP ()*/); -#endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n", @@ -2919,23 +2946,30 @@ set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch->read_sp = read_sp; } +int +gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_dummy_write_sp != 0; +} + void -gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val) +gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, CORE_ADDR val) { gdb_assert (gdbarch != NULL); - if (gdbarch->write_sp == 0) + if (gdbarch->deprecated_dummy_write_sp == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_write_sp invalid"); + "gdbarch: gdbarch_deprecated_dummy_write_sp invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n"); - gdbarch->write_sp (val); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_dummy_write_sp called\n"); + gdbarch->deprecated_dummy_write_sp (val); } void -set_gdbarch_write_sp (struct gdbarch *gdbarch, - gdbarch_write_sp_ftype write_sp) +set_gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, + gdbarch_deprecated_dummy_write_sp_ftype deprecated_dummy_write_sp) { - gdbarch->write_sp = write_sp; + gdbarch->deprecated_dummy_write_sp = deprecated_dummy_write_sp; } void @@ -4218,23 +4252,56 @@ set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch->return_value_on_stack = return_value_on_stack; } +int +gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_push_arguments != 0; +} + +CORE_ADDR +gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->deprecated_push_arguments == 0) + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_deprecated_push_arguments invalid"); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_arguments called\n"); + return gdbarch->deprecated_push_arguments (nargs, args, sp, struct_return, struct_addr); +} + +void +set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, + gdbarch_deprecated_push_arguments_ftype deprecated_push_arguments) +{ + gdbarch->deprecated_push_arguments = deprecated_push_arguments; +} + +int +gdbarch_push_dummy_call_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->push_dummy_call != 0; +} + CORE_ADDR -gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) +gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { gdb_assert (gdbarch != NULL); - if (gdbarch->push_arguments == 0) + if (gdbarch->push_dummy_call == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_push_arguments invalid"); + "gdbarch: gdbarch_push_dummy_call invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n"); - return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr); + fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n"); + return gdbarch->push_dummy_call (gdbarch, regcache, dummy_addr, nargs, args, sp, struct_return, struct_addr); } void -set_gdbarch_push_arguments (struct gdbarch *gdbarch, - gdbarch_push_arguments_ftype push_arguments) +set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, + gdbarch_push_dummy_call_ftype push_dummy_call) { - gdbarch->push_arguments = push_arguments; + gdbarch->push_dummy_call = push_dummy_call; } int @@ -4264,29 +4331,29 @@ set_gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch, } int -gdbarch_push_return_address_p (struct gdbarch *gdbarch) +gdbarch_deprecated_push_return_address_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->push_return_address != 0; + return gdbarch->deprecated_push_return_address != 0; } CORE_ADDR -gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp) +gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp) { gdb_assert (gdbarch != NULL); - if (gdbarch->push_return_address == 0) + if (gdbarch->deprecated_push_return_address == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_push_return_address invalid"); + "gdbarch: gdbarch_deprecated_push_return_address invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n"); - return gdbarch->push_return_address (pc, sp); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_return_address called\n"); + return gdbarch->deprecated_push_return_address (pc, sp); } void -set_gdbarch_push_return_address (struct gdbarch *gdbarch, - gdbarch_push_return_address_ftype push_return_address) +set_gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, + gdbarch_deprecated_push_return_address_ftype deprecated_push_return_address) { - gdbarch->push_return_address = push_return_address; + gdbarch->deprecated_push_return_address = deprecated_push_return_address; } int diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index dd66773..de8cb2d 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -388,20 +388,42 @@ extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype #endif #endif +/* The dummy call frame SP should be set by push_dummy_call. */ + +#if defined (DEPRECATED_DUMMY_WRITE_SP) +/* Legacy for systems yet to multi-arch DEPRECATED_DUMMY_WRITE_SP */ +#if !defined (DEPRECATED_DUMMY_WRITE_SP_P) +#define DEPRECATED_DUMMY_WRITE_SP_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DUMMY_WRITE_SP_P) +#define DEPRECATED_DUMMY_WRITE_SP_P() (0) +#endif + +extern int gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP_P) +#error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DUMMY_WRITE_SP_P) +#define DEPRECATED_DUMMY_WRITE_SP_P() (gdbarch_deprecated_dummy_write_sp_p (current_gdbarch)) +#endif + /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_SP) -#define TARGET_WRITE_SP(val) (generic_target_write_sp (val)) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DUMMY_WRITE_SP) +#define DEPRECATED_DUMMY_WRITE_SP(val) (internal_error (__FILE__, __LINE__, "DEPRECATED_DUMMY_WRITE_SP"), 0) #endif -typedef void (gdbarch_write_sp_ftype) (CORE_ADDR val); -extern void gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val); -extern void set_gdbarch_write_sp (struct gdbarch *gdbarch, gdbarch_write_sp_ftype *write_sp); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_SP) -#error "Non multi-arch definition of TARGET_WRITE_SP" +typedef void (gdbarch_deprecated_dummy_write_sp_ftype) (CORE_ADDR val); +extern void gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, CORE_ADDR val); +extern void set_gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP) +#error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_SP) -#define TARGET_WRITE_SP(val) (gdbarch_write_sp (current_gdbarch, val)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DUMMY_WRITE_SP) +#define DEPRECATED_DUMMY_WRITE_SP(val) (gdbarch_deprecated_dummy_write_sp (current_gdbarch, val)) #endif #endif @@ -1238,11 +1260,9 @@ extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * cal #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_WORDS) #error "Non multi-arch definition of CALL_DUMMY_WORDS" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_WORDS) +#if !defined (CALL_DUMMY_WORDS) #define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch)) #endif -#endif /* Default (value) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (SIZEOF_CALL_DUMMY_WORDS) @@ -1254,11 +1274,9 @@ extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int si #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIZEOF_CALL_DUMMY_WORDS) #error "Non multi-arch definition of SIZEOF_CALL_DUMMY_WORDS" #endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SIZEOF_CALL_DUMMY_WORDS) +#if !defined (SIZEOF_CALL_DUMMY_WORDS) #define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch)) #endif -#endif #if defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST) /* Legacy for systems yet to multi-arch DEPRECATED_CALL_DUMMY_STACK_ADJUST */ @@ -1629,23 +1647,51 @@ extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_ #endif #endif +/* Replaced by PUSH_DUMMY_CALL */ + +#if defined (DEPRECATED_PUSH_ARGUMENTS) +/* Legacy for systems yet to multi-arch DEPRECATED_PUSH_ARGUMENTS */ +#if !defined (DEPRECATED_PUSH_ARGUMENTS_P) +#define DEPRECATED_PUSH_ARGUMENTS_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_ARGUMENTS_P) +#define DEPRECATED_PUSH_ARGUMENTS_P() (0) +#endif + +extern int gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_ARGUMENTS_P) +#error "Non multi-arch definition of DEPRECATED_PUSH_ARGUMENTS" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_ARGUMENTS_P) +#define DEPRECATED_PUSH_ARGUMENTS_P() (gdbarch_deprecated_push_arguments_p (current_gdbarch)) +#endif + /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (PUSH_ARGUMENTS) -#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (default_push_arguments (nargs, args, sp, struct_return, struct_addr)) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_ARGUMENTS) +#define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_ARGUMENTS"), 0) #endif -typedef CORE_ADDR (gdbarch_push_arguments_ftype) (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); -extern CORE_ADDR gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); -extern void set_gdbarch_push_arguments (struct gdbarch *gdbarch, gdbarch_push_arguments_ftype *push_arguments); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_ARGUMENTS) -#error "Non multi-arch definition of PUSH_ARGUMENTS" +typedef CORE_ADDR (gdbarch_deprecated_push_arguments_ftype) (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); +extern CORE_ADDR gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); +extern void set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_ARGUMENTS) +#error "Non multi-arch definition of DEPRECATED_PUSH_ARGUMENTS" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_ARGUMENTS) -#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_ARGUMENTS) +#define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_deprecated_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr)) #endif #endif +extern int gdbarch_push_dummy_call_p (struct gdbarch *gdbarch); + +typedef CORE_ADDR (gdbarch_push_dummy_call_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); +extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); +extern void set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call); + #if defined (DEPRECATED_PUSH_DUMMY_FRAME) /* Legacy for systems yet to multi-arch DEPRECATED_PUSH_DUMMY_FRAME */ #if !defined (DEPRECATED_PUSH_DUMMY_FRAME_P) @@ -1683,40 +1729,42 @@ extern void set_gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch, gd #endif #endif -#if defined (PUSH_RETURN_ADDRESS) -/* Legacy for systems yet to multi-arch PUSH_RETURN_ADDRESS */ -#if !defined (PUSH_RETURN_ADDRESS_P) -#define PUSH_RETURN_ADDRESS_P() (1) +/* NOTE: This can be handled directly in push_dummy_call. */ + +#if defined (DEPRECATED_PUSH_RETURN_ADDRESS) +/* Legacy for systems yet to multi-arch DEPRECATED_PUSH_RETURN_ADDRESS */ +#if !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) +#define DEPRECATED_PUSH_RETURN_ADDRESS_P() (1) #endif #endif /* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (PUSH_RETURN_ADDRESS_P) -#define PUSH_RETURN_ADDRESS_P() (0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) +#define DEPRECATED_PUSH_RETURN_ADDRESS_P() (0) #endif -extern int gdbarch_push_return_address_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_RETURN_ADDRESS_P) -#error "Non multi-arch definition of PUSH_RETURN_ADDRESS" +extern int gdbarch_deprecated_push_return_address_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) +#error "Non multi-arch definition of DEPRECATED_PUSH_RETURN_ADDRESS" #endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_RETURN_ADDRESS_P) -#define PUSH_RETURN_ADDRESS_P() (gdbarch_push_return_address_p (current_gdbarch)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P) +#define DEPRECATED_PUSH_RETURN_ADDRESS_P() (gdbarch_deprecated_push_return_address_p (current_gdbarch)) #endif /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (PUSH_RETURN_ADDRESS) -#define PUSH_RETURN_ADDRESS(pc, sp) (internal_error (__FILE__, __LINE__, "PUSH_RETURN_ADDRESS"), 0) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_RETURN_ADDRESS) +#define DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp) (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_RETURN_ADDRESS"), 0) #endif -typedef CORE_ADDR (gdbarch_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp); -extern CORE_ADDR gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp); -extern void set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch_push_return_address_ftype *push_return_address); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_RETURN_ADDRESS) -#error "Non multi-arch definition of PUSH_RETURN_ADDRESS" +typedef CORE_ADDR (gdbarch_deprecated_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp); +extern CORE_ADDR gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp); +extern void set_gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, gdbarch_deprecated_push_return_address_ftype *deprecated_push_return_address); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_RETURN_ADDRESS) +#error "Non multi-arch definition of DEPRECATED_PUSH_RETURN_ADDRESS" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_RETURN_ADDRESS) -#define PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_push_return_address (current_gdbarch, pc, sp)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_RETURN_ADDRESS) +#define DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_deprecated_push_return_address (current_gdbarch, pc, sp)) #endif #endif diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index a1122e1..91f2293 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -430,7 +430,8 @@ f:2:TARGET_READ_PC:CORE_ADDR:read_pc:ptid_t ptid:ptid::0:generic_target_read_pc: f:2:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, ptid_t ptid:val, ptid::0:generic_target_write_pc::0 f:2:TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:generic_target_read_fp::0 f:2:TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:generic_target_read_sp::0 -f:2:TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:generic_target_write_sp::0 +# The dummy call frame SP should be set by push_dummy_call. +F:2:DEPRECATED_DUMMY_WRITE_SP:void:deprecated_dummy_write_sp:CORE_ADDR val:val # Function for getting target's idea of a frame pointer. FIXME: GDB's # whole scheme for dealing with "frames" and "frame pointers" needs a # serious shakedown. @@ -531,8 +532,8 @@ v:2:CALL_DUMMY_LENGTH:int:call_dummy_length::::0:-1:::::gdbarch->call_dummy_leng # doesn't need to be modified. F:1:DEPRECATED_PC_IN_CALL_DUMMY:int:deprecated_pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::generic_pc_in_call_dummy:generic_pc_in_call_dummy v:1:CALL_DUMMY_P:int:call_dummy_p::::0:-1 -v:2:CALL_DUMMY_WORDS:LONGEST *:call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx -v:2:SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0:0x%08lx +v::CALL_DUMMY_WORDS:LONGEST *:call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx +v::SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0 V:2:DEPRECATED_CALL_DUMMY_STACK_ADJUST:int:deprecated_call_dummy_stack_adjust::::0 f:2:FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p:::0 F:2:DEPRECATED_INIT_FRAME_PC_FIRST:CORE_ADDR:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev @@ -555,9 +556,12 @@ f:2:ADDRESS_TO_POINTER:void:address_to_pointer:struct type *type, void *buf, COR F:2:INTEGER_TO_ADDRESS:CORE_ADDR:integer_to_address:struct type *type, void *buf:type, buf # f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::generic_return_value_on_stack_not::0 -f:2:PUSH_ARGUMENTS:CORE_ADDR:push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr:::default_push_arguments::0 +# Replaced by PUSH_DUMMY_CALL +F:2:DEPRECATED_PUSH_ARGUMENTS:CORE_ADDR:deprecated_push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr +M::PUSH_DUMMY_CALL:CORE_ADDR:push_dummy_call:struct regcache *regcache, CORE_ADDR dummy_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:regcache, dummy_addr, nargs, args, sp, struct_return, struct_addr F:2:DEPRECATED_PUSH_DUMMY_FRAME:void:deprecated_push_dummy_frame:void:-:::0 -F:2:PUSH_RETURN_ADDRESS:CORE_ADDR:push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp:::0 +# NOTE: This can be handled directly in push_dummy_call. +F:2:DEPRECATED_PUSH_RETURN_ADDRESS:CORE_ADDR:deprecated_push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp:::0 F:2:DEPRECATED_POP_FRAME:void:deprecated_pop_frame:void:-:::0 # NOTE: cagney/2003-03-24: Replaced by PUSH_ARGUMENTS. F:2:DEPRECATED_STORE_STRUCT_RETURN:void:deprecated_store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0 diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index e78bc0f..e08cff7 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -1148,9 +1148,9 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) * Call Dummies * * These values and methods are used when gdb calls a target function. */ - set_gdbarch_push_return_address (gdbarch, h8300_push_return_address); + set_gdbarch_deprecated_push_return_address (gdbarch, h8300_push_return_address); set_gdbarch_deprecated_extract_return_value (gdbarch, h8300_extract_return_value); - set_gdbarch_push_arguments (gdbarch, h8300_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, h8300_push_arguments); set_gdbarch_deprecated_pop_frame (gdbarch, h8300_pop_frame); set_gdbarch_deprecated_store_struct_return (gdbarch, h8300_store_struct_return); set_gdbarch_deprecated_store_return_value (gdbarch, h8300_store_return_value); @@ -1175,6 +1175,9 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* set_gdbarch_stack_align (gdbarch, SOME_stack_align); */ set_gdbarch_believe_pcc_promotion (gdbarch, 1); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + return gdbarch; } diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c index 66b7b61..3d1ca88 100644 --- a/gdb/hppa-hpux-tdep.c +++ b/gdb/hppa-hpux-tdep.c @@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "arch-utils.h" #include "gdbcore.h" #include "osabi.h" +#include "gdb_string.h" /* Forward declarations. */ extern void _initialize_hppa_hpux_tdep (void); diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 2f5412e..b9d3d55 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -33,7 +33,7 @@ #include "language.h" #include "osabi.h" #include "gdb_assert.h" - +#include "infttrace.h" /* For argument passing to the inferior */ #include "symtab.h" @@ -886,7 +886,7 @@ hppa_frame_saved_pc (struct frame_info *frame) { CORE_ADDR pc = get_frame_pc (frame); struct unwind_table_entry *u; - CORE_ADDR old_pc; + CORE_ADDR old_pc = 0; int spun_around_loop = 0; int rp_offset = 0; @@ -5005,7 +5005,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_length (gdbarch, INSTRUCTION_SIZE * 28); set_gdbarch_call_dummy_start_offset (gdbarch, 0); /* set_gdbarch_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */ - set_gdbarch_push_arguments (gdbarch, hppa_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, hppa_push_arguments); set_gdbarch_smash_text_address (gdbarch, hppa_smash_text_address); set_gdbarch_believe_pcc_promotion (gdbarch, 1); set_gdbarch_read_pc (gdbarch, hppa_target_read_pc); diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c index 51b74fc..b953d25 100644 --- a/gdb/hppah-nat.c +++ b/gdb/hppah-nat.c @@ -31,6 +31,7 @@ #include "gdbcore.h" #include "gdb_wait.h" #include "regcache.h" +#include "gdb_string.h" #include <signal.h> extern CORE_ADDR text_end; @@ -785,8 +786,6 @@ startup_semaphore_t; static startup_semaphore_t startup_semaphore; -extern int parent_attach_all (int, PTRACE_ARG3_TYPE, int); - #ifdef PT_SETTRC /* This function causes the caller's process to be traced by its parent. This is intended to be called after GDB forks itself, @@ -907,14 +906,13 @@ hppa_insert_hw_watchpoint (int pid, CORE_ADDR start, LONGEST len, int type) } int -hppa_remove_hw_watchpoint (int pid, CORE_ADDR start, LONGEST len, - enum bptype type) +hppa_remove_hw_watchpoint (int pid, CORE_ADDR start, LONGEST len, int type) { error ("Hardware watchpoints not implemented on this platform."); } int -hppa_can_use_hw_watchpoint (enum bptype type, int cnt, enum bptype ot) +hppa_can_use_hw_watchpoint (int type, int cnt, int ot) { return 0; } diff --git a/gdb/hpread.c b/gdb/hpread.c index 6acf576..606ccfe 100644 --- a/gdb/hpread.c +++ b/gdb/hpread.c @@ -35,6 +35,8 @@ #include "gdb-stabs.h" #include "gdbtypes.h" #include "demangle.h" +#include "somsolib.h" +#include "gdb_assert.h" /* Private information attached to an objfile which we use to find and internalize the HP C debug symbols within that objfile. */ @@ -1024,7 +1026,7 @@ hpread_quick_traverse (struct objfile *objfile, char *gntt_bits, while (VALID_CURR_FILE || VALID_CURR_MODULE) { - char *mod_name_string; + char *mod_name_string = NULL; char *full_name_string; /* First check for modules like "version.c", which have no code @@ -2321,7 +2323,7 @@ static unsigned long hpread_get_textlow (int global, int index, struct objfile *objfile, int symcount) { - union dnttentry *dn_bufp; + union dnttentry *dn_bufp = NULL; struct minimal_symbol *msymbol; /* Look for a DNTT_TYPE_FUNCTION symbol. */ @@ -2340,6 +2342,11 @@ hpread_get_textlow (int global, int index, struct objfile *objfile, && index < symcount); } + /* NOTE: cagney/2003-03-29: If !(index < symcount), dn_bufp is left + undefined and that means that the test below is using a garbage + pointer from the stack. */ + gdb_assert (dn_bufp != NULL); + /* Avoid going past a DNTT_TYPE_END when looking for a DNTT_TYPE_FUNCTION. This might happen when a sourcefile has no functions. */ if (dn_bufp->dblock.kind == DNTT_TYPE_END) @@ -3359,10 +3366,10 @@ static struct type * hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp, struct objfile *objfile, int newblock) { - struct type *type, *type1; struct pending *syms; struct pending *local_list = NULL; int nsyms = 0; + struct type *type; dnttpointer param; union dnttentry *paramp; char *name; @@ -3378,11 +3385,17 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp, } else { + struct type *type1 = NULL; /* Nope, so read it in and store it away. */ if (dn_bufp->dblock.kind == DNTT_TYPE_DOC_FUNCTION || dn_bufp->dblock.kind == DNTT_TYPE_DOC_MEMFUNC) type1 = lookup_function_type (hpread_type_lookup (dn_bufp->ddocfunc.retval, objfile)); + /* NOTE: cagney/2003-03-29: Oh, no not again. TYPE1 is + potentially left undefined here. Assert it isn't and hope + the assert never fails ... */ + gdb_assert (type1 != NULL); + replace_type (type, type1); /* Mark it -- in the middle of processing */ diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 02abc9e..f4c0368 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -925,7 +925,7 @@ static CORE_ADDR i386_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { - sp = default_push_arguments (nargs, args, sp, struct_return, struct_addr); + sp = legacy_push_arguments (nargs, args, sp, struct_return, struct_addr); if (struct_return) { @@ -939,12 +939,6 @@ i386_push_arguments (int nargs, struct value **args, CORE_ADDR sp, return sp; } -static void -i386_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) -{ - /* Do nothing. Everything was already done by i386_push_arguments. */ -} - /* These registers are used for returning integers (and on some targets also for returning `struct' and `union' values when their size and alignment match an integer type). */ @@ -1586,10 +1580,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_parm_boundary (gdbarch, 32); set_gdbarch_extract_return_value (gdbarch, i386_extract_return_value); - set_gdbarch_push_arguments (gdbarch, i386_push_arguments); - set_gdbarch_push_return_address (gdbarch, i386_push_return_address); + set_gdbarch_deprecated_push_arguments (gdbarch, i386_push_arguments); + set_gdbarch_deprecated_push_return_address (gdbarch, i386_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, i386_pop_frame); - set_gdbarch_deprecated_store_struct_return (gdbarch, i386_store_struct_return); set_gdbarch_store_return_value (gdbarch, i386_store_return_value); set_gdbarch_extract_struct_value_address (gdbarch, i386_extract_struct_value_address); @@ -1630,6 +1623,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) i386_add_reggroups (gdbarch); set_gdbarch_register_reggroup_p (gdbarch, i386_register_reggroup_p); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 1b3d765..5ace962 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -96,8 +96,6 @@ static gdbarch_deprecated_extract_return_value_ftype ia64_extract_return_value; static gdbarch_deprecated_extract_struct_value_address_ftype ia64_extract_struct_value_address; static gdbarch_use_struct_convention_ftype ia64_use_struct_convention; static gdbarch_frameless_function_invocation_ftype ia64_frameless_function_invocation; -static gdbarch_push_arguments_ftype ia64_push_arguments; -static gdbarch_push_return_address_ftype ia64_push_return_address; static gdbarch_saved_pc_after_call_ftype ia64_saved_pc_after_call; static void ia64_pop_frame_regular (struct frame_info *frame); static struct type *is_float_or_hfa_type (struct type *t); @@ -2216,8 +2214,8 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Settings for calling functions in the inferior. */ set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_push_arguments (gdbarch, ia64_push_arguments); - set_gdbarch_push_return_address (gdbarch, ia64_push_return_address); + set_gdbarch_deprecated_push_arguments (gdbarch, ia64_push_arguments); + set_gdbarch_deprecated_push_return_address (gdbarch, ia64_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, ia64_pop_frame); set_gdbarch_call_dummy_p (gdbarch, 1); @@ -2239,7 +2237,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); diff --git a/gdb/inferior.h b/gdb/inferior.h index 10da8ee..99316cc 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -178,8 +178,6 @@ extern CORE_ADDR read_sp (void); extern CORE_ADDR generic_target_read_sp (void); -extern void write_sp (CORE_ADDR); - extern void generic_target_write_sp (CORE_ADDR); extern CORE_ADDR read_fp (void); diff --git a/gdb/infrun.c b/gdb/infrun.c index 6da3394..7066a52 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1153,6 +1153,11 @@ void handle_inferior_event (struct execution_control_state *ecs) { CORE_ADDR real_stop_pc; + /* NOTE: cagney/2003-03-28: If you're looking at this code and + thinking that the variable stepped_after_stopped_by_watchpoint + isn't used, then you're wrong! The macro STOPPED_BY_WATCHPOINT, + defined in the file "config/pa/nm-hppah.h", accesses the variable + indirectly. Mutter something rude about the HP merge. */ int stepped_after_stopped_by_watchpoint; int sw_single_step_trap_p = 0; @@ -1165,7 +1170,15 @@ handle_inferior_event (struct execution_control_state *ecs) case infwait_thread_hop_state: /* Cancel the waiton_ptid. */ ecs->waiton_ptid = pid_to_ptid (-1); - /* Fall thru to the normal_state case. */ + /* See comments where a TARGET_WAITKIND_SYSCALL_RETURN event + is serviced in this loop, below. */ + if (ecs->enable_hw_watchpoints_after_wait) + { + TARGET_ENABLE_HW_WATCHPOINTS (PIDGET (inferior_ptid)); + ecs->enable_hw_watchpoints_after_wait = 0; + } + stepped_after_stopped_by_watchpoint = 0; + break; case infwait_normal_state: /* See comments where a TARGET_WAITKIND_SYSCALL_RETURN event @@ -1179,6 +1192,7 @@ handle_inferior_event (struct execution_control_state *ecs) break; case infwait_nullified_state: + stepped_after_stopped_by_watchpoint = 0; break; case infwait_nonstep_watch_state: @@ -1189,6 +1203,9 @@ handle_inferior_event (struct execution_control_state *ecs) in combination correctly? */ stepped_after_stopped_by_watchpoint = 1; break; + + default: + internal_error (__FILE__, __LINE__, "bad switch"); } ecs->infwait_state = infwait_normal_state; diff --git a/gdb/infttrace.c b/gdb/infttrace.c index 02a5576..f86ab02 100644 --- a/gdb/infttrace.c +++ b/gdb/infttrace.c @@ -27,6 +27,7 @@ #include "gdb_string.h" #include "gdb_wait.h" #include "command.h" +#include "gdbthread.h" /* We need pstat functionality so that we can get the exec file for a process we attach to. @@ -2947,7 +2948,7 @@ ptrace_wait (ptid_t ptid, int *status) child_acknowledge_created_inferior.) */ int -parent_attach_all (void) +parent_attach_all (int p1, PTRACE_ARG3_TYPE p2, int p3) { int tt_status; @@ -3674,7 +3675,7 @@ call_ptrace (int pt_request, int gdb_tid, PTRACE_ARG3_TYPE addr, int data) there's no need for any "break" statements. */ case PT_SETTRC: - return parent_attach_all (); + return parent_attach_all (0, 0, 0); case PT_RUREGS: tt_status = read_from_register_save_state (gdb_tid, @@ -5378,8 +5379,7 @@ hppa_insert_hw_watchpoint (int pid, CORE_ADDR start, LONGEST len, int type) watchpoints. */ int -hppa_remove_hw_watchpoint (int pid, CORE_ADDR start, LONGEST len, - enum bptype type) +hppa_remove_hw_watchpoint (int pid, CORE_ADDR start, LONGEST len, int type) { CORE_ADDR page_start; int dictionary_is_empty; @@ -5439,7 +5439,7 @@ hppa_remove_hw_watchpoint (int pid, CORE_ADDR start, LONGEST len, hardware support. */ int -hppa_can_use_hw_watchpoint (enum bptype type, int cnt, enum bptype ot) +hppa_can_use_hw_watchpoint (int type, int cnt, int ot) { return (type == bp_hardware_watchpoint); } diff --git a/gdb/lin-lwp.c b/gdb/lin-lwp.c index 9f9dd81..c36394e 100644 --- a/gdb/lin-lwp.c +++ b/gdb/lin-lwp.c @@ -172,8 +172,7 @@ status_to_str (int status) snprintf (buf, sizeof (buf), "%s (terminated)", strsignal (WSTOPSIG (status))); else - snprintf (buf, sizeof (buf), "%d (exited)", - WEXITSTATUS (status)); + snprintf (buf, sizeof (buf), "%d (exited)", WEXITSTATUS (status)); return buf; } @@ -306,8 +305,8 @@ iterate_over_lwps (int (*callback) (struct lwp_info *, void *), void *data) int lin_lwp_prepare_to_proceed (void) { - if (! ptid_equal (trap_ptid, null_ptid) - && ! ptid_equal (inferior_ptid, trap_ptid)) + if (!ptid_equal (trap_ptid, null_ptid) + && !ptid_equal (inferior_ptid, trap_ptid)) { /* Switched over from TRAP_PID. */ CORE_ADDR stop_pc = read_pc (); @@ -319,7 +318,7 @@ lin_lwp_prepare_to_proceed (void) if (trap_pc != stop_pc && breakpoint_here_p (trap_pc)) { /* User hasn't deleted the breakpoint. Return non-zero, and - switch back to TRAP_PID. */ + switch back to TRAP_PID. */ inferior_ptid = trap_ptid; /* FIXME: Is this stuff really necessary? */ @@ -355,7 +354,7 @@ lin_lwp_attach_lwp (ptid_t ptid, int verbose) /* Make sure SIGCHLD is blocked. We don't want SIGCHLD events to interrupt either the ptrace() or waitpid() calls below. */ - if (! sigismember (&blocked_mask, SIGCHLD)) + if (!sigismember (&blocked_mask, SIGCHLD)) { sigaddset (&blocked_mask, SIGCHLD); sigprocmask (SIG_BLOCK, &blocked_mask, NULL); @@ -380,8 +379,8 @@ lin_lwp_attach_lwp (ptid_t ptid, int verbose) safe_strerror (errno)); if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "LLAL: PTRACE_ATTACH %s, 0, 0 (OK)\n", + fprintf_unfiltered (gdb_stdlog, + "LLAL: PTRACE_ATTACH %s, 0, 0 (OK)\n", target_pid_to_str (ptid)); pid = waitpid (GET_LWP (ptid), &status, 0); @@ -401,18 +400,18 @@ lin_lwp_attach_lwp (ptid_t ptid, int verbose) { fprintf_unfiltered (gdb_stdlog, "LLAL: waitpid %s received %s\n", - target_pid_to_str (ptid), + target_pid_to_str (ptid), status_to_str (status)); } } else { /* We assume that the LWP representing the original process - is already stopped. Mark it as stopped in the data structure - that the lin-lwp layer uses to keep track of threads. Note - that this won't have already been done since the main thread - will have, we assume, been stopped by an attach from a - different layer. */ + is already stopped. Mark it as stopped in the data structure + that the lin-lwp layer uses to keep track of threads. Note + that this won't have already been done since the main thread + will have, we assume, been stopped by an attach from a + different layer. */ lp->stopped = 1; } } @@ -455,8 +454,7 @@ lin_lwp_attach (char *args, int from_tty) if (debug_lin_lwp) { fprintf_unfiltered (gdb_stdlog, - "LLA: waitpid %ld, faking SIGSTOP\n", - (long) pid); + "LLA: waitpid %ld, faking SIGSTOP\n", (long) pid); } } @@ -467,7 +465,7 @@ detach_callback (struct lwp_info *lp, void *data) if (debug_lin_lwp && lp->status) fprintf_unfiltered (gdb_stdlog, "DC: Pending %s for %s on detach.\n", - strsignal (WSTOPSIG (lp->status)), + strsignal (WSTOPSIG (lp->status)), target_pid_to_str (lp->ptid)); while (lp->signalled && lp->stopped) @@ -479,10 +477,10 @@ detach_callback (struct lwp_info *lp, void *data) safe_strerror (errno)); if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog, "DC: PTRACE_CONTINUE (%s, 0, %s) (OK)\n", target_pid_to_str (lp->ptid), - status_to_str (lp->status)); + status_to_str (lp->status)); lp->stopped = 0; lp->signalled = 0; @@ -505,7 +503,7 @@ detach_callback (struct lwp_info *lp, void *data) if (debug_lin_lwp) fprintf_unfiltered (gdb_stdlog, "PTRACE_DETACH (%s, %s, 0) (OK)\n", - target_pid_to_str (lp->ptid), + target_pid_to_str (lp->ptid), strsignal (WSTOPSIG (lp->status))); delete_lwp (lp->ptid); @@ -547,7 +545,7 @@ resume_callback (struct lwp_info *lp, void *data) child_resume (pid_to_ptid (GET_LWP (lp->ptid)), 0, TARGET_SIGNAL_0); if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog, "RC: PTRACE_CONT %s, 0, 0 (resume sibling)\n", target_pid_to_str (lp->ptid)); lp->stopped = 0; @@ -606,13 +604,13 @@ lin_lwp_resume (ptid_t ptid, int step, enum target_signal signo) if (lp->status) { /* FIXME: What should we do if we are supposed to continue - this thread with a signal? */ + this thread with a signal? */ gdb_assert (signo == TARGET_SIGNAL_0); return; } /* Mark LWP as not stopped to prevent it from being continued by - resume_callback. */ + resume_callback. */ lp->stopped = 0; } @@ -634,7 +632,7 @@ lin_lwp_resume (ptid_t ptid, int step, enum target_signal signo) static int stop_callback (struct lwp_info *lp, void *data) { - if (! lp->stopped && ! lp->signalled) + if (!lp->stopped && !lp->signalled) { int ret; @@ -662,7 +660,7 @@ stop_wait_callback (struct lwp_info *lp, void *data) { sigset_t *flush_mask = data; - if (! lp->stopped && lp->signalled) + if (!lp->stopped && lp->signalled) { pid_t pid; int status; @@ -681,7 +679,7 @@ stop_wait_callback (struct lwp_info *lp, void *data) { fprintf_unfiltered (gdb_stdlog, "SWC: waitpid %s received %s\n", - target_pid_to_str (lp->ptid), + target_pid_to_str (lp->ptid), status_to_str (status)); } @@ -692,14 +690,14 @@ stop_wait_callback (struct lwp_info *lp, void *data) if (in_thread_list (lp->ptid)) { /* Core GDB cannot deal with us deleting the current - thread. */ + thread. */ if (!ptid_equal (lp->ptid, inferior_ptid)) delete_thread (lp->ptid); printf_unfiltered ("[%s exited]\n", target_pid_to_str (lp->ptid)); } if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, "SWC: %s exited.\n", + fprintf_unfiltered (gdb_stdlog, "SWC: %s exited.\n", target_pid_to_str (lp->ptid)); delete_lwp (lp->ptid); @@ -727,29 +725,29 @@ stop_wait_callback (struct lwp_info *lp, void *data) if (WSTOPSIG (status) == SIGTRAP) { /* If a LWP other than the LWP that we're reporting an - event for has hit a GDB breakpoint (as opposed to - some random trap signal), then just arrange for it to - hit it again later. We don't keep the SIGTRAP status - and don't forward the SIGTRAP signal to the LWP. We - will handle the current event, eventually we will - resume all LWPs, and this one will get its breakpoint - trap again. - - If we do not do this, then we run the risk that the - user will delete or disable the breakpoint, but the - thread will have already tripped on it. */ + event for has hit a GDB breakpoint (as opposed to + some random trap signal), then just arrange for it to + hit it again later. We don't keep the SIGTRAP status + and don't forward the SIGTRAP signal to the LWP. We + will handle the current event, eventually we will + resume all LWPs, and this one will get its breakpoint + trap again. + + If we do not do this, then we run the risk that the + user will delete or disable the breakpoint, but the + thread will have already tripped on it. */ /* Now resume this LWP and get the SIGSTOP event. */ errno = 0; ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0); if (debug_lin_lwp) { - fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog, "PTRACE_CONT %s, 0, 0 (%s)\n", target_pid_to_str (lp->ptid), errno ? safe_strerror (errno) : "OK"); - fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog, "SWC: Candidate SIGTRAP event in %s\n", target_pid_to_str (lp->ptid)); } @@ -767,39 +765,39 @@ stop_wait_callback (struct lwp_info *lp, void *data) else { /* The thread was stopped with a signal other than - SIGSTOP, and didn't accidentally trip a breakpoint. */ + SIGSTOP, and didn't accidentally trip a breakpoint. */ if (debug_lin_lwp) { - fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog, "SWC: Pending event %s in %s\n", - status_to_str ((int) status), + status_to_str ((int) status), target_pid_to_str (lp->ptid)); } /* Now resume this LWP and get the SIGSTOP event. */ errno = 0; ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0); if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog, "SWC: PTRACE_CONT %s, 0, 0 (%s)\n", target_pid_to_str (lp->ptid), errno ? safe_strerror (errno) : "OK"); /* Hold this event/waitstatus while we check to see if - there are any more (we still want to get that SIGSTOP). */ + there are any more (we still want to get that SIGSTOP). */ stop_wait_callback (lp, data); /* If the lp->status field is still empty, use it to hold - this event. If not, then this event must be returned - to the event queue of the LWP. */ + this event. If not, then this event must be returned + to the event queue of the LWP. */ if (lp->status == 0) lp->status = status; else { if (debug_lin_lwp) { - fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog, "SWC: kill %s, %s\n", - target_pid_to_str (lp->ptid), + target_pid_to_str (lp->ptid), status_to_str ((int) status)); } kill (GET_LWP (lp->ptid), WSTOPSIG (status)); @@ -810,7 +808,7 @@ stop_wait_callback (struct lwp_info *lp, void *data) else { /* We caught the SIGSTOP that we intended to catch, so - there's no SIGSTOP pending. */ + there's no SIGSTOP pending. */ lp->stopped = 1; lp->signalled = 0; } @@ -904,8 +902,8 @@ cancel_breakpoints_callback (struct lwp_info *lp, void *data) tripped on it. */ if (lp->status != 0 - && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP - && breakpoint_inserted_here_p (read_pc_pid (lp->ptid) - + && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP + && breakpoint_inserted_here_p (read_pc_pid (lp->ptid) - DECR_PC_AFTER_BREAK)) { if (debug_lin_lwp) @@ -948,7 +946,7 @@ select_event_lwp (struct lwp_info **orig_lp, int *status) else { /* No single-stepping LWP. Select one at random, out of those - which have had SIGTRAP events. */ + which have had SIGTRAP events. */ /* First see how many SIGTRAP events we have. */ iterate_over_lwps (count_events_callback, &num_events); @@ -958,8 +956,8 @@ select_event_lwp (struct lwp_info **orig_lp, int *status) ((num_events * (double) rand ()) / (RAND_MAX + 1.0)); if (debug_lin_lwp && num_events > 1) - fprintf_unfiltered (gdb_stdlog, - "SEL: Found %d SIGTRAP events, selecting #%d\n", + fprintf_unfiltered (gdb_stdlog, + "SEL: Found %d SIGTRAP events, selecting #%d\n", num_events, random_selector); event_lp = iterate_over_lwps (select_event_lwp_callback, @@ -970,7 +968,7 @@ select_event_lwp (struct lwp_info **orig_lp, int *status) { /* Switch the event LWP. */ *orig_lp = event_lp; - *status = event_lp->status; + *status = event_lp->status; } /* Flush the wait status for the event LWP. */ @@ -1014,17 +1012,16 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus) if (debug_lin_lwp) { - fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog, "CW: waitpid %ld received %s\n", - (long) pid, - status_to_str (status)); + (long) pid, status_to_str (status)); } save_errno = errno; /* Make sure we don't report an event for the exit of the - original program, if we've detached from it. */ - if (pid != -1 && ! WIFSTOPPED (status) && pid != GET_PID (inferior_ptid)) + original program, if we've detached from it. */ + if (pid != -1 && !WIFSTOPPED (status) && pid != GET_PID (inferior_ptid)) { pid = -1; save_errno = EINTR; @@ -1037,7 +1034,7 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus) if (pid == -1) { - warning ("Child process unexpectedly missing: %s", + warning ("Child process unexpectedly missing: %s", safe_strerror (errno)); /* Claim it exited with unknown signal. */ @@ -1064,13 +1061,13 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) sigemptyset (&flush_mask); /* Make sure SIGCHLD is blocked. */ - if (! sigismember (&blocked_mask, SIGCHLD)) + if (!sigismember (&blocked_mask, SIGCHLD)) { sigaddset (&blocked_mask, SIGCHLD); sigprocmask (SIG_BLOCK, &blocked_mask, NULL); } - retry: +retry: /* Make sure there is at least one LWP that has been resumed, at least if there are any LWPs at all. */ @@ -1089,7 +1086,7 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) if (debug_lin_lwp && status) fprintf_unfiltered (gdb_stdlog, "LLW: Using pending wait status %s for %s.\n", - status_to_str (status), + status_to_str (status), target_pid_to_str (lp->ptid)); } @@ -1101,7 +1098,7 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) else if (is_lwp (ptid)) { if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog, "LLW: Waiting for specific LWP %s.\n", target_pid_to_str (ptid)); @@ -1114,7 +1111,7 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) if (debug_lin_lwp && status) fprintf_unfiltered (gdb_stdlog, "LLW: Using pending wait status %s for %s.\n", - status_to_str (status), + status_to_str (status), target_pid_to_str (lp->ptid)); /* If we have to wait, take into account whether PID is a cloned @@ -1127,19 +1124,19 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) if (status && lp->signalled) { /* A pending SIGSTOP may interfere with the normal stream of - events. In a typical case where interference is a problem, - we have a SIGSTOP signal pending for LWP A while - single-stepping it, encounter an event in LWP B, and take the - pending SIGSTOP while trying to stop LWP A. After processing - the event in LWP B, LWP A is continued, and we'll never see - the SIGTRAP associated with the last time we were - single-stepping LWP A. */ + events. In a typical case where interference is a problem, + we have a SIGSTOP signal pending for LWP A while + single-stepping it, encounter an event in LWP B, and take the + pending SIGSTOP while trying to stop LWP A. After processing + the event in LWP B, LWP A is continued, and we'll never see + the SIGTRAP associated with the last time we were + single-stepping LWP A. */ /* Resume the thread. It should halt immediately returning the - pending SIGSTOP. */ + pending SIGSTOP. */ registers_changed (); child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step, - TARGET_SIGNAL_0); + TARGET_SIGNAL_0); if (debug_lin_lwp) fprintf_unfiltered (gdb_stdlog, "LLW: %s %s, 0, 0 (expect SIGSTOP)\n", @@ -1152,8 +1149,8 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) stop_wait_callback (lp, NULL); } - set_sigint_trap (); /* Causes SIGINT to be passed on to the - attached process. */ + set_sigint_trap (); /* Causes SIGINT to be passed on to the + attached process. */ set_sigio_trap (); while (status == 0) @@ -1169,8 +1166,7 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) { fprintf_unfiltered (gdb_stdlog, "LLW: waitpid %ld received %s\n", - (long) lwpid, - status_to_str (status)); + (long) lwpid, status_to_str (status)); } lp = find_lwp_pid (pid_to_ptid (lwpid)); @@ -1179,13 +1175,13 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) our list, i.e. not part of the current process. This can happen if we detach from a program we original forked and then it exits. */ - if (! WIFSTOPPED (status) && ! lp) + if (!WIFSTOPPED (status) && !lp) { status = 0; continue; } - if (! lp) + if (!lp) { lp = add_lwp (BUILD_LWP (lwpid, GET_PID (inferior_ptid))); if (options & __WCLONE) @@ -1197,10 +1193,10 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) && WSTOPSIG (status) == SIGSTOP); lp->signalled = 1; - if (! in_thread_list (inferior_ptid)) + if (!in_thread_list (inferior_ptid)) { inferior_ptid = BUILD_LWP (GET_PID (inferior_ptid), - GET_PID (inferior_ptid)); + GET_PID (inferior_ptid)); add_thread (inferior_ptid); } @@ -1211,22 +1207,22 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) } /* Make sure we don't report a TARGET_WAITKIND_EXITED or - TARGET_WAITKIND_SIGNALLED event if there are still LWP's - left in the process. */ + TARGET_WAITKIND_SIGNALLED event if there are still LWP's + left in the process. */ if ((WIFEXITED (status) || WIFSIGNALED (status)) && num_lwps > 1) { if (in_thread_list (lp->ptid)) { /* Core GDB cannot deal with us deleting the current - thread. */ - if (! ptid_equal (lp->ptid, inferior_ptid)) + thread. */ + if (!ptid_equal (lp->ptid, inferior_ptid)) delete_thread (lp->ptid); printf_unfiltered ("[%s exited]\n", target_pid_to_str (lp->ptid)); } if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "LLW: %s exited.\n", + fprintf_unfiltered (gdb_stdlog, + "LLW: %s exited.\n", target_pid_to_str (lp->ptid)); delete_lwp (lp->ptid); @@ -1240,13 +1236,12 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) } /* Make sure we don't report a SIGSTOP that we sent - ourselves in an attempt to stop an LWP. */ + ourselves in an attempt to stop an LWP. */ if (lp->signalled - && WIFSTOPPED (status) - && WSTOPSIG (status) == SIGSTOP) + && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP) { if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog, "LLW: Delayed SIGSTOP caught for %s.\n", target_pid_to_str (lp->ptid)); @@ -1255,11 +1250,11 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) registers_changed (); child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step, - TARGET_SIGNAL_0); + TARGET_SIGNAL_0); if (debug_lin_lwp) fprintf_unfiltered (gdb_stdlog, "LLW: %s %s, 0, 0 (discard SIGSTOP)\n", - lp->step ? + lp->step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT", target_pid_to_str (lp->ptid)); @@ -1309,16 +1304,17 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) && signal_pass_state (signo) == 1) { /* FIMXE: kettenis/2001-06-06: Should we resume all threads - here? It is not clear we should. GDB may not expect - other threads to run. On the other hand, not resuming - newly attached threads may cause an unwanted delay in - getting them running. */ + here? It is not clear we should. GDB may not expect + other threads to run. On the other hand, not resuming + newly attached threads may cause an unwanted delay in + getting them running. */ registers_changed (); child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step, signo); if (debug_lin_lwp) fprintf_unfiltered (gdb_stdlog, "LLW: %s %s, %s (preempt 'handle')\n", - lp->step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT", + lp->step ? + "PTRACE_SINGLESTEP" : "PTRACE_CONT", target_pid_to_str (lp->ptid), signo ? strsignal (signo) : "0"); lp->stopped = 0; @@ -1326,13 +1322,12 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) goto retry; } - if (signo == TARGET_SIGNAL_INT - && signal_pass_state (signo) == 0) + if (signo == TARGET_SIGNAL_INT && signal_pass_state (signo) == 0) { /* If ^C/BREAK is typed at the tty/console, SIGINT gets - forwarded to the entire process group, that is, all LWP's - will receive it. Since we only want to report it once, - we try to flush it from all LWPs except this one. */ + forwarded to the entire process group, that is, all LWP's + will receive it. Since we only want to report it once, + we try to flush it from all LWPs except this one. */ sigaddset (&flush_mask, SIGINT); } } @@ -1342,8 +1337,7 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) if (debug_lin_lwp) fprintf_unfiltered (gdb_stdlog, "LLW: Candidate event %s in %s.\n", - status_to_str (status), - target_pid_to_str (lp->ptid)); + status_to_str (status), target_pid_to_str (lp->ptid)); /* Now stop all other LWP's ... */ iterate_over_lwps (stop_callback, NULL); @@ -1370,7 +1364,7 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) { trap_ptid = (threaded ? lp->ptid : pid_to_ptid (GET_LWP (lp->ptid))); if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog, "LLW: trap_ptid is %s.\n", target_pid_to_str (trap_ptid)); } @@ -1387,7 +1381,7 @@ kill_callback (struct lwp_info *lp, void *data) errno = 0; ptrace (PTRACE_KILL, GET_LWP (lp->ptid), 0, 0); if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog, "KC: PTRACE_KILL %s, 0, 0 (%s)\n", target_pid_to_str (lp->ptid), errno ? safe_strerror (errno) : "OK"); @@ -1430,7 +1424,7 @@ kill_wait_callback (struct lwp_info *lp, void *data) if (pid != (pid_t) -1 && debug_lin_lwp) { fprintf_unfiltered (gdb_stdlog, - "KWC: wait %s received unk.\n", + "KWC: wait %s received unk.\n", target_pid_to_str (lp->ptid)); } } @@ -1458,7 +1452,7 @@ lin_lwp_create_inferior (char *exec_file, char *allargs, char **env) child_ops.to_create_inferior (exec_file, allargs, env); } -static void +static void lin_lwp_mourn_inferior (void) { trap_ptid = null_ptid; @@ -1475,8 +1469,7 @@ lin_lwp_mourn_inferior (void) static int lin_lwp_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, - struct mem_attrib *attrib, - struct target_ops *target) + struct mem_attrib *attrib, struct target_ops *target) { struct cleanup *old_chain = save_inferior_ptid (); int xfer; @@ -1502,7 +1495,7 @@ lin_lwp_thread_alive (ptid_t ptid) if (debug_lin_lwp) fprintf_unfiltered (gdb_stdlog, "LLTA: PTRACE_PEEKUSER %s, 0, 0 (%s)\n", - target_pid_to_str (ptid), + target_pid_to_str (ptid), errno ? safe_strerror (errno) : "OK"); if (errno) return 0; @@ -1586,11 +1579,9 @@ _initialize_lin_lwp (void) sigemptyset (&blocked_mask); add_show_from_set (add_set_cmd ("lin-lwp", no_class, var_zinteger, - (char *) &debug_lin_lwp, + (char *) &debug_lin_lwp, "Set debugging of GNU/Linux lwp module.\n\ -Enables printf debugging output.\n", - &setdebuglist), - &showdebuglist); +Enables printf debugging output.\n", &setdebuglist), &showdebuglist); } diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c index 00383e9..a951296 100644 --- a/gdb/linux-proc.c +++ b/gdb/linux-proc.c @@ -21,17 +21,17 @@ #include "defs.h" #include "inferior.h" -#include <sys/param.h> /* for MAXPATHLEN */ -#include <sys/procfs.h> /* for elf_gregset etc. */ -#include "gdb_stat.h" /* for struct stat */ -#include <ctype.h> /* for isdigit */ -#include <unistd.h> /* for open, pread64 */ -#include <fcntl.h> /* for O_RDONLY */ -#include "regcache.h" /* for registers_changed */ -#include "gregset.h" /* for gregset */ -#include "gdbcore.h" /* for get_exec_file */ -#include "gdbthread.h" /* for struct thread_info etc. */ -#include "elf-bfd.h" /* for elfcore_write_* */ +#include <sys/param.h> /* for MAXPATHLEN */ +#include <sys/procfs.h> /* for elf_gregset etc. */ +#include "gdb_stat.h" /* for struct stat */ +#include <ctype.h> /* for isdigit */ +#include <unistd.h> /* for open, pread64 */ +#include <fcntl.h> /* for O_RDONLY */ +#include "regcache.h" /* for registers_changed */ +#include "gregset.h" /* for gregset */ +#include "gdbcore.h" /* for get_exec_file */ +#include "gdbthread.h" /* for struct thread_info etc. */ +#include "elf-bfd.h" /* for elfcore_write_* */ #include "cli/cli-decode.h" /* for add_info */ #include "gdb_string.h" @@ -69,28 +69,26 @@ child_pid_to_exec_file (int pid) * Service function for corefiles and info proc. */ -static int -read_mapping (FILE *mapfile, - long long *addr, - long long *endaddr, - char *permissions, - long long *offset, - char *device, - long long *inode, - char *filename) +static int +read_mapping (FILE *mapfile, + long long *addr, + long long *endaddr, + char *permissions, + long long *offset, + char *device, long long *inode, char *filename) { - int ret = fscanf (mapfile, "%llx-%llx %s %llx %s %llx", + int ret = fscanf (mapfile, "%llx-%llx %s %llx %s %llx", addr, endaddr, permissions, offset, device, inode); if (ret > 0 && ret != EOF && *inode != 0) { /* Eat everything up to EOL for the filename. This will prevent - weird filenames (such as one with embedded whitespace) from - confusing this code. It also makes this code more robust - in respect to annotations the kernel may add after the - filename. + weird filenames (such as one with embedded whitespace) from + confusing this code. It also makes this code more robust + in respect to annotations the kernel may add after the + filename. - Note the filename is used for informational purposes only. */ + Note the filename is used for informational purposes only. */ ret += fscanf (mapfile, "%[^\n]\n", filename); } else @@ -108,11 +106,9 @@ read_mapping (FILE *mapfile, */ static int -linux_find_memory_regions (int (*func) (CORE_ADDR, +linux_find_memory_regions (int (*func) (CORE_ADDR, unsigned long, - int, int, int, - void *), - void *obfd) + int, int, int, void *), void *obfd) { long long pid = PIDGET (inferior_ptid); char mapsfilename[MAXPATHLEN]; @@ -128,31 +124,29 @@ linux_find_memory_regions (int (*func) (CORE_ADDR, error ("Could not open %s\n", mapsfilename); if (info_verbose) - fprintf_filtered (gdb_stdout, + fprintf_filtered (gdb_stdout, "Reading memory regions from %s\n", mapsfilename); /* Now iterate until end-of-file. */ - while (read_mapping (mapsfile, &addr, &endaddr, &permissions[0], + while (read_mapping (mapsfile, &addr, &endaddr, &permissions[0], &offset, &device[0], &inode, &filename[0])) { size = endaddr - addr; /* Get the segment's permissions. */ - read = (strchr (permissions, 'r') != 0); + read = (strchr (permissions, 'r') != 0); write = (strchr (permissions, 'w') != 0); - exec = (strchr (permissions, 'x') != 0); + exec = (strchr (permissions, 'x') != 0); if (info_verbose) { - fprintf_filtered (gdb_stdout, - "Save segment, %lld bytes at 0x%s (%c%c%c)", - size, paddr_nz (addr), - read ? 'r' : ' ', - write ? 'w' : ' ', - exec ? 'x' : ' '); + fprintf_filtered (gdb_stdout, + "Save segment, %lld bytes at 0x%s (%c%c%c)", + size, paddr_nz (addr), + read ? 'r' : ' ', + write ? 'w' : ' ', exec ? 'x' : ' '); if (filename && filename[0]) - fprintf_filtered (gdb_stdout, - " for %s", filename); + fprintf_filtered (gdb_stdout, " for %s", filename); fprintf_filtered (gdb_stdout, "\n"); } @@ -169,7 +163,7 @@ linux_find_memory_regions (int (*func) (CORE_ADDR, */ static char * -linux_do_thread_registers (bfd *obfd, ptid_t ptid, +linux_do_thread_registers (bfd *obfd, ptid_t ptid, char *note_data, int *note_size) { gdb_gregset_t gregs; @@ -180,26 +174,23 @@ linux_do_thread_registers (bfd *obfd, ptid_t ptid, unsigned long merged_pid = ptid_get_tid (ptid) << 16 | ptid_get_pid (ptid); fill_gregset (&gregs, -1); - note_data = (char *) elfcore_write_prstatus (obfd, - note_data, - note_size, - merged_pid, - stop_signal, - &gregs); + note_data = (char *) elfcore_write_prstatus (obfd, + note_data, + note_size, + merged_pid, + stop_signal, &gregs); fill_fpregset (&fpregs, -1); - note_data = (char *) elfcore_write_prfpreg (obfd, - note_data, - note_size, - &fpregs, - sizeof (fpregs)); + note_data = (char *) elfcore_write_prfpreg (obfd, + note_data, + note_size, + &fpregs, sizeof (fpregs)); #ifdef FILL_FPXREGSET fill_fpxregset (&fpxregs, -1); - note_data = (char *) elfcore_write_prxfpreg (obfd, - note_data, - note_size, - &fpxregs, - sizeof (fpxregs)); + note_data = (char *) elfcore_write_prxfpreg (obfd, + note_data, + note_size, + &fpxregs, sizeof (fpxregs)); #endif return note_data; } @@ -228,9 +219,9 @@ linux_corefile_thread_callback (struct thread_info *ti, void *data) registers_changed (); target_fetch_registers (-1); /* FIXME should not be necessary; fill_gregset should do it automatically. */ - args->note_data = linux_do_thread_registers (args->obfd, - ti->ptid, - args->note_data, + args->note_data = linux_do_thread_registers (args->obfd, + ti->ptid, + args->note_data, args->note_size); args->num_notes++; inferior_ptid = saved_ptid; @@ -252,28 +243,24 @@ linux_make_note_section (bfd *obfd, int *note_size) { struct linux_corefile_thread_data thread_args; struct cleanup *old_chain; - char fname[16] = {'\0'}; - char psargs[80] = {'\0'}; + char fname[16] = { '\0' }; + char psargs[80] = { '\0' }; char *note_data = NULL; ptid_t current_ptid = inferior_ptid; if (get_exec_file (0)) { strncpy (fname, strrchr (get_exec_file (0), '/') + 1, sizeof (fname)); - strncpy (psargs, get_exec_file (0), - sizeof (psargs)); + strncpy (psargs, get_exec_file (0), sizeof (psargs)); if (get_inferior_args ()) { - strncat (psargs, " ", - sizeof (psargs) - strlen (psargs)); - strncat (psargs, get_inferior_args (), + strncat (psargs, " ", sizeof (psargs) - strlen (psargs)); + strncat (psargs, get_inferior_args (), sizeof (psargs) - strlen (psargs)); } - note_data = (char *) elfcore_write_prpsinfo (obfd, - note_data, - note_size, - fname, - psargs); + note_data = (char *) elfcore_write_prpsinfo (obfd, + note_data, + note_size, fname, psargs); } /* Dump information for threads. */ @@ -285,8 +272,8 @@ linux_make_note_section (bfd *obfd, int *note_size) if (thread_args.num_notes == 0) { /* iterate_over_threads didn't come up with any threads; - just use inferior_ptid. */ - note_data = linux_do_thread_registers (obfd, inferior_ptid, + just use inferior_ptid. */ + note_data = linux_do_thread_registers (obfd, inferior_ptid, note_data, note_size); } else @@ -420,33 +407,30 @@ linux_info_proc_cmd (char *args, int from_tty) if (TARGET_ADDR_BIT == 32) { header_fmt_string = "\t%10s %10s %10s %10s %7s\n"; - data_fmt_string = "\t%#10lx %#10lx %#10x %#10x %7s\n"; + data_fmt_string = "\t%#10lx %#10lx %#10x %#10x %7s\n"; } else { header_fmt_string = " %18s %18s %10s %10s %7s\n"; - data_fmt_string = " %#18lx %#18lx %#10x %#10x %7s\n"; + data_fmt_string = " %#18lx %#18lx %#10x %#10x %7s\n"; } printf_filtered ("Mapped address spaces:\n\n"); - printf_filtered (header_fmt_string, + printf_filtered (header_fmt_string, "Start Addr", " End Addr", - " Size", - " Offset", - "objfile"); - - while (read_mapping (procfile, &addr, &endaddr, &permissions[0], + " Size", " Offset", "objfile"); + + while (read_mapping (procfile, &addr, &endaddr, &permissions[0], &offset, &device[0], &inode, &filename[0])) { size = endaddr - addr; - printf_filtered (data_fmt_string, - (unsigned long) addr, /* FIXME: pr_addr */ - (unsigned long) endaddr, - (int) size, - (unsigned int) offset, + printf_filtered (data_fmt_string, (unsigned long) addr, /* FIXME: pr_addr */ + (unsigned long) endaddr, + (int) size, + (unsigned int) offset, filename[0] ? filename : ""); - + } fclose (procfile); @@ -463,7 +447,7 @@ linux_info_proc_cmd (char *args, int from_tty) printf_filtered (buffer); fclose (procfile); } - else + else warning ("unable to open /proc file '%s'", fname1); } if (stat_f || all) @@ -493,16 +477,16 @@ linux_info_proc_cmd (char *args, int from_tty) if (fscanf (procfile, "%u ", &itmp) > 0) printf_filtered ("Flags: 0x%x\n", itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Minor faults (no memory page): %u\n", + printf_filtered ("Minor faults (no memory page): %u\n", (unsigned int) itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Minor faults, children: %u\n", + printf_filtered ("Minor faults, children: %u\n", (unsigned int) itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Major faults (memory page faults): %u\n", + printf_filtered ("Major faults (memory page faults): %u\n", (unsigned int) itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Major faults, children: %u\n", + printf_filtered ("Major faults, children: %u\n", (unsigned int) itmp); if (fscanf (procfile, "%d ", &itmp) > 0) printf_filtered ("utime: %d\n", itmp); @@ -513,36 +497,34 @@ linux_info_proc_cmd (char *args, int from_tty) if (fscanf (procfile, "%d ", &itmp) > 0) printf_filtered ("stime, children: %d\n", itmp); if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("jiffies remaining in current time slice: %d\n", + printf_filtered ("jiffies remaining in current time slice: %d\n", itmp); if (fscanf (procfile, "%d ", &itmp) > 0) printf_filtered ("'nice' value: %d\n", itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("jiffies until next timeout: %u\n", + printf_filtered ("jiffies until next timeout: %u\n", (unsigned int) itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("jiffies until next SIGALRM: %u\n", + printf_filtered ("jiffies until next SIGALRM: %u\n", (unsigned int) itmp); if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("start time (jiffies since system boot): %d\n", + printf_filtered ("start time (jiffies since system boot): %d\n", itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Virtual memory size: %u\n", + printf_filtered ("Virtual memory size: %u\n", (unsigned int) itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Resident set size: %u\n", - (unsigned int) itmp); + printf_filtered ("Resident set size: %u\n", (unsigned int) itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("rlim: %u\n", - (unsigned int) itmp); + printf_filtered ("rlim: %u\n", (unsigned int) itmp); if (fscanf (procfile, "%u ", &itmp) > 0) printf_filtered ("Start of text: 0x%x\n", itmp); if (fscanf (procfile, "%u ", &itmp) > 0) printf_filtered ("End of text: 0x%x\n", itmp); if (fscanf (procfile, "%u ", &itmp) > 0) printf_filtered ("Start of stack: 0x%x\n", itmp); -#if 0 /* Don't know how architecture-dependent the rest is... - Anyway the signal bitmap info is available from "status". */ +#if 0 /* Don't know how architecture-dependent the rest is... + Anyway the signal bitmap info is available from "status". */ if (fscanf (procfile, "%u ", &itmp) > 0) /* FIXME arch? */ printf_filtered ("Kernel stack pointer: 0x%x\n", itmp); if (fscanf (procfile, "%u ", &itmp) > 0) /* FIXME arch? */ @@ -574,7 +556,7 @@ _initialize_linux_proc (void) inftarg_set_find_memory_regions (linux_find_memory_regions); inftarg_set_make_corefile_notes (linux_make_note_section); - add_info ("proc", linux_info_proc_cmd, + add_info ("proc", linux_info_proc_cmd, "Show /proc process information about any running process.\n\ Specify any process id, or use the program being debugged by default.\n\ Specify any of the following keywords for detailed info:\n\ @@ -584,9 +566,9 @@ Specify any of the following keywords for detailed info:\n\ all -- list all available /proc info."); } -int linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, int write, - struct mem_attrib *attrib, - struct target_ops *target) +int +linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, int write, + struct mem_attrib *attrib, struct target_ops *target) { int fd, ret; char filename[64]; @@ -616,8 +598,7 @@ int linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, int write, #ifdef HAVE_PREAD64 if (pread64 (fd, myaddr, len, addr) != len) #else - if (lseek (fd, addr, SEEK_SET) == -1 - || read (fd, myaddr, len) != len) + if (lseek (fd, addr, SEEK_SET) == -1 || read (fd, myaddr, len) != len) #endif ret = 0; else diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 02ba5c0..3fff897 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1369,7 +1369,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_write_pc (gdbarch, generic_target_write_pc); set_gdbarch_read_fp (gdbarch, generic_target_read_fp); set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); set_gdbarch_sp_regnum (gdbarch, HARD_SP_REGNUM); set_gdbarch_fp_regnum (gdbarch, SOFT_FP_REGNUM); @@ -1392,8 +1392,8 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_deprecated_extract_return_value (gdbarch, m68hc11_extract_return_value); - set_gdbarch_push_arguments (gdbarch, m68hc11_push_arguments); - set_gdbarch_push_return_address (gdbarch, m68hc11_push_return_address); + set_gdbarch_deprecated_push_arguments (gdbarch, m68hc11_push_arguments); + set_gdbarch_deprecated_push_return_address (gdbarch, m68hc11_push_return_address); set_gdbarch_return_value_on_stack (gdbarch, m68hc11_return_value_on_stack); set_gdbarch_deprecated_store_struct_return (gdbarch, m68hc11_store_struct_return); diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index a72ea53..c25f2e1 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -1051,6 +1051,9 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_push_dummy_frame (gdbarch, m68k_push_dummy_frame); set_gdbarch_deprecated_pop_frame (gdbarch, m68k_pop_frame); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + return gdbarch; } diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c index e3070b3..a112eee 100644 --- a/gdb/mcore-tdep.c +++ b/gdb/mcore-tdep.c @@ -1129,8 +1129,8 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_function_start_offset (gdbarch, 0); set_gdbarch_decr_pc_after_break (gdbarch, 0); set_gdbarch_breakpoint_from_pc (gdbarch, mcore_breakpoint_from_pc); - set_gdbarch_push_return_address (gdbarch, mcore_push_return_address); - set_gdbarch_push_arguments (gdbarch, mcore_push_arguments); + set_gdbarch_deprecated_push_return_address (gdbarch, mcore_push_return_address); + set_gdbarch_deprecated_push_arguments (gdbarch, mcore_push_arguments); set_gdbarch_call_dummy_length (gdbarch, 0); /* Frames: */ @@ -1163,6 +1163,9 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) between registers and stack. */ set_gdbarch_reg_struct_has_addr (gdbarch, mcore_reg_struct_has_addr); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + return gdbarch; } diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 1785b9b..1b6b497 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,8 @@ +2003-03-27 Andrew Cagney <cagney@redhat.com> + + * gdbmi.texinfo: Delete file. Contents moved to + ../doc/gdb.texinfo. + 2003-03-12 Andrew Cagney <cagney@redhat.com> * mi-main.c (get_register): Use frame_register instead of diff --git a/gdb/mi/gdbmi.texinfo b/gdb/mi/gdbmi.texinfo deleted file mode 100644 index da8b77c..0000000 --- a/gdb/mi/gdbmi.texinfo +++ /dev/null @@ -1,3902 +0,0 @@ -@c \input texinfo @c -*-texinfo-*- -@c @c %**start of header -@c @setfilename gdbmi.info -@c @settitle GDB/MI Machine Interface -@c @setchapternewpage off -@c @c %**end of header - -@c @ifinfo -@c This file documents GDB/MI, a Machine Interface to GDB. - -@c Copyright 2000, 2001, 2002 Free Software Foundation, Inc. -@c Contributed by Cygnus Solutions. - -@c Permission is granted to copy, distribute and/or modify this document -@c under the terms of the GNU Free Documentation License, Version 1.1 or -@c any later version published by the Free Software Foundation; with no -@c Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,'' -@c and with the Back-Cover Texts as in (a) below. - -@c (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify -@c this GNU Manual, like GNU software. Copies published by the Free -@c Software Foundation raise funds for GNU development.'' -@c @end ifinfo - -@c @c This title page illustrates only one of the -@c @c two methods of forming a title page. - -@c @titlepage -@c @title GDB/MI -@c @subtitle Version 0.3 -@c @subtitle Apr 2001 -@c @author Andrew Cagney, Fernando Nasser and Elena Zannoni - -@c @c The following two commands -@c @c start the copyright page. -@c @page -@c @vskip 0pt plus 1filll - -@c Copyright @copyright{} 2000, 2001, 2002 Free Software Foundation, Inc. - -@c Permission is granted to copy, distribute and/or modify this document -@c under the terms of the GNU Free Documentation License, Version 1.1 or -@c any later version published by the Free Software Foundation; with no -@c Invariant Sections, with the Front-Cover texts being ``A GNU Manual,'' -@c and with the Back-Cover Texts as in (a) below. - -@c (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify -@c this GNU Manual, like GNU software. Copies published by the Free -@c Software Foundation raise funds for GNU development.'' -@c @end titlepage - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI -@chapter The @sc{gdb/mi} Interface - -@unnumberedsec Function and Purpose - -@cindex @sc{gdb/mi}, its purpose -@sc{gdb/mi} is a line based machine oriented text interface to @value{GDBN}. It is -specifically intended to support the development of systems which use -the debugger as just one small component of a larger system. - -This chapter is a specification of the @sc{gdb/mi} interface. It is written -in the form of a reference manual. - -Note that @sc{gdb/mi} is still under construction, so some of the -features described below are incomplete and subject to change. - -@unnumberedsec Notation and Terminology - -@cindex notational conventions, for @sc{gdb/mi} -This chapter uses the following notation: - -@itemize @bullet -@item -@code{|} separates two alternatives. - -@item -@code{[ @var{something} ]} indicates that @var{something} is optional: -it may or may not be given. - -@item -@code{( @var{group} )*} means that @var{group} inside the parentheses -may repeat zero or more times. - -@item -@code{( @var{group} )+} means that @var{group} inside the parentheses -may repeat one or more times. - -@item -@code{"@var{string}"} means a literal @var{string}. -@end itemize - -@ignore -@heading Dependencies -@end ignore - -@heading Acknowledgments - -In alphabetic order: Andrew Cagney, Fernando Nasser, Stan Shebs and -Elena Zannoni. - -@menu -* GDB/MI Command Syntax:: -* GDB/MI Compatibility with CLI:: -* GDB/MI Output Records:: -* GDB/MI Command Description Format:: -* GDB/MI Breakpoint Table Commands:: -* GDB/MI Data Manipulation:: -* GDB/MI Program Control:: -* GDB/MI Miscellaneous Commands:: -@ignore -* GDB/MI Kod Commands:: -* GDB/MI Memory Overlay Commands:: -* GDB/MI Signal Handling Commands:: -@end ignore -* GDB/MI Stack Manipulation:: -* GDB/MI Symbol Query:: -* GDB/MI Target Manipulation:: -* GDB/MI Thread Commands:: -* GDB/MI Tracepoint Commands:: -* GDB/MI Variable Objects:: -@end menu - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Command Syntax -@section @sc{gdb/mi} Command Syntax - -@menu -* GDB/MI Input Syntax:: -* GDB/MI Output Syntax:: -* GDB/MI Simple Examples:: -@end menu - -@node GDB/MI Input Syntax -@subsection @sc{gdb/mi} Input Syntax - -@cindex input syntax for @sc{gdb/mi} -@cindex @sc{gdb/mi}, input syntax -@table @code -@item @var{command} @expansion{} -@code{@var{cli-command} | @var{mi-command}} - -@item @var{cli-command} @expansion{} -@code{[ @var{token} ] @var{cli-command} @var{nl}}, where -@var{cli-command} is any existing @value{GDBN} CLI command. - -@item @var{mi-command} @expansion{} -@code{[ @var{token} ] "-" @var{operation} ( " " @var{option} )* -@code{[} " --" @code{]} ( " " @var{parameter} )* @var{nl}} - -@item @var{token} @expansion{} -"any sequence of digits" - -@item @var{option} @expansion{} -@code{"-" @var{parameter} [ " " @var{parameter} ]} - -@item @var{parameter} @expansion{} -@code{@var{non-blank-sequence} | @var{c-string}} - -@item @var{operation} @expansion{} -@emph{any of the operations described in this chapter} - -@item @var{non-blank-sequence} @expansion{} -@emph{anything, provided it doesn't contain special characters such as -"-", @var{nl}, """ and of course " "} - -@item @var{c-string} @expansion{} -@code{""" @var{seven-bit-iso-c-string-content} """} - -@item @var{nl} @expansion{} -@code{CR | CR-LF} -@end table - -@noindent -Notes: - -@itemize @bullet -@item -The CLI commands are still handled by the @sc{mi} interpreter; their -output is described below. - -@item -The @code{@var{token}}, when present, is passed back when the command -finishes. - -@item -Some @sc{mi} commands accept optional arguments as part of the parameter -list. Each option is identified by a leading @samp{-} (dash) and may be -followed by an optional argument parameter. Options occur first in the -parameter list and can be delimited from normal parameters using -@samp{--} (this is useful when some parameters begin with a dash). -@end itemize - -Pragmatics: - -@itemize @bullet -@item -We want easy access to the existing CLI syntax (for debugging). - -@item -We want it to be easy to spot a @sc{mi} operation. -@end itemize - -@node GDB/MI Output Syntax -@subsection @sc{gdb/mi} Output Syntax - -@cindex output syntax of @sc{gdb/mi} -@cindex @sc{gdb/mi}, output syntax -The output from @sc{gdb/mi} consists of zero or more out-of-band records -followed, optionally, by a single result record. This result record -is for the most recent command. The sequence of output records is -terminated by @samp{(@value{GDBP})}. - -If an input command was prefixed with a @code{@var{token}} then the -corresponding output for that command will also be prefixed by that same -@var{token}. - -@table @code -@item @var{output} @expansion{} -@code{( @var{out-of-band-record} )* [ @var{result-record} ] "(gdb)" @var{nl}} - -@item @var{result-record} @expansion{} -@code{ [ @var{token} ] "^" @var{result-class} ( "," @var{result} )* @var{nl}} - -@item @var{out-of-band-record} @expansion{} -@code{@var{async-record} | @var{stream-record}} - -@item @var{async-record} @expansion{} -@code{@var{exec-async-output} | @var{status-async-output} | @var{notify-async-output}} - -@item @var{exec-async-output} @expansion{} -@code{[ @var{token} ] "*" @var{async-output}} - -@item @var{status-async-output} @expansion{} -@code{[ @var{token} ] "+" @var{async-output}} - -@item @var{notify-async-output} @expansion{} -@code{[ @var{token} ] "=" @var{async-output}} - -@item @var{async-output} @expansion{} -@code{@var{async-class} ( "," @var{result} )* @var{nl}} - -@item @var{result-class} @expansion{} -@code{"done" | "running" | "connected" | "error" | "exit"} - -@item @var{async-class} @expansion{} -@code{"stopped" | @var{others}} (where @var{others} will be added -depending on the needs---this is still in development). - -@item @var{result} @expansion{} -@code{ @var{variable} "=" @var{value}} - -@item @var{variable} @expansion{} -@code{ @var{string} } - -@item @var{value} @expansion{} -@code{ @var{const} | @var{tuple} | @var{list} } - -@item @var{const} @expansion{} -@code{@var{c-string}} - -@item @var{tuple} @expansion{} -@code{ "@{@}" | "@{" @var{result} ( "," @var{result} )* "@}" } - -@item @var{list} @expansion{} -@code{ "[]" | "[" @var{value} ( "," @var{value} )* "]" | "[" -@var{result} ( "," @var{result} )* "]" } - -@item @var{stream-record} @expansion{} -@code{@var{console-stream-output} | @var{target-stream-output} | @var{log-stream-output}} - -@item @var{console-stream-output} @expansion{} -@code{"~" @var{c-string}} - -@item @var{target-stream-output} @expansion{} -@code{"@@" @var{c-string}} - -@item @var{log-stream-output} @expansion{} -@code{"&" @var{c-string}} - -@item @var{nl} @expansion{} -@code{CR | CR-LF} - -@item @var{token} @expansion{} -@emph{any sequence of digits}. -@end table - -@noindent -Notes: - -@itemize @bullet -@item -All output sequences end in a single line containing a period. - -@item -The @code{@var{token}} is from the corresponding request. If an execution -command is interrupted by the @samp{-exec-interrupt} command, the -@var{token} associated with the @samp{*stopped} message is the one of the -original execution command, not the one of the interrupt command. - -@item -@cindex status output in @sc{gdb/mi} -@var{status-async-output} contains on-going status information about the -progress of a slow operation. It can be discarded. All status output is -prefixed by @samp{+}. - -@item -@cindex async output in @sc{gdb/mi} -@var{exec-async-output} contains asynchronous state change on the target -(stopped, started, disappeared). All async output is prefixed by -@samp{*}. - -@item -@cindex notify output in @sc{gdb/mi} -@var{notify-async-output} contains supplementary information that the -client should handle (e.g., a new breakpoint information). All notify -output is prefixed by @samp{=}. - -@item -@cindex console output in @sc{gdb/mi} -@var{console-stream-output} is output that should be displayed as is in the -console. It is the textual response to a CLI command. All the console -output is prefixed by @samp{~}. - -@item -@cindex target output in @sc{gdb/mi} -@var{target-stream-output} is the output produced by the target program. -All the target output is prefixed by @samp{@@}. - -@item -@cindex log output in @sc{gdb/mi} -@var{log-stream-output} is output text coming from @value{GDBN}'s internals, for -instance messages that should be displayed as part of an error log. All -the log output is prefixed by @samp{&}. - -@item -@cindex list output in @sc{gdb/mi} -New @sc{gdb/mi} commands should only output @var{lists} containing -@var{values}. - - -@end itemize - -@xref{GDB/MI Stream Records, , @sc{gdb/mi} Stream Records}, for more -details about the various output records. - -@node GDB/MI Simple Examples -@subsection Simple Examples of @sc{gdb/mi} Interaction -@cindex @sc{gdb/mi}, simple examples - -This subsection presents several simple examples of interaction using -the @sc{gdb/mi} interface. In these examples, @samp{->} means that the -following line is passed to @sc{gdb/mi} as input, while @samp{<-} means -the output received from @sc{gdb/mi}. - -@subsubheading Target Stop -@c Ummm... There is no "-stop" command. This assumes async, no? -Here's an example of stopping the inferior process: - -@example --> -stop -<- (@value{GDBP}) -@end example - -@noindent -and later: - -@example -<- *stop,reason="stop",address="0x123",source="a.c:123" -<- (@value{GDBP}) -@end example - -@subsubheading Simple CLI Command - -Here's an example of a simple CLI command being passed through -@sc{gdb/mi} and on to the CLI. - -@example --> print 1+2 -<- &"print 1+2\n" -<- ~"$1 = 3\n" -<- ^done -<- (@value{GDBP}) -@end example - -@subsubheading Command With Side Effects - -@example --> -symbol-file xyz.exe -<- *breakpoint,nr="3",address="0x123",source="a.c:123" -<- (@value{GDBP}) -@end example - -@subsubheading A Bad Command - -Here's what happens if you pass a non-existent command: - -@example --> -rubbish -<- ^error,msg="Undefined MI command: rubbish" -<- (@value{GDBP}) -@end example - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Compatibility with CLI -@section @sc{gdb/mi} Compatibility with CLI - -@cindex compatibility, @sc{gdb/mi} and CLI -@cindex @sc{gdb/mi}, compatibility with CLI -To help users familiar with @value{GDBN}'s existing CLI interface, @sc{gdb/mi} -accepts existing CLI commands. As specified by the syntax, such -commands can be directly entered into the @sc{gdb/mi} interface and @value{GDBN} will -respond. - -This mechanism is provided as an aid to developers of @sc{gdb/mi} -clients and not as a reliable interface into the CLI. Since the command -is being interpreteted in an environment that assumes @sc{gdb/mi} -behaviour, the exact output of such commands is likely to end up being -an un-supported hybrid of @sc{gdb/mi} and CLI output. - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Output Records -@section @sc{gdb/mi} Output Records - -@menu -* GDB/MI Result Records:: -* GDB/MI Stream Records:: -* GDB/MI Out-of-band Records:: -@end menu - -@node GDB/MI Result Records -@subsection @sc{gdb/mi} Result Records - -@cindex result records in @sc{gdb/mi} -@cindex @sc{gdb/mi}, result records -In addition to a number of out-of-band notifications, the response to a -@sc{gdb/mi} command includes one of the following result indications: - -@table @code -@findex ^done -@item "^done" [ "," @var{results} ] -The synchronous operation was successful, @code{@var{results}} are the return -values. - -@item "^running" -@findex ^running -@c Is this one correct? Should it be an out-of-band notification? -The asynchronous operation was successfully started. The target is -running. - -@item "^error" "," @var{c-string} -@findex ^error -The operation failed. The @code{@var{c-string}} contains the corresponding -error message. -@end table - -@node GDB/MI Stream Records -@subsection @sc{gdb/mi} Stream Records - -@cindex @sc{gdb/mi}, stream records -@cindex stream records in @sc{gdb/mi} -@value{GDBN} internally maintains a number of output streams: the console, the -target, and the log. The output intended for each of these streams is -funneled through the @sc{gdb/mi} interface using @dfn{stream records}. - -Each stream record begins with a unique @dfn{prefix character} which -identifies its stream (@pxref{GDB/MI Output Syntax, , @sc{gdb/mi} Output -Syntax}). In addition to the prefix, each stream record contains a -@code{@var{string-output}}. This is either raw text (with an implicit new -line) or a quoted C string (which does not contain an implicit newline). - -@table @code -@item "~" @var{string-output} -The console output stream contains text that should be displayed in the -CLI console window. It contains the textual responses to CLI commands. - -@item "@@" @var{string-output} -The target output stream contains any textual output from the running -target. - -@item "&" @var{string-output} -The log stream contains debugging messages being produced by @value{GDBN}'s -internals. -@end table - -@node GDB/MI Out-of-band Records -@subsection @sc{gdb/mi} Out-of-band Records - -@cindex out-of-band records in @sc{gdb/mi} -@cindex @sc{gdb/mi}, out-of-band records -@dfn{Out-of-band} records are used to notify the @sc{gdb/mi} client of -additional changes that have occurred. Those changes can either be a -consequence of @sc{gdb/mi} (e.g., a breakpoint modified) or a result of -target activity (e.g., target stopped). - -The following is a preliminary list of possible out-of-band records. - -@table @code -@item "*" "stop" -@end table - - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Command Description Format -@section @sc{gdb/mi} Command Description Format - -The remaining sections describe blocks of commands. Each block of -commands is laid out in a fashion similar to this section. - -Note the the line breaks shown in the examples are here only for -readability. They don't appear in the real output. -Also note that the commands with a non-available example (N.A.@:) are -not yet implemented. - -@subheading Motivation - -The motivation for this collection of commands. - -@subheading Introduction - -A brief introduction to this collection of commands as a whole. - -@subheading Commands - -For each command in the block, the following is described: - -@subsubheading Synopsis - -@example - -command @var{args}@dots{} -@end example - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} CLI command. - -@subsubheading Result - -@subsubheading Out-of-band - -@subsubheading Notes - -@subsubheading Example - - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Breakpoint Table Commands -@section @sc{gdb/mi} Breakpoint table commands - -@cindex breakpoint commands for @sc{gdb/mi} -@cindex @sc{gdb/mi}, breakpoint commands -This section documents @sc{gdb/mi} commands for manipulating -breakpoints. - -@subheading The @code{-break-after} Command -@findex -break-after - -@subsubheading Synopsis - -@example - -break-after @var{number} @var{count} -@end example - -The breakpoint number @var{number} is not in effect until it has been -hit @var{count} times. To see how this is reflected in the output of -the @samp{-break-list} command, see the description of the -@samp{-break-list} command below. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{ignore}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --break-insert main -^done,bkpt=@{number="1",addr="0x000100d0",file="hello.c",line="5"@} -(@value{GDBP}) --break-after 1 3 -~ -^done -(@value{GDBP}) --break-list -^done,BreakpointTable=@{nr_rows="1",nr_cols="6", -hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, -@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, -@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, -@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, -@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, -@{width="40",alignment="2",col_name="what",colhdr="What"@}], -body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", -addr="0x000100d0",func="main",file="hello.c",line="5",times="0", -ignore="3"@}]@} -(@value{GDBP}) -@end smallexample - -@ignore -@subheading The @code{-break-catch} Command -@findex -break-catch - -@subheading The @code{-break-commands} Command -@findex -break-commands -@end ignore - - -@subheading The @code{-break-condition} Command -@findex -break-condition - -@subsubheading Synopsis - -@example - -break-condition @var{number} @var{expr} -@end example - -Breakpoint @var{number} will stop the program only if the condition in -@var{expr} is true. The condition becomes part of the -@samp{-break-list} output (see the description of the @samp{-break-list} -command below). - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{condition}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --break-condition 1 1 -^done -(@value{GDBP}) --break-list -^done,BreakpointTable=@{nr_rows="1",nr_cols="6", -hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, -@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, -@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, -@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, -@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, -@{width="40",alignment="2",col_name="what",colhdr="What"@}], -body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", -addr="0x000100d0",func="main",file="hello.c",line="5",cond="1", -times="0",ignore="3"@}]@} -(@value{GDBP}) -@end smallexample - -@subheading The @code{-break-delete} Command -@findex -break-delete - -@subsubheading Synopsis - -@example - -break-delete ( @var{breakpoint} )+ -@end example - -Delete the breakpoint(s) whose number(s) are specified in the argument -list. This is obviously reflected in the breakpoint list. - -@subsubheading @value{GDBN} command - -The corresponding @value{GDBN} command is @samp{delete}. - -@subsubheading Example - -@example -(@value{GDBP}) --break-delete 1 -^done -(@value{GDBP}) --break-list -^done,BreakpointTable=@{nr_rows="0",nr_cols="6", -hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, -@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, -@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, -@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, -@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, -@{width="40",alignment="2",col_name="what",colhdr="What"@}], -body=[]@} -(@value{GDBP}) -@end example - -@subheading The @code{-break-disable} Command -@findex -break-disable - -@subsubheading Synopsis - -@example - -break-disable ( @var{breakpoint} )+ -@end example - -Disable the named @var{breakpoint}(s). The field @samp{enabled} in the -break list is now set to @samp{n} for the named @var{breakpoint}(s). - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{disable}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --break-disable 2 -^done -(@value{GDBP}) --break-list -^done,BreakpointTable=@{nr_rows="1",nr_cols="6", -hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, -@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, -@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, -@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, -@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, -@{width="40",alignment="2",col_name="what",colhdr="What"@}], -body=[bkpt=@{number="2",type="breakpoint",disp="keep",enabled="n", -addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}]@} -(@value{GDBP}) -@end smallexample - -@subheading The @code{-break-enable} Command -@findex -break-enable - -@subsubheading Synopsis - -@example - -break-enable ( @var{breakpoint} )+ -@end example - -Enable (previously disabled) @var{breakpoint}(s). - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{enable}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --break-enable 2 -^done -(@value{GDBP}) --break-list -^done,BreakpointTable=@{nr_rows="1",nr_cols="6", -hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, -@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, -@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, -@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, -@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, -@{width="40",alignment="2",col_name="what",colhdr="What"@}], -body=[bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y", -addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}]@} -(@value{GDBP}) -@end smallexample - -@subheading The @code{-break-info} Command -@findex -break-info - -@subsubheading Synopsis - -@example - -break-info @var{breakpoint} -@end example - -@c REDUNDANT??? -Get information about a single breakpoint. - -@subsubheading @value{GDBN} command - -The corresponding @value{GDBN} command is @samp{info break @var{breakpoint}}. - -@subsubheading Example -N.A. - -@subheading The @code{-break-insert} Command -@findex -break-insert - -@subsubheading Synopsis - -@example - -break-insert [ -t ] [ -h ] [ -r ] - [ -c @var{condition} ] [ -i @var{ignore-count} ] - [ -p @var{thread} ] [ @var{line} | @var{addr} ] -@end example - -@noindent -If specified, @var{line}, can be one of: - -@itemize @bullet -@item function -@c @item +offset -@c @item -offset -@c @item linenum -@item filename:linenum -@item filename:function -@item *address -@end itemize - -The possible optional parameters of this command are: - -@table @samp -@item -t -Insert a tempoary breakpoint. -@item -h -Insert a hardware breakpoint. -@item -c @var{condition} -Make the breakpoint conditional on @var{condition}. -@item -i @var{ignore-count} -Initialize the @var{ignore-count}. -@item -r -Insert a regular breakpoint in all the functions whose names match the -given regular expression. Other flags are not applicable to regular -expresson. -@end table - -@subsubheading Result - -The result is in the form: - -@example - ^done,bkptno="@var{number}",func="@var{funcname}", - file="@var{filename}",line="@var{lineno}" -@end example - -@noindent -where @var{number} is the @value{GDBN} number for this breakpoint, @var{funcname} -is the name of the function where the breakpoint was inserted, -@var{filename} is the name of the source file which contains this -function, and @var{lineno} is the source line number within that file. - -Note: this format is open to change. -@c An out-of-band breakpoint instead of part of the result? - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} commands are @samp{break}, @samp{tbreak}, -@samp{hbreak}, @samp{thbreak}, and @samp{rbreak}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --break-insert main -^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@} -(@value{GDBP}) --break-insert -t foo -^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",line="11"@} -(@value{GDBP}) --break-list -^done,BreakpointTable=@{nr_rows="2",nr_cols="6", -hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, -@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, -@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, -@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, -@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, -@{width="40",alignment="2",col_name="what",colhdr="What"@}], -body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", -addr="0x0001072c", func="main",file="recursive2.c",line="4",times="0"@}, -bkpt=@{number="2",type="breakpoint",disp="del",enabled="y", -addr="0x00010774",func="foo",file="recursive2.c",line="11",times="0"@}]@} -(@value{GDBP}) --break-insert -r foo.* -~int foo(int, int); -^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c",line="11"@} -(@value{GDBP}) -@end smallexample - -@subheading The @code{-break-list} Command -@findex -break-list - -@subsubheading Synopsis - -@example - -break-list -@end example - -Displays the list of inserted breakpoints, showing the following fields: - -@table @samp -@item Number -number of the breakpoint -@item Type -type of the breakpoint: @samp{breakpoint} or @samp{watchpoint} -@item Disposition -should the breakpoint be deleted or disabled when it is hit: @samp{keep} -or @samp{nokeep} -@item Enabled -is the breakpoint enabled or no: @samp{y} or @samp{n} -@item Address -memory location at which the breakpoint is set -@item What -logical location of the breakpoint, expressed by function name, file -name, line number -@item Times -number of times the breakpoint has been hit -@end table - -If there are no breakpoints or watchpoints, the @code{BreakpointTable} -@code{body} field is an empty list. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{info break}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --break-list -^done,BreakpointTable=@{nr_rows="2",nr_cols="6", -hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, -@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, -@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, -@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, -@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, -@{width="40",alignment="2",col_name="what",colhdr="What"@}], -body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", -addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}, -bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y", -addr="0x00010114",func="foo",file="hello.c",line="13",times="0"@}]@} -(@value{GDBP}) -@end smallexample - -Here's an example of the result when there are no breakpoints: - -@smallexample -(@value{GDBP}) --break-list -^done,BreakpointTable=@{nr_rows="0",nr_cols="6", -hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, -@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, -@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, -@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, -@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, -@{width="40",alignment="2",col_name="what",colhdr="What"@}], -body=[]@} -(@value{GDBP}) -@end smallexample - -@subheading The @code{-break-watch} Command -@findex -break-watch - -@subsubheading Synopsis - -@example - -break-watch [ -a | -r ] -@end example - -Create a watchpoint. With the @samp{-a} option it will create an -@dfn{access} watchpoint, i.e. a watchpoint that triggers either on a -read from or on a write to the memory location. With the @samp{-r} -option, the watchpoint created is a @dfn{read} watchpoint, i.e. it will -trigger only when the memory location is accessed for reading. Without -either of the options, the watchpoint created is a regular watchpoint, -i.e. it will trigger when the memory location is accessed for writing. -@xref{Set Watchpoints, , Setting watchpoints}. - -Note that @samp{-break-list} will report a single list of watchpoints and -breakpoints inserted. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} commands are @samp{watch}, @samp{awatch}, and -@samp{rwatch}. - -@subsubheading Example - -Setting a watchpoint on a variable in the @code{main} function: - -@smallexample -(@value{GDBP}) --break-watch x -^done,wpt=@{number="2",exp="x"@} -(@value{GDBP}) --exec-continue -^running -^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@}, -value=@{old="-268439212",new="55"@}, -frame=@{func="main",args=[],file="recursive2.c",line="5"@} -(@value{GDBP}) -@end smallexample - -Setting a watchpoint on a variable local to a function. @value{GDBN} will stop -the program execution twice: first for the variable changing value, then -for the watchpoint going out of scope. - -@smallexample -(@value{GDBP}) --break-watch C -^done,wpt=@{number="5",exp="C"@} -(@value{GDBP}) --exec-continue -^running -^done,reason="watchpoint-trigger", -wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@}, -frame=@{func="callee4",args=[], -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@} -(@value{GDBP}) --exec-continue -^running -^done,reason="watchpoint-scope",wpnum="5", -frame=@{func="callee3",args=[@{name="strarg", -value="0x11940 \"A string argument.\""@}], -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@} -(@value{GDBP}) -@end smallexample - -Listing breakpoints and watchpoints, at different points in the program -execution. Note that once the watchpoint goes out of scope, it is -deleted. - -@smallexample -(@value{GDBP}) --break-watch C -^done,wpt=@{number="2",exp="C"@} -(@value{GDBP}) --break-list -^done,BreakpointTable=@{nr_rows="2",nr_cols="6", -hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, -@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, -@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, -@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, -@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, -@{width="40",alignment="2",col_name="what",colhdr="What"@}], -body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", -addr="0x00010734",func="callee4", -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@}, -bkpt=@{number="2",type="watchpoint",disp="keep", -enabled="y",addr="",what="C",times="0"@}]@} -(@value{GDBP}) --exec-continue -^running -^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@}, -value=@{old="-276895068",new="3"@}, -frame=@{func="callee4",args=[], -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@} -(@value{GDBP}) --break-list -^done,BreakpointTable=@{nr_rows="2",nr_cols="6", -hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, -@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, -@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, -@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, -@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, -@{width="40",alignment="2",col_name="what",colhdr="What"@}], -body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", -addr="0x00010734",func="callee4", -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@}, -bkpt=@{number="2",type="watchpoint",disp="keep", -enabled="y",addr="",what="C",times="-5"@}]@} -(@value{GDBP}) --exec-continue -^running -^done,reason="watchpoint-scope",wpnum="2", -frame=@{func="callee3",args=[@{name="strarg", -value="0x11940 \"A string argument.\""@}], -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@} -(@value{GDBP}) --break-list -^done,BreakpointTable=@{nr_rows="1",nr_cols="6", -hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@}, -@{width="14",alignment="-1",col_name="type",colhdr="Type"@}, -@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@}, -@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@}, -@{width="10",alignment="-1",col_name="addr",colhdr="Address"@}, -@{width="40",alignment="2",col_name="what",colhdr="What"@}], -body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", -addr="0x00010734",func="callee4", -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@}]@} -(@value{GDBP}) -@end smallexample - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Data Manipulation -@section @sc{gdb/mi} Data Manipulation - -@cindex data manipulation, in @sc{gdb/mi} -@cindex @sc{gdb/mi}, data manipulation -This section describes the @sc{gdb/mi} commands that manipulate data: -examine memory and registers, evaluate expressions, etc. - -@c REMOVED FROM THE INTERFACE. -@c @subheading -data-assign -@c Change the value of a program variable. Plenty of side effects. -@c @subsubheading GDB command -@c set variable -@c @subsubheading Example -@c N.A. - -@subheading The @code{-data-disassemble} Command -@findex -data-disassemble - -@subsubheading Synopsis - -@example - -data-disassemble - [ -s @var{start-addr} -e @var{end-addr} ] - | [ -f @var{filename} -l @var{linenum} [ -n @var{lines} ] ] - -- @var{mode} -@end example - -@noindent -Where: - -@table @samp -@item @var{start-addr} -is the beginning address (or @code{$pc}) -@item @var{end-addr} -is the end address -@item @var{filename} -is the name of the file to disassemble -@item @var{linenum} -is the line number to disassemble around -@item @var{lines} -is the the number of disassembly lines to be produced. If it is -1, -the whole function will be disassembled, in case no @var{end-addr} is -specified. If @var{end-addr} is specified as a non-zero value, and -@var{lines} is lower than the number of disassembly lines between -@var{start-addr} and @var{end-addr}, only @var{lines} lines are -displayed; if @var{lines} is higher than the number of lines between -@var{start-addr} and @var{end-addr}, only the lines up to @var{end-addr} -are displayed. -@item @var{mode} -is either 0 (meaning only disassembly) or 1 (meaning mixed source and -disassembly). -@end table - -@subsubheading Result - -The output for each instruction is composed of four fields: - -@itemize @bullet -@item Address -@item Func-name -@item Offset -@item Instruction -@end itemize - -Note that whatever included in the instruction field, is not manipulated -directely by @sc{gdb/mi}, i.e. it is not possible to adjust its format. - -@subsubheading @value{GDBN} Command - -There's no direct mapping from this command to the CLI. - -@subsubheading Example - -Disassemble from the current value of @code{$pc} to @code{$pc + 20}: - -@smallexample -(@value{GDBP}) --data-disassemble -s $pc -e "$pc + 20" -- 0 -^done, -asm_insns=[ -@{address="0x000107c0",func-name="main",offset="4", -inst="mov 2, %o0"@}, -@{address="0x000107c4",func-name="main",offset="8", -inst="sethi %hi(0x11800), %o2"@}, -@{address="0x000107c8",func-name="main",offset="12", -inst="or %o2, 0x140, %o1\t! 0x11940 <_lib_version+8>"@}, -@{address="0x000107cc",func-name="main",offset="16", -inst="sethi %hi(0x11800), %o2"@}, -@{address="0x000107d0",func-name="main",offset="20", -inst="or %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"@}] -(@value{GDBP}) -@end smallexample - -Disassemble the whole @code{main} function. Line 32 is part of -@code{main}. - -@smallexample --data-disassemble -f basics.c -l 32 -- 0 -^done,asm_insns=[ -@{address="0x000107bc",func-name="main",offset="0", -inst="save %sp, -112, %sp"@}, -@{address="0x000107c0",func-name="main",offset="4", -inst="mov 2, %o0"@}, -@{address="0x000107c4",func-name="main",offset="8", -inst="sethi %hi(0x11800), %o2"@}, -[@dots{}] -@{address="0x0001081c",func-name="main",offset="96",inst="ret "@}, -@{address="0x00010820",func-name="main",offset="100",inst="restore "@}] -(@value{GDBP}) -@end smallexample - -Disassemble 3 instructions from the start of @code{main}: - -@smallexample -(@value{GDBP}) --data-disassemble -f basics.c -l 32 -n 3 -- 0 -^done,asm_insns=[ -@{address="0x000107bc",func-name="main",offset="0", -inst="save %sp, -112, %sp"@}, -@{address="0x000107c0",func-name="main",offset="4", -inst="mov 2, %o0"@}, -@{address="0x000107c4",func-name="main",offset="8", -inst="sethi %hi(0x11800), %o2"@}] -(@value{GDBP}) -@end smallexample - -Disassemble 3 instructions from the start of @code{main} in mixed mode: - -@smallexample -(@value{GDBP}) --data-disassemble -f basics.c -l 32 -n 3 -- 1 -^done,asm_insns=[ -src_and_asm_line=@{line="31", -file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \ - testsuite/gdb.mi/basics.c",line_asm_insn=[ -@{address="0x000107bc",func-name="main",offset="0", -inst="save %sp, -112, %sp"@}]@}, -src_and_asm_line=@{line="32", -file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \ - testsuite/gdb.mi/basics.c",line_asm_insn=[ -@{address="0x000107c0",func-name="main",offset="4", -inst="mov 2, %o0"@}, -@{address="0x000107c4",func-name="main",offset="8", -inst="sethi %hi(0x11800), %o2"@}]@}] -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-data-evaluate-expression} Command -@findex -data-evaluate-expression - -@subsubheading Synopsis - -@example - -data-evaluate-expression @var{expr} -@end example - -Evaluate @var{expr} as an expression. The expression could contain an -inferior function call. The function call will execute synchronously. -If the expression contains spaces, it must be enclosed in double quotes. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} commands are @samp{print}, @samp{output}, and -@samp{call}. In @code{gdbtk} only, there's a corresponding -@samp{gdb_eval} command. - -@subsubheading Example - -In the following example, the numbers that precede the commands are the -@dfn{tokens} described in @ref{GDB/MI Command Syntax, ,@sc{gdb/mi} -Command Syntax}. Notice how @sc{gdb/mi} returns the same tokens in its -output. - -@smallexample -211-data-evaluate-expression A -211^done,value="1" -(@value{GDBP}) -311-data-evaluate-expression &A -311^done,value="0xefffeb7c" -(@value{GDBP}) -411-data-evaluate-expression A+3 -411^done,value="4" -(@value{GDBP}) -511-data-evaluate-expression "A + 3" -511^done,value="4" -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-data-list-changed-registers} Command -@findex -data-list-changed-registers - -@subsubheading Synopsis - -@example - -data-list-changed-registers -@end example - -Display a list of the registers that have changed. - -@subsubheading @value{GDBN} Command - -@value{GDBN} doesn't have a direct analog for this command; @code{gdbtk} -has the corresponding command @samp{gdb_changed_register_list}. - -@subsubheading Example - -On a PPC MBX board: - -@smallexample -(@value{GDBP}) --exec-continue -^running - -(@value{GDBP}) -*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main", -args=[],file="try.c",line="5"@} -(@value{GDBP}) --data-list-changed-registers -^done,changed-registers=["0","1","2","4","5","6","7","8","9", -"10","11","13","14","15","16","17","18","19","20","21","22","23", -"24","25","26","27","28","30","31","64","65","66","67","69"] -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-data-list-register-names} Command -@findex -data-list-register-names - -@subsubheading Synopsis - -@example - -data-list-register-names [ ( @var{regno} )+ ] -@end example - -Show a list of register names for the current target. If no arguments -are given, it shows a list of the names of all the registers. If -integer numbers are given as arguments, it will print a list of the -names of the registers corresponding to the arguments. To ensure -consistency between a register name and its number, the output list may -include empty register names. - -@subsubheading @value{GDBN} Command - -@value{GDBN} does not have a command which corresponds to -@samp{-data-list-register-names}. In @code{gdbtk} there is a -corresponding command @samp{gdb_regnames}. - -@subsubheading Example - -For the PPC MBX board: -@smallexample -(@value{GDBP}) --data-list-register-names -^done,register-names=["r0","r1","r2","r3","r4","r5","r6","r7", -"r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18", -"r19","r20","r21","r22","r23","r24","r25","r26","r27","r28","r29", -"r30","r31","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9", -"f10","f11","f12","f13","f14","f15","f16","f17","f18","f19","f20", -"f21","f22","f23","f24","f25","f26","f27","f28","f29","f30","f31", -"", "pc","ps","cr","lr","ctr","xer"] -(@value{GDBP}) --data-list-register-names 1 2 3 -^done,register-names=["r1","r2","r3"] -(@value{GDBP}) -@end smallexample - -@subheading The @code{-data-list-register-values} Command -@findex -data-list-register-values - -@subsubheading Synopsis - -@example - -data-list-register-values @var{fmt} [ ( @var{regno} )*] -@end example - -Display the registers' contents. @var{fmt} is the format according to -which the registers' contents are to be returned, followed by an optional -list of numbers specifying the registers to display. A missing list of -numbers indicates that the contents of all the registers must be returned. - -Allowed formats for @var{fmt} are: - -@table @code -@item x -Hexadecimal -@item o -Octal -@item t -Binary -@item d -Decimal -@item r -Raw -@item N -Natural -@end table - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} commands are @samp{info reg}, @samp{info -all-reg}, and (in @code{gdbtk}) @samp{gdb_fetch_registers}. - -@subsubheading Example - -For a PPC MBX board (note: line breaks are for readability only, they -don't appear in the actual output): - -@smallexample -(@value{GDBP}) --data-list-register-values r 64 65 -^done,register-values=[@{number="64",value="0xfe00a300"@}, -@{number="65",value="0x00029002"@}] -(@value{GDBP}) --data-list-register-values x -^done,register-values=[@{number="0",value="0xfe0043c8"@}, -@{number="1",value="0x3fff88"@},@{number="2",value="0xfffffffe"@}, -@{number="3",value="0x0"@},@{number="4",value="0xa"@}, -@{number="5",value="0x3fff68"@},@{number="6",value="0x3fff58"@}, -@{number="7",value="0xfe011e98"@},@{number="8",value="0x2"@}, -@{number="9",value="0xfa202820"@},@{number="10",value="0xfa202808"@}, -@{number="11",value="0x1"@},@{number="12",value="0x0"@}, -@{number="13",value="0x4544"@},@{number="14",value="0xffdfffff"@}, -@{number="15",value="0xffffffff"@},@{number="16",value="0xfffffeff"@}, -@{number="17",value="0xefffffed"@},@{number="18",value="0xfffffffe"@}, -@{number="19",value="0xffffffff"@},@{number="20",value="0xffffffff"@}, -@{number="21",value="0xffffffff"@},@{number="22",value="0xfffffff7"@}, -@{number="23",value="0xffffffff"@},@{number="24",value="0xffffffff"@}, -@{number="25",value="0xffffffff"@},@{number="26",value="0xfffffffb"@}, -@{number="27",value="0xffffffff"@},@{number="28",value="0xf7bfffff"@}, -@{number="29",value="0x0"@},@{number="30",value="0xfe010000"@}, -@{number="31",value="0x0"@},@{number="32",value="0x0"@}, -@{number="33",value="0x0"@},@{number="34",value="0x0"@}, -@{number="35",value="0x0"@},@{number="36",value="0x0"@}, -@{number="37",value="0x0"@},@{number="38",value="0x0"@}, -@{number="39",value="0x0"@},@{number="40",value="0x0"@}, -@{number="41",value="0x0"@},@{number="42",value="0x0"@}, -@{number="43",value="0x0"@},@{number="44",value="0x0"@}, -@{number="45",value="0x0"@},@{number="46",value="0x0"@}, -@{number="47",value="0x0"@},@{number="48",value="0x0"@}, -@{number="49",value="0x0"@},@{number="50",value="0x0"@}, -@{number="51",value="0x0"@},@{number="52",value="0x0"@}, -@{number="53",value="0x0"@},@{number="54",value="0x0"@}, -@{number="55",value="0x0"@},@{number="56",value="0x0"@}, -@{number="57",value="0x0"@},@{number="58",value="0x0"@}, -@{number="59",value="0x0"@},@{number="60",value="0x0"@}, -@{number="61",value="0x0"@},@{number="62",value="0x0"@}, -@{number="63",value="0x0"@},@{number="64",value="0xfe00a300"@}, -@{number="65",value="0x29002"@},@{number="66",value="0x202f04b5"@}, -@{number="67",value="0xfe0043b0"@},@{number="68",value="0xfe00b3e4"@}, -@{number="69",value="0x20002b03"@}] -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-data-read-memory} Command -@findex -data-read-memory - -@subsubheading Synopsis - -@example - -data-read-memory [ -o @var{byte-offset} ] - @var{address} @var{word-format} @var{word-size} - @var{nr-rows} @var{nr-cols} [ @var{aschar} ] -@end example - -@noindent -where: - -@table @samp -@item @var{address} -An expression specifying the address of the first memory word to be -read. Complex expressions containing embedded white space should be -quoted using the C convention. - -@item @var{word-format} -The format to be used to print the memory words. The notation is the -same as for @value{GDBN}'s @code{print} command (@pxref{Output Formats, -,Output formats}). - -@item @var{word-size} -The size of each memory word in bytes. - -@item @var{nr-rows} -The number of rows in the output table. - -@item @var{nr-cols} -The number of columns in the output table. - -@item @var{aschar} -If present, indicates that each row should include an @sc{ascii} dump. The -value of @var{aschar} is used as a padding character when a byte is not a -member of the printable @sc{ascii} character set (printable @sc{ascii} -characters are those whose code is between 32 and 126, inclusively). - -@item @var{byte-offset} -An offset to add to the @var{address} before fetching memory. -@end table - -This command displays memory contents as a table of @var{nr-rows} by -@var{nr-cols} words, each word being @var{word-size} bytes. In total, -@code{@var{nr-rows} * @var{nr-cols} * @var{word-size}} bytes are read -(returned as @samp{total-bytes}). Should less than the requested number -of bytes be returned by the target, the missing words are identified -using @samp{N/A}. The number of bytes read from the target is returned -in @samp{nr-bytes} and the starting address used to read memory in -@samp{addr}. - -The address of the next/previous row or page is available in -@samp{next-row} and @samp{prev-row}, @samp{next-page} and -@samp{prev-page}. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{x}. @code{gdbtk} has -@samp{gdb_get_mem} memory read command. - -@subsubheading Example - -Read six bytes of memory starting at @code{bytes+6} but then offset by -@code{-6} bytes. Format as three rows of two columns. One byte per -word. Display each word in hex. - -@smallexample -(@value{GDBP}) -9-data-read-memory -o -6 -- bytes+6 x 1 3 2 -9^done,addr="0x00001390",nr-bytes="6",total-bytes="6", -next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396", -prev-page="0x0000138a",memory=[ -@{addr="0x00001390",data=["0x00","0x01"]@}, -@{addr="0x00001392",data=["0x02","0x03"]@}, -@{addr="0x00001394",data=["0x04","0x05"]@}] -(@value{GDBP}) -@end smallexample - -Read two bytes of memory starting at address @code{shorts + 64} and -display as a single word formatted in decimal. - -@smallexample -(@value{GDBP}) -5-data-read-memory shorts+64 d 2 1 1 -5^done,addr="0x00001510",nr-bytes="2",total-bytes="2", -next-row="0x00001512",prev-row="0x0000150e", -next-page="0x00001512",prev-page="0x0000150e",memory=[ -@{addr="0x00001510",data=["128"]@}] -(@value{GDBP}) -@end smallexample - -Read thirty two bytes of memory starting at @code{bytes+16} and format -as eight rows of four columns. Include a string encoding with @samp{x} -used as the non-printable character. - -@smallexample -(@value{GDBP}) -4-data-read-memory bytes+16 x 1 8 4 x -4^done,addr="0x000013a0",nr-bytes="32",total-bytes="32", -next-row="0x000013c0",prev-row="0x0000139c", -next-page="0x000013c0",prev-page="0x00001380",memory=[ -@{addr="0x000013a0",data=["0x10","0x11","0x12","0x13"],ascii="xxxx"@}, -@{addr="0x000013a4",data=["0x14","0x15","0x16","0x17"],ascii="xxxx"@}, -@{addr="0x000013a8",data=["0x18","0x19","0x1a","0x1b"],ascii="xxxx"@}, -@{addr="0x000013ac",data=["0x1c","0x1d","0x1e","0x1f"],ascii="xxxx"@}, -@{addr="0x000013b0",data=["0x20","0x21","0x22","0x23"],ascii=" !\"#"@}, -@{addr="0x000013b4",data=["0x24","0x25","0x26","0x27"],ascii="$%&'"@}, -@{addr="0x000013b8",data=["0x28","0x29","0x2a","0x2b"],ascii="()*+"@}, -@{addr="0x000013bc",data=["0x2c","0x2d","0x2e","0x2f"],ascii=",-./"@}] -(@value{GDBP}) -@end smallexample - -@subheading The @code{-display-delete} Command -@findex -display-delete - -@subsubheading Synopsis - -@example - -display-delete @var{number} -@end example - -Delete the display @var{number}. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{delete display}. - -@subsubheading Example -N.A. - - -@subheading The @code{-display-disable} Command -@findex -display-disable - -@subsubheading Synopsis - -@example - -display-disable @var{number} -@end example - -Disable display @var{number}. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{disable display}. - -@subsubheading Example -N.A. - - -@subheading The @code{-display-enable} Command -@findex -display-enable - -@subsubheading Synopsis - -@example - -display-enable @var{number} -@end example - -Enable display @var{number}. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{enable display}. - -@subsubheading Example -N.A. - - -@subheading The @code{-display-insert} Command -@findex -display-insert - -@subsubheading Synopsis - -@example - -display-insert @var{expression} -@end example - -Display @var{expression} every time the program stops. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{display}. - -@subsubheading Example -N.A. - - -@subheading The @code{-display-list} Command -@findex -display-list - -@subsubheading Synopsis - -@example - -display-list -@end example - -List the displays. Do not show the current values. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{info display}. - -@subsubheading Example -N.A. - - -@subheading The @code{-environment-cd} Command -@findex -environment-cd - -@subsubheading Synopsis - -@example - -environment-cd @var{pathdir} -@end example - -Set @value{GDBN}'s working directory. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{cd}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb -^done -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-environment-directory} Command -@findex -environment-directory - -@subsubheading Synopsis - -@example - -environment-directory [ -r ] [ @var{pathdir} ]+ -@end example - -Add directories @var{pathdir} to beginning of search path for source files. -If the @samp{-r} option is used, the search path is reset to the default -search path. If directories @var{pathdir} are supplied in addition to the -@samp{-r} option, the search path is first reset and then addition -occurs as normal. -Multiple directories may be specified, separated by blanks. Specifying -multiple directories in a single command -results in the directories added to the beginning of the -search path in the same order they were presented in the command. -If blanks are needed as -part of a directory name, double-quotes should be used around -the name. In the command output, the path will show up separated -by the system directory-separator character. The directory-seperator -character must not be used -in any directory name. -If no directories are specified, the current search path is displayed. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{dir}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb -^done,source-path="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd" -(@value{GDBP}) --environment-directory "" -^done,source-path="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd" -(@value{GDBP}) --environment-directory -r /home/jjohnstn/src/gdb /usr/src -^done,source-path="/home/jjohnstn/src/gdb:/usr/src:$cdir:$cwd" -(@value{GDBP}) --environment-directory -r -^done,source-path="$cdir:$cwd" -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-environment-path} Command -@findex -environment-path - -@subsubheading Synopsis - -@example - -environment-path [ -r ] [ @var{pathdir} ]+ -@end example - -Add directories @var{pathdir} to beginning of search path for object files. -If the @samp{-r} option is used, the search path is reset to the original -search path that existed at gdb start-up. If directories @var{pathdir} are -supplied in addition to the -@samp{-r} option, the search path is first reset and then addition -occurs as normal. -Multiple directories may be specified, separated by blanks. Specifying -multiple directories in a single command -results in the directories added to the beginning of the -search path in the same order they were presented in the command. -If blanks are needed as -part of a directory name, double-quotes should be used around -the name. In the command output, the path will show up separated -by the system directory-separator character. The directory-seperator -character must not be used -in any directory name. -If no directories are specified, the current path is displayed. - - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{path}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --environment-path -^done,path="/usr/bin" -(@value{GDBP}) --environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb /bin -^done,path="/kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb:/bin:/usr/bin" -(@value{GDBP}) --environment-path -r /usr/local/bin -^done,path="/usr/local/bin:/usr/bin" -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-environment-pwd} Command -@findex -environment-pwd - -@subsubheading Synopsis - -@example - -environment-pwd -@end example - -Show the current working directory. - -@subsubheading @value{GDBN} command - -The corresponding @value{GDBN} command is @samp{pwd}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --environment-pwd -^done,cwd="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb" -(@value{GDBP}) -@end smallexample - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Program Control -@section @sc{gdb/mi} Program control - -@subsubheading Program termination - -As a result of execution, the inferior program can run to completion, if -it doesn't encounter any breakpoints. In this case the output will -include an exit code, if the program has exited exceptionally. - -@subsubheading Examples - -@noindent -Program exited normally: - -@smallexample -(@value{GDBP}) --exec-run -^running -(@value{GDBP}) -x = 55 -*stopped,reason="exited-normally" -(@value{GDBP}) -@end smallexample - -@noindent -Program exited exceptionally: - -@smallexample -(@value{GDBP}) --exec-run -^running -(@value{GDBP}) -x = 55 -*stopped,reason="exited",exit-code="01" -(@value{GDBP}) -@end smallexample - -Another way the program can terminate is if it receives a signal such as -@code{SIGINT}. In this case, @sc{gdb/mi} displays this: - -@smallexample -(@value{GDBP}) -*stopped,reason="exited-signalled",signal-name="SIGINT", -signal-meaning="Interrupt" -@end smallexample - - -@subheading The @code{-exec-abort} Command -@findex -exec-abort - -@subsubheading Synopsis - -@example - -exec-abort -@end example - -Kill the inferior running program. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{kill}. - -@subsubheading Example -N.A. - - -@subheading The @code{-exec-arguments} Command -@findex -exec-arguments - -@subsubheading Synopsis - -@example - -exec-arguments @var{args} -@end example - -Set the inferior program arguments, to be used in the next -@samp{-exec-run}. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{set args}. - -@subsubheading Example - -@c FIXME! -Don't have one around. - - -@subheading The @code{-exec-continue} Command -@findex -exec-continue - -@subsubheading Synopsis - -@example - -exec-continue -@end example - -Asynchronous command. Resumes the execution of the inferior program -until a breakpoint is encountered, or until the inferior exits. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} corresponding is @samp{continue}. - -@subsubheading Example - -@smallexample --exec-continue -^running -(@value{GDBP}) -@@Hello world -*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=[], -file="hello.c",line="13"@} -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-exec-finish} Command -@findex -exec-finish - -@subsubheading Synopsis - -@example - -exec-finish -@end example - -Asynchronous command. Resumes the execution of the inferior program -until the current function is exited. Displays the results returned by -the function. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{finish}. - -@subsubheading Example - -Function returning @code{void}. - -@smallexample --exec-finish -^running -(@value{GDBP}) -@@hello from foo -*stopped,reason="function-finished",frame=@{func="main",args=[], -file="hello.c",line="7"@} -(@value{GDBP}) -@end smallexample - -Function returning other than @code{void}. The name of the internal -@value{GDBN} variable storing the result is printed, together with the -value itself. - -@smallexample --exec-finish -^running -(@value{GDBP}) -*stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo", -args=[@{name="a",value="1"],@{name="b",value="9"@}@}, -file="recursive2.c",line="14"@}, -gdb-result-var="$1",return-value="0" -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-exec-interrupt} Command -@findex -exec-interrupt - -@subsubheading Synopsis - -@example - -exec-interrupt -@end example - -Asynchronous command. Interrupts the background execution of the target. -Note how the token associated with the stop message is the one for the -execution command that has been interrupted. The token for the interrupt -itself only appears in the @samp{^done} output. If the user is trying to -interrupt a non-running program, an error message will be printed. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{interrupt}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) -111-exec-continue -111^running - -(@value{GDBP}) -222-exec-interrupt -222^done -(@value{GDBP}) -111*stopped,signal-name="SIGINT",signal-meaning="Interrupt", -frame=@{addr="0x00010140",func="foo",args=[],file="try.c",line="13"@} -(@value{GDBP}) - -(@value{GDBP}) --exec-interrupt -^error,msg="mi_cmd_exec_interrupt: Inferior not executing." -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-exec-next} Command -@findex -exec-next - -@subsubheading Synopsis - -@example - -exec-next -@end example - -Asynchronous command. Resumes execution of the inferior program, stopping -when the beginning of the next source line is reached. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{next}. - -@subsubheading Example - -@smallexample --exec-next -^running -(@value{GDBP}) -*stopped,reason="end-stepping-range",line="8",file="hello.c" -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-exec-next-instruction} Command -@findex -exec-next-instruction - -@subsubheading Synopsis - -@example - -exec-next-instruction -@end example - -Asynchronous command. Executes one machine instruction. If the -instruction is a function call continues until the function returns. If -the program stops at an instruction in the middle of a source line, the -address will be printed as well. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{nexti}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --exec-next-instruction -^running - -(@value{GDBP}) -*stopped,reason="end-stepping-range", -addr="0x000100d4",line="5",file="hello.c" -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-exec-return} Command -@findex -exec-return - -@subsubheading Synopsis - -@example - -exec-return -@end example - -Makes current function return immediately. Doesn't execute the inferior. -Displays the new current frame. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{return}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) -200-break-insert callee4 -200^done,bkpt=@{number="1",addr="0x00010734", -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@} -(@value{GDBP}) -000-exec-run -000^running -(@value{GDBP}) -000*stopped,reason="breakpoint-hit",bkptno="1", -frame=@{func="callee4",args=[], -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@} -(@value{GDBP}) -205-break-delete -205^done -(@value{GDBP}) -111-exec-return -111^done,frame=@{level="0",func="callee3", -args=[@{name="strarg", -value="0x11940 \"A string argument.\""@}], -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@} -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-exec-run} Command -@findex -exec-run - -@subsubheading Synopsis - -@example - -exec-run -@end example - -Asynchronous command. Starts execution of the inferior from the -beginning. The inferior executes until either a breakpoint is -encountered or the program exits. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{run}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --break-insert main -^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@} -(@value{GDBP}) --exec-run -^running -(@value{GDBP}) -*stopped,reason="breakpoint-hit",bkptno="1", -frame=@{func="main",args=[],file="recursive2.c",line="4"@} -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-exec-show-arguments} Command -@findex -exec-show-arguments - -@subsubheading Synopsis - -@example - -exec-show-arguments -@end example - -Print the arguments of the program. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{show args}. - -@subsubheading Example -N.A. - -@c @subheading -exec-signal - -@subheading The @code{-exec-step} Command -@findex -exec-step - -@subsubheading Synopsis - -@example - -exec-step -@end example - -Asynchronous command. Resumes execution of the inferior program, stopping -when the beginning of the next source line is reached, if the next -source line is not a function call. If it is, stop at the first -instruction of the called function. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{step}. - -@subsubheading Example - -Stepping into a function: - -@smallexample --exec-step -^running -(@value{GDBP}) -*stopped,reason="end-stepping-range", -frame=@{func="foo",args=[@{name="a",value="10"@}, -@{name="b",value="0"@}],file="recursive2.c",line="11"@} -(@value{GDBP}) -@end smallexample - -Regular stepping: - -@smallexample --exec-step -^running -(@value{GDBP}) -*stopped,reason="end-stepping-range",line="14",file="recursive2.c" -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-exec-step-instruction} Command -@findex -exec-step-instruction - -@subsubheading Synopsis - -@example - -exec-step-instruction -@end example - -Asynchronous command. Resumes the inferior which executes one machine -instruction. The output, once @value{GDBN} has stopped, will vary depending on -whether we have stopped in the middle of a source line or not. In the -former case, the address at which the program stopped will be printed as -well. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{stepi}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --exec-step-instruction -^running - -(@value{GDBP}) -*stopped,reason="end-stepping-range", -frame=@{func="foo",args=[],file="try.c",line="10"@} -(@value{GDBP}) --exec-step-instruction -^running - -(@value{GDBP}) -*stopped,reason="end-stepping-range", -frame=@{addr="0x000100f4",func="foo",args=[],file="try.c",line="10"@} -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-exec-until} Command -@findex -exec-until - -@subsubheading Synopsis - -@example - -exec-until [ @var{location} ] -@end example - -Asynchronous command. Executes the inferior until the @var{location} -specified in the argument is reached. If there is no argument, the inferior -executes until a source line greater than the current one is reached. -The reason for stopping in this case will be @samp{location-reached}. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{until}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --exec-until recursive2.c:6 -^running -(@value{GDBP}) -x = 55 -*stopped,reason="location-reached",frame=@{func="main",args=[], -file="recursive2.c",line="6"@} -(@value{GDBP}) -@end smallexample - -@ignore -@subheading -file-clear -Is this going away???? -@end ignore - - -@subheading The @code{-file-exec-and-symbols} Command -@findex -file-exec-and-symbols - -@subsubheading Synopsis - -@example - -file-exec-and-symbols @var{file} -@end example - -Specify the executable file to be debugged. This file is the one from -which the symbol table is also read. If no file is specified, the -command clears the executable and symbol information. If breakpoints -are set when using this command with no arguments, @value{GDBN} will produce -error messages. Otherwise, no output is produced, except a completion -notification. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{file}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx -^done -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-file-exec-file} Command -@findex -file-exec-file - -@subsubheading Synopsis - -@example - -file-exec-file @var{file} -@end example - -Specify the executable file to be debugged. Unlike -@samp{-file-exec-and-symbols}, the symbol table is @emph{not} read -from this file. If used without argument, @value{GDBN} clears the information -about the executable file. No output is produced, except a completion -notification. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{exec-file}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx -^done -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-file-list-exec-sections} Command -@findex -file-list-exec-sections - -@subsubheading Synopsis - -@example - -file-list-exec-sections -@end example - -List the sections of the current executable file. - -@subsubheading @value{GDBN} Command - -The @value{GDBN} command @samp{info file} shows, among the rest, the same -information as this command. @code{gdbtk} has a corresponding command -@samp{gdb_load_info}. - -@subsubheading Example -N.A. - - -@subheading The @code{-file-list-exec-source-files} Command -@findex -file-list-exec-source-files - -@subsubheading Synopsis - -@example - -file-list-exec-source-files -@end example - -List the source files for the current executable. - -@subsubheading @value{GDBN} Command - -There's no @value{GDBN} command which directly corresponds to this one. -@code{gdbtk} has an analogous command @samp{gdb_listfiles}. - -@subsubheading Example -N.A. - - -@subheading The @code{-file-list-shared-libraries} Command -@findex -file-list-shared-libraries - -@subsubheading Synopsis - -@example - -file-list-shared-libraries -@end example - -List the shared libraries in the program. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{info shared}. - -@subsubheading Example -N.A. - - -@subheading The @code{-file-list-symbol-files} Command -@findex -file-list-symbol-files - -@subsubheading Synopsis - -@example - -file-list-symbol-files -@end example - -List symbol files. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{info file} (part of it). - -@subsubheading Example -N.A. - - -@subheading The @code{-file-symbol-file} Command -@findex -file-symbol-file - -@subsubheading Synopsis - -@example - -file-symbol-file @var{file} -@end example - -Read symbol table info from the specified @var{file} argument. When -used without arguments, clears @value{GDBN}'s symbol table info. No output is -produced, except for a completion notification. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{symbol-file}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx -^done -(@value{GDBP}) -@end smallexample - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Miscellaneous Commands -@section Miscellaneous @value{GDBN} commands in @sc{gdb/mi} - -@c @subheading -gdb-complete - -@subheading The @code{-gdb-exit} Command -@findex -gdb-exit - -@subsubheading Synopsis - -@example - -gdb-exit -@end example - -Exit @value{GDBN} immediately. - -@subsubheading @value{GDBN} Command - -Approximately corresponds to @samp{quit}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --gdb-exit -@end smallexample - -@subheading The @code{-gdb-set} Command -@findex -gdb-set - -@subsubheading Synopsis - -@example - -gdb-set -@end example - -Set an internal @value{GDBN} variable. -@c IS THIS A DOLLAR VARIABLE? OR SOMETHING LIKE ANNOTATE ????? - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{set}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --gdb-set $foo=3 -^done -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-gdb-show} Command -@findex -gdb-show - -@subsubheading Synopsis - -@example - -gdb-show -@end example - -Show the current value of a @value{GDBN} variable. - -@subsubheading @value{GDBN} command - -The corresponding @value{GDBN} command is @samp{show}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --gdb-show annotate -^done,value="0" -(@value{GDBP}) -@end smallexample - -@c @subheading -gdb-source - - -@subheading The @code{-gdb-version} Command -@findex -gdb-version - -@subsubheading Synopsis - -@example - -gdb-version -@end example - -Show version information for @value{GDBN}. Used mostly in testing. - -@subsubheading @value{GDBN} Command - -There's no equivalent @value{GDBN} command. @value{GDBN} by default shows this -information when you start an interactive session. - -@subsubheading Example - -@c This example modifies the actual output from GDB to avoid overfull -@c box in TeX. -@smallexample -(@value{GDBP}) --gdb-version -~GNU gdb 5.2.1 -~Copyright 2000 Free Software Foundation, Inc. -~GDB is free software, covered by the GNU General Public License, and -~you are welcome to change it and/or distribute copies of it under -~ certain conditions. -~Type "show copying" to see the conditions. -~There is absolutely no warranty for GDB. Type "show warranty" for -~ details. -~This GDB was configured as - "--host=sparc-sun-solaris2.5.1 --target=ppc-eabi". -^done -(@value{GDBP}) -@end smallexample - -@subheading The @code{-interpreter-exec} Command -@findex -interpreter-exec - -@subheading Synopsis - -@smallexample --interpreter-exec @var{interpreter} @var{command} -@end smallexample - -Execute the specified @var{command} in the given @var{interpreter}. - -@subheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{interpreter-exec}. - -@subheading Example - -@smallexample -(@value{GDBP}) --interpreter-exec console "break main" -&"During symbol reading, couldn't parse type; debugger out of date?.\n" -&"During symbol reading, bad structure-type format.\n" -~"Breakpoint 1 at 0x8074fc6: file ../../src/gdb/main.c, line 743.\n" -^done -(@value{GDBP}) -@end smallexample - -@ignore -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Kod Commands -@section @sc{gdb/mi} Kod Commands - -The Kod commands are not implemented. - -@c @subheading -kod-info - -@c @subheading -kod-list - -@c @subheading -kod-list-object-types - -@c @subheading -kod-show - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Memory Overlay Commands -@section @sc{gdb/mi} Memory Overlay Commands - -The memory overlay commands are not implemented. - -@c @subheading -overlay-auto - -@c @subheading -overlay-list-mapping-state - -@c @subheading -overlay-list-overlays - -@c @subheading -overlay-map - -@c @subheading -overlay-off - -@c @subheading -overlay-on - -@c @subheading -overlay-unmap - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Signal Handling Commands -@section @sc{gdb/mi} Signal Handling Commands - -Signal handling commands are not implemented. - -@c @subheading -signal-handle - -@c @subheading -signal-list-handle-actions - -@c @subheading -signal-list-signal-types -@end ignore - - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Stack Manipulation -@section @sc{gdb/mi} Stack Manipulation Commands - - -@subheading The @code{-stack-info-frame} Command -@findex -stack-info-frame - -@subsubheading Synopsis - -@example - -stack-info-frame -@end example - -Get info on the current frame. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{info frame} or @samp{frame} -(without arguments). - -@subsubheading Example -N.A. - -@subheading The @code{-stack-info-depth} Command -@findex -stack-info-depth - -@subsubheading Synopsis - -@example - -stack-info-depth [ @var{max-depth} ] -@end example - -Return the depth of the stack. If the integer argument @var{max-depth} -is specified, do not count beyond @var{max-depth} frames. - -@subsubheading @value{GDBN} Command - -There's no equivalent @value{GDBN} command. - -@subsubheading Example - -For a stack with frame levels 0 through 11: - -@smallexample -(@value{GDBP}) --stack-info-depth -^done,depth="12" -(@value{GDBP}) --stack-info-depth 4 -^done,depth="4" -(@value{GDBP}) --stack-info-depth 12 -^done,depth="12" -(@value{GDBP}) --stack-info-depth 11 -^done,depth="11" -(@value{GDBP}) --stack-info-depth 13 -^done,depth="12" -(@value{GDBP}) -@end smallexample - -@subheading The @code{-stack-list-arguments} Command -@findex -stack-list-arguments - -@subsubheading Synopsis - -@example - -stack-list-arguments @var{show-values} - [ @var{low-frame} @var{high-frame} ] -@end example - -Display a list of the arguments for the frames between @var{low-frame} -and @var{high-frame} (inclusive). If @var{low-frame} and -@var{high-frame} are not provided, list the arguments for the whole call -stack. - -The @var{show-values} argument must have a value of 0 or 1. A value of -0 means that only the names of the arguments are listed, a value of 1 -means that both names and values of the arguments are printed. - -@subsubheading @value{GDBN} Command - -@value{GDBN} does not have an equivalent command. @code{gdbtk} has a -@samp{gdb_get_args} command which partially overlaps with the -functionality of @samp{-stack-list-arguments}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --stack-list-frames -^done, -stack=[ -frame=@{level="0",addr="0x00010734",func="callee4", -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}, -frame=@{level="1",addr="0x0001076c",func="callee3", -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"@}, -frame=@{level="2",addr="0x0001078c",func="callee2", -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"@}, -frame=@{level="3",addr="0x000107b4",func="callee1", -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"@}, -frame=@{level="4",addr="0x000107e0",func="main", -file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}] -(@value{GDBP}) --stack-list-arguments 0 -^done, -stack-args=[ -frame=@{level="0",args=[]@}, -frame=@{level="1",args=[name="strarg"]@}, -frame=@{level="2",args=[name="intarg",name="strarg"]@}, -frame=@{level="3",args=[name="intarg",name="strarg",name="fltarg"]@}, -frame=@{level="4",args=[]@}] -(@value{GDBP}) --stack-list-arguments 1 -^done, -stack-args=[ -frame=@{level="0",args=[]@}, -frame=@{level="1", - args=[@{name="strarg",value="0x11940 \"A string argument.\""@}]@}, -frame=@{level="2",args=[ -@{name="intarg",value="2"@}, -@{name="strarg",value="0x11940 \"A string argument.\""@}]@}, -@{frame=@{level="3",args=[ -@{name="intarg",value="2"@}, -@{name="strarg",value="0x11940 \"A string argument.\""@}, -@{name="fltarg",value="3.5"@}]@}, -frame=@{level="4",args=[]@}] -(@value{GDBP}) --stack-list-arguments 0 2 2 -^done,stack-args=[frame=@{level="2",args=[name="intarg",name="strarg"]@}] -(@value{GDBP}) --stack-list-arguments 1 2 2 -^done,stack-args=[frame=@{level="2", -args=[@{name="intarg",value="2"@}, -@{name="strarg",value="0x11940 \"A string argument.\""@}]@}] -(@value{GDBP}) -@end smallexample - -@c @subheading -stack-list-exception-handlers - - -@subheading The @code{-stack-list-frames} Command -@findex -stack-list-frames - -@subsubheading Synopsis - -@example - -stack-list-frames [ @var{low-frame} @var{high-frame} ] -@end example - -List the frames currently on the stack. For each frame it displays the -following info: - -@table @samp -@item @var{level} -The frame number, 0 being the topmost frame, i.e. the innermost function. -@item @var{addr} -The @code{$pc} value for that frame. -@item @var{func} -Function name. -@item @var{file} -File name of the source file where the function lives. -@item @var{line} -Line number corresponding to the @code{$pc}. -@end table - -If invoked without arguments, this command prints a backtrace for the -whole stack. If given two integer arguments, it shows the frames whose -levels are between the two arguments (inclusive). If the two arguments -are equal, it shows the single frame at the corresponding level. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} commands are @samp{backtrace} and @samp{where}. - -@subsubheading Example - -Full stack backtrace: - -@smallexample -(@value{GDBP}) --stack-list-frames -^done,stack= -[frame=@{level="0",addr="0x0001076c",func="foo", - file="recursive2.c",line="11"@}, -frame=@{level="1",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}, -frame=@{level="2",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}, -frame=@{level="3",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}, -frame=@{level="4",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}, -frame=@{level="5",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}, -frame=@{level="6",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}, -frame=@{level="7",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}, -frame=@{level="8",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}, -frame=@{level="9",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}, -frame=@{level="10",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}, -frame=@{level="11",addr="0x00010738",func="main", - file="recursive2.c",line="4"@}] -(@value{GDBP}) -@end smallexample - -Show frames between @var{low_frame} and @var{high_frame}: - -@smallexample -(@value{GDBP}) --stack-list-frames 3 5 -^done,stack= -[frame=@{level="3",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}, -frame=@{level="4",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}, -frame=@{level="5",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}] -(@value{GDBP}) -@end smallexample - -Show a single frame: - -@smallexample -(@value{GDBP}) --stack-list-frames 3 3 -^done,stack= -[frame=@{level="3",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}] -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-stack-list-locals} Command -@findex -stack-list-locals - -@subsubheading Synopsis - -@example - -stack-list-locals @var{print-values} -@end example - -Display the local variable names for the current frame. With an -argument of 0 prints only the names of the variables, with argument of 1 -prints also their values. - -@subsubheading @value{GDBN} Command - -@samp{info locals} in @value{GDBN}, @samp{gdb_get_locals} in @code{gdbtk}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --stack-list-locals 0 -^done,locals=[name="A",name="B",name="C"] -(@value{GDBP}) --stack-list-locals 1 -^done,locals=[@{name="A",value="1"@},@{name="B",value="2"@}, - @{name="C",value="3"@}] -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-stack-select-frame} Command -@findex -stack-select-frame - -@subsubheading Synopsis - -@example - -stack-select-frame @var{framenum} -@end example - -Change the current frame. Select a different frame @var{framenum} on -the stack. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} commands are @samp{frame}, @samp{up}, -@samp{down}, @samp{select-frame}, @samp{up-silent}, and @samp{down-silent}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --stack-select-frame 2 -^done -(@value{GDBP}) -@end smallexample - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Symbol Query -@section @sc{gdb/mi} Symbol Query Commands - - -@subheading The @code{-symbol-info-address} Command -@findex -symbol-info-address - -@subsubheading Synopsis - -@example - -symbol-info-address @var{symbol} -@end example - -Describe where @var{symbol} is stored. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{info address}. - -@subsubheading Example -N.A. - - -@subheading The @code{-symbol-info-file} Command -@findex -symbol-info-file - -@subsubheading Synopsis - -@example - -symbol-info-file -@end example - -Show the file for the symbol. - -@subsubheading @value{GDBN} Command - -There's no equivalent @value{GDBN} command. @code{gdbtk} has -@samp{gdb_find_file}. - -@subsubheading Example -N.A. - - -@subheading The @code{-symbol-info-function} Command -@findex -symbol-info-function - -@subsubheading Synopsis - -@example - -symbol-info-function -@end example - -Show which function the symbol lives in. - -@subsubheading @value{GDBN} Command - -@samp{gdb_get_function} in @code{gdbtk}. - -@subsubheading Example -N.A. - - -@subheading The @code{-symbol-info-line} Command -@findex -symbol-info-line - -@subsubheading Synopsis - -@example - -symbol-info-line -@end example - -Show the core addresses of the code for a source line. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} comamnd is @samp{info line}. -@code{gdbtk} has the @samp{gdb_get_line} and @samp{gdb_get_file} commands. - -@subsubheading Example -N.A. - - -@subheading The @code{-symbol-info-symbol} Command -@findex -symbol-info-symbol - -@subsubheading Synopsis - -@example - -symbol-info-symbol @var{addr} -@end example - -Describe what symbol is at location @var{addr}. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{info symbol}. - -@subsubheading Example -N.A. - - -@subheading The @code{-symbol-list-functions} Command -@findex -symbol-list-functions - -@subsubheading Synopsis - -@example - -symbol-list-functions -@end example - -List the functions in the executable. - -@subsubheading @value{GDBN} Command - -@samp{info functions} in @value{GDBN}, @samp{gdb_listfunc} and -@samp{gdb_search} in @code{gdbtk}. - -@subsubheading Example -N.A. - - -@subheading The @code{-symbol-list-types} Command -@findex -symbol-list-types - -@subsubheading Synopsis - -@example - -symbol-list-types -@end example - -List all the type names. - -@subsubheading @value{GDBN} Command - -The corresponding commands are @samp{info types} in @value{GDBN}, -@samp{gdb_search} in @code{gdbtk}. - -@subsubheading Example -N.A. - - -@subheading The @code{-symbol-list-variables} Command -@findex -symbol-list-variables - -@subsubheading Synopsis - -@example - -symbol-list-variables -@end example - -List all the global and static variable names. - -@subsubheading @value{GDBN} Command - -@samp{info variables} in @value{GDBN}, @samp{gdb_search} in @code{gdbtk}. - -@subsubheading Example -N.A. - - -@subheading The @code{-symbol-locate} Command -@findex -symbol-locate - -@subsubheading Synopsis - -@example - -symbol-locate -@end example - -@subsubheading @value{GDBN} Command - -@samp{gdb_loc} in @code{gdbtk}. - -@subsubheading Example -N.A. - - -@subheading The @code{-symbol-type} Command -@findex -symbol-type - -@subsubheading Synopsis - -@example - -symbol-type @var{variable} -@end example - -Show type of @var{variable}. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{ptype}, @code{gdbtk} has -@samp{gdb_obj_variable}. - -@subsubheading Example -N.A. - - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Target Manipulation -@section @sc{gdb/mi} Target Manipulation Commands - - -@subheading The @code{-target-attach} Command -@findex -target-attach - -@subsubheading Synopsis - -@example - -target-attach @var{pid} | @var{file} -@end example - -Attach to a process @var{pid} or a file @var{file} outside of @value{GDBN}. - -@subsubheading @value{GDBN} command - -The corresponding @value{GDBN} command is @samp{attach}. - -@subsubheading Example -N.A. - - -@subheading The @code{-target-compare-sections} Command -@findex -target-compare-sections - -@subsubheading Synopsis - -@example - -target-compare-sections [ @var{section} ] -@end example - -Compare data of section @var{section} on target to the exec file. -Without the argument, all sections are compared. - -@subsubheading @value{GDBN} Command - -The @value{GDBN} equivalent is @samp{compare-sections}. - -@subsubheading Example -N.A. - - -@subheading The @code{-target-detach} Command -@findex -target-detach - -@subsubheading Synopsis - -@example - -target-detach -@end example - -Disconnect from the remote target. There's no output. - -@subsubheading @value{GDBN} command - -The corresponding @value{GDBN} command is @samp{detach}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --target-detach -^done -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-target-download} Command -@findex -target-download - -@subsubheading Synopsis - -@example - -target-download -@end example - -Loads the executable onto the remote target. -It prints out an update message every half second, which includes the fields: - -@table @samp -@item section -The name of the section. -@item section-sent -The size of what has been sent so far for that section. -@item section-size -The size of the section. -@item total-sent -The total size of what was sent so far (the current and the previous sections). -@item total-size -The size of the overall executable to download. -@end table - -@noindent -Each message is sent as status record (@pxref{GDB/MI Output Syntax, , -@sc{gdb/mi} Output Syntax}). - -In addition, it prints the name and size of the sections, as they are -downloaded. These messages include the following fields: - -@table @samp -@item section -The name of the section. -@item section-size -The size of the section. -@item total-size -The size of the overall executable to download. -@end table - -@noindent -At the end, a summary is printed. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{load}. - -@subsubheading Example - -Note: each status message appears on a single line. Here the messages -have been broken down so that they can fit onto a page. - -@smallexample -(@value{GDBP}) --target-download -+download,@{section=".text",section-size="6668",total-size="9880"@} -+download,@{section=".text",section-sent="512",section-size="6668", -total-sent="512",total-size="9880"@} -+download,@{section=".text",section-sent="1024",section-size="6668", -total-sent="1024",total-size="9880"@} -+download,@{section=".text",section-sent="1536",section-size="6668", -total-sent="1536",total-size="9880"@} -+download,@{section=".text",section-sent="2048",section-size="6668", -total-sent="2048",total-size="9880"@} -+download,@{section=".text",section-sent="2560",section-size="6668", -total-sent="2560",total-size="9880"@} -+download,@{section=".text",section-sent="3072",section-size="6668", -total-sent="3072",total-size="9880"@} -+download,@{section=".text",section-sent="3584",section-size="6668", -total-sent="3584",total-size="9880"@} -+download,@{section=".text",section-sent="4096",section-size="6668", -total-sent="4096",total-size="9880"@} -+download,@{section=".text",section-sent="4608",section-size="6668", -total-sent="4608",total-size="9880"@} -+download,@{section=".text",section-sent="5120",section-size="6668", -total-sent="5120",total-size="9880"@} -+download,@{section=".text",section-sent="5632",section-size="6668", -total-sent="5632",total-size="9880"@} -+download,@{section=".text",section-sent="6144",section-size="6668", -total-sent="6144",total-size="9880"@} -+download,@{section=".text",section-sent="6656",section-size="6668", -total-sent="6656",total-size="9880"@} -+download,@{section=".init",section-size="28",total-size="9880"@} -+download,@{section=".fini",section-size="28",total-size="9880"@} -+download,@{section=".data",section-size="3156",total-size="9880"@} -+download,@{section=".data",section-sent="512",section-size="3156", -total-sent="7236",total-size="9880"@} -+download,@{section=".data",section-sent="1024",section-size="3156", -total-sent="7748",total-size="9880"@} -+download,@{section=".data",section-sent="1536",section-size="3156", -total-sent="8260",total-size="9880"@} -+download,@{section=".data",section-sent="2048",section-size="3156", -total-sent="8772",total-size="9880"@} -+download,@{section=".data",section-sent="2560",section-size="3156", -total-sent="9284",total-size="9880"@} -+download,@{section=".data",section-sent="3072",section-size="3156", -total-sent="9796",total-size="9880"@} -^done,address="0x10004",load-size="9880",transfer-rate="6586", -write-rate="429" -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-target-exec-status} Command -@findex -target-exec-status - -@subsubheading Synopsis - -@example - -target-exec-status -@end example - -Provide information on the state of the target (whether it is running or -not, for instance). - -@subsubheading @value{GDBN} Command - -There's no equivalent @value{GDBN} command. - -@subsubheading Example -N.A. - - -@subheading The @code{-target-list-available-targets} Command -@findex -target-list-available-targets - -@subsubheading Synopsis - -@example - -target-list-available-targets -@end example - -List the possible targets to connect to. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{help target}. - -@subsubheading Example -N.A. - - -@subheading The @code{-target-list-current-targets} Command -@findex -target-list-current-targets - -@subsubheading Synopsis - -@example - -target-list-current-targets -@end example - -Describe the current target. - -@subsubheading @value{GDBN} Command - -The corresponding information is printed by @samp{info file} (among -other things). - -@subsubheading Example -N.A. - - -@subheading The @code{-target-list-parameters} Command -@findex -target-list-parameters - -@subsubheading Synopsis - -@example - -target-list-parameters -@end example - -@c ???? - -@subsubheading @value{GDBN} Command - -No equivalent. - -@subsubheading Example -N.A. - - -@subheading The @code{-target-select} Command -@findex -target-select - -@subsubheading Synopsis - -@example - -target-select @var{type} @var{parameters @dots{}} -@end example - -Connect @value{GDBN} to the remote target. This command takes two args: - -@table @samp -@item @var{type} -The type of target, for instance @samp{async}, @samp{remote}, etc. -@item @var{parameters} -Device names, host names and the like. @xref{Target Commands, , -Commands for managing targets}, for more details. -@end table - -The output is a connection notification, followed by the address at -which the target program is, in the following form: - -@smallexample -^connected,addr="@var{address}",func="@var{function name}", - args=[@var{arg list}] -@end smallexample - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{target}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --target-select async /dev/ttya -^connected,addr="0xfe00a300",func="??",args=[] -(@value{GDBP}) -@end smallexample - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Thread Commands -@section @sc{gdb/mi} Thread Commands - - -@subheading The @code{-thread-info} Command -@findex -thread-info - -@subsubheading Synopsis - -@example - -thread-info -@end example - -@subsubheading @value{GDBN} command - -No equivalent. - -@subsubheading Example -N.A. - - -@subheading The @code{-thread-list-all-threads} Command -@findex -thread-list-all-threads - -@subsubheading Synopsis - -@example - -thread-list-all-threads -@end example - -@subsubheading @value{GDBN} Command - -The equivalent @value{GDBN} command is @samp{info threads}. - -@subsubheading Example -N.A. - - -@subheading The @code{-thread-list-ids} Command -@findex -thread-list-ids - -@subsubheading Synopsis - -@example - -thread-list-ids -@end example - -Produces a list of the currently known @value{GDBN} thread ids. At the -end of the list it also prints the total number of such threads. - -@subsubheading @value{GDBN} Command - -Part of @samp{info threads} supplies the same information. - -@subsubheading Example - -No threads present, besides the main process: - -@smallexample -(@value{GDBP}) --thread-list-ids -^done,thread-ids=@{@},number-of-threads="0" -(@value{GDBP}) -@end smallexample - - -Several threads: - -@smallexample -(@value{GDBP}) --thread-list-ids -^done,thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@}, -number-of-threads="3" -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-thread-select} Command -@findex -thread-select - -@subsubheading Synopsis - -@example - -thread-select @var{threadnum} -@end example - -Make @var{threadnum} the current thread. It prints the number of the new -current thread, and the topmost frame for that thread. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{thread}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --exec-next -^running -(@value{GDBP}) -*stopped,reason="end-stepping-range",thread-id="2",line="187", -file="../../../devo/gdb/testsuite/gdb.threads/linux-dp.c" -(@value{GDBP}) --thread-list-ids -^done, -thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@}, -number-of-threads="3" -(@value{GDBP}) --thread-select 3 -^done,new-thread-id="3", -frame=@{level="0",func="vprintf", -args=[@{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""@}, -@{name="arg",value="0x2"@}],file="vprintf.c",line="31"@} -(@value{GDBP}) -@end smallexample - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Tracepoint Commands -@section @sc{gdb/mi} Tracepoint Commands - -The tracepoint commands are not yet implemented. - -@c @subheading -trace-actions - -@c @subheading -trace-delete - -@c @subheading -trace-disable - -@c @subheading -trace-dump - -@c @subheading -trace-enable - -@c @subheading -trace-exists - -@c @subheading -trace-find - -@c @subheading -trace-frame-number - -@c @subheading -trace-info - -@c @subheading -trace-insert - -@c @subheading -trace-list - -@c @subheading -trace-pass-count - -@c @subheading -trace-save - -@c @subheading -trace-start - -@c @subheading -trace-stop - - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Variable Objects -@section @sc{gdb/mi} Variable Objects - - -@subheading Motivation for Variable Objects in @sc{gdb/mi} - -For the implementation of a variable debugger window (locals, watched -expressions, etc.), we are proposing the adaptation of the existing code -used by @code{Insight}. - -The two main reasons for that are: - -@enumerate 1 -@item -It has been proven in practice (it is already on its second generation). - -@item -It will shorten development time (needless to say how important it is -now). -@end enumerate - -The original interface was designed to be used by Tcl code, so it was -slightly changed so it could be used through @sc{gdb/mi}. This section -describes the @sc{gdb/mi} operations that will be available and gives some -hints about their use. - -@emph{Note}: In addition to the set of operations described here, we -expect the @sc{gui} implementation of a variable window to require, at -least, the following operations: - -@itemize @bullet -@item @code{-gdb-show} @code{output-radix} -@item @code{-stack-list-arguments} -@item @code{-stack-list-locals} -@item @code{-stack-select-frame} -@end itemize - -@subheading Introduction to Variable Objects in @sc{gdb/mi} - -@cindex variable objects in @sc{gdb/mi} -The basic idea behind variable objects is the creation of a named object -to represent a variable, an expression, a memory location or even a CPU -register. For each object created, a set of operations is available for -examining or changing its properties. - -Furthermore, complex data types, such as C structures, are represented -in a tree format. For instance, the @code{struct} type variable is the -root and the children will represent the struct members. If a child -is itself of a complex type, it will also have children of its own. -Appropriate language differences are handled for C, C@t{++} and Java. - -When returning the actual values of the objects, this facility allows -for the individual selection of the display format used in the result -creation. It can be chosen among: binary, decimal, hexadecimal, octal -and natural. Natural refers to a default format automatically -chosen based on the variable type (like decimal for an @code{int}, hex -for pointers, etc.). - -The following is the complete set of @sc{gdb/mi} operations defined to -access this functionality: - -@multitable @columnfractions .4 .6 -@item @strong{Operation} -@tab @strong{Description} - -@item @code{-var-create} -@tab create a variable object -@item @code{-var-delete} -@tab delete the variable object and its children -@item @code{-var-set-format} -@tab set the display format of this variable -@item @code{-var-show-format} -@tab show the display format of this variable -@item @code{-var-info-num-children} -@tab tells how many children this object has -@item @code{-var-list-children} -@tab return a list of the object's children -@item @code{-var-info-type} -@tab show the type of this variable object -@item @code{-var-info-expression} -@tab print what this variable object represents -@item @code{-var-show-attributes} -@tab is this variable editable? does it exist here? -@item @code{-var-evaluate-expression} -@tab get the value of this variable -@item @code{-var-assign} -@tab set the value of this variable -@item @code{-var-update} -@tab update the variable and its children -@end multitable - -In the next subsection we describe each operation in detail and suggest -how it can be used. - -@subheading Description And Use of Operations on Variable Objects - -@subheading The @code{-var-create} Command -@findex -var-create - -@subsubheading Synopsis - -@example - -var-create @{@var{name} | "-"@} - @{@var{frame-addr} | "*"@} @var{expression} -@end example - -This operation creates a variable object, which allows the monitoring of -a variable, the result of an expression, a memory cell or a CPU -register. - -The @var{name} parameter is the string by which the object can be -referenced. It must be unique. If @samp{-} is specified, the varobj -system will generate a string ``varNNNNNN'' automatically. It will be -unique provided that one does not specify @var{name} on that format. -The command fails if a duplicate name is found. - -The frame under which the expression should be evaluated can be -specified by @var{frame-addr}. A @samp{*} indicates that the current -frame should be used. - -@var{expression} is any expression valid on the current language set (must not -begin with a @samp{*}), or one of the following: - -@itemize @bullet -@item -@samp{*@var{addr}}, where @var{addr} is the address of a memory cell - -@item -@samp{*@var{addr}-@var{addr}} --- a memory address range (TBD) - -@item -@samp{$@var{regname}} --- a CPU register name -@end itemize - -@subsubheading Result - -This operation returns the name, number of children and the type of the -object created. Type is returned as a string as the ones generated by -the @value{GDBN} CLI: - -@example - name="@var{name}",numchild="N",type="@var{type}" -@end example - - -@subheading The @code{-var-delete} Command -@findex -var-delete - -@subsubheading Synopsis - -@example - -var-delete @var{name} -@end example - -Deletes a previously created variable object and all of its children. - -Returns an error if the object @var{name} is not found. - - -@subheading The @code{-var-set-format} Command -@findex -var-set-format - -@subsubheading Synopsis - -@example - -var-set-format @var{name} @var{format-spec} -@end example - -Sets the output format for the value of the object @var{name} to be -@var{format-spec}. - -The syntax for the @var{format-spec} is as follows: - -@example - @var{format-spec} @expansion{} - @{binary | decimal | hexadecimal | octal | natural@} -@end example - - -@subheading The @code{-var-show-format} Command -@findex -var-show-format - -@subsubheading Synopsis - -@example - -var-show-format @var{name} -@end example - -Returns the format used to display the value of the object @var{name}. - -@example - @var{format} @expansion{} - @var{format-spec} -@end example - - -@subheading The @code{-var-info-num-children} Command -@findex -var-info-num-children - -@subsubheading Synopsis - -@example - -var-info-num-children @var{name} -@end example - -Returns the number of children of a variable object @var{name}: - -@example - numchild=@var{n} -@end example - - -@subheading The @code{-var-list-children} Command -@findex -var-list-children - -@subsubheading Synopsis - -@example - -var-list-children @var{name} -@end example - -Returns a list of the children of the specified variable object: - -@example - numchild=@var{n},children=[@{name=@var{name}, - numchild=@var{n},type=@var{type}@},@r{(repeats N times)}] -@end example - - -@subheading The @code{-var-info-type} Command -@findex -var-info-type - -@subsubheading Synopsis - -@example - -var-info-type @var{name} -@end example - -Returns the type of the specified variable @var{name}. The type is -returned as a string in the same format as it is output by the -@value{GDBN} CLI: - -@example - type=@var{typename} -@end example - - -@subheading The @code{-var-info-expression} Command -@findex -var-info-expression - -@subsubheading Synopsis - -@example - -var-info-expression @var{name} -@end example - -Returns what is represented by the variable object @var{name}: - -@example - lang=@var{lang-spec},exp=@var{expression} -@end example - -@noindent -where @var{lang-spec} is @code{@{"C" | "C++" | "Java"@}}. - -@subheading The @code{-var-show-attributes} Command -@findex -var-show-attributes - -@subsubheading Synopsis - -@example - -var-show-attributes @var{name} -@end example - -List attributes of the specified variable object @var{name}: - -@example - status=@var{attr} [ ( ,@var{attr} )* ] -@end example - -@noindent -where @var{attr} is @code{@{ @{ editable | noneditable @} | TBD @}}. - -@subheading The @code{-var-evaluate-expression} Command -@findex -var-evaluate-expression - -@subsubheading Synopsis - -@example - -var-evaluate-expression @var{name} -@end example - -Evaluates the expression that is represented by the specified variable -object and returns its value as a string in the current format specified -for the object: - -@example - value=@var{value} -@end example - -Note that one must invoke @code{-var-list-children} for a variable -before the value of a child variable can be evaluated. - -@subheading The @code{-var-assign} Command -@findex -var-assign - -@subsubheading Synopsis - -@example - -var-assign @var{name} @var{expression} -@end example - -Assigns the value of @var{expression} to the variable object specified -by @var{name}. The object must be @samp{editable}. If the variable's -value is altered by the assign, the variable will show up in any -subsequent @code{-var-update} list. - -@subsubheading Example - -@example -(@value{GDBP}) --var-assign var1 3 -^done,value="3" -(@value{GDBP}) --var-update * -^done,changelist=[@{name="var1",in_scope="true",type_changed="false"@}] -(@value{GDBP}) -@end example - -@subheading The @code{-var-update} Command -@findex -var-update - -@subsubheading Synopsis - -@example - -var-update @{@var{name} | "*"@} -@end example - -Update the value of the variable object @var{name} by evaluating its -expression after fetching all the new values from memory or registers. -A @samp{*} causes all existing variable objects to be updated. diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 2a63d22..67f516b 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -5806,7 +5806,7 @@ mips_gdbarch_init (struct gdbarch_info info, switch (mips_abi) { case MIPS_ABI_O32: - set_gdbarch_push_arguments (gdbarch, mips_o32_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, mips_o32_push_arguments); set_gdbarch_deprecated_store_return_value (gdbarch, mips_o32_store_return_value); set_gdbarch_extract_return_value (gdbarch, mips_o32_extract_return_value); tdep->mips_default_saved_regsize = 4; @@ -5825,7 +5825,7 @@ mips_gdbarch_init (struct gdbarch_info info, mips_o32_use_struct_convention); break; case MIPS_ABI_O64: - set_gdbarch_push_arguments (gdbarch, mips_o64_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, mips_o64_push_arguments); set_gdbarch_deprecated_store_return_value (gdbarch, mips_o64_store_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, mips_o64_extract_return_value); tdep->mips_default_saved_regsize = 8; @@ -5844,7 +5844,7 @@ mips_gdbarch_init (struct gdbarch_info info, mips_o32_use_struct_convention); break; case MIPS_ABI_EABI32: - set_gdbarch_push_arguments (gdbarch, mips_eabi_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, mips_eabi_push_arguments); set_gdbarch_deprecated_store_return_value (gdbarch, mips_eabi_store_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, mips_eabi_extract_return_value); tdep->mips_default_saved_regsize = 4; @@ -5863,7 +5863,7 @@ mips_gdbarch_init (struct gdbarch_info info, mips_eabi_use_struct_convention); break; case MIPS_ABI_EABI64: - set_gdbarch_push_arguments (gdbarch, mips_eabi_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, mips_eabi_push_arguments); set_gdbarch_deprecated_store_return_value (gdbarch, mips_eabi_store_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, mips_eabi_extract_return_value); tdep->mips_default_saved_regsize = 8; @@ -5882,7 +5882,7 @@ mips_gdbarch_init (struct gdbarch_info info, mips_eabi_use_struct_convention); break; case MIPS_ABI_N32: - set_gdbarch_push_arguments (gdbarch, mips_n32n64_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, mips_n32n64_push_arguments); set_gdbarch_deprecated_store_return_value (gdbarch, mips_n32n64_store_return_value); set_gdbarch_extract_return_value (gdbarch, mips_n32n64_extract_return_value); tdep->mips_default_saved_regsize = 8; @@ -5913,7 +5913,7 @@ mips_gdbarch_init (struct gdbarch_info info, mips_n32n64_reg_struct_has_addr); break; case MIPS_ABI_N64: - set_gdbarch_push_arguments (gdbarch, mips_n32n64_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, mips_n32n64_push_arguments); set_gdbarch_deprecated_store_return_value (gdbarch, mips_n32n64_store_return_value); set_gdbarch_extract_return_value (gdbarch, mips_n32n64_extract_return_value); tdep->mips_default_saved_regsize = 8; @@ -6003,7 +6003,7 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_write_pc (gdbarch, generic_target_write_pc); set_gdbarch_read_fp (gdbarch, mips_read_sp); /* Draft FRAME base. */ set_gdbarch_read_sp (gdbarch, mips_read_sp); - set_gdbarch_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); /* Add/remove bits from an address. The MIPS needs be careful to ensure that all 32 bit addresses are sign extended to 64 bits. */ @@ -6028,7 +6028,7 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_address (gdbarch, mips_call_dummy_address); - set_gdbarch_push_return_address (gdbarch, mips_push_return_address); + set_gdbarch_deprecated_push_return_address (gdbarch, mips_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, mips_pop_frame); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); @@ -6037,7 +6037,7 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_fix_call_dummy (gdbarch, mips_fix_call_dummy); set_gdbarch_call_dummy_words (gdbarch, mips_call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (mips_call_dummy_words)); - set_gdbarch_push_return_address (gdbarch, mips_push_return_address); + set_gdbarch_deprecated_push_return_address (gdbarch, mips_push_return_address); set_gdbarch_frame_align (gdbarch, mips_frame_align); set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); set_gdbarch_register_convertible (gdbarch, mips_register_convertible); diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index 087c9df..156adbf 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -1196,14 +1196,17 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); - set_gdbarch_push_arguments (gdbarch, mn10300_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, mn10300_push_arguments); set_gdbarch_reg_struct_has_addr (gdbarch, mn10300_reg_struct_has_addr); - set_gdbarch_push_return_address (gdbarch, mn10300_push_return_address); + set_gdbarch_deprecated_push_return_address (gdbarch, mn10300_push_return_address); set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); set_gdbarch_use_struct_convention (gdbarch, mn10300_use_struct_convention); tdep->am33_mode = am33_mode; + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + return gdbarch; } diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c index 323cade..4e43674 100644 --- a/gdb/ns32k-tdep.c +++ b/gdb/ns32k-tdep.c @@ -600,7 +600,8 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof_ns32k_call_dummy_words); set_gdbarch_fix_call_dummy (gdbarch, ns32k_fix_call_dummy); set_gdbarch_call_dummy_start_offset (gdbarch, 3); - set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 0); + set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); + set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 15); set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); @@ -611,6 +612,9 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Misc info */ set_gdbarch_function_start_offset (gdbarch, 0); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + /* Hook in OS ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y index 8e52fc0..002600d 100644 --- a/gdb/objc-exp.y +++ b/gdb/objc-exp.y @@ -247,9 +247,11 @@ exp1 : exp /* Expressions, not including the comma operator. */ exp : '*' exp %prec UNARY { write_exp_elt_opcode (UNOP_IND); } + ; exp : '&' exp %prec UNARY { write_exp_elt_opcode (UNOP_ADDR); } + ; exp : '-' exp %prec UNARY { write_exp_elt_opcode (UNOP_NEG); } @@ -569,6 +571,7 @@ exp : SELECTOR write_exp_elt_opcode (OP_OBJC_SELECTOR); write_exp_string ($1); write_exp_elt_opcode (OP_OBJC_SELECTOR); } + ; exp : SIZEOF '(' type ')' %prec UNARY { write_exp_elt_opcode (OP_LONG); diff --git a/gdb/regcache.c b/gdb/regcache.c index c669017..70af06f 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -1328,16 +1328,16 @@ regcache_collect (int regnum, void *buf) } -/* read_pc, write_pc, read_sp, write_sp, read_fp, etc. Special - handling for registers PC, SP, and FP. */ +/* read_pc, write_pc, read_sp, read_fp, etc. Special handling for + registers PC, SP, and FP. */ /* NOTE: cagney/2001-02-18: The functions generic_target_read_pc(), read_pc_pid(), read_pc(), generic_target_write_pc(), write_pc_pid(), write_pc(), generic_target_read_sp(), read_sp(), - generic_target_write_sp(), write_sp(), generic_target_read_fp() and - read_fp(), will eventually be moved out of the reg-cache into - either frame.[hc] or to the multi-arch framework. The are not part - of the raw register cache. */ + generic_target_write_sp(), generic_target_read_fp() and read_fp(), + will eventually be moved out of the reg-cache into either + frame.[hc] or to the multi-arch framework. The are not part of the + raw register cache. */ /* This routine is getting awfully cluttered with #if's. It's probably time to turn this into READ_PC and define it in the tm.h file. @@ -1456,12 +1456,6 @@ generic_target_write_sp (CORE_ADDR val) "generic_target_write_sp"); } -void -write_sp (CORE_ADDR val) -{ - TARGET_WRITE_SP (val); -} - CORE_ADDR generic_target_read_fp (void) { diff --git a/gdb/remote.h b/gdb/remote.h index e2171b2..4477148 100644 --- a/gdb/remote.h +++ b/gdb/remote.h @@ -54,4 +54,7 @@ extern void remote_cisco_objfile_relocate (bfd_signed_vma text_off, extern void async_remote_interrupt_twice (void *arg); +extern void (*target_resume_hook) (void); +extern void (*target_wait_loop_hook) (void); + #endif diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 539905e..6dea3d8 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -2876,7 +2876,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_pc (gdbarch, generic_target_write_pc); set_gdbarch_read_fp (gdbarch, generic_target_read_fp); set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); set_gdbarch_num_regs (gdbarch, v->nregs); set_gdbarch_num_pseudo_regs (gdbarch, v->npregs); @@ -2909,7 +2909,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fix_call_dummy (gdbarch, rs6000_fix_call_dummy); set_gdbarch_frame_align (gdbarch, rs6000_frame_align); set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); - set_gdbarch_push_return_address (gdbarch, ppc_push_return_address); + set_gdbarch_deprecated_push_return_address (gdbarch, ppc_push_return_address); set_gdbarch_believe_pcc_promotion (gdbarch, 1); set_gdbarch_register_convertible (gdbarch, rs6000_register_convertible); @@ -2924,9 +2924,9 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 64-bit code. At some point in the future, this matter needs to be revisited. */ if (sysv_abi && wordsize == 4) - set_gdbarch_push_arguments (gdbarch, ppc_sysv_abi_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, ppc_sysv_abi_push_arguments); else - set_gdbarch_push_arguments (gdbarch, rs6000_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, rs6000_push_arguments); set_gdbarch_deprecated_store_struct_return (gdbarch, rs6000_store_struct_return); set_gdbarch_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address); diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 18b7d10..6574874 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -1866,12 +1866,12 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); - set_gdbarch_push_arguments (gdbarch, s390_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, s390_push_arguments); set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); - set_gdbarch_push_return_address (gdbarch, s390_push_return_address); + set_gdbarch_deprecated_push_return_address (gdbarch, s390_push_return_address); set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (s390_call_dummy_words)); set_gdbarch_call_dummy_words (gdbarch, s390_call_dummy_words); @@ -1907,6 +1907,9 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) break; } + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + return gdbarch; } diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 7649c62..38098b5 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -4375,7 +4375,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register); set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sh_init_extra_frame_info); set_gdbarch_deprecated_extract_return_value (gdbarch, sh_extract_return_value); - set_gdbarch_push_arguments (gdbarch, sh_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, sh_push_arguments); set_gdbarch_deprecated_store_struct_return (gdbarch, sh_store_struct_return); set_gdbarch_use_struct_convention (gdbarch, sh_use_struct_convention); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh_extract_struct_value_address); @@ -4617,7 +4617,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_frame_chain (gdbarch, sh64_frame_chain); set_gdbarch_deprecated_get_saved_register (gdbarch, sh64_get_saved_register); set_gdbarch_deprecated_extract_return_value (gdbarch, sh64_extract_return_value); - set_gdbarch_push_arguments (gdbarch, sh64_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, sh64_push_arguments); /*set_gdbarch_deprecated_store_struct_return (gdbarch, sh64_store_struct_return);*/ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh64_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, sh64_use_struct_convention); @@ -4641,7 +4641,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_pc (gdbarch, generic_target_write_pc); set_gdbarch_read_fp (gdbarch, generic_target_read_fp); set_gdbarch_read_sp (gdbarch, generic_target_read_sp); - set_gdbarch_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); set_gdbarch_register_name (gdbarch, sh_register_name); set_gdbarch_register_virtual_type (gdbarch, sh_register_virtual_type); @@ -4663,7 +4663,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); - set_gdbarch_push_return_address (gdbarch, sh_push_return_address); + set_gdbarch_deprecated_push_return_address (gdbarch, sh_push_return_address); set_gdbarch_deprecated_store_return_value (gdbarch, sh_store_return_value); set_gdbarch_skip_prologue (gdbarch, sh_skip_prologue); diff --git a/gdb/signals/signals.c b/gdb/signals/signals.c index ba5e7ea..ca46a9e 100644 --- a/gdb/signals/signals.c +++ b/gdb/signals/signals.c @@ -518,6 +518,8 @@ static int do_target_signal_to_host (enum target_signal oursig, int *oursig_ok) { + int retsig; + *oursig_ok = 1; switch (oursig) { @@ -742,36 +744,31 @@ do_target_signal_to_host (enum target_signal oursig, default: #if defined (REALTIME_LO) - if (oursig < REALTIME_LO || oursig >= REALTIME_HI) - { - *oursig_ok = 0; - return 0; - } + retsig = 0; if (oursig >= TARGET_SIGNAL_REALTIME_33 && oursig <= TARGET_SIGNAL_REALTIME_63) { /* This block of signals is continuous, and TARGET_SIGNAL_REALTIME_33 is 33 by definition. */ - int retsig = - (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33; - return retsig; + retsig = (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33; } else if (oursig == TARGET_SIGNAL_REALTIME_32) { /* TARGET_SIGNAL_REALTIME_32 isn't contiguous with TARGET_SIGNAL_REALTIME_33. It is 32 by definition. */ - return 32; + retsig = 32; } else if (oursig >= TARGET_SIGNAL_REALTIME_64 && oursig <= TARGET_SIGNAL_REALTIME_127) { /* This block of signals is continuous, and TARGET_SIGNAL_REALTIME_64 is 64 by definition. */ - int retsig = - (int) oursig - (int) TARGET_SIGNAL_REALTIME_64 + 64; - return retsig; + retsig = (int) oursig - (int) TARGET_SIGNAL_REALTIME_64 + 64; } + + if (retsig >= REALTIME_LO && retsig < REALTIME_HI) + return retsig; #endif *oursig_ok = 0; diff --git a/gdb/somread.c b/gdb/somread.c index 85d4f0a..654ae06 100644 --- a/gdb/somread.c +++ b/gdb/somread.c @@ -37,6 +37,8 @@ /* Various things we might complain about... */ +static int init_import_symbols (struct objfile *objfile); + static void som_symfile_init (struct objfile *); static void som_new_init (struct objfile *); @@ -466,7 +468,7 @@ som_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs) not defined there. (Variables that are imported are dealt with as "loc_indirect" vars.) Return value = number of import symbols read in. */ -int +static int init_import_symbols (struct objfile *objfile) { unsigned int import_list; diff --git a/gdb/somsolib.h b/gdb/somsolib.h index 0840067..c241411 100644 --- a/gdb/somsolib.h +++ b/gdb/somsolib.h @@ -23,6 +23,9 @@ Written by the Center for Software Science at the Univerity of Utah and by Cygnus Support. */ +#ifndef SOMSOLIB_H +#define SOMSOLIB_H + /* Forward decl's for prototypes */ struct target_ops; struct objfile; @@ -164,3 +167,12 @@ extern char *som_solib_address (CORE_ADDR); /* somsolib.c */ /* If ADDR lies in a shared library, return its name. */ #define PC_SOLIB(addr) som_solib_address (addr) + +extern CORE_ADDR som_solib_get_solib_by_pc (CORE_ADDR addr); + +struct so_list; +extern CORE_ADDR so_lib_thread_start_addr (struct so_list *so); + +extern void no_shared_libraries (char *ignored, int from_tty); + +#endif diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index e9daad8..a6ca7cd 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -1040,7 +1040,7 @@ sparc_push_dummy_frame (void) sp -= DUMMY_STACK_SIZE; - write_sp (sp); + DEPRECATED_DUMMY_WRITE_SP (sp); write_memory (sp + DUMMY_REG_SAVE_OFFSET, ®ister_temp[0], DUMMY_STACK_REG_BUF_SIZE); @@ -1310,7 +1310,7 @@ sparc_pop_frame (void) read_memory_integer (fsr[O0_REGNUM + 7], SPARC_INTREG_SIZE)); - write_sp (get_frame_base (frame)); + DEPRECATED_DUMMY_WRITE_SP (get_frame_base (frame)); } else if (fsr[I0_REGNUM]) { @@ -3161,7 +3161,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8); set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8); set_gdbarch_deprecated_pop_frame (gdbarch, sparc_pop_frame); - set_gdbarch_push_return_address (gdbarch, sparc_push_return_address); + set_gdbarch_deprecated_push_return_address (gdbarch, sparc_push_return_address); set_gdbarch_deprecated_push_dummy_frame (gdbarch, sparc_push_dummy_frame); set_gdbarch_read_pc (gdbarch, generic_target_read_pc); set_gdbarch_register_convert_to_raw (gdbarch, sparc_convert_to_raw); @@ -3259,7 +3259,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_npc_regnum (gdbarch, SPARC32_NPC_REGNUM); set_gdbarch_pc_regnum (gdbarch, SPARC32_PC_REGNUM); set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT); - set_gdbarch_push_arguments (gdbarch, sparc32_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, sparc32_push_arguments); set_gdbarch_read_fp (gdbarch, generic_target_read_fp); set_gdbarch_read_sp (gdbarch, generic_target_read_sp); @@ -3279,7 +3279,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_store_struct_return (gdbarch, sparc32_store_struct_return); set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention); - set_gdbarch_write_sp (gdbarch, generic_target_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); tdep->y_regnum = SPARC32_Y_REGNUM; tdep->fp_max_regnum = SPARC_FP0_REGNUM + 32; tdep->intreg_size = 4; @@ -3315,7 +3315,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_npc_regnum (gdbarch, SPARC64_NPC_REGNUM); set_gdbarch_pc_regnum (gdbarch, SPARC64_PC_REGNUM); set_gdbarch_ptr_bit (gdbarch, 8 * TARGET_CHAR_BIT); - set_gdbarch_push_arguments (gdbarch, sparc64_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, sparc64_push_arguments); /* NOTE different for at_entry */ set_gdbarch_read_fp (gdbarch, sparc64_read_fp); set_gdbarch_read_sp (gdbarch, sparc64_read_sp); @@ -3337,7 +3337,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_store_struct_return (gdbarch, sparc64_store_struct_return); set_gdbarch_use_struct_convention (gdbarch, sparc64_use_struct_convention); - set_gdbarch_write_sp (gdbarch, sparc64_write_sp); + set_gdbarch_deprecated_dummy_write_sp (gdbarch, sparc64_write_sp); tdep->y_regnum = SPARC64_Y_REGNUM; tdep->fp_max_regnum = SPARC_FP0_REGNUM + 48; tdep->intreg_size = 8; diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 4337088..3c031f3 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,30 @@ +2003-03-29 Andrew Cagney <cagney@redhat.com> + + * gdb.base/sizeof.c (main): Print the value of '\377'. + * gdb.base/sizeof.exp: Check the sign of '\377'. + +2003-03-27 Michael Chastain <mec@shout.net> + + * gdb.base/gdb1090.exp: New file. + * gdb.base/gdb1090.cc: New file. + +2003-03-27 J. Brobecker <brobecker@gnat.com> + + * gdb.gdb/observer.exp: New regression test. + +2003-03-27 Michael Chastain <mec@shout.net> + + * gdb.base/list.exp: Remove setup_xfail_format for DWARF 1. + * gdb.base/ptype.exp: Likewise. + +2003-03-27 Corinna Vinschen <vinschen@redhat.com> + + * gdb.c++/casts.exp: Fix startup to run also on embedded targets. + +2003-03-26 Michael Chastain <mec@shout.net> + + * gdb.base/ptype.exp: Actually use some typedef'd types. + 2003-03-21 Stephane Carrez <stcarrez@nerim.fr> * gdb.asm/asm-source.exp: Set asm-arch for m6811 and m6812. diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp index dee9152..84a15cf 100644 --- a/gdb/testsuite/gdb.base/list.exp +++ b/gdb/testsuite/gdb.base/list.exp @@ -164,11 +164,9 @@ proc test_listsize {} { proc test_list_include_file {} { global gdb_prompt - setup_xfail_format "DWARF 1" setup_xfail_format "COFF" gdb_test "list list0.h:1" "1\[ \t\]+/\[*\]+ An include file .*10\[ \t\]+bar \\(x\\+\\+\\);" "list line 1 in include file" - setup_xfail_format "DWARF 1" setup_xfail_format "COFF" gdb_test "list list0.h:100" "Line number 95 out of range; .*list0.h has 3\[67\] lines." "list message for lines past EOF" } @@ -239,7 +237,6 @@ proc test_list_function {} { # Ultrix gdb is the second case, still correct. # SunPRO cc is the third case. setup_xfail "powerpc-*-*" - setup_xfail_format "DWARF 1" gdb_test "list foo" "(3\[ \t\]+.*12\[ \t\]+bar \[(\]+.*\[)\]+;|2\[ \t\]+including file.*11\[ \t\]+bar \[(\]+.*\[)\]+;|1\[ \t\]+/. An include file.*10\[ \t\]+bar \[(\]+.*\[)\]+;)" "list function in include file" } @@ -427,7 +424,6 @@ proc test_list_filename_and_function {} { # SunPRO cc is the third case. setup_xfail "rs6000-*-*" 1804 setup_xfail "powerpc-*-*" 1804 - setup_xfail_format "DWARF 1" setup_xfail_format "COFF" send_gdb "list list0.h:foo\n" gdb_expect { @@ -496,7 +492,6 @@ proc test_list_filename_and_function {} { gdb_test "list foobar.c:main" "No source file named foobar.c.|Location not found" "list filename:function; nonexistant file" - setup_xfail_format "DWARF 1" gdb_test "list list0.h:foobar" "Function \"foobar\" not defined.|Location not found" "list filename:function; nonexistant function" } diff --git a/gdb/testsuite/gdb.base/ptype.c b/gdb/testsuite/gdb.base/ptype.c index 2c85c7c..397a714 100644 --- a/gdb/testsuite/gdb.base/ptype.c +++ b/gdb/testsuite/gdb.base/ptype.c @@ -59,6 +59,7 @@ double v_double_array[2]; /* PR 3742 */ typedef char t_char_array[]; +t_char_array *pv_char_array; /**** pointers *******/ @@ -237,6 +238,8 @@ int (*xptr) (int (*) (), int (*) (void), int); int (*(*ffptr) (char)) (short); int (*(*(*fffptr) (char)) (short)) (long); +func_type v_func_type; + /* Here are the sort of stabs we expect to see for the above: .stabs "func_type:t(0,100)=*(0,101)=g(0,1)(0,102)=*(0,103)=g(0,1)(0,1)(0,14)#(0,14)#",128,0,234,0 diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp index 6e33d85..6580b43 100644 --- a/gdb/testsuite/gdb.base/ptype.exp +++ b/gdb/testsuite/gdb.base/ptype.exp @@ -1,5 +1,5 @@ # Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1999, -# 2000, 2002 Free Software Foundation, Inc. +# 2000, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -137,7 +137,6 @@ if {!$gcc_compiled && !$hp_aCC_compiler} { # For get_debug_format to do its job, we need to have a current source file. gdb_test "list main" "" get_debug_format -setup_xfail_format "DWARF 1" gdb_test "whatis v_boolean" "type = (enum |)boolean" \ "whatis unnamed typedef'd enum (compiler bug in IBM's xlc)" @@ -370,7 +369,6 @@ gdb_test "ptype v_int" "type = int.*" "ptype int" # if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" } -setup_xfail_format "DWARF 1" if {$hp_aCC_compiler} {setup_xfail "hppa*-*-*"} gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]" diff --git a/gdb/testsuite/gdb.base/sizeof.c b/gdb/testsuite/gdb.base/sizeof.c index 95d379e..c32231f 100644 --- a/gdb/testsuite/gdb.base/sizeof.c +++ b/gdb/testsuite/gdb.base/sizeof.c @@ -114,6 +114,7 @@ main () printf ("sizeof (long double) == %d\n", sizeof (long double)); /* Signed char? */ + printf ("valueof ('\\377') == %d\n", '\377'); printf ("valueof ((int) (char) -1) == %d\n", (int) (char) -1); printf ("valueof ((int) (signed char) -1) == %d\n", (int) (signed char) -1); printf ("valueof ((int) (unsigned char) -1) == %d\n", (int) (unsigned char) -1); diff --git a/gdb/testsuite/gdb.base/sizeof.exp b/gdb/testsuite/gdb.base/sizeof.exp index 7c03905..7fcbe0e 100644 --- a/gdb/testsuite/gdb.base/sizeof.exp +++ b/gdb/testsuite/gdb.base/sizeof.exp @@ -154,10 +154,12 @@ proc check_valueof { exp val } { # Check that GDB and the target agree over the sign of a character. +set signof_byte [get_valueof "/d" "'\\377'" -1] set signof_char [get_valueof "/d" "(int) (char) -1" -1] set signof_signed_char [get_valueof "/d" "(int) (signed char) -1" -1] set signof_unsigned_char [get_valueof "/d" "(int) (unsigned char) -1" -1] +check_valueof "'\\\\377'" ${signof_byte} check_valueof "(int) (char) -1" ${signof_char} check_valueof "(int) (signed char) -1" ${signof_signed_char} check_valueof "(int) (unsigned char) -1" ${signof_unsigned_char} diff --git a/gdb/testsuite/gdb.c++/casts.exp b/gdb/testsuite/gdb.c++/casts.exp index 859755f..5b6cabe 100644 --- a/gdb/testsuite/gdb.c++/casts.exp +++ b/gdb/testsuite/gdb.c++/casts.exp @@ -55,11 +55,16 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} +if ![runto_main] then { + perror "couldn't run to breakpoint" + continue +} + gdb_test "break [gdb_get_line_number "casts.exp: 1"]" \ "Breakpoint.*at.* file .*" \ "" -gdb_test "run" "Breakpoint .* at .*casts.cc.*" "" +gdb_test "continue" "Breakpoint .* at .*casts.cc.*" "" # Casting a pointer to a base class to a pointer to a derived class # should yield the entire derived class. Until August 2002, GDB got diff --git a/gdb/thread.c b/gdb/thread.c index 2c70ee5..1b6d872 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -255,9 +255,8 @@ in_thread_list (ptid_t ptid) /* Print a list of thread ids currently known, and the total number of threads. To be used from within catch_errors. */ -static int -do_captured_list_thread_ids (struct ui_out *uiout, - void *arg) +static int +do_captured_list_thread_ids (struct ui_out *uiout, void *arg) { struct thread_info *tp; int num = 0; @@ -291,24 +290,23 @@ gdb_list_thread_ids (struct ui_out *uiout) /* Load infrun state for the thread PID. */ void -load_infrun_state (ptid_t ptid, - CORE_ADDR *prev_pc, +load_infrun_state (ptid_t ptid, + CORE_ADDR *prev_pc, CORE_ADDR *prev_func_start, - char **prev_func_name, + char **prev_func_name, int *trap_expected, struct breakpoint **step_resume_breakpoint, struct breakpoint **through_sigtramp_breakpoint, - CORE_ADDR *step_range_start, + CORE_ADDR *step_range_start, CORE_ADDR *step_range_end, - struct frame_id *step_frame_id, + struct frame_id *step_frame_id, int *handling_longjmp, - int *another_trap, + int *another_trap, int *stepping_through_solib_after_catch, bpstat *stepping_through_solib_catchpoints, int *stepping_through_sigtramp, - int *current_line, - struct symtab **current_symtab, - CORE_ADDR *step_sp) + int *current_line, + struct symtab **current_symtab, CORE_ADDR *step_sp) { struct thread_info *tp; @@ -329,8 +327,10 @@ load_infrun_state (ptid_t ptid, *step_frame_id = tp->step_frame_id; *handling_longjmp = tp->handling_longjmp; *another_trap = tp->another_trap; - *stepping_through_solib_after_catch = tp->stepping_through_solib_after_catch; - *stepping_through_solib_catchpoints = tp->stepping_through_solib_catchpoints; + *stepping_through_solib_after_catch = + tp->stepping_through_solib_after_catch; + *stepping_through_solib_catchpoints = + tp->stepping_through_solib_catchpoints; *stepping_through_sigtramp = tp->stepping_through_sigtramp; *current_line = tp->current_line; *current_symtab = tp->current_symtab; @@ -340,24 +340,23 @@ load_infrun_state (ptid_t ptid, /* Save infrun state for the thread PID. */ void -save_infrun_state (ptid_t ptid, - CORE_ADDR prev_pc, +save_infrun_state (ptid_t ptid, + CORE_ADDR prev_pc, CORE_ADDR prev_func_start, - char *prev_func_name, + char *prev_func_name, int trap_expected, struct breakpoint *step_resume_breakpoint, struct breakpoint *through_sigtramp_breakpoint, - CORE_ADDR step_range_start, + CORE_ADDR step_range_start, CORE_ADDR step_range_end, - const struct frame_id *step_frame_id, + const struct frame_id *step_frame_id, int handling_longjmp, - int another_trap, + int another_trap, int stepping_through_solib_after_catch, bpstat stepping_through_solib_catchpoints, - int stepping_through_sigtramp, + int stepping_through_sigtramp, int current_line, - struct symtab *current_symtab, - CORE_ADDR step_sp) + struct symtab *current_symtab, CORE_ADDR step_sp) { struct thread_info *tp; @@ -506,7 +505,7 @@ switch_to_thread (ptid_t ptid) static void restore_current_thread (ptid_t ptid) { - if (! ptid_equal (ptid, inferior_ptid)) + if (!ptid_equal (ptid, inferior_ptid)) { switch_to_thread (ptid); print_stack_frame (get_current_frame (), 0, -1); @@ -571,14 +570,13 @@ thread_apply_all_command (char *cmd, int from_tty) switch_to_thread (tp->ptid); #ifdef HPUXHPPA printf_filtered ("\nThread %d (%s):\n", - tp->num, - target_tid_to_str (inferior_ptid)); + tp->num, target_tid_to_str (inferior_ptid)); #else printf_filtered ("\nThread %d (%s):\n", tp->num, target_pid_to_str (inferior_ptid)); #endif execute_command (cmd, from_tty); - strcpy (cmd, saved_cmd); /* Restore exact command used previously */ + strcpy (cmd, saved_cmd); /* Restore exact command used previously */ } do_cleanups (saved_cmd_cleanup_chain); @@ -690,8 +688,7 @@ thread_command (char *tidstr, int from_tty) } static int -do_captured_thread_select (struct ui_out *uiout, - void *tidstr) +do_captured_thread_select (struct ui_out *uiout, void *tidstr) { int num; struct thread_info *tp; @@ -724,8 +721,7 @@ do_captured_thread_select (struct ui_out *uiout, } enum gdb_rc -gdb_thread_select (struct ui_out *uiout, - char *tidstr) +gdb_thread_select (struct ui_out *uiout, char *tidstr) { return catch_exceptions (uiout, do_captured_thread_select, tidstr, NULL, RETURN_MASK_ALL); @@ -744,16 +740,14 @@ _initialize_thread (void) add_prefix_cmd ("thread", class_run, thread_command, "Use this command to switch between threads.\n\ -The new thread ID must be currently known.", &thread_cmd_list, "thread ", 1, - &cmdlist); +The new thread ID must be currently known.", &thread_cmd_list, "thread ", 1, &cmdlist); add_prefix_cmd ("apply", class_run, thread_apply_command, "Apply a command to a list of threads.", &thread_apply_list, "apply ", 1, &thread_cmd_list); add_cmd ("all", class_run, thread_apply_all_command, - "Apply a command to all threads.", - &thread_apply_list); + "Apply a command to all threads.", &thread_apply_list); if (!xdb_commands) add_com_alias ("t", "thread", class_run, 1); diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 9bae316..e6720a4 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -1268,9 +1268,9 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) * Call Dummies * * These values and methods are used when gdb calls a target function. */ - set_gdbarch_push_return_address (gdbarch, v850_push_return_address); + set_gdbarch_deprecated_push_return_address (gdbarch, v850_push_return_address); set_gdbarch_deprecated_extract_return_value (gdbarch, v850_extract_return_value); - set_gdbarch_push_arguments (gdbarch, v850_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, v850_push_arguments); set_gdbarch_deprecated_pop_frame (gdbarch, v850_pop_frame); set_gdbarch_deprecated_store_struct_return (gdbarch, v850_store_struct_return); set_gdbarch_deprecated_store_return_value (gdbarch, v850_store_return_value); @@ -1292,6 +1292,9 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + return gdbarch; } diff --git a/gdb/valops.c b/gdb/valops.c index ff24a9f..5b36cb7 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1079,8 +1079,8 @@ value_push (register CORE_ADDR sp, struct value *arg) } CORE_ADDR -default_push_arguments (int nargs, struct value **args, CORE_ADDR sp, - int struct_return, CORE_ADDR struct_addr) +legacy_push_arguments (int nargs, struct value **args, CORE_ADDR sp, + int struct_return, CORE_ADDR struct_addr) { /* ASSERT ( !struct_return); */ int i; @@ -1264,6 +1264,7 @@ hand_function_call (struct value *function, int nargs, struct value **args) static ULONGEST *dummy; int sizeof_dummy1; char *dummy1; + CORE_ADDR dummy_addr; CORE_ADDR old_sp; struct type *value_type; unsigned char struct_return; @@ -1428,21 +1429,25 @@ hand_function_call (struct value *function, int nargs, struct value **args) real_pc = start_sp; #endif - if (CALL_DUMMY_LOCATION == ON_STACK) + switch (CALL_DUMMY_LOCATION) { + case ON_STACK: + dummy_addr = start_sp; write_memory (start_sp, (char *) dummy1, sizeof_dummy1); if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) generic_save_call_dummy_addr (start_sp, start_sp + sizeof_dummy1); - } - - if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT) - { + break; + case AT_ENTRY_POINT: real_pc = funaddr; + dummy_addr = CALL_DUMMY_ADDRESS (); if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) /* NOTE: cagney/2002-04-13: The entry point is going to be modified with a single breakpoint. */ generic_save_call_dummy_addr (CALL_DUMMY_ADDRESS (), CALL_DUMMY_ADDRESS () + 1); + break; + default: + internal_error (__FILE__, __LINE__, "bad switch"); } #ifdef lint @@ -1569,9 +1574,8 @@ You must use a pointer to function type variable. Command ignored.", arg_name); { int len = TYPE_LENGTH (value_type); if (STACK_ALIGN_P ()) - /* MVS 11/22/96: I think at least some of this stack_align - code is really broken. Better to let PUSH_ARGUMENTS adjust - the stack in a target-defined manner. */ + /* NOTE: cagney/2003-03-22: Should rely on frame align, rather + than stack align to force the alignment of the stack. */ len = STACK_ALIGN (len); if (INNER_THAN (1, 2)) { @@ -1605,7 +1609,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name); if (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED) { /* MVS 11/22/96: I think at least some of this stack_align code - is really broken. Better to let PUSH_ARGUMENTS adjust the + is really broken. Better to let push_dummy_call() adjust the stack in a target-defined manner. */ if (STACK_ALIGN_P () && INNER_THAN (1, 2)) { @@ -1620,9 +1624,24 @@ You must use a pointer to function type variable. Command ignored.", arg_name); } } - sp = PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr); + /* Create the dummy stack frame. Pass in the call dummy address as, + presumably, the ABI code knows where, in the call dummy, the + return address should be pointed. */ + if (gdbarch_push_dummy_call_p (current_gdbarch)) + /* When there is no push_dummy_call method, should this code + simply error out. That would the implementation of this method + for all ABIs (which is probably a good thing). */ + sp = gdbarch_push_dummy_call (current_gdbarch, current_regcache, + dummy_addr, nargs, args, sp, struct_return, + struct_addr); + else if (DEPRECATED_PUSH_ARGUMENTS_P ()) + /* Keep old targets working. */ + sp = DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return, + struct_addr); + else + sp = legacy_push_arguments (nargs, args, sp, struct_return, struct_addr); - if (PUSH_RETURN_ADDRESS_P ()) + if (DEPRECATED_PUSH_RETURN_ADDRESS_P ()) /* for targets that use no CALL_DUMMY */ /* There are a number of targets now which actually don't write any CALL_DUMMY instructions into the target, but instead just @@ -1633,9 +1652,14 @@ You must use a pointer to function type variable. Command ignored.", arg_name); return-address register as appropriate. Formerly this has been done in PUSH_ARGUMENTS, but that's overloading its functionality a bit, so I'm making it explicit to do it here. */ - sp = PUSH_RETURN_ADDRESS (real_pc, sp); + sp = DEPRECATED_PUSH_RETURN_ADDRESS (real_pc, sp); - if (STACK_ALIGN_P () && !INNER_THAN (1, 2)) + /* NOTE: cagney/2003-03-23: Diable this code when there is a + push_dummy_call() method. Since that method will have already + handled any alignment issues, the code below is entirely + redundant. */ + if (!gdbarch_push_dummy_call_p (current_gdbarch) + && STACK_ALIGN_P () && !INNER_THAN (1, 2)) { /* If stack grows up, we must leave a hole at the bottom, note that sp already has been advanced for the arguments! */ @@ -1667,7 +1691,13 @@ You must use a pointer to function type variable. Command ignored.", arg_name); might fool with it. On SPARC, this write also stores the register window into the right place in the new stack frame, which otherwise wouldn't happen. (See store_inferior_registers in sparc-nat.c.) */ - write_sp (sp); + /* NOTE: cagney/2003-03-23: Disable this code when there is a + push_dummy_call() method. Since that method will have already + stored the stack pointer (as part of creating the fake call + frame), and none of the code following that code adjusts the + stack-pointer value, the below call is entirely redundant. */ + if (DEPRECATED_DUMMY_WRITE_SP_P ()) + DEPRECATED_DUMMY_WRITE_SP (sp); if (SAVE_DUMMY_FRAME_TOS_P ()) SAVE_DUMMY_FRAME_TOS (sp); diff --git a/gdb/value.h b/gdb/value.h index 04be76a..b5b2b07 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -560,9 +560,9 @@ extern struct value *find_function_in_inferior (const char *); extern struct value *value_allocate_space_in_inferior (int); -extern CORE_ADDR default_push_arguments (int nargs, struct value ** args, - CORE_ADDR sp, int struct_return, - CORE_ADDR struct_addr); +extern CORE_ADDR legacy_push_arguments (int nargs, struct value ** args, + CORE_ADDR sp, int struct_return, + CORE_ADDR struct_addr); extern struct value *value_of_local (const char *name, int complain); diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index d2ac421..aac62f3 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -686,6 +686,9 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_function_start_offset (gdbarch, 2); set_gdbarch_believe_pcc_promotion (gdbarch, 1); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); diff --git a/gdb/version.in b/gdb/version.in index dae81b3..968b70c 100644 --- a/gdb/version.in +++ b/gdb/version.in @@ -1 +1 @@ -2003-03-26-cvs +2003-03-30-cvs diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index 321d9c3..5d43e01 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -1013,8 +1013,8 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_extract_return_value (gdbarch, x86_64_extract_return_value); - set_gdbarch_push_arguments (gdbarch, x86_64_push_arguments); - set_gdbarch_push_return_address (gdbarch, x86_64_push_return_address); + set_gdbarch_deprecated_push_arguments (gdbarch, x86_64_push_arguments); + set_gdbarch_deprecated_push_return_address (gdbarch, x86_64_push_return_address); set_gdbarch_deprecated_pop_frame (gdbarch, x86_64_pop_frame); set_gdbarch_deprecated_store_struct_return (gdbarch, x86_64_store_struct_return); set_gdbarch_store_return_value (gdbarch, x86_64_store_return_value); diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index 5408a08..1ddc03f 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -1084,9 +1084,9 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) * Call Dummies * * These values and methods are used when gdb calls a target function. */ - set_gdbarch_push_return_address (gdbarch, xstormy16_push_return_address); + set_gdbarch_deprecated_push_return_address (gdbarch, xstormy16_push_return_address); set_gdbarch_deprecated_extract_return_value (gdbarch, xstormy16_extract_return_value); - set_gdbarch_push_arguments (gdbarch, xstormy16_push_arguments); + set_gdbarch_deprecated_push_arguments (gdbarch, xstormy16_push_arguments); set_gdbarch_deprecated_pop_frame (gdbarch, xstormy16_pop_frame); set_gdbarch_deprecated_store_struct_return (gdbarch, xstormy16_store_struct_return); set_gdbarch_deprecated_store_return_value (gdbarch, xstormy16_store_return_value); @@ -1122,6 +1122,9 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_in_solib_call_trampoline (gdbarch, xstormy16_in_solib_call_trampoline); + /* Should be using push_dummy_call. */ + set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp); + return gdbarch; } |