From: nobody <> Date: Fri, 6 Jul 2001 14:44:22 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create tag 'gdb-post- X-Git-Tag: gdb-post-ptid_t-2001-05-03 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce49e1d32e42cb914b58a897e68cb109c9f29fe0;p=thirdparty%2Fbinutils-gdb.git This commit was manufactured by cvs2svn to create tag 'gdb-post- ptid_t-2001-05-03'. Sprout from dberlin-typesystem-branch 2001-07-06 14:44:20 UTC nobody 'This commit was manufactured by cvs2svn to create branch 'dberlin-' Cherrypick from master 2001-05-04 04:15:33 UTC Kevin Buettner 'Phase 1 of the ptid_t changes.': gdb/ChangeLog gdb/MAINTAINERS gdb/Makefile.in gdb/NEWS gdb/TODO gdb/arch-utils.c gdb/arch-utils.h gdb/arm-linux-nat.c gdb/blockframe.c gdb/breakpoint.c gdb/breakpoint.h gdb/cli-out.c gdb/cli/cli-cmds.c gdb/cli/cli-script.c gdb/cli/cli-setshow.c gdb/coff-solib.c gdb/coffread.c gdb/completer.c gdb/completer.h gdb/config/alpha/alpha-osf1.mh gdb/config/alpha/alpha-osf2.mh gdb/config/alpha/alpha-osf3.mh gdb/config/arm/tm-arm.h gdb/config/djgpp/djconfig.sh gdb/config/djgpp/fnchange.lst gdb/config/i386/tm-i386.h gdb/config/i386/tm-i386sol2.h gdb/config/i386/tm-i386v.h gdb/config/i386/tm-i386v42mp.h gdb/config/i386/xm-cygwin.h gdb/config/i386/xm-go32.h gdb/config/i386/xm-linux.h gdb/config/mips/tm-mips.h gdb/config/mn10300/tm-mn10300.h gdb/config/nm-linux.h gdb/config/pa/tm-hppa.h gdb/config/powerpc/ppc-eabi.mt gdb/config/powerpc/ppc-sim.mt gdb/config/powerpc/ppcle-eabi.mt gdb/config/powerpc/ppcle-sim.mt gdb/config/sparc/tm-sun4sol2.h gdb/configure gdb/configure.host gdb/configure.in gdb/configure.tgt gdb/corelow.c gdb/cp-abi.h gdb/d10v-tdep.c gdb/defs.h gdb/doc/ChangeLog gdb/doc/Makefile.in gdb/doc/annotate.texi gdb/doc/gdb.texinfo gdb/doc/gdbint.texinfo gdb/dwarf2read.c gdb/elfread.c gdb/gdb-events.c gdb/gdb-events.h gdb/gdb-events.sh gdb/gdbarch.c gdb/gdbarch.h gdb/gdbarch.sh gdb/gdbthread.h gdb/gdbtypes.c gdb/gdbtypes.h gdb/gnu-nat.c gdb/gnu-regex.c gdb/gnu-v2-abi.c gdb/go32-nat.c gdb/hp-symtab-read.c gdb/hppa-tdep.c gdb/hpux-thread.c gdb/i386-linux-nat.c gdb/i386-tdep.c gdb/i387-tdep.c gdb/ia64-linux-tdep.c gdb/ia64-tdep.c gdb/infcmd.c gdb/inferior.h gdb/infptrace.c gdb/infrun.c gdb/language.c gdb/lin-lwp.c gdb/lin-thread.c gdb/linux-thread.c gdb/lynx-nat.c gdb/m3-nat.c gdb/m32r-rom.c gdb/m68hc11-tdep.c gdb/main.c gdb/mdebugread.c gdb/memattr.c gdb/memattr.h gdb/mi/ChangeLog gdb/mi/gdbmi.texinfo gdb/mi/mi-cmd-disas.c gdb/mi/mi-cmd-stack.c gdb/mi/mi-cmd-var.c gdb/mi/mi-main.c gdb/mi/mi-out.c gdb/mi/mi-out.h gdb/minsyms.c gdb/mips-tdep.c gdb/mipsread.c gdb/mn10300-tdep.c gdb/monitor.c gdb/nindy-share/ttyflush.c gdb/objfiles.c gdb/p-exp.y gdb/partial-stab.h gdb/ppc-linux-nat.c gdb/printcmd.c gdb/proc-api.c gdb/proc-service.c gdb/procfs.c gdb/rdi-share/host.h gdb/rdi-share/hostchan.h gdb/rdi-share/unixcomm.c gdb/regcache.c gdb/remote-array.c gdb/remote-e7000.c gdb/remote-rdi.c gdb/remote-sds.c gdb/remote-sim.c gdb/remote-st.c gdb/remote.c gdb/rs6000-tdep.c gdb/ser-e7kpc.c gdb/ser-go32.c gdb/ser-ocd.c gdb/ser-tcp.c gdb/ser-unix.c gdb/sh-tdep.c gdb/sh3-rom.c gdb/sol-thread.c gdb/solib-svr4.c gdb/solib.c gdb/solib.h gdb/solist.h gdb/somsolib.c gdb/source.c gdb/sparc-tdep.c gdb/stack.c gdb/symfile.c gdb/symtab.c gdb/symtab.h gdb/target.c gdb/testsuite/ChangeLog gdb/testsuite/config/gdbserver.exp gdb/testsuite/config/sid.exp gdb/testsuite/gdb.base/annota1.exp gdb/testsuite/gdb.base/arithmet.exp gdb/testsuite/gdb.base/callfuncs.exp gdb/testsuite/gdb.base/commands.exp gdb/testsuite/gdb.base/completion.exp gdb/testsuite/gdb.base/condbreak.exp gdb/testsuite/gdb.base/corefile.exp gdb/testsuite/gdb.base/dbx.exp gdb/testsuite/gdb.base/default.exp gdb/testsuite/gdb.base/define.exp gdb/testsuite/gdb.base/ending-run.exp gdb/testsuite/gdb.base/exprs.exp gdb/testsuite/gdb.base/finish.exp gdb/testsuite/gdb.base/help.exp gdb/testsuite/gdb.base/long_long.exp gdb/testsuite/gdb.base/restore.c gdb/testsuite/gdb.base/return2.c gdb/testsuite/gdb.c++/classes.exp gdb/testsuite/gdb.c++/cplusfuncs.cc gdb/testsuite/gdb.disasm/Makefile.in gdb/testsuite/gdb.mi/ChangeLog-mi gdb/testsuite/gdb.mi/mi-basics.exp gdb/testsuite/gdb.mi/mi-break.exp gdb/testsuite/gdb.mi/mi-console.exp gdb/testsuite/gdb.mi/mi-disassemble.exp gdb/testsuite/gdb.mi/mi-eval.exp gdb/testsuite/gdb.mi/mi-hack-cli.exp gdb/testsuite/gdb.mi/mi-read-memory.exp gdb/testsuite/gdb.mi/mi-regs.exp gdb/testsuite/gdb.mi/mi-return.exp gdb/testsuite/gdb.mi/mi-simplerun.exp gdb/testsuite/gdb.mi/mi-stack.exp gdb/testsuite/gdb.mi/mi-stepi.exp gdb/testsuite/gdb.mi/mi-until.exp gdb/testsuite/gdb.mi/mi-var-block.exp gdb/testsuite/gdb.mi/mi-var-child.exp gdb/testsuite/gdb.mi/mi-var-cmd.exp gdb/testsuite/gdb.mi/mi-var-display.exp gdb/testsuite/gdb.mi/mi-watch.exp gdb/testsuite/gdb.threads/linux-dp.exp gdb/testsuite/gdb.threads/pthreads.exp gdb/testsuite/gdb.trace/actions.c gdb/testsuite/gdb.trace/gdb_c_test.c gdb/testsuite/lib/gdb.exp gdb/testsuite/lib/mi-support.exp gdb/thread-db.c gdb/thread.c gdb/top.c gdb/tracepoint.c gdb/ui-out.c gdb/ui-out.h gdb/utils.c gdb/valops.c gdb/value.h gdb/values.c gdb/varobj.c Delete: gdb/config/mips/irix6.mh gdb/config/mips/irix6.mt gdb/config/mips/nm-irix6.h gdb/config/mips/tm-irix6.h gdb/config/mips/xm-irix6.h gdb/gnu-v3-abi.c gdb/solib-osf.c gdb/testsuite/gdb.disasm/h8300s.exp gdb/testsuite/gdb.disasm/h8300s.s gdb/testsuite/gdb.mi/ChangeLog gdb/testsuite/gdb.mi/mi0-basics.exp gdb/testsuite/gdb.mi/mi0-break.exp gdb/testsuite/gdb.mi/mi0-console.exp gdb/testsuite/gdb.mi/mi0-disassemble.exp gdb/testsuite/gdb.mi/mi0-eval.exp gdb/testsuite/gdb.mi/mi0-hack-cli.exp gdb/testsuite/gdb.mi/mi0-read-memory.exp gdb/testsuite/gdb.mi/mi0-regs.exp gdb/testsuite/gdb.mi/mi0-return.exp gdb/testsuite/gdb.mi/mi0-simplerun.exp gdb/testsuite/gdb.mi/mi0-stack.exp gdb/testsuite/gdb.mi/mi0-stepi.exp gdb/testsuite/gdb.mi/mi0-until.exp gdb/testsuite/gdb.mi/mi0-var-block.exp gdb/testsuite/gdb.mi/mi0-var-child.exp gdb/testsuite/gdb.mi/mi0-var-cmd.exp gdb/testsuite/gdb.mi/mi0-var-display.exp gdb/testsuite/gdb.mi/mi0-watch.exp gdb/version.in --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 59ffe44adc1..bf35ec01ca7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,1628 +1,3 @@ -2001-07-06 Jim Blandy - - * gdbtypes.h (builtin_type_void_func_ptr): New builtin type. - * gdbtypes.c (builtin_type_void_func_ptr): Define the variable. - (build_gdbtypes): Initialize it. - (_initialize_gdbtypes): Swap it. - -2001-07-04 Daniel Jacobowitz - - * mips-tdep.c (mips32_op): Correct offset. - (itype_op): Likewise. - (itype_rs): Fix formatting. - (itype_immediate): Fix formatting. - (jtype_op): Correct offset. - (jtype_target): Fix formatting. - (rtype_op): Correct offset. - (rtype_rs): Fix formatting. - (rtype_rt): Likewise. - (rtype_rd): Likewise. - (rtype_shamt): Likewise. - (rtype_funct): Likewise. - - (mips32_next_pc): Fix formatting and comments. Recognize - coprocessor 1 branches. Check the correct field for BLT family - branches. Use itype_rt instead of itype_rs for the second register - of a BNE or BNEL branch. Move (unreachable) default case. - -2001-07-04 Andrew Cagney - - * ui-out.h (struct ui_out_impl): Add field is_mi_like_p. - (ui_out_is_mi_like_p): Declare. - * ui-out.c (ui_out_is_mi_like_p): Define. - (default_ui_out_impl): Initialize is_mi_like_p to zero. - * cli-out.c (cli_ui_out_impl): Ditto. - * breakpoint.c (print_it_typical): Use ui_out_is_mi_like_p. - (watchpoint_check, print_one_breakpoint, mention): Ditto. - * infrun.c (print_stop_reason, normal_stop): Ditto. - -2001-07-05 Daniel Jacobowitz - - * mips-tdep.c (mips_software_single_step): New function. - * config/mips/tm-mips.h: Add prototype for - mips_software_single_step. - -2001-07-05 Daniel Jacobowitz - - * ppc-linux-nat.c (supply_gregset): Use elf_greg_t instead - of greg_t. - (fill_gregset): Likewise. - -2001-07-05 Andrew Cagney - - * objfiles.c (open_mapped_file): Use lbasename instead of - basename. - -2001-07-05 Jim Blandy - - * d10v-tdep.c (d10v_frame_chain, d10v_frame_init_saved_regs, - show_regs, d10v_read_pc, d10v_write_pc, d10v_read_sp, - d10v_write_sp, d10v_write_fp, d10v_read_fp, - d10v_push_return_address): Call the functions d10v_make_daddr, - d10v_make_iaddr, d10v_convert_iaddr_to_raw, and - d10v_convert_daddr_to_raw, not the global macros D10V_MAKE_DADDR, - D10V_MAKE_IADDR, D10V_CONVERT_IADDR_TO_RAW, and - D10V_CONVERT_DADDR_TO_RAW. - - * dwarf2read (dwarf2_build_psymtabs_hard): Doc fix. - -2001-07-05 Mark Kettenis - - * config/i386/xm-go32.h (HOST_I386): Removed. - * config/i386/xm-linux.h (HOST_I386): Removed. - -2001-07-04 Mark Kettenis - - * i387-tdep.c (print_i387_value): Add extra space after final full - stop in comment. - -2001-07-04 Andrew Cagney - - * TODO (5.1): Update. Doco changes committed. - -2001-06-29 Andrew Cagney - - * config/arm/tm-arm.h: Include "floatformat.h". - -2001-06-29 Andrew Cagney - - * i387-tdep.c: Include "gdb_assert.h". - (print_i387_value): Use extract_floating to extract the FP value - from a zero padded local buffer. - -2001-06-28 Andrew Cagney - - * TODO: Delete all thread items. The thread code was overhauled. - -2001-07-04 Elena Zannoni - - * memattr.c (create_mem_region): Move n to next memory region, - to avoid infinite loop. - - * memattr.h: Add copyright statement. - * memattr.c: Ditto. - -2001-07-04 Jim Blandy - - * dwarf2read.c (struct partial_die_info): New member: has_pc_info. - (read_partial_die): Delete fourth argument; we return this info in - the struct partial_die_info object itself now. - (dwarf2_build_psymtabs_hard, scan_partial_symbols): Use the - has_pc_info field of the partial die struct, rather than passing a - variable by reference to read_partial_die. - - * dwarf2read.c (dwarf2_build_psymtabs_hard): Remove extraneous - code in loop condition. - -2001-07-03 Michael Snyder - - * thread_db (find_new_threads_callback, thread_db_thread_alive, - attach_thread): Update comments. - -2001-06-29 Ken Whaley - - * thread-db.c (attach_thread): Check for TD_THR_ZOMBIE in addition - to TD_THR_UNKNOWN when looking for defunct zombie threads. - (thread_db_thread_alive): Ditto. - (find_new_threads_callback): Ditto. - -2001-07-02 Daniel Jacobowitz - - * MAINTAINERS: Add myself to the write-after-approval list. - -2001-07-02 Daniel Jacobowitz - - * solib-svr4.c: Include "elf/mips.h". - (elf_locate_base): Make DT_MIPS_RLD_MAP block unconditional. - -2001-07-02 Jim Blandy - - * dwarf2read.c (read_comp_unit, sibling_die, dump_die, - dump_die_list, store_in_ref_table, follow_die_ref): Make these - static; they're private functions. - -2001-07-01 Mark Elbrecht - - * coffread.c (coff_symfile_read): Parse DWARF2 info if present. - -2001-06-28 Elena Zannoni - - * TODO: Add import of readline 4.2 as a gdb 5.2 task. - -2001-06-29 Andrew Cagney - - * config/djgpp/fnchange.lst: Sort. - -2001-06-28 Andrew Cagney - - * config/djgpp/fnchange.lst: Rename mi0-var-block.exp, - mi0-var-cmd.exp, mi0-var-child.exp and mi0-var-display.exp. - -2001-06-29 Andreas Jaeger - - * MAINTAINERS: Add myself to the write-after-approval list. - -2001-06-28 Andrew Cagney - - * remote-array.c (SWAP_TARGET_AND_HOST): Delete macro. - (get_hex_word): Don't use HOST_BYTE_ORDER. - (array_fetch_registers): Add variable ``reg''. Use - store_unsigned_integer to byte-swap the register. Delete unused - local ``regs''. - -2001-06-28 Andrew Cagney - - * MAINTAINERS: Add Per Bothner to Java maintainers. - -2001-06-28 Andrew Cagney - - * rdi-share/unixcomm.c (SERIAL_PREFIX): Always provide a default. - * rdi-share/hostchan.h (__unix): Hack, provide a default value. - * rdi-share/host.h (__unix): Hack, define when __NetBSD__. - * TODO: Update. - * MAINTAINERS: Update. arm-elf builds. - -2001-06-28 Jim Blandy - - * d10v-tdep.c (d10v_ts2_dmap_register): Doc fix. - - * d10v-tdep.c (d10v_frame_chain_valid, d10v_use_struct_convention, - d10v_breakpoint_from_pc, d10v_register_byte, - d10v_register_raw_size, d10v_register_virtual_size, - d10v_register_virtual_type, d10v_register_convertible, - d10v_register_convert_to_virtual, d10v_register_convert_to_raw, - d10v_make_daddr, d10v_make_iaddr, d10v_daddr_p, d10v_iaddr_p, - d10v_convert_iaddr_to_raw, d10v_convert_daddr_to_raw, - d10v_store_struct_return, d10v_store_return_value, - d10v_extract_struct_value_address, d10v_frame_saved_pc, - d10v_saved_pc_after_call, d10v_pop_frame, d10v_skip_prologue, - d10v_frame_chain, d10v_frame_init_saved_regs, - d10v_init_extra_frame_info, d10v_read_pc, d10v_write_pc, - d10v_read_sp, d10v_write_sp, d10v_write_fp, d10v_read_fp, - d10v_push_return_address, d10v_push_arguments, - d10v_extract_return_value): Make these functions static. - -2001-06-28 Andrew Cagney - - From Fernando Nasser: - * infrun.c (handle_inferior_event): Handle "nexti" inside function - prologues. - -2001-06-28 Michael Snyder - - * infrun.c (handle_inferior_event): Replace prev_pc test in all - calls to bpstat_stop_status (removed in 1999-09-24). This test - helps distinguish stepping over a breakpoint trap from stepping - thru a jump to the instruction after a breakpoint trap. - (handle_inferior_event): Don't bother writing the PC if - DECR_PC_AFTER_BREAK is zero (optimization). - * breakpoint.c (bpstat_stop_status): Add comment explaining the - purpose and usage of the "not_a_breakpoint" argument in computing - the breakpoint address. - -2001-06-28 Andrew Cagney - - From 2000-12-03 Stephane Carrez : - * monitor.c (setmem_resp_delim_pattern): New regexp pattern. - (setreg_resp_delim_pattern): Likewise. - (setmem_resp_delim_fastmap): New buffer. - (setreg_resp_delim_fastmap): Likewise. - (monitor_open): Initialize above regexp if they are defined. - (monitor_write_memory): Use regexp to check the result of write. - (monitor_store_register): Likewise to check result of register set. - -2001-06-28 Andrew Cagney - - From 2000-06-14 John Marshall : - * coff-solib.c: Include symfile.h and objfiles.h to make - OBJF_SHARED visible. - -2001-06-28 Andrew Cagney - - * configure.in (--enable-gdbmi): Enable by default. - * configure: Regenerate. - * TODO: Update. - * NEWS: Update - -2001-06-28 Joel Brobecker - - * solib-osf.c (osf_in_dynsym_resolve_code): Add a comment - explaining the consequences of always returning zero. No code - change. - -2001-06-28 Andrew Cagney - - From 2001-06-08 Daniel Jacobowitz : - * defs.h (enum target_signal): Add TARGET_SIGNAL_REALTIME_65 - to TARGET_SIGNAL_REALTIME_127. - * target.c (struct signals): Add SIG63 to SIG127. - (target_signal_from_host): Handle up to 127 signals. - (do_target_signal_to_host): Likewise. - -2001-06-27 Andrew Cagney - - * remote-sds.c (sds_start_remote): Change type of ``c'' to int - from possibly unsigned char. - -2001-06-27 Andrew Cagney - - * ser-ocd.c: Delete file. - * Makefile.in (ALLDEPFILES): Remove ser-ocd.c - (ser-ocd.o): Delete target. - * TODO: Update. - * NEWS: Update. - -2001-06-27 Andrew Cagney - - * MAINTAINERS (Write After Approval): Sort. - (Past Maintainers): Daniel Berlin stepped down as C++ maintainer. - -2001-06-26 Andrew Cagney - - * breakpoint.c (breakpoint_1): Always output the breakpoint - headings. Leave it to ui-out to decide which - -2001-06-25 Andrew Cagney - - * stack.c (print_frame): For ui_out, output a list of arguments. - -2001-06-25 Kevin Buettner - - * MAINTAINERS (paper trail): Update. - -2001-06-25 Michael Snyder - - * infrun.c: Eliminate the "thread_step_needed" state variable, - and replace it with a relatively simple test in resume. - (resume): Replace thread_step_needed logic with a test for - stepping, breakpoint_here_p and breakpoints_inserted. - Move CANNOT_STEP_BREAKPOINT logic to after thread_step logic. - (proceed): Discard thread_step_needed logic. - (wait_for_inferior, fetch_inferior_event, handle_inferior_event): - Discard thread_step_needed logic. - -2001-06-24 Fernando Nasser - - * remote-rdi.c (arm_rdi_wait): Fix return type in prototype. - * rdi-share/host.h: Add missing parenthesis in conditional. - -2001-06-22 J.T. Conklin - - * configure.in: include nlist.h when checking for member som_addr - in struct so_map. - * configure: regenerate. - -2001-06-21 Keith Seitz - - * cli-out.c (cli_out_new): Initialize new structure member - "suppress_output". - -2001-06-20 Andrew Cagney - - * ui-out.h (ui_out_table_header): Add parameter ``col_name''. - (table_header_ftype): Ditto. - * cli-out.c (cli_table_header): Update. - * ui-out.c (ui_out_table_header): Update. - (uo_table_header): Update. - (default_table_header): Update. - (append_header_to_list): Update. - (struct ui_out_header): Add field ``col_name''. - (append_header_to_list): Use xstrdup. Initialize col_name. - * breakpoint.c (breakpoint_1): Pass COL_NAME to - ui_out_table_header. - -2001-06-19 Andrew Cagney - - * cli-out.c: Include "gdb_assert.h'. - (struct ui_out_data): Add field ``suppress_output. - (cli_table_begin): When NR_ROWS is zero, suppress_output. - (cli_table_end): Clear suppress_output. - (cli_table_body): Check suppress_output. - (cli_table_header, cli_begin): Ditto. - (cli_end, cli_field_int, cli_field_skip): Ditto. - (cli_field_string, cli_field_fmt, cli_spaces): Ditto. - (cli_text, cli_message, cli_wrap_hint): Ditto. - * breakpoint.c (breakpoint_1): Close the ui_out table before - printing the breakpoint not found message. - -2001-06-18 Andrew Cagney - - * ui-out.c (ui_out_table_begin): Add parameter ``nr_rows''. - (default_table_begin): Ditto. - (uo_table_begin): Ditto. - * cli-out.c (cli_table_begin): Ditto. - * ui-out.h (ui_out_table_begin): Update - (table_begin_ftype): Update. - * breakpoint.c (breakpoint_1): Pass nr_printable_breakpoints to - ui_out_table_begin. - -2001-06-16 Andrew Cagney - - * breakpoint.c (breakpoint_1): Restructure. Compute the - nr_printable_breakpoints. Move the header output to before the - main print breakpoints loop. - (user_settable_breakpoint): New function. - -2001-06-18 Andrew Cagney - - * infrun.c, breakpoint.c: Use strncmp as the "mi" test. Allow, - "mi", "mi0" and "mi1". - -2001-06-17 Andrew Cagney - - * gdbarch.sh: Generate an error when conflicting macro - definitions. Generate an error when both pure multi-arch and - "tm.h". - * gdbarch.h, gdbarch.c: Regenerate. - * defs.h (GDB_MULTI_ARCH_TM): Rewrite definition. - -2001-06-17 Andrew Cagney - - * config/sparc/tm-sun4sol2.h (GDB_MULTI_ARCH): Down grade to - GDB_MULTI_ARCH_PARTIAL from two. - -2001-06-17 Fernando Nasser - - From 2001-06-15 Eirik Fuller - * cli/cli-script.c (free_command_lines): Reset list pointer. - -2001-06-16 Andrew Cagney - - * arch-utils.c (init_frame_pc_default): New function - * arch-utils.h (init_frame_pc_default): Declare. - * gdbarch.sh (INIT_FRAME_PC): Default to init_frame_pc_default and - not init_frame_pc_noop. - * gdbarch.h, gdbarch.c: Re-generate. - * blockframe.c (INIT_FRAME_PC): Delete macro definition. - * mips-tdep.c (mips_gdbarch_init): Set init_frame_pc to - init_frame_pc_noop. - -2001-06-16 Andrew Cagney - - * gdbarch.c: Regenerate. Out-of-sync with gdbarch.sh. - -2001-06-15 Andrew Cagney - - * gdbarch.sh (CANNOT_FETCH_REGISTER): Multi-arch. - (CANNOT_STORE_REGISTER): Ditto. - * infptrace.c (CANNOT_FETCH_REGISTER): Delete definition. - (CANNOT_STORE_REGISTER): Ditto. - * regcache.c (CANNOT_STORE_REGISTER): Ditto. - * lynx-nat.c (CANNOT_STORE_REGISTER): Ditto. - * arch-utils.h (cannot_register_not): Define. - * arch-utils.c (cannot_register_not): Declare. - -2001-06-15 Andrew Cagney - - * gdbarch.sh: Clarify pre/post default - (INIT_FRAME_PC_FIRST, INIT_FRAME_PC): Multiarch. - * blockframe.c (get_prev_frame): Remove #ifdef from around - INIT_FRAME_PC_FIRST call. - * arch-utils.c (init_frame_pc_noop): Define. - * arch-utils.h (init_frame_pc_noop): Declare. - * config/mips/tm-mips.h (INIT_FRAME_PC_FIRST): Delete. - (INIT_FRAME_PC, mips_init_frame_pc_first): Ditto. - * mips-tdep.c (mips_init_frame_pc_first): Make static. - (mips_gdbarch_init): Initialize init_frame_pc_first. - (mips_dump_tdep): Update. - -2001-06-15 Michael Snyder - - * infrun.c (context_switch): New function. Abstract the operation - of saving and restoring infrun's state when switching threads. - (handle_inferior_event): Normalize the handling of the 'thread hop' - event (when the wrong thread hits a thread-specific breakpoint, - and we need to solo-step that thread past the breakpoint). - Call keep_going, instead of target_resume. Handle the subsequent - singlestep-trap as a normal event instead of just resuming. - -2001-06-15 Andrew Cagney - - * arch-utils.c (core_addr_identity): New function. Rename - default_convert_from_func_ptr_addr. - * gdbarch.sh (CONVERT_FROM_FUNC_PTR_ADDR): Update. - (ADDR_BITS_REMOVE): Define. Default to core_addr_identity. - * defs.h (ADDR_BITS_REMOVE): Delete macro definition. - * config/mips/tm-mips.h (ADDR_BITS_REMOVE): Delete definition. - * mips-tdep.c (mips_addr_bits_remove): Make static. - (mips_gdbarch_init): Initialize addr_bits_remove. - -2001-06-15 Andrew Cagney - - From 2001-02-26 D.J. Barrow : - * configure.tgt: Add S/390 31 & 64 bit target configuration. - * configure.host: Ditto for host. - -2001-06-15 Andrew Cagney - - * gdbarch.sh (EXTRACT_STRUCT_VALUE_ADDRESS_P): Delete definition. - (EXTRACT_STRUCT_VALUE_ADDRESS): Change to a function with - predicate. - * gdbarch.h, gdbarch.c: Regenerate. - * values.c (value_being_returned): Change the reference to - EXTRACT_STRUCT_VALUE_ADDRESS_P to a function call. - -2001-06-15 Joel Brobecker - - * MAINTAINERS: Add Paul Hilfinger and Joel Brobecker to the - Write After Approval list. - -2001-06-14 Michael Snyder - - * remote.c (show_remote_protocol_qSymbol_packet_cmd, - set_remote_protocol_qSymbol_packet_cmd): New functions. - (init_all_packet_configs, show_remote_cmd): Add qSymbol packet. - (remote_check_symbols): New function. Implement qSymbol packet, - allowing target to request symbol lookup service from gdb. - (remote_open_1, remote_async_open_1): Call remote_check_symbols, - allowing symbol lookup from exec_bfd on connection to target. - (remote_new_objfile): New function. Catch new objfile notifications - from shared library module, and call remote_check_symbols. - (_initialize_remote): Hook remote_new_objfile into the shared - library notification chain. Add "set remote symbol-lookup" command. - -2001-06-14 Keith Seitz - - * tracepoint.c (trace_command): We now have tracepoint - events. Get rid of those ugly hooks. - (tracepoint_operation): Likewise. - (trace_pass_command): Likewise. - -2001-06-13 Michael Snyder - - * gdbthread.h (struct thread_info): Add new fields: - current_line, current_symtab, step_sp, for saved infrun state. - * thread.c (save_infrun_state, load_infrun_state): Save and - restore current_line, current_symtab, and step_sp. - (add_thread): Rather than adding assignments to initialize - the new fields, just use memset (tp, 0, sizeof (*tp). - This way future new fields will not be overlooked. - * infrun.c (handle_inferior_event): Save and restore save_sp, - current_line, and current_symtab when switching threads. - -2001-06-13 Elena Zannoni - - * MAINTAINERS: Add Andrew Cagney as co-maintainer of - testsuite/gdb.mi. - -2001-06-11 Andrew Cagney - - * symtab.c (lookup_symtab_1): Replace basename with lbasename. - (lookup_partial_symtab, file_matches): Ditto. - (make_source_files_completion_list): Ditto. - (make_file_symbol_completion_list): Ditto. Make local char* - variable ``tail'' constant. - (make_source_files_completion_list): Ditto with ``base_name''. - * source.c (open_source_file): Use lbasename. Make ``p'' const - char *. - -2001-06-13 Eli Zaretskii - - * config/i386/xm-go32.h (SLASH_P, ROOTED_P, SLASH_CHAR) - (SLASH_STRING): Remove unised definitions. - * config/i386/xm-cygwin.h: Likewise. - -2001-06-12 Andrew Cagney - - * ui-out.c (ui_out_list_begin): Add parameter ``id''. - (make_cleanup_ui_out_list_begin_end): Ditto. Open the list. - * ui-out.h: Update declarations. - -Mon Jun 11 17:26:43 2001 Andrew Cagney - - * source.c (openp): Make parameters ``path'' and ``string'' - constant. - (openp): Use alloca to safely duplicate ``string''. Make local - variables ``p'' and ``p1'' constant. Delete char* casts. - * defs.h: Update. - - * symtab.c (lookup_symtab_1): Make parameter ``name'' constant. - (lookup_symtab, lookup_partial_symtab): Ditto. - * symtab.h (lookup_symtab, lookup_partial_symtab): Update. - -2001-06-11 Andrew Cagney - - * ui-out.h (ui_out_table_begin): Make char* parameters constant. - (ui_out_table_header, ui_out_field_int): Ditto. - (ui_out_field_core_addr, ui_out_field_string): Ditto. - (ui_out_field_stream, ui_out_field_fmt): Ditto. - (ui_out_field_skip, ui_out_text, ui_out_message): Ditto. - * ui-out.c (ui_out_table_begin, ui_out_table_header): Update. - (ui_out_field_core_addr, ui_out_field_stream): Update. - (ui_out_field_string, ui_out_field_fmt): Update. - (ui_out_text, ui_out_message): Update. - (append_header_to_list): Make char* parameters constant. - (uo_table_header, uo_table_begin): Ditto. - (uo_field_int, uo_field_skip): Ditto. - (uo_field_string, uo_field_fmt): Ditto. - (uo_text, uo_message): Ditto. - -2001-06-11 Eli Zaretskii - - * completer.c (gdb_completer_loc_break_characters): New variable. - (line_completion_function): If we are completing on locations, - back up the start of word pointer past all characters which can - appear in a location spec. - (location_completer): New function. - - * completer.h: Add prototype for location_completer. - - * symtab.c (make_source_files_completion_list) - (add_filename_to_list, not_interesting_fname): New functions. - (filename_seen): New function, body extracted from - output_source_filename. - (output_source_filename): Call filename_seen to check if the file - was already printed. - (make_symbol_completion_list): If TEXT includes a - double-quoted string, return an empty list, not NULL. - (make_file_symbol_completion_list): New function, similar to - make_symbol_completion_list but with an additional argument - SRCFILE. - - * symtab.h (make_file_symbol_completion_list) - (make_source_files_completion_list): Add prototypes. - - * breakpoint.c (_initialize_breakpoint): Make location_completer - be the completion function for all commands which set breakpoints - and watchpoints. - (top-level): #include "completer.h". - - * tracepoint.c (_initialize_tracepoint): Make location_completer - be the completion function for the "trace" command. - (top-level): #include "completer.h". - - * printcmd.c (_initialize_printcmd): Make location_completer be - the completion function for the "print", "inspect", "call", and - "disassemble" commands. - (top-level): #include "completer.h". - - * infcmd.c (_initialize_infcmd): Make location_completer be the - completion function for the "go", "jump", and "until" commands. - (top-level): #include "completer.h". - -2001-06-10 Christopher Faylor - - * gnu-regex.c: Eliminate obsolete check for _MSC_VER. - * utils.c (notice_quit): Remove dummy function only used for _MSC_VER. - * values.c (unpack_double): Remove obsolete check for _MSC_VER. - * defs.h: Ditto. - * m32r-rom.c: Ditto. - * p-exp.y: Ditto. - * ser-e7kpc.c: Ditto. Define WIN32_LEAN_AND_MEAN under _WIN32, for - faster compilation. - (get_ds_base): Remove _MSC_VER version of this function. - * nindy-share/ttyflush.c: Ditto. - * rdi-share/host.h: Ditto. - * ser-go32.c (dos_readchar): Remove call to obsolete function. - * remote-sim.c (gdb_os_poll_quit): Ditto. - * remote-e7000.c (expect): Remove obsolete #if 0'ed code. - - * main.c (captured_main): Eliminate special Cygwin checks. - * ser-tcp.c: Remove unneeded __CYGWIN__ guard against system include. - -2001-06-09 Andrew Cagney - - * Makefile.in (gdbcmd_h): Add ui_out_h. - (breakpoint.o, infcmd.o, main.o, printcmd.o, stack.o): Ditto. - (thread.o, top.o): Ditto. - - * ui-out.h (table_begin_ftype): Make string parameters constant. - (table_header_ftype): Ditto. - (field_int_ftype): Ditto. - (field_skip_ftype): Ditto. - (field_string_ftype): Ditto. - (field_fmt_ftype): Ditto. - (text_ftype): Ditto. - (message_ftype): Ditto. - * cli-out.c (cli_table_begin): Ditto. - (cli_table_header): Ditto. - (cli_field_int): Ditto. - (cli_field_skip): Ditto. - (cli_field_string): Ditto. - (cli_field_fmt): Ditto. - (cli_text): Ditto. - (cli_message): Ditto. - (out_field_fmt): Ditto. - * ui-out.c (default_table_begin): Ditto. - (default_table_header): Ditto. - (default_field_int): Ditto. - (default_field_skip): Ditto. - (default_field_string): Ditto. - (default_field_fmt): Ditto. - (default_text): Ditto. - (default_message): Ditto. - -2001-06-08 Michael Snyder - - * breakpoint.c (delete_breakpoint): Pass mark_inserted to - remove_breakpoint, so that the subsequent test for - bpt->inserted will succeed, and duplicates will be fixed up. - -2001-06-08 Per Bothner - - * dwarf2read.c (set_cu_language): Handle DW_LANG_Java. - -2001-06-07 Keith Seitz - - * tracepoint.c (tracepoint_opertation): Add ui event - notifications. - (trace_pass_command): Ditto. - -2001-06-07 Andrew Cagney - - * MAINTAINERS (Write After Approval): Note the entry criteria. - (HP/PA): Jeff Law stepped down - -2001-06-07 Jim Blandy - - * gdbarch.sh: Make sure that '[' doesn't interpret interesting - variable values as operators. - -2001-06-07 Keith Seitz - - * gdb-events.sh: Fix quote escaping which was obsoleted - by last patch. - -2001-06-07 Keith Seitz - - * gdb-events.sh: Make if statements and tests - a little more portable. - Don't use shell's echo command to put strings containing - escaped characeters into a file -- different flavors of /bin/sh - require differnt levels of escaping. Use cat < - - * lin-lwp.c (struct lwp_info): Add member `resumed'. - (iterate_over_lwps): Make sure we can handle CALLBACK deleting the - LWP it's called for. - (lin_lwp_attach): Mark LWP as resumed to make sure the fake - SIGSTOP is reported. - (resume_clear_callback): New function. - (resume_set_callback): New function. - (lin_lwp_resume): Mark all LWP's that we're going to resume as - resumed, and unmark all others. - (status_callback): Only report a pending wait status if we pretend - that LP has been resumed. - (resumed_callback): New function. - (lin_lwp_wait): Add assertions to check that LWP's are properly - marked as resumed. Partially revert 2001-05-25 patch by Michael - Snyder: do not resume all threads. Add comment explaining the - problems associated with this bit of code. - -2001-06-07 Keith Seitz - - * MAINTAINTERS: Syd Polk is stepping down from - maintaining libgui. I am replacing him. - -2001-06-07 Eli Zaretskii - - * config/mips/tm-irix6.h: New file. - - * config/mips/irix6.mh: New file. - - * config/mips/irix6.mt: New file. - - * config/mips/xm-irix6.h: New file. - - * config/mips/nm-irix6.h: New file. - - * mips-tdep.c (mips_gdbarch_init) : Set up the - disassembler info in tm_print_insn_info as appropriate for the N32 - ABI. Force N32 ABI to be the default if the CPU is R8000 or - R10000. - - * configure.tgt (mips*-sgi-irix6*): Map to irix6. - - * configure.host (mips*-sgi-irix6*): Ditto. - -2001-06-07 Andrew Cagney - - * gnu-v3-abi.c: Include "gdb_assert.h". - (build_gdb_vtable_type): Replace abort() with gdb_assert(). - -2001-06-06 Jim Blandy - - * cp-abi.h: Rearrange code to put documentation comments above the - functions we export. The actual function table itself simply - refers to those functions. Minor doc fixes. - - * gdbarch.sh: Changes to effect the following: - * gdbarch.c (initialize_non_multiarch): New function. - * gdbarch.h (initialize_non_multiarch): New declaration. - * arch-utils.c (initialize_current_architecture): For - non-multiarch configurations, call initialize_non_multiarch. - -2001-06-06 Andrew Cagney - - * symfile.c (compare_psymbols): Replace PTR with void*. Delete - declaration. - (compare_symbols): Ditto. - -2001-06-06 Jonathan Larmour - - * arch-utils.c (generic_prepare_to_proceed): Allow for having - stopped due to a Ctrl-C as well as breakpoints. - - * hppa-tdep.c (hppa_prepare_to_proceed): Add FIXME as this may not - support thread switches after Ctrl-C. - * lin-lwp.c (lin_lwp_prepare_to_proceed): Ditto. - * linux-thread.c (linuxthreads_prepare_to_proceed): Ditto. - * m3-nat.c (mach3_prepare_to_proceed): Ditto. - -2001-06-06 Jim Blandy - - * gdbarch.sh, gdbarch.c: Revert change of 2001-06-01; all - per-architecture data should be registered at initialization time, - before any gdbarch objects get used, so the generality is - unnecessary. - -2001-06-06 Keith Seitz - - * gdb-events.sh (function_list): Add tracepoint_create, - tracepoint_delete, and tracepoint_modify events. - * gdb-events.c: Regenerated. - * gdb-events.h: Regenerated. - -2001-06-06 Keith Seitz - - * gdb-events.sh: Update copyrights. - Change free to xfree. - * gdb-events.c: Regenerated. - * gdb-events.h: Regenerated. - -2001-06-06 Eli Zaretskii - - * source.c (mod_path, openp): Use #ifdef HAVE_DOS_BASED_FILE_SYSTEM - instead of #if HAVE_DOS_BASED_FILE_SYSTEM. - * completer.c: Ditto. - * cli/cli-cmds.c (cd_command): Ditto. - -2001-06-04 Eli Zaretskii - - * mips-tdep.c (show_mipsfpu_command): Remove unused variable msg. - (mips_set_processor_type_command): Remove unused variable j. - (mips_breakpoint_from_pc): Declare breakpoint instruction - sequences as unsigned char, to avoid compiler warnings. - - * source.c (mod_path, openp): Use HAVE_DOS_BASED_FILE_SYSTEM - instead of system-specific define's like _WIN32 and __MSDOS__. - Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH instead of SLASH_P and - ROOTED_P. - (top-level): #include "filenames.h". - - * solib.c (solib_open): Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH - instead of SLASH_CHAR, ROOTED_P and SLASH_P. - (top-level): #include "filenames.h". - - * defs.h (SLASH_P, SLASH_CHAR, ROOTED_P): Remove definitions. - (SLASH_STRING): Define only for _WIN32. - - * completer.c: Use HAVE_DOS_BASED_FILE_SYSTEM instead of - __MSDOS_. - - * cli/cli-cmds.c (cd_command): Use IS_DIR_SEPARATOR and - IS_ABSOLUTE_PATH instead of SLASH_P and ROOTED_P. Replace - system-specific ifdefs with HAVE_DOS_BASED_FILE_SYSTEM. - (top-level): #include "filenames.h". - - * go32-nat.c (go32_wait): Change the return value to ptid_t. - - * config/djgpp/fnchange.lst: Add two new files in the - gdb/testsuite/gdb.c++/ directory to the remapped names. - - * config/djgpp/djconfig.sh (lt_cv_sys_max_cmd_len): Set to 12KB. - -2001-06-01 Jim Blandy - - Expand the gdbarch per-architecture data vector as needed, rather - than requiring that all per-architecture data be registered before - the first gdbarch object is allocated. - * gdbarch.sh: Changes to effect the following: - * gdbarch.c (alloc_gdbarch_data, init_gdbarch_data): Delete - declarations and definitions. - (check_gdbarch_data): New function, and declaration. - (gdbarch_alloc): Don't call alloc_gdbarch_data; leaving the fields - zero is good enough. - (free_gdbarch_data): Tolerate a null data pointer. Free only - those data items gdbarch->data actually has allocated. - (set_gdbarch_data, gdbarch_data): Call check_gdbarch_data. - (gdbarch_update_p): No need to call init_gdbarch_data. - -2001-06-01 Kevin Buettner - - * ia64-tdep.c (is_float_or_hfa_type_recurse): Call check_typedef() - on types that we wish to recurse on. - (slot_alignment_is_next_even): New function. - (ia64_push_arguments): Call slot_alignment_is_next_even() to - examine the type in order to decide if it's necessary to skip - an odd slot. - -2001-06-01 Michael Snyder - - * thread.c (delete_step_resume_breakpoint): New function. - Maintain internal consistency of the thread list while deleting - a step_resume_breakpoint. - * gdbthread.h (delete_step_resume_breakpoint): Export. - * breakpoint.c (bpstat_find_step_resume_breakpoint): - Make thread-aware: don't return a step_resume_breakpoint - for the wrong thread. - * infrun.c (wait_for_inferior): Call delete_step_resume_breakpoint - instead of delete_breakpoint_current_contents. - (fetch_inferior_event): Ditto. - (handle_inferior_event): Call delete_step_resume_breakpoint - instead of delete_breakpoint. - * infrun.c (handle_inferior_event): After singlestepping over a - thread-specific breakpoint, use currently_stepping() to decide - whether to step or continue. - -2001-06-01 Jim Blandy - - * gnu-v3-abi.c (gnu_v3_abi_ops, vtable_type_gdbarch_data): Make - these static --- there's no reason other files should use these. - - * partial-stab.h (case N_FUN: case 'f':, case N_FUN: case 'F':) - Fix memory leak. - - * partial-stab.h: New complaint: function_outside_compilation_unit. - (case N_FUN: case 'f':, case N_FUN: case 'F':): If pst is zero, - complain, and don't try to set pst's start address. - -2001-05-31 Kevin Buettner - - * ia64-linux-tdep.c (IA64_LINUX_SIGCONTEXT_OFFSET): Revise to - match the location at which the kernel is placing the sigcontext - struct. - - * ia64-tdep.c (max_skip_non_prologue_insns): New static global. - (refine_prologue_limit): New function. - (examine_prologue): Further limit number of instructions - scanned by calling refine_prologue_limit(). Revise way in - which the end of prologue address is computed for frameless - functions. - -2001-05-29 Christopher Faylor - - * partial-stab.h: Revert previous patch. - -2001-05-29 Christopher Faylor - - * partial-stab.h: Consistently guard against pst being NULL. - -2001-05-29 Alexandre Oliva - - * symfile.c (compare_psymbols, compare_symbols): Declare using - PTR, as in the definition. - * minsyms.c (compare_minimal_symbols): Likewise. - * coffread.c (find_targ_sec): Likewise. - * elfread.c (free_elfinfo, elf_locate_sections): Likewise. - * mipsread.c (alphacoff_locate_sections): Likewise. - * mdebugread.c (compare_blocks): Likewise. - -2001-05-25 Nick Duffek - - * solib.c (update_solib_list): Move target_resize_to_sections() - into solib_map_sections() loop. - (info_sharedlibrary_command): Try bfd_arch_bits_per_address() if - bfd_get_arch_size() fails. - -2001-05-25 Nick Duffek - - * Makefile.in (osfsolib.c, osfsolib.o): Rename to solib-osf.c and - solib-osf.o. - * config/alpha/alpha-osf1.mh (NATDEPFILES): Replace osfsolib.o - with solib-osf.o and solib.o. - * config/alpha/alpha-osf2.mh: Likewise. - * config/alpha/alpha-osf3.mh: Likewise. - * solib-osf.c: New file, renamed and largely rewritten from - osfsolib.c. - -2001-05-25 Michael Snyder - - * lin-lwp.c (lin_lwp_attach_lwp): Call stop_wait_callback, - to consume the SIGSTOP generated by PTRACE_ATTACH. - (stop_wait_callback): If a SIGTRAP or a SIGINT event is consumed, - try again to get the SIGSTOP event. - (lin_lwp_wait): Resume all threads when ignoring a signal. - This will insure that newly attached threads get resumed. - * lin-lwp.c (stop_wait_callback): Discard redundant SIGINT events. - * remote.c (remote_write_bytes): Update 'p' packet pointer. - -2001-05-25 Jim Blandy - - * gnu-v2-abi.c (gnuv2_virtual_fn_field): There's no need to clear - VALUE_POINTED_TO_OFFSET here; if value_cast doesn't return a - useful value, then we should fix that instead. - -2001-05-24 Nick Duffek - - * solist.h (struct so_list): Document the requirement that - current_sos initialize some fields to 0. - -2001-05-24 Mark Kettenis - - * gnu-nat.c: Include . - (gnu_pid_to_exec_file): Add PID parameter. - (set_sig_thread_cmd): Use PIDGET on return value from - thread_id_to_pid. - (proc_string): Use MERGEPID to construct argument to - pid_to_thread_id. - -2001-05-22 Kevin Buettner - - * breakpoint.c (breakpoint_address_is_meaningful): New function. - (check_duplicates): Don't compare non-meaningful addresses. - -2001-05-22 Michael Snyder - - * thread-db.c: Allow for defunct zombie threads. - (attach_thread): Do not attempt to attach zombie thread. - (thread_db_thread_alive): Return false for defunct zombie thread. - (find_new_threads_callback): Don't add defunct zombie thread to list. - -2001-05-22 Jim Blandy - - Add support for the GNU V3 C++ ABI. - (Includes changes by Dan Berlin.) - - * gnu-v3-abi.c: New file. - * minsyms.c: #include "value.h" and "cp-abi.h". - (install_minimal_symbols): Check the minimal symbol table for - symbols that look mangled in the V3 style, and select the V3 ABI - if we find any. - * Makefile.in (SFILES): Add gnu-v3-abi.c. - (COMMON_OBS): Add gnu-v3-abi.o. - (gnu-v3-abi.o): Add new rule. - (minsyms.o): Depend on $(cp_abi_h) and $(value_h). - -2001-05-21 Jim Blandy - - * values.c (value_primitive_field): If we're extracting a base - class, then the type of the result should be the base class being - extracted, not the type of which it is a base class. - - * value.h (struct value): Doc fix, and rearrange members to place - them near their explanations. - -2001-05-21 Michael Snyder - - * remote.c (remote_async_wait): Added new variable fieldsize. - Add fieldsize (return value of hex2bin) to string pointer p. - -2001-05-20 Stephane Carrez - - * m68hc11-tdep.c (m68hc11_pop_frame): Fix stack pointer computation. - (m68hc11_analyze_instruction): Update the pc correctly. - (m68hc11_guess_from_prologue): Take into account the stack correction - for the saving address. - -2001-05-07 Daniel Berlin - - Changes by Jim Ingham: - - * values.c (value_change_enclosing_type): New function. If the - new enclosing type is larger than the old one, we need to allocate - more space. - * value.h: Add value_change_enclosing_type prototype. - * valops.c (value_cast): Use it. - (value_assign): Use it. - (value_addr): Use it. - (value_ind): Use it. - (value_full_object): Use it. - -2001-05-07 Daniel Berlin - - * values.c (value_static_field): Handle static fields that have a - constant value. - -2001-05-17 Michael Snyder - - * blockframe.c (create_new_frame): Zero all the fields via memset, - rather than zeroing them one by one. - -2001-05-17 Eli Zaretskii - - * top.c (user_args): Remove unused declaration. - -2001-05-16 Michael Snyder - - * infcmd.c (do_registers_info): Move alloca outside of loop. - -2001-05-15 John S Kallal - - * remote.c (remote_wait): Added new variable fieldsize. - Add fieldsize (return value of hex2bin) to string pointer p. - -2001-05-15 Mark Kettenis - - * sparc-tdep.c (sparc_gdbarch_init): Get the architecture from - info.bfd_arch_info. - -2001-05-14 Kevin Buettner - - * lin-lwp.c (detach_callback, lin_lwp_wait, lin_lwp_pid_to_str): - Adjust format strings for printing LWPs to account for the fact - that the type returned by GET_LWP() is now a long instead of an - int. - -2001-05-14 Kevin Buettner - - * inferior.h (null_ptid, minus_one_ptid): New variable declarations. - (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp) - (ptid_get_tid, ptid_equal): New function declarations. - * infrun.c (null_ptid, minus_one_ptid): New variables. - (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp) - (ptid_get_tid, ptid_equal): New functions. - (_initialize_infrun): Initialize null_ptid, minus_one_ptid, - inferior_ptid, and target_last_wait_ptid. - - * defs.h (ptid_t): Redefine to be a struct rather than an int. - (pid_to_ptid, null_ptid, ptid_equal): Delete these macros. - (PIDGET, TIDGET, MERGEPID): Redefine these macros using the - new ptid accessors and constructor. - - * config/i386/tm-i386v42mp.h (PIDGET, TIDGET, LIDGET, MERGEPID, - MKLID, MKTID, ISTID): Provide new definitions for these macros. - The old macros are retained, but disabled via #if 0 in order - to aid in future restructuring. See FIXME. - - * arm-linux-nat.c (PIDGET, TIDGET): Delete macro definitions. - * i386-linux-nat.c (PIDGET, TIDGET): Likewise. - * infptrace.c (PIDGET, TIDGET): Likewise. - * lin-lwp.c (PIDGET0, PIDGET, TIDGET, MERGEPID): Likewise. - * lin-thread.c (PIDGET0, PIDGET, TIDGET, MERGEPID): Likewise. - * proc-service.c (MERGEPID): Likewise. - * procfs.c (PIDGET, TIDGET, MERGEPID): Likewise. - * thread-db.c (PIDGET0, PIDGET, TIDGET, MERGEPID): Likewise. - * config/nm-linux.h (PIDGET0, PIDGET, TIDGET, MERGEPID): Likewise. - * config/i386/tm-i386sol2.h (PIDGET0, PIDGET, TIDGET, MERGEPID): - Likewise. - * config/sparc/tm-sun4sol2.h (PIDGET0, PIDGET, TIDGET, MERGEPID): - Likewise. - - * lin-lwp.c (THREAD_FLAG): Delete macro definition. - (GET_LWP): Redefine in terms of ptid_get_lwp(). - (GET_PID): Redefine in terms of ptid_get_pid(). - (is_lwp): Redefine without the need for THREAD_FLAG. - (BUILD_LWP): Redefine in terms of ptid_build(). - * lin-thread.c (THREAD_FLAG): Delete macro definition. - (GET_LWP): Redefine in terms of ptid_get_lwp(). - (GET_PID): Redefine in terms of ptid_get_pid(). - (GET_THREAD): Redefine in terms of ptid_get_tid(). - (BUILD_THREAD, BUILD_LWP): Redefine in terms of ptid_build(). - (is_lwp, is_thread): Redefine. - (linux_child_wait, check_all_signal_numbers) - (linuxthreads_discard_global_state, attach_thread): Declare these - functions to squash warnings about missing declarations. - * sol-thread.c (THREAD_FLAG): Delete macro definition. - (GET_PID): Redefine in terms of ptid_get_pid(). - (GET_LWP): Redefine in terms of ptid_get_lwp(). - (GET_THREAD): Redefine in terms of ptid_get_tid(). - (BUILD_THREAD, BUILD_LWP): Redefine in terms of ptid_build(). - (is_lwp, is_thread): Redefine. - * thread-db.c (THREAD_FLAG): Delete macro definition. - (GET_PID): Redefine in terms of ptid_get_pid(). - (GET_LWP): Redefine in terms of ptid_get_lwp(). - (GET_THREAD): Redefine in terms of ptid_get_tid(). - (BUILD_THREAD, BUILD_LWP): Redefine in terms of ptid_build(). - (is_lwp, is_thread): Redefine. - - * corelow.c (add_to_thread_list, get_core_register_section): - Eliminate hacks needed to prevent regressions when inferior_ptid - wasn't wide enough to hold the core file thread id in the pid - component of inferior_ptid. - -2001-05-14 Michael Snyder - - * remote.c (hex2bin): Make first argument const. - Require explicit count, don't accept null-terminated str. - (remote_resume, remote_async_resume): White space fix-up. - (remote_write_bytes): Set nr_bytes to return value of bin2hex. - -2001-05-13 Mark Kettenis - - * symtab.c (lookup_symtab_1): Use lbasename (NAME) instead of - basename (NAME). The FreeBSD basename returns a pointer to a - static buffer, even if it's simply returning a string identical to - its argument. - (lookup_partial_symtab): Likewise. - -2001-05-14 Michael Snyder - - * solib.c, solib.h: Add comment for function no_shared_libraries. - -2001-05-14 Kevin Buettner - - * solib.h (no_shared_libraries): Make declaration match definition - in solib.c. - -2001-05-14 Andrew Cagney - - * remote.c (remote_write_bytes): Set nr_bytes before returning it. - * solib.h (no_shared_libraries): Declare. - -2001-05-12 Andrew Cagney - - * gdbarch.sh (struct gdbarch_info): Delete field bfd_architecture. - (gdbarch_update_p): Rewrite logic filling in INFO struct. Use - user specified values when available. - * rs6000-tdep.c (rs6000_gdbarch_init): Update. Get the - architecture from info.bfd_arch_info. - * gdbarch.c, gdbarch.h: Regenerate. - -2001-05-12 Fernando Nasser - - * remote-e7000.c (e7000_open): Check for bad baud rate. - * remote-st.c (st2000_open): Ditto. - -2001-05-11 Jim Blandy - - * thread.c (do_captured_list_thread_ids): Use ui_out_tuple_begin - and ui_out_tuple_end instead of ui_out_list_begin and - ui_out_list_end. - - * Makefile.in (gnu-v2-abi.o): Add $(demangle_h) to list of - dependencies. Reorder dependencies to match #includes in file, - for easier verification. - -Fri May 11 13:32:50 2001 Andrew Cagney - - * breakpoint.c: Replace ui_out_list_begin, ui_out_list_end and - make_cleanup_ui_out_list_end with ui_out_tuple_begin, - ui_out_tuple_end and make_cleanup_ui_out_tuple_begin_end. - * cli/cli-setshow.c: Ditto. - * printcmd.c: Ditto. - * stack.c: Ditto. - - * ui-out.h (enum ui_out_type): Fix tipo - tupple -> tuple. - * ui-out.c (ui_out_list_begin): Delete ``lstid'' parameter. - (ui_out_tuple_begin): New function. - (ui_out_tuple_end): New function. - (ui_out_tuple_begin_end): New function. - (make_cleanup_ui_out_list_begin_end): Replace - make_cleanup_ui_out_list_end function. - * ui-out.h (ui_out_list_begin): Update declaration. - (make_cleanup_ui_out_list_begin_end): Replace - make_cleanup_ui_out_list_end declaration. - (ui_out_tuple_begin, ui_out_tuple_end): Declare. - (ui_out_tuple_begin_end): Declare. - -2001-05-11 Jim Blandy - - * gnu-v2-abi.c: Don't #include "gdb_regex.h". We don't use it. - -2001-05-11 Andrew Cagney - - From 2001-03-26 Rodney Brown - * config/pa/tm-hppa.h: Remove trigraph. - * hp-symtab-read.c (hpread_type_translate): Provide return value. - (hpread_read_struct_type): Remove trigraph. Add parameter in - `warning'. - (hpread_read_array_type): Provide return value. - (hpread_type_lookup): Avoid ambiguous `else'. Provide return - value. - * hppa-tdep.c (initialize_hp_cxx_exception_support): Remove - trigraph. - -2001-05-11 Jim Blandy - - * mips-tdep.c (mips_store_return_value, - mips_extract_return_value): Pass arguments to - return_value_location in the proper order. - -2001-05-11 Andrew Cagney - - * Makefile.in (VERSION): Delete. Moved to file ``version.in''. - (version.c): Depends on file ``version.in''. Extract version - number from ``version.in'' file. - (clean mostlyclean): Update. - * version.in: New file. - * NEWS: Update. - -2001-05-11 Kevin Buettner - - * breakpoint.c (set_raw_breakpoint): Add new parameter - representing the breakpoint's type. Adjust all callers. - (create_longjmp_breakpoint, create_temp_exception_breakpoint) - (create_thread_event_breakpoint): Don't test for zero return - value from set_raw_breakpoint(). It can never be zero. - (create_exception_catchpoint, watch_command_1): Move logic - which calculates the breakpoint type prior to the call to - set_raw_breakpoint(). - -2001-05-11 Fernando Nasser - - * ser-unix.c (rate_to_code): Issue warning if baud rate is invalid. - (hardwire_setbaudrate): Set errno to EINVAL and return with error - if the conversion of the baud rate to code fails. - -2001-05-10 Andrew Cagney - - * ui-out.h (make_cleanup_ui_out_begin_end): Declare. - * ui-out.c (struct ui_out_end_cleanup_data): Define. - (do_cleanup_end): New function. Replace do_list_end. - (make_cleanup_ui_out_end): New function. - (make_cleanup_ui_out_begin_end): New function. - (make_cleanup_ui_out_list_end): Use make_cleanup_ui_out_end. - -2001-05-10 Elena Zannoni - - * MAINTAINERS: Declare xcoffread.c open to all maintainers, - and make Kevin Buettner (kevinb@redhat.com) the reference person. - -2001-05-10 Elena Zannoni - - * proc-api.c (ioctl_with_trace): Fix uninitialized variable. - -2001-05-10 Fernando Nasser - - * MAINTAINERS: Add testsuite subdirectory co-maintainers. - -Thu May 10 16:26:47 2001 Andrew Cagney - - * Makefile.in (mi-main.o): Compile with -Werror. - -2001-05-10 Michael Snyder - - * remote.c (remote_open_1): Call no_shared_libraries, so that - symbols for shared libraries can be reloaded per session. - (remote_async_open_1): Ditto. - * remote.c (bin2hex, hex2bin): New functions. Factor out these - two conversions which are coded for repeatedly in this module. - (remote_threads_extra_info, remote_wait, remote_async_wait, - store_register_using_P, remote_store_registers, remote_write_bytes, - remote_read_bytes, remote_rcmd): Use bin2hex and hex2bin instead - of coding the conversions inline. - (fromhex): Not exported, change from extern to static. - -2001-05-10 Andrew Cagney - - * arch-utils.c (initialize_current_architecture): Delete obsolete - ``info architecture'' command. - (info_architecture): Delete function. - -2001-05-10 Andrew Cagney - - * TODO (5.1, 5.2): Update. - -2001-05-09 Andrew Cagney - - * MAINTAINERS: Jim Ingham is no longer maintaining Arm related - stuff. - -2001-05-10 Keith Seitz - - * Makefile.in (SUBDIR_GDBTK_OBS): Add gdbtk-bp.o, gdbtk-register.o - and gdbtk-stack.o. - (SUBDIR_GDBTK_SRCS): Ditto for the sources. - (gdbtk-bp.o): New rule. - (gdbtk-register.o): New rule. - (gdbtk-stack.o): New rule. - (gdbtk-cmds.o): Update dependencies. - (gdbtk.o): Ditto. - (gdbtk-hooks.o): Ditto. - (gdbtk-varobj.o): Ditto. - -2001-05-10 Fernando Nasser - - * varobj.c (c_number_of_children): Fix memory leak. Delete unwanted old - variables, not just unregister them. - -2001-05-10 Fernando Nasser - - * varobj.c (c_number_of_children): Check for target type of void*, - not the target type name. Allow dereferencing char*. - -2001-05-10 Fernando Nasser - - * symfile.c (symbol_file_add_main_1): New static function. - Passes the flags arguments to symbol_file_add() and takes care - of any necessary reinitializations. - (symbol_file_command): Call symbol_file_add_main_1() instead of - symbol_file_add(). - (symbol_file_add_main): Ditto. - -2001-05-09 Kevin Buettner - - * lin-lwp.c (lin_lwp_pid_to_str): Revert inadvertent format - string change in 2001-05-03 changes. - (lin_lwp_wait): Revert GET_LWP coercion introduced in 2001-05-03 - changes. - -2001-05-09 Kevin Buettner - - * lin-lwp.c (lin_lwp_attach): Use PIDGET() to fetch the pid - component from inferior_ptid. - (lin_lwp_detach): Use pid_to_ptid() to convert from a pid to a - ptid. - -2001-05-09 Elena Zannoni - - * sh3-rom.c (_initialize_sh3_rom): Get rid of specific _WINDOWS - conditional for help with connections through parallel ports, - given that the actual code for downloading through a parallel port - is not conditionalized. - - * sh-tdep.c: Remove WIN32_WCE conditional. The wince sh target is - unmaintaned, and probably on its way to obsolescence. - -2001-05-09 Mark Kettenis - - * i386-tdep.c (i386_frame_saved_pc): New function. - * config/i386/tm-i386.h (FRAME_SAVED_PC): Redefine in terms of - i386_frame_saved_pc. - (i386_frame_saved_pc): New prototype. - - * i386-tdep.c (i386_register_virtual_type): New function. - (i386_register_convertible): New function. - * config/i386/tm-i386.h (REGISTER_VIRTUAL_TYPE): Redefine in terms - of i386_register_virtual_type. - (REGISTER_CONVERTIBLE): Redefine in terms of - i386_register_convertible. - (i386_register_virtual_type, i386_register_convertible): New - prototypes. - -2001-05-08 Jim Blandy - - * Makefile.in (mn10300-tdep.o): New rule. - - * Makefile.in (gdb_string_h): Define. Use it throughout. - Some rules were already using this, even though it isn't defined. - - * Makefile.in (obstack_h, target_h): Define; these are already - used elsewhere, but have been expanding to the empty string. - (memattr_h): Define; needed by target_h. - - * mn10300-tdep.c (mn10300_extract_return_value): Mark this as - static. (This was accidentally omitted from the earlier patch.) - - * mn10300-tdep.c (mn10300_dwarf2_reg_to_regnum): New function. - (mn10300_gdbarch_init): Register it as the architecture's - dwarf2_reg_to_regnum method. - - Correct and expand handling of `movm' instruction, and register - saves in general. - * config/mn10300/tm-mn10300.h (D0_REGNUM, A0_REGNUM, MDRQ_REGNUM, - MCRH_REGNUM, MCRL_REGNUM, MCVF_REGNUM): New definitions. - (enum movm_register_bits): New enum. - * mn10300-tdep.c (set_movm_offsets): Use symbolic names for the - bits, not hex literals. Handle the `other', `exreg0', and - `exother' bits. Correct handling of `exreg1': it saves r4, r5, - r6, and r7, not r2, r3, r4, and r5. - (saved_regs_size): New function. - (mn10300_frame_chain, mn10300_frame_saved_pc): Use it, instead - of computing the same thing inline, incorrectly. - - * mn10300-tdep.c (mn10300_gdbarch_init): We do have a - dummy_breakpoint_offset; it's zero. - - * mn10300-tdep.c (mn10300_pop_frame): Split the mn10300-specific - stuff out into mn10300_pop_frame_regular, and use - generic_pop_current_frame. This lets us share code, and also - makes this function's prototype match that expected by gdbarch. - Make this function static. - (mn10300_pop_frame_regular): New function. - (mn10300_gdbarch_init): Register mn10300_pop_frame as the - gdbarch's pop_frame method. - * config/mn10300/tm-mn10300.h (POP_FRAME): Delete definition. - (mn10300_pop_frame): Delete declaration. - - * mn10300-tdep.c (mn10300_saved_pc_after_call, - mn10300_extract_return_value, - mn10300_extract_struct_value_address, mn10300_store_return_value, - mn10300_use_struct_convention, mn10300_breakpoint_from_pc, - mn10300_frame_chain, mn10300_skip_prologue, - mn10300_push_arguments, mn10300_push_return_address, - mn10300_store_struct_return, mn10300_frame_saved_pc, - mn10300_init_extra_frame_info, mn10300_frame_init_saved_regs): - Make these functions static; they should only be visible to the - outside world as gdbarch methods. - - * config/mn10300/tm-mn10300.h (mn10300_find_callers_reg): Delete - unused declaration. - - * mn10300-tdep.c (mn10300_gdbarch_init): Put the gdbarch methods - in some rational order. - - * mn10300-tdep.c (mn10300_gdbarch_init): Rather than using - generic_pc_in_call_dummy, use pc_in_call_dummy_at_entry_point. - - Use gdbarch for most target parameters for the MN10300, rather - than the tm-*.h file. - * config/mn10300/tm-mn10300.h (MAX_REGISTER_VIRTUAL_SIZE, - REGISTER_BYTES, FP_REGNUM, BREAKPOINT_FROM_PC, - FUNCTION_START_OFFSET, DECR_PC_AFTER_BREAK, INNER_THAN, - SAVED_PC_AFTER_CALL, INIT_EXTRA_FRAME_INFO, FRAME_INIT_SAVED_REGS, - FRAME_CHAIN, FRAME_CHAIN_VALID, FRAME_SAVED_PC, - EXTRACT_RETURN_VALUE, EXTRACT_STRUCT_VALUE_ADDRESS, - STORE_RETURN_VALUE, STORE_STRUCT_RETURN, SKIP_PROLOGUE, - FRAME_ARGS_SKIP, FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS, - FRAME_NUM_ARGS, POP_FRAME, USE_GENERIC_DUMMY_FRAMES, CALL_DUMMY, - CALL_DUMMY_START_OFFSET, CALL_DUMMY_BREAKPOINT_OFFSET, - CALL_DUMMY_LOCATION, FIX_CALL_DUMMY, CALL_DUMMY_ADDRESS, - TARGET_READ_FP, PUSH_RETURN_ADDRESS, PUSH_DUMMY_FRAME, - SAVE_DUMMY_FRAME_TOS, PUSH_ARGUMENTS, PC_IN_CALL_DUMMY, - REG_STRUCT_HAS_ADDR, USE_STRUCT_CONVENTION, GET_SAVED_REGISTER): - Delete definitions. We register gdbarch methods for these now. - (struct frame_info, struct type, struct value): Delete forward - declarations of these types; they're no longer necessary, since we - don't have function declarations here any more. - * mn10300-tdep.c: #include "arch-utils.h", to get declarations for - some default gdbarch methods. - (mn10300_store_struct_return): Return void, as expected by - gdbarch. - (mn10300_init_extra_frame_info): Take initial `fromleaf' argument, - as expected by gdbarch. - (mn10300_frame_init_saved_regs): Provide dummy definition for - this, as required by gdbarch. - (mn10300_gdbarch_init): Add mn10300_call_dummy_words, as expected - by gdbarch. Register gdbarch methods or values for all the stuff - removed from tm-10300.h, listed above. - -2001-05-08 Andrew Cagney - - * cli-out.c (cli_begin, cli_end): Replace cli_list_begin and - cli_list_end. - (cli_ui_out_impl): Update. - - * ui-out.c (default_begin, default_end): Replace - default_list_begin and default_list_end. - (default_ui_out_impl): Update. - (uo_begin, uo_end): Replace ou_list_begin and uo_list_end. - (ui_out_begin, ui_out_end): Replace ui_out_list_begin and - ui_out_list_end. - (ui_out_list_begin, ui_out_list_end): New. Compatibility - functions. - (struct ui_out_level): Add field type. - (push_level, pop_level): Update. Add type parameter. - - * ui-out.h (enum ui_out_type): Declare. - (ui_out_begin, ui_out_end): Declare. - (ui_out_begin_ftype, ui_out_end_ftype): Replace list_begin_ftype - and list_end_ftype. - (struct ui_out_impl): Update. - -2001-05-07 Andrew Cagney - - * ui-out.h (list_begin_ftype, list_end_ftype): Rename argument - ``list_flag'' to ``depth''. - * ui-out.c (default_list_begin, default_list_end): Update. - (uo_list_begin, uo_list_end): Update. - (MAX_UI_OUT_LEVELS): Define. - (struct ui_out_level): Define. - (top-level): Include "gdb_assert.h". - (struct ui_out): Add fields ``level'' and ``levels''. Delete - fields ``list_flag'' and ``field_count''. - (ui_out_new): Update. - (verify_field_proper_position): Update. - (current_level, push_level, pop_level): New functions. - (ui_out_list_begin): Use push_level. - (ui_out_list_end): Use pop_level. - (ui_out_field_int): Use current_level. - (ui_out_field_skip): Ditto. - (ui_out_field_fmt): Ditto. - -2001-05-08 Michael Snyder - - * language.c (longest_local_hex_string_custom): Strlen test is - inverted -- reverse the sense of the test. - -2001-05-08 Mark Kettenis - - * config/i386/tm-i386v.h (struct frame_info, struct - frame_saved_regs): Remove declarations. - (i386_frame_num_args): Remove prototype. - -2001-05-07 Andrew Cagney - - * MAINTAINERS: I'm no longer actively maintaining the mn10300 - target. - -2001-05-04 Andrew Cagney - - * main.c (captured_main): Delete #ifndef _WIN32 conditional for - WinGDB. - -2001-05-06 Kevin Buettner - - * inferior.h (save_inferior_ptid): Declare. - * infrun.c (save_inferior_ptid, restore_inferior_ptid): Define. - - * hpux-thread.c (save_inferior_ptid, restore_inferior_ptid): - Delete these functions. - * lin-lwp.c (save_inferior_ptid, restore_inferior_ptid): Likewise. - * lin-thread.c (save_inferior_ptid, restore_inferior_ptid): Likewise. - * linux-thread.c (save_inferior_ptid, restore_inferior_ptid): - Likewise. - * proc-service.c (save_inferior_ptid, restore_inferior_ptid): - Likewise. - * sol-thread.c (save_inferior_ptid, restore_inferior_ptid): Likewise. - * thread-db.c (save_inferior_ptid, restore_inferior_ptid): Likewise. - - * somsolib.c (reset_inferior_ptid): Delete. - (som_solib_remove_inferior_hook): Use save_inferior_ptid() to - build the cleanup struct. - - * breakpoint.c (reattach_breakpoints, detach_breakpoints): Use - a cleanup to save/restore inferior_ptid. - -2001-05-06 Mark Kettenis - - Implement attach/detach for multi-threaded programs on Linux. - * thread-db.c (keep_thread_db): Adjust comment. - (deactivate_target): Removed. - (thread_db_new_objfile): Don't call deactivate_target. Implement - guts of deactivate_target inline instead. - (attach_thread): Call ATTACH_LWP unconditionally if defined. - (thread_db_attach): New function. - (thread_db_detach): Don't call deactivate_target. Do necessary - cleanup inline instead. Set inferior_ptid to LWP corresponding to - the current user-level thread. - (thread_db_kill): Set inferior_ptid to LWP corresponding to the - current user-level thread. - (thread_db_create_inferior): Deactivate target vector if - KEEP_THREAD_DB is zero. - (thread_db_mourn_inferior): Don't call deactivate_target. Do - necessary cleanup inline instead. - (init_thread_db_ops): Initialize to_attach field to - thread_db_attach. - * lin-lwp.c (lin_lwp_mourn_inferior): Remove prototype. - (stop_wait_callback): Add prototype. - (init_lwp_list): Add comment about when to re-initialize the LWP - list. - (lin_lwp_attach_lwp): Only call ptrace for cloned processes. - Avoid adding publicates to the LWP list. Only mark an LWP as - signalled if it doesn't correspond to a cloned process. - (lin_lwp_attach): Add initial process to the LWP list. Make sure - it's stopped and fake a SIGSTOP. - (detach_callback): New function. - (lin_lwp_detach): Implement. - (lin_lwp_create_inferior): Don't re-initialize LWP list here. - Call child_ops.to_create_inferior directly instead of via - target_beneath local. - (lin_lwp_mourn_inferior): Call child_ops.to_mourn_inferior - directly instead of via target_beneath local. - -2001-05-06 Eli Zaretskii - - * symtab.c (lookup_symtab_1, lookup_partial_symtab): Use basename - instead of non-portable search for `/'. Use FILENAME_CMP instead - of STREQ, to account for case-insensitive filesystems. - (top-level): #include "filenames.h". - -2001-05-05 Jim Blandy - - * breakpoint.c (check_duplicates): Use the breakpoint's type, not - its address, to decide whether it's a watchpoint or not. Zero - is a valid code address. - (update_breakpoints_after_exec): Admonishing comments. - * breakpoint.h (struct breakpoint): Doc fixes. - - * breakpoint.c (check_duplicates): Take a breakpoint object as an - argument, rather than an address and section. All callers changed. - 2001-05-03 Kevin Buettner * defs.h (ptid_t): New typedef. diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS index 9fff3261355..5c074454f95 100644 --- a/gdb/MAINTAINERS +++ b/gdb/MAINTAINERS @@ -57,8 +57,9 @@ maintainer works with the native maintainer when resolving API issues. arc --target=arc-elf ,-Werror Maintenance only - arm --target=arm-coff,arm-elf,arm-pe -w + arm (--target=arm-coff,arm-elf,arm-pe broken) Fernando Nasser fnasser@cygnus.com + Jim Ingham jingham@apple.com Scott Bambrough scottb@netwinder.org d10v --target=d10v-elf ,-Werror @@ -111,13 +112,13 @@ maintainer works with the native maintainer when resolving API issues. Maintenance only mn10300 --target=mn10300-elf ,-Werror - Maintenance only + Andrew Cagney cagney@cygnus.com ns32k --target=ns32k-netbsd ,-Werror Maintenance only pa (--target=hppa1.1-hp-proelf broken) - Maintenance only + Jeff Law law@cygnus.com powerpc --target=powerpc-eabi,powerpcle-eabi ,-Werror Kevin Buettner kevinb@cygnus.com @@ -196,6 +197,7 @@ GNU/Linux PPC native Kevin Buettner kevinb@cygnus.com FreeBSD native & host Mark Kettenis kettenis@gnu.org David O'Brien obrien@freebsd.org hurd native Mark Kettenis kettenis@gnu.org +hpux, hp pa native Jeff Law law@cygnus.com NetBSD native & host J.T. Conklin jtc@redback.com SCO/Unixware Nick Duffek nsd@cygnus.com Robert Lipe rjl@sco.com @@ -229,8 +231,6 @@ generic symtabs Jim Blandy jimb@cygnus.com stabs reader Jim Blandy jimb@cygnus.com Elena Zannoni ezannoni@cygnus.com coff reader Philippe De Muyter phdm@macqel.be - xcoff reader Any maintainer can modify this; please send tricky - ones to Kevin Buettner linespec Jim Blandy jimb@cygnus.com Elena Zannoni ezannoni@cygnus.com Fernando Nasser fnasser@cygnus.com @@ -242,9 +242,8 @@ threads Michael Snyder msnyder@cygnus.com breakpoints Michael Snyder msnyder@cygnus.com Jim Blandy jimb@cygnus.com language support David Taylor taylor@cygnus.com - Java support (devolved) - Per Bothner per@bothner.com - Anthony Green green@cygnus.com + C++ support Daniel Berlin dan@cgsoftware.com + Java support Anthony Green green@cygnus.com Objective-C/C++ Klee Dienes kdienes@apple.com Jim Ingham jimgham@apple.com Pascal support Pierre Muller muller@sourceware.cygnus.com @@ -262,17 +261,11 @@ remote.c Andrew Cagney cagney@cygnus.com include/remote-sim.h, remote-sim.c Andrew Cagney cagney@cygnus.com sds protocol Fernando Nasser fnasser@cygnus.com + Jim Ingham jingham@apple.com rdi/adp protocol Fernando Nasser fnasser@cygnus.com + Jim Ingham jingham@apple.com documentation Eli Zaretskii eliz@gnu.org testsuite Fernando Nasser fnasser@cygnus.com - config Mark Salter msalter@redhat.com - lib Mark Salter msalter@redhat.com - gdbtk (gdb.gdbtk) Keith Seitz keiths@redhat.com - mi tests (gdb.mi) Elena Zannoni ezannoni@redhat.com - Andrew Cagney cagney@redhat.com - stabs (gdb.satbs) Elena Zannoni ezannoni@redhat.com - threads (gdb.threads) Michael Snyder msnyder@redhat.com - trace (gdb.trace) Michael Snyder msnyder@redhat.com hp tests (gdb.hp) (vacant) Java tests (gdb.java) Anthony Green green@cygnus.com Kernel Object Display Fernando Nasser fnasser@cygnus.com @@ -285,8 +278,8 @@ command interpreter Fernando Nasser fnasser@cygnus.com gdbtk (c & tcl) Jim Ingham jingham@apple.com Fernando Nasser fnasser@cygnus.com Keith Seitz keiths@cygnus.com -libgui (w/foundry, sn) Jim Ingham jingham@apple.com - Keith Seitz keiths@redhat.com +libgui (w/foundry, sn) Syd Polk spolk@cygnus.com + Jim Ingham jingham@apple.com mi (gdb/mi) Andrew Cagney cagney@cygnus.com Elena Zannoni ezannoni@cygnus.com Fernando Nasser fnasser@cygnus.com @@ -313,52 +306,42 @@ readline/ Master version: ftp://ftp.cwru.edu/pub/bash/ - Write After Approval - (alphabetic) - -To get recommended for the Write After Approval list you need a valid -FSF assignment and have submitted one good patch. + Write After Approval David Anderson davea@sgi.com -Philip Blundell philb@gnu.org -Joel Brobecker brobecker@act-europe.fr -Michael Chastain chastain@redhat.com -Nick Clifton nickc@cygnus.com -Orjan Friberg orjanf@axis.com -Paul Hilfinger hilfinger@gnat.com -Matt Hiller hiller@redhat.com -Kazu Hirata kazu@hxi.com -Jeff Holcomb jeffh@redhat.com -Don Howard dhoward@redhat.com -Martin Hunt hunt@redhat.com -Daniel Jacobowitz dan@debian.org -Andreas Jaeger aj@suse.de -Geoff Keating geoffk@redhat.com Jim Kingdon jkingdon@engr.sgi.com ++ -Jonathan Larmour jlarmour@redhat.co.uk +Jason Molenda jsm@cygnus.com H.J. Lu hjl@lucon.org +Nick Clifton nickc@cygnus.com +Jonathan Larmour jlarmour@redhat.co.uk Glen McCready gkm@cygnus.com -Jason Molenda jsm@cygnus.com +Gary Thomas gthomas@redhat.com Pierre Muller muller@sourceware.cygnus.com +Kazu Hirata kazu@hxi.com +Tom Tromey tromey@cygnus.com Alexandre Oliva aoliva@redhat.com Mark Salter msalter@redhat.com -Keith Seitz keiths@cygnus.com +Michael Chastain chastain@redhat.com +Orjan Friberg orjanf@axis.com +Jeff Holcomb jeffh@redhat.com David Smith dsmith@redhat.com -Gary Thomas gthomas@redhat.com -Tom Tromey tromey@cygnus.com - +Martin Hunt hunt@redhat.com +Matt Hiller hiller@redhat.com +Philip Blundell philb@gnu.org +Keith Seitz keiths@cygnus.com +Geoff Keating geoffk@redhat.com +Don Howard dhoward@redhat.com Past Maintainers Jimmy Guo (gdb.hp, tui) guo@cup.hp.com -Jeff Law (hppa) law@cygnus.com -Daniel Berlin (C++ support) dan@cgsoftware.com Folks that have been caught up in a paper trail: Jim Kingdon jkingdon@engr.sgi.com +Paul Hilfinger hilfingr@gnat.com (*) Chris G. Demetriou cgd@sibyte.com -- diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 46bd68d6c76..a2beabe334c 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -265,13 +265,11 @@ GUI_CFLAGS_X = @GUI_CFLAGS_X@ IDE_CFLAGS=$(GUI_CFLAGS_X) $(IDE_CFLAGS_X) SUBDIR_GDBTK_OBS = \ - gdbtk.o gdbtk-bp.o gdbtk-cmds.o gdbtk-hooks.o \ - gdbtk-register.o gdbtk-stack.o gdbtk-varobj.o gdbtk-wrapper.o + gdbtk.o gdbtk-cmds.o gdbtk-hooks.o gdbtk-varobj.o gdbtk-wrapper.o SUBDIR_GDBTK_SRCS = \ - gdbtk/generic/gdbtk.c gdbtk/generic/gdbtk-bp.c \ - gdbtk/generic/gdbtk-cmds.c gdbtk/generic/gdbtk-hooks.c \ - gdbtk/generic/gdbtk-register.c gdbtk/generic/gdbtk-stack.c \ - gdbtk/generic/gdbtk-varobj.c gdbtk/generic/gdbtk-wrapper.c + gdbtk/generic/gdbtk.c gdbtk/generic/gdbtk-cmds.c \ + gdbtk/generic/gdbtk-hooks.c gdbtk/generic/gdbtk-varobj.c \ + gdbtk/generic/gdbtk-wrapper.c SUBDIR_GDBTK_DEPS = \ $(LIBGUI) $(ITCL_DEPS) $(ITK_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS) SUBDIR_GDBTK_INITS = gdbtk/generic/gdbtk.c @@ -359,6 +357,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \ ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) ADD_DEPS = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) +VERSION = 5.0 DIST=gdb LINT=/usr/5bin/lint @@ -541,7 +540,7 @@ SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \ tui/tui-file.h tui/tui-file.c \ ui-file.h ui-file.c \ frame.c \ - gnu-v2-abi.c gnu-v3-abi.c hpacc-abi.c cp-abi.c + gnu-v2-abi.c hpacc-abi.c cp-abi.c LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c @@ -556,7 +555,6 @@ bfd_h = $(BFD_DIR)/bfd.h dis-asm_h = $(INCLUDE_DIR)/dis-asm.h remote-sim_h = $(INCLUDE_DIR)/remote-sim.h demangle_h = $(INCLUDE_DIR)/demangle.h -obstack_h = $(INCLUDE_DIR)/obstack.h dcache_h = dcache.h remote_utils_h = $(dcache_h) serial.h target.h remote-utils.h $(remote-sim_h) @@ -588,7 +586,7 @@ value_h = value.h $(symtab_h) $(gdbtypes_h) $(expression_h) breakpoint_h = breakpoint.h $(frame_h) $(value_h) command_h = command.h -gdbcmd_h = gdbcmd.h $(command_h) $(ui_out_h) +gdbcmd_h = gdbcmd.h $(command_h) call_cmds_h = call-cmds.h regcache_h = regcache.h @@ -599,8 +597,6 @@ defs_h = defs.h $(xm_h) $(tm_h) $(nm_h) config.status config.h gdbarch.h ui-file top_h = top.h inferior_h = inferior.h $(breakpoint_h) -target_h = target.h $(bfd_h) $(symtab_h) $(dcache_h) $(memattr_h) -memattr_h = memattr.h tracepoint_h = tracepoint.h ax_h = ax.h event_loop_h = event-loop.h @@ -611,7 +607,6 @@ version_h = version.h ui_out_h = ui-out.h cli_out_h = cli-out.h arch_utils_h = arch-utils.h -gdb_string_h = gdb_string.h cli_decode_h = $(srcdir)/cli/cli-decode.h cli_cmds_h = $(srcdir)/cli/cli-cmds.h @@ -695,7 +690,7 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \ nlmread.o serial.o mdebugread.o os9kread.o top.o utils.o \ ui-file.o tui-file.o \ frame.o \ - gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o + gnu-v2-abi.o hpacc-abi.o cp-abi.o OBS = $(COMMON_OBS) $(ANNOTATE_OBS) @@ -932,7 +927,7 @@ tags: TAGS clean mostlyclean: $(CONFIG_CLEAN) @$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(SUBDIRS)" subdir_do - rm -f *.o *.a $(ADD_FILES) *~ init.c-tmp init.l-tmp version.c-tmp + rm -f *.o *.a $(ADD_FILES) *~ init.c-tmp init.l-tmp rm -f init.c version.c rm -f gdb$(EXEEXT) core make.log rm -f gdb[0-9]$(EXEEXT) @@ -1013,13 +1008,12 @@ $(srcdir)/copying.c: @MAINTAINER_MODE_TRUE@ \ < $(srcdir)/COPYING > $(srcdir)/copying.tmp mv $(srcdir)/copying.tmp $(srcdir)/copying.c -version.c: Makefile version.in - rm -f version.c-tmp version.c - echo '#include "version.h"' >> version.c-tmp - echo 'const char version[] = "'"`head -1 ${srcdir}/version.in`"'";' >> version.c-tmp - echo 'const char host_name[] = "$(host_alias)";' >> version.c-tmp - echo 'const char target_name[] = "$(target_alias)";' >> version.c-tmp - mv version.c-tmp version.c +version.c: Makefile + rm -f version.c + echo '#include "version.h"' >> version.c + echo 'const char version[] = "$(VERSION)";' >> version.c + echo 'const char host_name[] = "$(host_alias)";' >> version.c + echo 'const char target_name[] = "$(target_alias)";' >> version.c version.o: version.c $(version_h) # c-exp.tab.c is generated in objdir from c-exp.y if it doesn't exist @@ -1163,7 +1157,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \ mips-tdep.c mipsm3-nat.c mipsv4-nat.c news-xdep.c \ nindy-share/Onindy.c nindy-share/nindy.c \ nindy-share/ttyflush.c nindy-tdep.c \ - ns32k-tdep.c solib-osf.c \ + ns32k-tdep.c osfsolib.c \ somread.c somsolib.c $(HPREAD_SOURCE) \ ppc-linux-nat.c ppc-linux-tdep.c \ procfs.c \ @@ -1173,7 +1167,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \ remote-st.c remote-utils.c dcache.c \ remote-udi.c remote-vx.c remote-vx29k.c \ rs6000-nat.c rs6000-tdep.c \ - ser-go32.c ser-pipe.c ser-tcp.c \ + ser-go32.c ser-pipe.c ser-ocd.c ser-tcp.c \ sh-tdep.c solib.c sparc-nat.c \ sparc-tdep.c sparcl-tdep.c sun3-nat.c \ symm-tdep.c symm-nat.c \ @@ -1201,13 +1195,13 @@ alpha-nat.o: alpha-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \ $(regcache_h) alpha-tdep.o: alpha-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ - $(inferior_h) $(symtab_h) $(dis-asm.h) $(gdb_string_h) linespec.h \ + $(inferior_h) $(symtab_h) $(dis-asm.h) gdb_string.h linespec.h \ $(regcache_h) annotate.o: annotate.c $(defs_h) annotate.h $(value_h) target.h $(gdbtypes_h) arm-linux-nat.o: arm-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ - $(gdb_string_h) $(regcache_h) + gdb_string.h $(regcache_h) arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) target.h $(value_h) \ $(gdbtypes_h) $(floatformat_h) $(regcache_h) @@ -1221,31 +1215,31 @@ blockframe.o: blockframe.c $(defs_h) $(gdbcore_h) $(inferior_h) \ objfiles.h symfile.h target.h $(regcache_h) breakpoint.o: breakpoint.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ - $(inferior_h) language.h target.h gdbthread.h $(gdb_string_h) \ - gdb-events.h linespec.h $(ui_out_h) + $(inferior_h) language.h target.h gdbthread.h gdb_string.h \ + gdb-events.h linespec.h buildsym.o: buildsym.c $(bfd_h) buildsym.h complaints.h $(defs_h) \ - objfiles.h symfile.h $(symtab_h) $(gdb_string_h) + objfiles.h symfile.h $(symtab_h) gdb_string.h c-lang.o: c-lang.c c-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \ language.h parser-defs.h $(symtab_h) c-typeprint.o: c-typeprint.c c-lang.h $(defs_h) $(expression_h) \ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) \ - target.h typeprint.h $(value_h) $(gdb_string_h) $(cp_abi_h) + target.h typeprint.h $(value_h) gdb_string.h $(cp_abi_h) c-valprint.o: c-valprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \ language.h $(symtab_h) valprint.h $(value_h) $(cp_abi_h) f-lang.o: f-lang.c f-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \ - language.h parser-defs.h $(symtab_h) $(gdb_string_h) + language.h parser-defs.h $(symtab_h) gdb_string.h f-typeprint.o: f-typeprint.c f-lang.h $(defs_h) $(expression_h) \ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) \ - target.h typeprint.h $(value_h) $(gdb_string_h) + target.h typeprint.h $(value_h) gdb_string.h f-valprint.o: f-valprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \ - language.h $(symtab_h) valprint.h $(value_h) $(gdb_string_h) + language.h $(symtab_h) valprint.h $(value_h) gdb_string.h ch-exp.o: ch-exp.c ch-lang.h $(defs_h) language.h parser-defs.h $(bfd_h) symfile.h objfiles.h $(value_h) @@ -1254,7 +1248,7 @@ ch-lang.o: ch-lang.c ch-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \ ch-typeprint.o: ch-typeprint.c ch-lang.h $(defs_h) $(expression_h) \ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) \ - target.h $(value_h) typeprint.h $(gdb_string_h) + target.h $(value_h) typeprint.h gdb_string.h ch-valprint.o: ch-valprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \ language.h $(symtab_h) valprint.h $(value_h) c-lang.h @@ -1264,7 +1258,7 @@ coff-solib.o: coff-solib.c $(defs_h) coffread.o: coffread.c $(bfd_h) $(breakpoint_h) buildsym.h \ complaints.h $(defs_h) $(expression_h) $(gdbtypes_h) objfiles.h \ symfile.h $(symtab_h) gdb-stabs.h stabsread.h target.h \ - $(gdb_string_h) + gdb_string.h complaints.o: complaints.c complaints.h $(defs_h) $(gdbcmd_h) @@ -1276,60 +1270,60 @@ core-aout.o: core-aout.c $(defs_h) $(gdbcore_h) $(value_h) $(inferior_h) \ $(regcache_h) core-sol2.o: core-sol2.c $(command_h) $(defs_h) $(gdbcore_h) \ - $(inferior_h) target.h $(gdb_string_h) $(regcache_h) + $(inferior_h) target.h gdb_string.h $(regcache_h) core-regset.o: core-regset.c $(command_h) $(defs_h) $(gdbcore_h) \ - $(inferior_h) target.h $(gdb_string_h) + $(inferior_h) target.h gdb_string.h corefile.o: corefile.c $(dis-asm_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ - $(inferior_h) target.h language.h $(gdb_string_h) completer.h \ + $(inferior_h) target.h language.h gdb_string.h completer.h \ symfile.h corelow.o: corelow.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ - target.h gdbthread.h $(gdb_string_h) $(regcache_h) + target.h gdbthread.h gdb_string.h $(regcache_h) cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) cp-valprint.o: cp-valprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \ - $(gdbtypes_h) $(symtab_h) $(value_h) $(gdb_string_h) + $(gdbtypes_h) $(symtab_h) $(value_h) gdb_string.h -dcache.o: dcache.c $(dcache_h) $(defs_h) $(gdbcmd_h) $(gdb_string_h) \ +dcache.o: dcache.c $(dcache_h) $(defs_h) $(gdbcmd_h) gdb_string.h \ $(gdbcore_h) target.h dbxread.o: dbxread.c $(breakpoint_h) buildsym.h $(command_h) \ complaints.h $(defs_h) $(expression_h) gdb-stabs.h $(gdbcore_h) \ $(gdbtypes_h) language.h objfiles.h partial-stab.h stabsread.h \ - symfile.h $(symtab_h) target.h $(gdb_string_h) $(cp_abi_h) + symfile.h $(symtab_h) target.h gdb_string.h $(cp_abi_h) delta68-nat.o: delta68-nat.c $(defs_h) -demangle.o: demangle.c $(defs_h) $(gdbcmd_h) $(gdb_string_h) +demangle.o: demangle.c $(defs_h) $(gdbcmd_h) gdb_string.h dink32-rom.o: dink32-rom.c monitor.h $(bfd_h) gdb_wait.h $(defs_h) \ $(gdbcmd_h) $(inferior_h) target.h serial.h terminal.h symfile.h \ $(regcache_h) -dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h) +dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) gdb_string.h -dstread.o: dstread.c $(gdb_string_h) +dstread.o: dstread.c gdb_string.h dwarfread.o: dwarfread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \ $(expression_h) $(gdbtypes_h) language.h objfiles.h symfile.h \ - $(symtab_h) $(gdb_string_h) + $(symtab_h) gdb_string.h dwarf2read.o: dwarf2read.c $(bfd_h) buildsym.h $(defs_h) \ $(expression_h) $(gdbtypes_h) language.h objfiles.h symfile.h \ - $(symtab_h) $(gdb_string_h) + $(symtab_h) gdb_string.h elfread.o: elfread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \ - gdb-stabs.h objfiles.h symfile.h $(symtab_h) $(gdb_string_h) \ + gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h \ $(BFD_SRC)/elf-bfd.h $(INCLUDE_DIR)/elf/mips.h -environ.o: environ.c $(defs_h) environ.h $(gdbcore_h) $(gdb_string_h) +environ.o: environ.c $(defs_h) environ.h $(gdbcore_h) gdb_string.h eval.o: eval.c $(bfd_h) $(defs_h) $(expression_h) $(frame_h) \ $(gdbtypes_h) language.h $(symtab_h) target.h $(value_h) \ - $(gdb_string_h) $(cp_abi_h) + gdb_string.h $(cp_abi_h) event-loop.o: event-loop.c $(defs_h) $(top_h) $(event_loop_h) $(event_top_h) @@ -1341,13 +1335,13 @@ inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(inf_loop_h) $(event_loop_h) \ $(event_top_h) exec.o: exec.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \ - target.h language.h $(gdb_string_h) completer.h + target.h language.h gdb_string.h completer.h expprint.o: expprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \ language.h parser-defs.h $(symtab_h) $(value_h) findvar.o: findvar.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \ - $(gdb_string_h) $(regcache_h) + gdb_string.h $(regcache_h) frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \ $(regcache_h) @@ -1355,7 +1349,7 @@ frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \ regcache.o: regcache.c $(defs_h) $(inferior_h) target.h $(regcache_h) fork-child.o: fork-child.c gdb_wait.h $(defs_h) $(gdbcore_h) \ - $(inferior_h) target.h terminal.h gdbthread.h $(gdb_string_h) + $(inferior_h) target.h terminal.h gdbthread.h gdb_string.h # FIXME: cagney/2000-03-27: Post 5.0 this link code can be removed. # It should now be possible to run GDBtk from the build directory @@ -1398,57 +1392,31 @@ gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico gdbtk.o: $(srcdir)/gdbtk/generic/gdbtk.c \ $(srcdir)/gdbtk/generic/gdbtk.h $(defs_h) \ $(symtab_h) $(inferior_h) $(command_h) \ - $(bfd_h) $(symfile_h) objfiles.h $(target_h) $(gdb_string_h) \ - $(tracepoint_h) $(top_h) + $(bfd_h) symfile.h objfiles.h target.h gdb_string.h $(tracepoint_h) \ + $(top_h) $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ $(ITK_CFLAGS) $(TIX_CFLAGS) \ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\ $(srcdir)/gdbtk/generic/gdbtk.c -DGDBTK_LIBRARY=\"$(datadir)/gdbtcl\" -gdbtk-bp.o: $(srcdir)/gdbtk/generic/gdbtk-bp.c \ - $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \ - $(defs_h) $(breakpoint_h) $(tracepoint_h) $(symfile_h) $(symtab_h) - $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ - $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ - $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-bp.c \ - -DGDBTK_LIBRARY=\"$(datadir)/gdbtcl\" - gdbtk-cmds.o: $(srcdir)/gdbtk/generic/gdbtk-cmds.c \ - $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \ + $(srcdir)/gdbtk/generic/gdbtk.h \ $(defs_h) $(symtab_h) $(inferior_h) \ - $(command_h) $(bfd_h) $(top_h) $(symfile_h) objfiles.h $(target_h) \ - $(gdb_string_h) $(tracepoint_h) source.h $(regcache_h) + $(command_h) $(bfd_h) $(top_h) symfile.h objfiles.h target.h \ + gdb_string.h $(tracepoint_h) $(frame_h) source.h $(regcache_h) $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ - $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-cmds.c \ + $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-cmds.c \ -DGDBTK_LIBRARY=\"$(datadir)/gdbtcl\" gdbtk-hooks.o: $(srcdir)/gdbtk/generic/gdbtk-hooks.c \ $(srcdir)/gdbtk/generic/gdbtk.h $(defs_h) \ $(symtab_h) $(inferior_h) $(command_h) \ - $(bfd_h) $(symfile_h) objfiles.h $(target_h) $(gdb_string_h) $(tracepoint_h) + $(bfd_h) symfile.h objfiles.h target.h gdb_string.h $(tracepoint_h) $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\ $(srcdir)/gdbtk/generic/gdbtk-hooks.c -DGDBTK_LIBRARY=\"$(datadir)/gdbtcl\" -gdbtk-register.o: $(srcdir)/gdbtk/generic/gdbtk-register.c \ - $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \ - $(defs_h) $(frame_h) $(value_h) - $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ - $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ - $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-register.c \ - -DGDBTK_LIBRARY=\"$(datadir)/gdbtcl\" - -gdbtk-stack.o: $(srcdir)/gdbtk/generic/gdbtk-stack.c \ - $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \ - $(srcdir)/gdbtk/generic/gdbtk-wrapper.h \ - $(defs_h) $(frame_h) $(value_h) $(target_h) $(breakpoint_h) \ - linespec.h - $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ - $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ - $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-stack.c \ - -DGDBTK_LIBRARY=\"$(datadir)/gdbtcl\" - gdbtk-varobj.o: $(srcdir)/gdbtk/generic/gdbtk-varobj.c \ $(srcdir)/gdbtk/generic/gdbtk.h \ $(defs_h) $(value_h) varobj.h @@ -1463,7 +1431,7 @@ gdbtk-wrapper.o: $(srcdir)/gdbtk/generic/gdbtk-wrapper.c \ v850ice.o: v850ice.c $(defs_h) $(symtab_h) $(inferior_h) $(command_h) \ $(frame_h) $(breakpoint_h) $(gdbcore_h) $(value_h) symfile.h \ - $(gdb_string_h) target.h objfiles.h $(regcache_h) + gdb_string.h target.h objfiles.h $(regcache_h) $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\ $(srcdir)/v850ice.c @@ -1474,7 +1442,7 @@ v850-tdep.o: v850-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(obstack_h) \ tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(tracepoint_h) \ $(gdbtypes_h) $(expression_h) $(gdbcmd_h) $(value_h) target.h \ - language.h $(gdb_string_h) $(readline_headers) $(remote_h) linespec.h \ + language.h gdb_string.h $(readline_headers) $(remote_h) linespec.h \ $(regcache_h) gdbarch.o: gdbarch.c $(defs_h) $(bfd_h) $(gdbcmd_h) @@ -1484,7 +1452,7 @@ arch-utils.o: arch-utils.c $(defs_h) $(bfd_h) $(gdbcmd_h) \ gdbtypes.o: gdbtypes.c $(bfd_h) complaints.h $(defs_h) $(expression_h) \ $(gdbtypes_h) language.h objfiles.h symfile.h $(symtab_h) target.h \ - $(value_h) $(gdb_string_h) wrapper.h $(cp_abi_h) + $(value_h) gdb_string.h wrapper.h $(cp_abi_h) go32-nat.o: go32-nat.c $(defs_h) $(inferior_h) gdb_wait.h $(gdbcore_h) \ $(command_h) $(floatformat_h) target.h i387-nat.h $(regcache_h) @@ -1492,11 +1460,9 @@ go32-nat.o: go32-nat.c $(defs_h) $(inferior_h) gdb_wait.h $(gdbcore_h) \ gnu-nat.o: process_reply_S.h exc_request_S.h notify_S.h msg_reply_S.h \ exc_request_U.h msg_U.h gnu-nat.h -gnu-v2-abi.o: gnu-v2-abi.c $(defs_h) $(gdb_string_h) $(symtab_h) \ - $(gdbtypes_h) $(value_h) $(demangle_h) $(cp_abi_h) +gnu-v2-abi.o: gnu-v2-abi.c $(defs_h) $(cp_abi_h) gdb_string.h $(symtab_h) \ + $(gdbtypes_h) $(value_h) -gnu-v3-abi.o: gnu-v2-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(demangle_h) - h8300-tdep.o: h8300-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(regcache_h) h8500-tdep.o: h8500-tdep.c $(bfd_h) $(dis-asm_h) $(defs_h) \ @@ -1505,7 +1471,7 @@ h8500-tdep.o: h8500-tdep.c $(bfd_h) $(dis-asm_h) $(defs_h) \ hp300ux-nat.o: hp300ux-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h) -hpacc-abi.o: hpacc-abi.c $(defs_h) $(cp_abi_h) $(gdb_string_h) $(gdbtypes_h) \ +hpacc-abi.o: hpacc-abi.c $(defs_h) $(cp_abi_h) gdb_string.h $(gdbtypes_h) \ $(value_h) $(gdbcore_h) hppa-tdep.o: hppa-tdep.c gdb_wait.h $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ @@ -1519,7 +1485,7 @@ hppah-nat.o: hppah-nat.c $(bfd_h) $(defs_h) $(inferior_h) target.h \ i386gnu-nat.o: gnu-nat.h -i386-tdep.o: i386-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) \ +i386-tdep.o: i386-tdep.c $(defs_h) gdb_string.h $(frame_h) \ $(inferior_h) $(gdbcore_h) target.h $(floatformat_h) \ $(symtab_h) $(gdbcmd_h) $(command_h) $(arch_utils_h) $(regcache_h) @@ -1569,17 +1535,16 @@ ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) symfile.h $(gdbcore_h) \ $(INCLUDE_DIR)/elf/common.h $(regcache_h) infcmd.o: infcmd.c $(defs_h) environ.h $(gdbcmd_h) $(gdbcore_h) \ - $(inferior_h) target.h language.h symfile.h $(gdb_string_h) \ - $(ui_out_h) + $(inferior_h) target.h language.h symfile.h gdb_string.h inflow.o: inflow.c $(bfd_h) $(command_h) $(defs_h) $(inferior_h) \ - target.h terminal.h gdbthread.h $(gdb_string_h) + target.h terminal.h gdbthread.h gdb_string.h infptrace.o: infptrace.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \ - $(gdb_string_h) gdb_wait.h $(command_h) $(regcache_h) + gdb_string.h gdb_wait.h $(command_h) $(regcache_h) infrun.o: infrun.c gdb_wait.h $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ - $(inferior_h) target.h gdbthread.h $(gdb_string_h) $(event_loop_h) \ + $(inferior_h) target.h gdbthread.h gdb_string.h $(event_loop_h) \ $(event_top_h) $(regcache_h) inftarg.o: inftarg.c gdb_wait.h $(defs_h) $(gdbcore_h) $(inferior_h) \ @@ -1588,29 +1553,29 @@ inftarg.o: inftarg.c gdb_wait.h $(defs_h) $(gdbcore_h) $(inferior_h) \ irix4-nat.o: irix4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) irix5-nat.o: irix5-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) target.h \ $(symtab_h) symfile.h objfiles.h $(command_h) $(frame_h) gnu-regex.h \ - language.h $(gdb_string_h) $(regcache_h) + language.h gdb_string.h $(regcache_h) # OBSOLETE isi-xdep.o: isi-xdep.c jv-lang.o: jv-lang.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \ $(expression_h) parser-defs.h language.h symfile.h objfiles.h \ - $(gdb_string_h) $(value_h) c-lang.h jv-lang.h $(gdbcore_h) + gdb_string.h $(value_h) c-lang.h jv-lang.h $(gdbcore_h) jv-typeprint.o: jv-typeprint.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \ - $(value_h) $(demangle_h) jv-lang.h $(gdb_string_h) \ + $(value_h) $(demangle_h) jv-lang.h gdb_string.h \ typeprint.h c-lang.h $(cp_abi_h) jv-valprint.o: jv-valprint.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \ $(expression_h) $(value_h) $(demangle_h) valprint.h \ language.h jv-lang.h c-lang.h gdbcore.h annotate.h -kod.o: kod.c $(defs_h) $(command_h) $(gdbcmd_h) target.h $(gdb_string_h) kod.h +kod.o: kod.c $(defs_h) $(command_h) $(gdbcmd_h) target.h gdb_string.h kod.h -kod-cisco.o: kod-cisco.c $(defs_h) $(gdb_string_h) kod.h +kod-cisco.o: kod-cisco.c $(defs_h) gdb_string.h kod.h language.o: language.c $(bfd_h) $(defs_h) $(expression_h) $(frame_h) \ $(gdbcmd_h) $(gdbtypes_h) language.h parser-defs.h $(symtab_h) \ - target.h $(value_h) $(gdb_string_h) + target.h $(value_h) gdb_string.h lynx-nat.o: lynx-nat.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcore_h) \ target.h $(regcache_h) @@ -1620,7 +1585,7 @@ m2-lang.o: m2-lang.c $(defs_h) $(expression_h) $(gdbtypes_h) \ m2-typeprint.o: m2-typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \ $(gdbcore_h) $(gdbtypes_h) language.h m2-lang.h $(symtab_h) target.h \ - $(value_h) $(gdb_string_h) + $(value_h) gdb_string.h m2-valprint.o: m2-valprint.c $(defs_h) $(gdbtypes_h) $(symtab_h) \ valprint.h m2-lang.h @@ -1629,17 +1594,17 @@ m3-nat.o: m3-nat.c $(defs_h) $(inferior_h) $(value_h) language.h target.h \ gdb_wait.h $(gdbcmd_h) $(gdbcore_h) $(regcache_h) p-lang.o: p-lang.c p-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \ - language.h parser-defs.h $(symtab_h) $(gdb_string_h) + language.h parser-defs.h $(symtab_h) gdb_string.h p-typeprint.o: p-typeprint.c p-lang.h $(defs_h) $(expression_h) \ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) \ - target.h typeprint.h $(value_h) $(gdb_string_h) + target.h typeprint.h $(value_h) gdb_string.h p-valprint.o: p-valprint.c p-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \ - language.h $(symtab_h) valprint.h $(value_h) $(gdb_string_h) + language.h $(symtab_h) valprint.h $(value_h) gdb_string.h m68k-tdep.o: m68k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \ - $(gdbcore_h) $(gdb_string_h) $(regcache_h) + $(gdbcore_h) gdb_string.h $(regcache_h) m68kly-nat.o: m68kly-nat.c $(defs_h) $(frame_h) $(inferior_h) target.h @@ -1650,10 +1615,10 @@ m88k-nat.o: m88k-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h) m88k-tdep.o: m88k-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h) -mac-nat.o: mac-nat.c $(defs_h) $(gdb_string_h) $(regcache_h) +mac-nat.o: mac-nat.c $(defs_h) gdb_string.h $(regcache_h) -main.o: main.c top.h $(defs_h) $(gdb_string_h) $(event_loop_h) \ - symfile.h $(gdbcore_h) $(srcdir)/tui/tui-file.h $(ui_out_h) +main.o: main.c top.h $(defs_h) gdb_string.h $(event_loop_h) \ + symfile.h $(gdbcore_h) $(srcdir)/tui/tui-file.h maint.o: maint.c $(defs_h) $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) language.h \ $(expression_h) objfiles.h symfile.h @@ -1662,12 +1627,12 @@ mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(gdbcmd_h) $(value_h) \ $(symtab_h) $(symfile_h) $(gdbcore_h) $(inferior_h) mcore-rom.o: mcore-rom.c $(defs_h) $(gdbcore_h) target.h monitor.h \ - $(gdb_string_h) $(regcache_h) + gdb_string.h $(regcache_h) mdebugread.o: mdebugread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \ $(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \ objfiles.h partial-stab.h stabsread.h symfile.h $(symtab_h) \ - $(gdb_string_h) + gdb_string.h mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h) $(regcache_h) @@ -1676,34 +1641,30 @@ mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h) $(regcache_h) os9kread.o: os9kread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \ $(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) \ language.h objfiles.h stabsread.h symfile.h $(symtab_h) \ - target.h $(gdb_string_h) + target.h gdb_string.h $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $< mem-break.o: mem-break.c $(defs_h) minsyms.o: minsyms.c $(bfd_h) $(defs_h) objfiles.h symfile.h \ - $(symtab_h) $(gdb_string_h) $(value_h) $(cp_abi_h) + $(symtab_h) gdb_string.h mips-nat.o: mips-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h) mips-tdep.o: mips-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ $(arch_utils_h) $(regcache_h) \ - $(inferior_h) language.h objfiles.h symfile.h $(gdb_string_h) + $(inferior_h) language.h objfiles.h symfile.h gdb_string.h mipsread.o: mipsread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \ $(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \ objfiles.h partial-stab.h stabsread.h symfile.h $(symtab_h) \ - $(gdb_string_h) + gdb_string.h mipsv4-nat.o: mipsv4-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \ $(regcache_h) -mn10300-tdep.o: mn10300-tdep.c $(defs_h) $(frame_h) $(inferior_h) \ - $(obstack_h) $(target_h) $(value_h) $(bfd_h) gdb_string.h \ - $(gdbcore_h) $(symfile_h) $(regcache_h) $(arch-utils.h) - monitor.o: monitor.c monitor.h $(bfd_h) $(defs_h) $(gdbcmd_h) \ - $(inferior_h) target.h serial.h terminal.h $(gdb_string_h) $(regcache_h) + $(inferior_h) target.h serial.h terminal.h gdb_string.h $(regcache_h) news-xdep.o: news-xdep.c @@ -1717,7 +1678,7 @@ nindy.o: nindy-share/nindy.c gdb_wait.h nindy-share/block_io.h \ nlmread.o: nlmread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \ gdb-stabs.h objfiles.h symfile.h $(symtab_h) stabsread.h \ - $(gdb_string_h) + gdb_string.h # OBSOLETE ns32km3-nat.o: ns32km3-nat.c $(defs_h) $(inferior_h) $(regcache_h) @@ -1729,13 +1690,13 @@ nindy-tdep.o: nindy-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcore_h) ns32k-tdep.o: ns32k-tdep.c $(bfd_h) $(dis-asm_h) $(defs_h) objfiles.o: objfiles.c $(bfd_h) $(defs_h) objfiles.h symfile.h \ - $(symtab_h) $(gdb_string_h) $(breakpoint_h) + $(symtab_h) gdb_string.h $(breakpoint_h) -solib-osf.o: solib-osf.c $(defs_h) $(inferior_h) $(symtab_h) objfiles.h \ - $(symfile_h) $(target_h) $(gdb_string_h) solist.h +osfsolib.o: osfsolib.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ + objfiles.h gnu-regex.h symfile.h target.h language.h gdb_string.h somread.o: somread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \ - gdb-stabs.h objfiles.h symfile.h $(symtab_h) $(gdb_string_h) + gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h somsolib.o: somsolib.c $(defs_h) $(regcache_h) @@ -1748,20 +1709,20 @@ hpux-thread.o: hpux-thread.c $(defs_h) gdbthread.h target.h inferior.h \ # FIXME!!! hpread.o: hpread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \ - gdb-stabs.h objfiles.h symfile.h $(symtab_h) $(gdb_string_h) + gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h hp-psymtab-read.o: hp-psymtab-read.c hpread.h $(bfd_h) buildsym.h complaints.h \ - $(defs_h) gdb-stabs.h objfiles.h symfile.h $(symtab_h) $(gdb_string_h) + $(defs_h) gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h hp-symtab-read.o: hp-symtab-read.c hpread.h $(bfd_h) buildsym.h complaints.h \ - $(defs_h) gdb-stabs.h objfiles.h symfile.h $(symtab_h) $(gdb_string_h) + $(defs_h) gdb-stabs.h objfiles.h symfile.h $(symtab_h) gdb_string.h # END FIXME!!! parse.o: parse.c $(command_h) $(defs_h) $(expression_h) $(frame_h) \ $(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \ - $(gdb_string_h) linespec.h + gdb_string.h linespec.h -ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) \ +ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) gdb_string.h $(frame_h) \ $(inferior_h) $(bfd_h) symfile.h target.h $(gdbcmd_h) \ objfiles.h gdb-stabs.h serial.h ocd.h $(regcache_h) @@ -1776,12 +1737,12 @@ ppcbug-rom.o: ppcbug-rom.c monitor.h $(bfd_h) gdb_wait.h $(defs_h) \ printcmd.o: printcmd.c $(breakpoint_h) $(defs_h) $(expression_h) \ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) language.h objfiles.h \ - symfile.h $(symtab_h) target.h $(gdb_string_h) $(ui_out_h) + symfile.h $(symtab_h) target.h gdb_string.h # FIXME: Procfs.o gets -Wformat errors because things like pid_t don't # match output format strings. procfs.o: procfs.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ - target.h $(gdb_string_h) gdbthread.h proc-utils.h + target.h gdb_string.h gdbthread.h proc-utils.h $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $< proc-api.o: proc-api.c $(defs_h) $(gdbcmd_h) proc-utils.h @@ -1808,17 +1769,17 @@ lin-lwp.o: lin-lwp.c $(defs_h) gdb_assert.h gdb_wait.h gdbthread.h \ proc-service.o: proc-service.c $(defs_h) $(inferior_h) gdb_proc_service.h \ $(symtab_h) $(target_h) gregset.h -gnu-regex.o: gnu-regex.c gnu-regex.h $(defs_h) $(gdb_string_h) +gnu-regex.o: gnu-regex.c gnu-regex.h $(defs_h) gdb_string.h remote-adapt.o: remote-adapt.c $(defs_h) $(gdbcore_h) \ - $(inferior_h) target.h terminal.h $(gdb_string_h) $(regcache_h) + $(inferior_h) target.h terminal.h gdb_string.h $(regcache_h) remote-array.o: remote-array.c $(defs_h) $(gdbcore_h) target.h \ - $(gdb_string_h) $(command_h) serial.h monitor.h $(remote_utils_h) \ + gdb_string.h $(command_h) serial.h monitor.h $(remote_utils_h) \ $(version_h) $(regcache_h) remote-rdi.o: remote-rdi.c $(defs_h) $(gdbcore_h) \ - $(inferior_h) $(gdb_string_h) + $(inferior_h) gdb_string.h rdi-share/libangsd.a: force @dir=rdi-share; \ @@ -1831,10 +1792,10 @@ rdi-share/libangsd.a: force fi remote-rdp.o: remote-rdp.c $(defs_h) $(gdbcore_h) \ - $(inferior_h) $(gdb_string_h) + $(inferior_h) gdb_string.h remote-bug.o: remote-bug.c $(defs_h) $(gdbcore_h) \ - $(inferior_h) target.h terminal.h $(remote_utils_h) $(gdb_string_h) \ + $(inferior_h) target.h terminal.h $(remote_utils_h) gdb_string.h \ $(regcache_h) # FIXME: For the SH target, remote-e7000 contains numerous -Wformat @@ -1842,15 +1803,15 @@ remote-bug.o: remote-bug.c $(defs_h) $(gdbcore_h) \ # handles the SH remote protocol the changes need to be tested against # an SH board before they can be committed. cagney 1999-09-01. remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) target.h \ - serial.h $(gdb_string_h) $(regcache_h) + serial.h gdb_string.h $(regcache_h) $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $< remote-eb.o: remote-eb.c $(srcdir)/config/a29k/tm-a29k.h \ $(defs_h) $(gdbcore_h) $(inferior_h) symfile.h target.h terminal.h \ - $(gdb_string_h) $(regcache_h) + gdb_string.h $(regcache_h) remote-es.o: remote-es.c $(bfd_h) $(command_h) $(defs_h) \ - $(inferior_h) $(remote_utils_h) terminal.h $(gdb_string_h) \ + $(inferior_h) $(remote_utils_h) terminal.h gdb_string.h \ symfile.h $(regcache_h) remote-est.o: remote-est.c $(defs_h) $(gdbcore_h) \ @@ -1863,7 +1824,7 @@ remote-mips.o: remote-mips.c $(defs_h) $(gdbcmd_h) \ $(gdbcore_h) $(inferior_h) serial.h symfile.h target.h $(regcache_h) remote-mm.o: remote-mm.c $(bfd_h) $(defs_h) $(inferior_h) \ - minimon.h target.h terminal.h $(gdb_string_h) $(regcache_h) + minimon.h target.h terminal.h gdb_string.h $(regcache_h) remote-nindy.o: remote-nindy.c $(floatformat_h) $(command_h) \ $(defs_h) $(gdbcore_h) $(inferior_h) \ @@ -1872,43 +1833,43 @@ remote-nindy.o: remote-nindy.c $(floatformat_h) $(command_h) \ remote-os9k.o: remote-os9k.c $(defs_h) $(gdbcore_h) \ $(command_h) monitor.h $(remote_utils_h) $(symtab_h) symfile.h \ - objfiles.h gdb-stabs.h $(gdb_string_h) $(regcache_h) + objfiles.h gdb-stabs.h gdb_string.h $(regcache_h) remote-sds.o: remote-sds.c $(bfd_h) $(defs_h) $(gdbcmd_h) \ - $(inferior_h) $(remote_utils_h) symfile.h terminal.h $(gdb_string_h) \ + $(inferior_h) $(remote_utils_h) symfile.h terminal.h gdb_string.h \ $(regcache_h) remote-sim.o: remote-sim.c $(defs_h) $(gdbcore_h) \ - $(inferior_h) target.h terminal.h $(gdb_string_h) \ + $(inferior_h) target.h terminal.h gdb_string.h \ $(INCLUDE_DIR)/callback.h $(regcache_h) remote-st.o: remote-st.c $(defs_h) $(gdbcore_h) serial.h \ - target.h $(gdb_string_h) $(regcache_h) + target.h gdb_string.h $(regcache_h) remote-udi.o: remote-udi.c $(bfd_h) $(defs_h) $(gdbcmd_h) \ - $(inferior_h) target.h terminal.h $(udiheaders) $(gdb_string_h) \ + $(inferior_h) target.h terminal.h $(udiheaders) gdb_string.h \ $(regcache_h) remote-vx.o: remote-vx.c complaints.h $(defs_h) $(gdbcmd_h) \ $(gdbcore_h) $(inferior_h) target.h vx-share/dbgRpcLib.h \ vx-share/ptrace.h vx-share/xdr_ld.h vx-share/xdr_ptrace.h \ vx-share/xdr_rdb.h gdb-stabs.h objfiles.h symfile.h $(bfd_h) \ - $(gdb_string_h) $(regcache_h) + gdb_string.h $(regcache_h) remote-vx29k.o: remote-vx29k.c complaints.h $(defs_h) $(gdbcmd_h) \ $(gdbcore_h) $(inferior_h) target.h vx-share/dbgRpcLib.h \ vx-share/ptrace.h vx-share/xdr_ld.h vx-share/xdr_ptrace.h \ - vx-share/xdr_rdb.h $(gdb_string_h) $(regcache_h) + vx-share/xdr_rdb.h gdb_string.h $(regcache_h) -ocd.o: ocd.c ocd.h $(gdbcore_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ +ocd.o: ocd.c ocd.h $(gdbcore_h) gdb_string.h $(frame_h) $(inferior_h) \ $(bfd_h) symfile.h target.h $(gdbcmd_h) objfiles.h \ gdb-stabs.h $(dcache_h) serial.h $(regcache_h) remote-utils.o: remote-utils.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \ - $(inferior_h) $(remote_utils_h) $(gdb_string_h) $(regcache_h) + $(inferior_h) $(remote_utils_h) gdb_string.h $(regcache_h) remote.o: remote.c $(bfd_h) gdb_wait.h $(defs_h) $(gdbcmd_h) \ - $(inferior_h) $(remote_utils_h) symfile.h terminal.h $(gdb_string_h) \ + $(inferior_h) $(remote_utils_h) symfile.h terminal.h gdb_string.h \ $(event_loop_h) $(event_top_h) $(remote_h) $(inf_loop_h) remote-nrom.o: remote-nrom.c $(bfd_h) gdb_wait.h $(defs_h) $(gdbcmd_h) \ @@ -1928,7 +1889,7 @@ scm-exp.o: $(defs_h) $(value_h) parser-defs.h language.h c-lang.h \ scm-lang.h scm-tags.h scm-lang.o: $(defs_h) $(value_h) parser-defs.h language.h c-lang.h \ - scm-lang.h scm-tags.h $(gdb_string_h) $(gdbcore_h) + scm-lang.h scm-tags.h gdb_string.h $(gdbcore_h) scm-valprint.o: $(defs_h) $(value_h) parser-defs.h language.h \ scm-lang.h valprint.h $(gdbcore_h) @@ -1937,13 +1898,15 @@ ser-go32.o: ser-go32.c $(defs_h) serial.h ser-mac.o: ser-mac.c $(defs_h) serial.h -ser-pipe.o: ser-pipe.c $(defs_h) serial.h $(gdb_string_h) ser-unix.h +ser-ocd.o: ser-ocd.c $(defs_h) serial.h gdb_string.h + +ser-pipe.o: ser-pipe.c $(defs_h) serial.h gdb_string.h ser-unix.h -ser-tcp.o: ser-tcp.c $(defs_h) serial.h $(gdb_string_h) ser-unix.h +ser-tcp.o: ser-tcp.c $(defs_h) serial.h gdb_string.h ser-unix.h ser-unix.o: ser-unix.c $(defs_h) serial.h ser-unix.h -serial.o: serial.c $(defs_h) serial.h $(gdb_string_h) +serial.o: serial.c $(defs_h) serial.h gdb_string.h sh-tdep.o: sh-tdep.c $(bfd_h) $(dis-asm_h) \ $(srcdir)/../opcodes/sh-opc.h $(defs_h) $(expression_h) $(frame_h) \ @@ -1958,23 +1921,23 @@ mon960-rom.o: mon960-rom.c monitor.h $(bfd_h) gdb_wait.h $(defs_h) $(gdbcmd_h) \ $(inferior_h) target.h serial.h terminal.h solib.o: solib.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ - objfiles.h gnu-regex.h symfile.h target.h $(gdb_string_h) solist.h + objfiles.h gnu-regex.h symfile.h target.h gdb_string.h solist.h solib-svr4.o: solib-svr4.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \ - objfiles.h gnu-regex.h symfile.h target.h $(gdb_string_h) solist.h \ + objfiles.h gnu-regex.h symfile.h target.h gdb_string.h solist.h \ solib-svr4.h $(regcache_h) solib-legacy.o: solib-legacy.c $(defs_h) $(gdbcore_h) solib-svr4.h source.o: source.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \ $(gdbcore_h) language.h objfiles.h gnu-regex.h symfile.h $(symtab_h) \ - $(gdb_string_h) source.h completer.h linespec.h $(ui_out_h) + gdb_string.h source.h completer.h linespec.h sparc-nat.o: sparc-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(gdbcore_h) \ target.h $(regcache_h) sparc-tdep.o: sparc-tdep.c $(floatformat_h) $(defs_h) $(gdbcore_h) \ - $(inferior_h) objfiles.h symfile.h target.h $(gdb_string_h) \ + $(inferior_h) objfiles.h symfile.h target.h gdb_string.h \ $(arch_utils_h) $(regcache_h) sparcl-tdep.o: sparcl-tdep.c $(defs_h) $(gdbcore_h) target.h $(regcache_h) @@ -1984,10 +1947,10 @@ dsrec.o: dsrec.c $(defs_h) srec.h stabsread.o: stabsread.c $(bfd_h) $(INCLUDE_DIR)/aout/stab.def \ $(INCLUDE_DIR)/aout/stab_gnu.h buildsym.h complaints.h $(defs_h) \ $(gdbtypes_h) objfiles.h stabsread.h symfile.h $(symtab_h) \ - $(gdb_string_h) + gdb_string.h stack.o: stack.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \ - language.h target.h $(gdb_string_h) $(ui_out_h) + language.h target.h gdb_string.h ui-file.o: ui-file.c $(defs_h) ui-file.h tui-file.o: $(srcdir)/tui/tui-file.c $(defs_h) $(srcdir)/tui/tui-file.h @@ -2004,7 +1967,7 @@ sun3-nat.o: sun3-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h) symfile.o: symfile.c $(breakpoint_h) complaints.h $(defs_h) \ $(expression_h) gdb-stabs.h $(gdbcmd_h) $(gdbcore_h) \ $(gdbtypes_h) language.h objfiles.h symfile.h $(symtab_h) \ - target.h $(gdb_string_h) completer.h + target.h gdb_string.h completer.h symm-tdep.o: symm-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) @@ -2012,12 +1975,12 @@ symm-nat.o: symm-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h) symmisc.o: symmisc.c $(bfd_h) $(breakpoint_h) $(command_h) $(defs_h) \ $(expression_h) $(gdbtypes_h) language.h objfiles.h symfile.h \ - $(symtab_h) $(gdb_string_h) + $(symtab_h) gdb_string.h symtab.o: symtab.c call-cmds.h $(defs_h) $(expression_h) $(frame_h) \ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) language.h objfiles.h \ gnu-regex.h symfile.h $(symtab_h) target.h $(value_h) \ - $(gdb_string_h) linespec.h $(cp_abi_h) + gdb_string.h linespec.h $(cp_abi_h) linespec.o: linespec.c linespec.h $(defs_h) $(frame_h) $(value_h) \ objfiles.h symfile.h completer.h $(symtab_h) \ @@ -2026,22 +1989,21 @@ linespec.o: linespec.c linespec.h $(defs_h) $(frame_h) $(value_h) \ tic80-tdep.o: tic80-tdep.c $(defs_h) $(regcache_h) target.o: target.c $(bfd_h) $(defs_h) $(gdbcmd_h) $(inferior_h) \ - objfiles.h symfile.h target.h $(gdb_string_h) $(regcache_h) + objfiles.h symfile.h target.h gdb_string.h $(regcache_h) -thread.o: thread.c $(defs_h) gdbthread.h $(gdbcmd_h) target.h \ - $(regcache_h) $(ui_out_h) +thread.o: thread.c $(defs_h) gdbthread.h $(gdbcmd_h) target.h $(regcache_h) completer.o: completer.c completer.h $(gdbtypes_h) $(symtab_h) \ $(defs_h) $(gdbcmd_h) $(expression_h) $(readline_headers) top.o: top.c top.h $(bfd_h) $(getopt_h) $(readline_headers) call-cmds.h \ $(defs_h) $(gdbcmd_h) $(inferior_h) language.h \ - $(remote_utils_h) $(gdb_string_h) $(event_loop_h) $(event_top_h) \ - completer.h $(version_h) $(ui_out_h) + $(remote_utils_h) gdb_string.h $(event_loop_h) $(event_top_h) \ + completer.h $(version_h) typeprint.o: typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \ $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) target.h \ - $(value_h) $(gdb_string_h) $(cp_abi.h) + $(value_h) gdb_string.h $(cp_abi.h) # OBSOLETE ultra3-nat.o: ultra3-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h) @@ -2051,29 +2013,29 @@ typeprint.o: typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \ utils.o: utils.c $(bfd_h) $(defs_h) $(expression_h) $(gdbcmd_h) \ language.h target.h terminal.h $(readline_headers) \ - $(gdb_string_h) $(event_loop_h) $(event_top_h) + gdb_string.h $(event_loop_h) $(event_top_h) valarith.o: valarith.c $(bfd_h) $(defs_h) $(expression_h) \ $(gdbtypes_h) language.h $(symtab_h) target.h $(value_h) \ - $(gdb_string_h) + gdb_string.h valops.o: valops.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \ - $(gdb_string_h) $(regcache_h) $(cp_abi_h) + gdb_string.h $(regcache_h) $(cp_abi_h) valprint.o: valprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \ $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) target.h \ - $(value_h) $(gdb_string_h) valprint.h + $(value_h) gdb_string.h valprint.h values.o: values.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \ $(gdbcore_h) $(gdbtypes_h) $(symtab_h) target.h $(value_h) \ - $(gdb_string_h) scm-lang.h + gdb_string.h scm-lang.h vax-tdep.o: vax-tdep.c $(OP_INCLUDE)/vax.h $(defs_h) $(symtab_h) w65-tdep.o : w65-tdep.c $(gdbcore_h) $(regcache_h) win32-nat.o: win32-nat.c $(gdbcmd_h) $(gdbcore_h) $(inferior_h) $(defs_h) \ - $(gdb_string_h) $(regcache_h) + gdb_string.h $(regcache_h) xdr_ld.o: vx-share/xdr_ld.c $(defs_h) vx-share/vxTypes.h \ vx-share/vxWorks.h vx-share/xdr_ld.h @@ -2091,7 +2053,7 @@ xcoffread.o: xcoffread.c $(bfd_h) $(INCLUDE_DIR)/aout/stab.def \ $(INCLUDE_DIR)/aout/stab_gnu.h $(INCLUDE_DIR)/coff/internal.h \ $(INCLUDE_DIR)/coff/rs6000.h $(BFD_SRC)/libcoff.h buildsym.h \ complaints.h $(defs_h) $(gdbtypes_h) objfiles.h stabsread.h symfile.h \ - $(symtab_h) partial-stab.h $(gdb_string_h) + $(symtab_h) partial-stab.h gdb_string.h xcoffsolib.o: xcoffsolib.c $(bfd_h) $(defs_h) xcoffsolib.h $(inferior_h) \ $(gdbcmd_h) symfile.h $(frame_h) gnu-regex.h @@ -2191,7 +2153,7 @@ mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(mi_cmds_h) \ mi-main.o: $(srcdir)/mi/mi-main.c $(defs_h) $(top_h) $(mi_cmds_h) $(ui_out_h) \ $(mi_console_h) $(mi_getopt_h) $(event_loop_h) $(event_top_h) \ $(mi_getopt_h) $(regcache_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-main.c + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/mi/mi-main.c mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(mi_out_h) $(ui_out_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-out.c mi-console.o: $(srcdir)/mi/mi-console.c $(mi_out_h) $(defs_h) diff --git a/gdb/NEWS b/gdb/NEWS index 816cf4cc35b..484047140ee 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -5,11 +5,6 @@ * "info symbol" works on platforms which use COFF, ECOFF, XCOFF, and NLM. -* The MI enabled. - -The new machine oriented interface (MI) introduced in GDB 5.0 has been -revised and enabled. - * New native configurations Alpha FreeBSD alpha*-*-freebsd* @@ -42,14 +37,13 @@ been commented out. Unless there is activity to revive these configurations, the next release of GDB will have their sources permanently REMOVED. -* REMOVED configurations and files +* REMOVED configurations Altos 3068 m68*-altos-* Convex c1-*-*, c2-*-* Pyramid pyramid-*-* ARM RISCix arm-*-* (as host) Tahoe tahoe-*-* -ser-ocd.c *-*-* * Other news: @@ -57,12 +51,6 @@ ser-ocd.c *-*-* Multi-arch support is enabled for all MIPS configurations. -* GDB's version number moved to ``version.in'' - -The Makefile variable VERSION has been replaced by the file -``version.in''. People creating GDB distributions should update the -contents of this file. - * gdba.el deleted GUD support is now a standard part of the EMACS distribution. diff --git a/gdb/TODO b/gdb/TODO index 21e690495ad..1941cc3dcab 100644 --- a/gdb/TODO +++ b/gdb/TODO @@ -10,6 +10,20 @@ find out whether anyone else is working on it. Below is a list of problems identified during the GDB 5.0 release cycle. People hope to have these problems fixed in 5.1. +-- 2001-03-08 + +Update GDB's coding standard documentation. Known topics: + + o alloca/malloc et.al. + + o typedef and structs + + o ISO-C + +and most likely also: + + o include conventions + -- Wow, three bug reports for the same problem in one day! We should @@ -75,6 +89,25 @@ The following new features should be included in 5.1. -- +Enable MI by default. Old code can be deleted after 5.1 is out. + +Issues: + + o syntax change where a list would + look like: + [ foo=a, foo=b, foo=c ] + instead of + { foo=a, foo=b, foo=c } + + o kill off the idea of a reverse + query. + + o review test cases + + o enable it + +-- + Pascal (Pierre Muller, David Taylor) Pierre Muller has contributed patches for adding Pascal Language @@ -119,6 +152,14 @@ patch has been submitted. The following code cleanups will hopefully be applied to GDB 5.1. +-- 2001-03-26 + +Resolve the build status of all broken targets as identified by the +MAINTAINERS file. + + o arm-* vs NetBSD's lack of ``unix'' + o arm-* vs IRIX (see below) + -- Fix copyright notices. @@ -166,6 +207,11 @@ will still occure. sid/component/configure.in mis-configures GDB 5.2 - Fixes =============== +-- + +Thread support. Right now, as soon as a thread finishes and exits, +you're hosed. This problem is reported once a week or so. + -- GDB 5.2 - New features @@ -179,10 +225,6 @@ GCC 3.0 ABI support (but hopefully sooner...). Objective C/C++ support (but hopefully sooner...). --- - -Import of readline 4.2 - -- GDB 5.2 - Cleanups @@ -200,13 +242,9 @@ Makefile.in and configure.in. Compiler warnings. -Eliminate warnings for all targets on at least one host for one of the --W flags. Flags up for debate include: -Wswitch -Wcomment -trigraphs --Wtrigraphs -Wunused-function -Wunused-label -Wunused-variable --Wunused-value -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual --Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes --Wmissing-prototypes -Wmissing-declarations -Wredundant-decls --Woverloaded-virtual -Winline +Eliminate all warnings for at least one host/target for the flags: +-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses +-Wpointer-arith -Wuninitialized -- @@ -260,25 +298,6 @@ Deprecate, if not delete, the following: The size of the cache can be computed on the fly. - IS_TRAPPED_INTERNALVAR - The pseudo registers should eventually make - this redundant. - --- - -Obsolete the targets. - -arm*-wince-pe -mips*-*-pe -sh*-*-pe - -Obsolete the protocols: - -RDB - -``As of version 5.3, WindRiver has removed the RDB server (RDB -protocol support is built into gdb).'' -- Till. - -- Restructure gdb directory tree so that it avoids any 8.3 and 14 @@ -318,6 +337,18 @@ Rename read_register{,_pid}() to read_unsigned_register{,_pid}(). -- +Can't build IRIX -> arm GDB. +http://sourceware.cygnus.com/ml/gdb-patches/2000-04/msg00356.html + +David Whedon writes: +> Now I'm building for an embedded arm target. If there is a way of turning +> remote-rdi off, I couldn't find it. It looks like it gets built by default +> in gdb/configure.tgt(line 58) Anyway, the build dies in +> gdb/rdi-share/unixcomm.c. SERPORT1 et. al. never get defined because we +> aren't one of the architectures supported. + +-- + Problem with weak functions http://sourceware.cygnus.com/ml/gdb/2000-05/msg00060.html @@ -577,11 +608,6 @@ coverage analysis). Replace the file gdb/CONTRIBUTE with a file that is generated from the gdb/doc/*.texinfo directory. --- - -Rewrite/break up sparcl-tdep.c so that it uses ser*.c as the mechanism -for accessing either the serial or UDP port. - -- New Features and Fixes @@ -839,6 +865,58 @@ way to address this is provide a generic "reset" command and target vector. http://sources.redhat.com/ml/gdb-patches/2000-10/msg00011.html +-- + + Thread Support + ============== + +-- + +Generic: lin-thread cannot handle thread exit (Mark Kettenis, Michael +Snyder) http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00525.html + +The thread_db assisted debugging code doesn't handle exiting threads +properly, at least in combination with glibc 2.1.3 (the framework is +there, just not the actual code). There are at least two problems +that prevent this from working. + +As an additional reference point, the pre thread_db code did not work +either. + +-- + +GNU/Linux/x86 and random thread signals (and Solaris/SPARC but not +Solaris/x86). +http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00336.html + +Christopher Blizzard writes: + +So, I've done some more digging into this and it looks like Jim +Kingdon has reported this problem in the past: + +http://sourceware.cygnus.com/ml/bug-gdb/1999-10/msg00058.html + +I can reproduce this problem both with and without Tom's patch. Has +anyone seen this before? Maybe have a solution for it hanging around? +:) + +There's a test case for this documented at: + +when debugging threaded applications you get extra SIGTRAPs +http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=9565 + +[There should be a GDB testcase - cagney] + +-- + +GDB5 TOT on unixware 7 +http://sourceware.cygnus.com/ml/gdb/2000-04/msg00119.html + +Robert Lipe writes: +> I just spun the top of tree of the GDB5 branch on UnixWare 7. As a +> practical matter, the current thread support is somewhat more annoying +> than when GDB was thread-unaware. + -- Language Support @@ -974,14 +1052,6 @@ on the fly - should it be returned in the ``T'' packet? Underlying problem is that the register file is target endian. If the target endianess changes gdb doesn't know. -Suggest encoding registers as NN!VALUE. - --- - -GDB should allow incomming packets to be larger than outgoing ones. A -fully loaded T packet (containing all registers) can be very large - -definitly larger than a corresponding Gg packet. - -- Symbol Support @@ -1261,9 +1331,6 @@ The name is wrong for starters. ``target_signal'' should probably be After that it needs to be multi-arched and made independent of any host signal numbering. -Once this is done, the signal enum can probably be moved to -include/gdb so that it is available to embedded stubs. - -- Update ALPHA so that it uses ``struct frame_extra_info'' instead of diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 3da3c2713a6..2b9325e6d05 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -222,7 +222,7 @@ default_register_sim_regno (int num) CORE_ADDR -core_addr_identity (CORE_ADDR addr) +default_convert_from_func_ptr_addr (CORE_ADDR addr) { return addr; } @@ -258,11 +258,9 @@ generic_prepare_to_proceed (int select_it) /* Get the last target status returned by target_wait(). */ get_last_target_status (&wait_ptid, &wait_status); - /* Make sure we were stopped either at a breakpoint, or because - of a Ctrl-C. */ + /* Make sure we were stopped at a breakpoint. */ if (wait_status.kind != TARGET_WAITKIND_STOPPED - || (wait_status.value.sig != TARGET_SIGNAL_TRAP && - wait_status.value.sig != TARGET_SIGNAL_INT)) + || wait_status.value.sig != TARGET_SIGNAL_TRAP) { return 0; } @@ -273,11 +271,14 @@ generic_prepare_to_proceed (int select_it) /* Switched over from WAIT_PID. */ CORE_ADDR wait_pc = read_pc_pid (wait_ptid); - if (wait_pc != read_pc ()) + /* Avoid switching where it wouldn't do any good, i.e. if both + threads are at the same breakpoint. */ + if (wait_pc != read_pc () && breakpoint_here_p (wait_pc)) { if (select_it) { - /* Switch back to WAIT_PID thread. */ + /* User hasn't deleted the breakpoint. Switch back to + WAIT_PID and return non-zero. */ inferior_ptid = wait_ptid; /* FIXME: This stuff came from switch_to_thread() in @@ -287,42 +288,14 @@ generic_prepare_to_proceed (int select_it) stop_pc = wait_pc; select_frame (get_current_frame (), 0); } - /* We return 1 to indicate that there is a breakpoint here, - so we need to step over it before continuing to avoid - hitting it straight away. */ - if (breakpoint_here_p (wait_pc)) - { - return 1; - } + + return 1; } } return 0; } -void -init_frame_pc_noop (int fromleaf, struct frame_info *prev) -{ - return; -} - -void -init_frame_pc_default (int fromleaf, struct frame_info *prev) -{ - if (fromleaf) - prev->pc = SAVED_PC_AFTER_CALL (prev->next); - else if (prev->next != NULL) - prev->pc = FRAME_SAVED_PC (prev->next); - else - prev->pc = read_pc (); -} - -int -cannot_register_not (int regnum) -{ - return 0; -} - /* Functions to manipulate the endianness of the target. */ #ifdef TARGET_BYTE_ORDER_SELECTABLE @@ -613,6 +586,40 @@ set_architecture (char *ignore_args, int from_tty, struct cmd_list_element *c) show_architecture (NULL, from_tty); } +/* Called if the user enters ``info architecture'' without an argument. */ + +static void +info_architecture (char *args, int from_tty) +{ + printf_filtered ("Available architectures are:\n"); + if (GDB_MULTI_ARCH) + { + const char **arches = gdbarch_printable_names (); + const char **arch; + for (arch = arches; *arch != NULL; arch++) + { + printf_filtered (" %s", *arch); + } + xfree (arches); + } + else + { + enum bfd_architecture a; + for (a = bfd_arch_obscure + 1; a < bfd_arch_last; a++) + { + const struct bfd_arch_info *ap; + for (ap = bfd_lookup_arch (a, 0); + ap != NULL; + ap = ap->next) + { + printf_filtered (" %s", ap->printable_name); + ap = ap->next; + } + } + } + printf_filtered ("\n"); +} + /* Set the dynamic target-system-dependent parameters (architecture, byte-order) using information found in the BFD */ @@ -728,8 +735,6 @@ initialize_current_architecture (void) "initialize_current_architecture: Selection of initial architecture failed"); } } - else - initialize_non_multiarch (); /* Create the ``set architecture'' command appending ``auto'' to the list of architectures. */ @@ -754,6 +759,9 @@ initialize_current_architecture (void) current setting. */ add_cmd ("architecture", class_support, show_architecture, "Show the current target architecture", &showlist); + c = add_cmd ("architecture", class_support, info_architecture, + "List supported target architectures", &infolist); + deprecate_cmd (c, "set architecture"); } } diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index 071b5305ef8..d468da6a589 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -93,9 +93,9 @@ extern int (*target_architecture_hook) (const struct bfd_arch_info *); extern int default_register_sim_regno (int reg_nr); -/* Identity function on a CORE_ADDR. Just returns its parameter. */ +/* Default conversion of function pointer address - returns address. */ -extern CORE_ADDR core_addr_identity (CORE_ADDR addr); +extern CORE_ADDR default_convert_from_func_ptr_addr (CORE_ADDR addr); /* No-op conversion of reg to regnum. */ @@ -111,15 +111,4 @@ extern int default_prepare_to_proceed (int select_it); extern int generic_prepare_to_proceed (int select_it); -/* Versions of init_frame_pc(). Do nothing; do the default. */ - -void init_frame_pc_noop (int fromleaf, struct frame_info *prev); - -void init_frame_pc_default (int fromleaf, struct frame_info *prev); - -/* Version of cannot_fetch_register() / cannot_store_register() that - always fails. */ - -int cannot_register_not (int regnum); - #endif diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c index 50368b7adc2..96c78342d10 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c @@ -79,8 +79,14 @@ static unsigned int os_version, os_major, os_minor, os_release; /* On Linux, threads are implemented as pseudo-processes, in which case we may be tracing more than one process at a time. In that case, inferior_ptid will contain the main process ID and the - individual thread (process) ID. get_thread_id () is used to - get the thread id if it's available, and the process id otherwise. */ + individual thread (process) ID mashed together. These macros are + used to separate them out. These definitions should be overridden + if thread support is included. */ + +#if !defined (PIDGET) /* Default definition for PIDGET/TIDGET. */ +#define PIDGET(PID) PID +#define TIDGET(PID) 0 +#endif int get_thread_id (ptid_t ptid) diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 34e1484f749..d35c24a9efb 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -219,9 +219,10 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc) obstack_alloc (&frame_cache_obstack, sizeof (struct frame_info)); - /* Zero all fields by default. */ - memset (fi, 0, sizeof (struct frame_info)); - + /* Arbitrary frame */ + fi->saved_regs = NULL; + fi->next = NULL; + fi->prev = NULL; fi->frame = addr; fi->pc = pc; find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL); @@ -304,6 +305,12 @@ frameless_look_for_prologue (struct frame_info *frame) /* Default a few macros that people seldom redefine. */ +#if !defined (INIT_FRAME_PC) +#define INIT_FRAME_PC(fromleaf, prev) \ + prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \ + prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ()); +#endif + #ifndef FRAME_CHAIN_COMBINE #define FRAME_CHAIN_COMBINE(chain, thisframe) (chain) #endif @@ -436,7 +443,9 @@ get_prev_frame (struct frame_info *next_frame) Some machines won't use it. kingdon@cygnus.com, 13Apr93, 31Jan94, 14Dec94. */ +#ifdef INIT_FRAME_PC_FIRST INIT_FRAME_PC_FIRST (fromleaf, prev); +#endif #ifdef INIT_EXTRA_FRAME_INFO INIT_EXTRA_FRAME_INFO (fromleaf, prev); diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index ed152bede86..805079f2ee7 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -40,7 +40,6 @@ #include "symfile.h" #include "objfiles.h" #include "linespec.h" -#include "completer.h" #ifdef UI_OUT #include "ui-out.h" #endif @@ -92,9 +91,9 @@ static void break_command_1 (char *, int, int); static void mention (struct breakpoint *); -struct breakpoint *set_raw_breakpoint (struct symtab_and_line, enum bptype); +struct breakpoint *set_raw_breakpoint (struct symtab_and_line); -static void check_duplicates (struct breakpoint *); +static void check_duplicates (CORE_ADDR, asection *); static void describe_other_breakpoints (CORE_ADDR, asection *); @@ -1062,10 +1061,10 @@ reattach_breakpoints (int pid) { register struct breakpoint *b; int val; - struct cleanup *old_chain = save_inferior_ptid (); + ptid_t saved_inferior_ptid = inferior_ptid; - /* Set inferior_ptid; remove_breakpoint uses this global. */ - inferior_ptid = pid_to_ptid (pid); + /* FIXME: use a cleanup, to insure that inferior_ptid gets replaced! */ + inferior_ptid = pid_to_ptid (pid); /* Because remove_breakpoint will use this global. */ ALL_BREAKPOINTS (b) { if (b->inserted) @@ -1077,12 +1076,12 @@ reattach_breakpoints (int pid) val = target_insert_breakpoint (b->address, b->shadow_contents); if (val != 0) { - do_cleanups (old_chain); + inferior_ptid = saved_inferior_ptid; return val; } } } - do_cleanups (old_chain); + inferior_ptid = saved_inferior_ptid; return 0; } @@ -1145,17 +1144,7 @@ update_breakpoints_after_exec (void) ??rehrauer: Let's hope that merely clearing out this catchpoint's target address field, if any, is sufficient to have it be reset - automagically. Certainly on HP-UX that's true. - - Jim Blandy : Actually, zero is a perfectly - valid code address on some platforms (like the mn10200 and - mn10300 simulators). We shouldn't assign any special - interpretation to a breakpoint with a zero address. And in - fact, GDB doesn't --- I can't see what that comment above is - talking about. As far as I can tell, setting the address of a - bp_catch_exec/bp_catch_vfork/bp_catch_fork breakpoint to zero - is meaningless, since those are implemented with HP-UX kernel - hackery, not by storing breakpoint instructions somewhere. */ + automagically. Certainly on HP-UX that's true. */ if ((b->type == bp_catch_exec) || (b->type == bp_catch_vfork) || (b->type == bp_catch_fork)) @@ -1206,13 +1195,7 @@ update_breakpoints_after_exec (void) /* If this breakpoint has survived the above battery of checks, then it must have a symbolic address. Be sure that it gets reevaluated - to a target address, rather than reusing the old evaluation. - - Jim Blandy : As explained above in the comment - for bp_catch_exec and friends, I'm pretty sure this is entirely - unnecessary. A call to breakpoint_re_set_one always recomputes - the breakpoint's address from scratch, or deletes it if it can't. - So I think this assignment could be deleted without effect. */ + to a target address, rather than reusing the old evaluation. */ b->address = (CORE_ADDR) NULL; } } @@ -1222,13 +1205,13 @@ detach_breakpoints (int pid) { register struct breakpoint *b; int val; - struct cleanup *old_chain = save_inferior_ptid (); + ptid_t saved_inferior_ptid = inferior_ptid; if (pid == PIDGET (inferior_ptid)) error ("Cannot detach breakpoints of inferior_ptid"); - /* Set inferior_ptid; remove_breakpoint uses this global. */ - inferior_ptid = pid_to_ptid (pid); + /* FIXME: use a cleanup, to insure that inferior_ptid gets replaced! */ + inferior_ptid = pid_to_ptid (pid); /* Because remove_breakpoint will use this global. */ ALL_BREAKPOINTS (b) { if (b->inserted) @@ -1236,12 +1219,12 @@ detach_breakpoints (int pid) val = remove_breakpoint (b, mark_inserted); if (val != 0) { - do_cleanups (old_chain); + inferior_ptid = saved_inferior_ptid; return val; } } } - do_cleanups (old_chain); + inferior_ptid = saved_inferior_ptid; return 0; } @@ -1720,19 +1703,13 @@ bpstat_find_breakpoint (bpstat bsp, struct breakpoint *breakpoint) struct breakpoint * bpstat_find_step_resume_breakpoint (bpstat bsp) { - int current_thread; - if (bsp == NULL) error ("Internal error (bpstat_find_step_resume_breakpoint)"); - current_thread = pid_to_thread_id (inferior_ptid); - for (; bsp != NULL; bsp = bsp->next) { if ((bsp->breakpoint_at != NULL) && - (bsp->breakpoint_at->type == bp_step_resume) && - (bsp->breakpoint_at->thread == current_thread || - bsp->breakpoint_at->thread == -1)) + (bsp->breakpoint_at->type == bp_step_resume)) return bsp->breakpoint_at; } @@ -1889,7 +1866,7 @@ print_it_typical (bpstat bs) #ifdef UI_OUT annotate_breakpoint (bs->breakpoint_at->number); ui_out_text (uiout, "\nBreakpoint "); - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "breakpoint-hit"); ui_out_field_int (uiout, "bkptno", bs->breakpoint_at->number); ui_out_text (uiout, ", "); @@ -2034,17 +2011,17 @@ print_it_typical (bpstat bs) { annotate_watchpoint (bs->breakpoint_at->number); #ifdef UI_OUT - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "watchpoint-trigger"); mention (bs->breakpoint_at); - ui_out_tuple_begin (uiout, "value"); + ui_out_list_begin (uiout, "value"); ui_out_text (uiout, "\nOld value = "); value_print (bs->old_val, stb->stream, 0, Val_pretty_default); ui_out_field_stream (uiout, "old", stb); ui_out_text (uiout, "\nNew value = "); value_print (bs->breakpoint_at->val, stb->stream, 0, Val_pretty_default); ui_out_field_stream (uiout, "new", stb); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); ui_out_text (uiout, "\n"); #else mention (bs->breakpoint_at); @@ -2064,14 +2041,14 @@ print_it_typical (bpstat bs) case bp_read_watchpoint: #ifdef UI_OUT - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "read-watchpoint-trigger"); mention (bs->breakpoint_at); - ui_out_tuple_begin (uiout, "value"); + ui_out_list_begin (uiout, "value"); ui_out_text (uiout, "\nValue = "); value_print (bs->breakpoint_at->val, stb->stream, 0, Val_pretty_default); ui_out_field_stream (uiout, "value", stb); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); ui_out_text (uiout, "\n"); #else mention (bs->breakpoint_at); @@ -2088,10 +2065,10 @@ print_it_typical (bpstat bs) if (bs->old_val != NULL) { annotate_watchpoint (bs->breakpoint_at->number); - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "access-watchpoint-trigger"); mention (bs->breakpoint_at); - ui_out_tuple_begin (uiout, "value"); + ui_out_list_begin (uiout, "value"); ui_out_text (uiout, "\nOld value = "); value_print (bs->old_val, stb->stream, 0, Val_pretty_default); ui_out_field_stream (uiout, "old", stb); @@ -2102,14 +2079,14 @@ print_it_typical (bpstat bs) else { mention (bs->breakpoint_at); - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "access-watchpoint-trigger"); - ui_out_tuple_begin (uiout, "value"); + ui_out_list_begin (uiout, "value"); ui_out_text (uiout, "\nValue = "); } value_print (bs->breakpoint_at->val, stb->stream, 0,Val_pretty_default); ui_out_field_stream (uiout, "new", stb); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); ui_out_text (uiout, "\n"); #else if (bs->old_val != NULL) @@ -2139,7 +2116,7 @@ print_it_typical (bpstat bs) case bp_finish: #ifdef UI_OUT - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "function-finished"); #endif return PRINT_UNKNOWN; @@ -2147,7 +2124,7 @@ print_it_typical (bpstat bs) case bp_until: #ifdef UI_OUT - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "location-reached"); #endif return PRINT_UNKNOWN; @@ -2354,7 +2331,7 @@ watchpoint_check (PTR p) will be deleted already. So we have no choice but print the information here. */ #ifdef UI_OUT - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "watchpoint-scope"); ui_out_text (uiout, "\nWatchpoint "); ui_out_field_int (uiout, "wpnum", bs->breakpoint_at->number); @@ -2409,12 +2386,7 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint) "Error evaluating expression for watchpoint %d\n"; char message[sizeof (message1) + 30 /* slop */ ]; - /* Get the address where the breakpoint would have been. - The "not_a_breakpoint" argument is meant to distinguish - between a breakpoint trap event and a trace/singlestep - trap event. For a trace/singlestep trap event, we would - not want to subtract DECR_PC_AFTER_BREAK from the PC. */ - + /* Get the address where the breakpoint would have been. */ bp_addr = *pc - (not_a_breakpoint && !SOFTWARE_SINGLE_STEP_P () ? 0 : DECR_PC_AFTER_BREAK); @@ -3138,7 +3110,7 @@ print_one_breakpoint (struct breakpoint *b, annotate_record (); #ifdef UI_OUT - ui_out_tuple_begin (uiout, "bkpt"); + ui_out_list_begin (uiout, "bkpt"); #endif /* 1 */ @@ -3481,7 +3453,7 @@ print_one_breakpoint (struct breakpoint *b, #ifdef UI_OUT /* Output the count also if it is zero, but only if this is mi. FIXME: Should have a better test for this. */ - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) if (show_breakpoint_hit_counts && b->hit_count == 0) ui_out_field_int (uiout, "times", b->hit_count); #endif @@ -3502,9 +3474,9 @@ print_one_breakpoint (struct breakpoint *b, { annotate_field (9); #ifdef UI_OUT - ui_out_tuple_begin (uiout, "script"); + ui_out_list_begin (uiout, "script"); print_command_lines (uiout, l, 4); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); #else while (l) { @@ -3514,7 +3486,7 @@ print_one_breakpoint (struct breakpoint *b, #endif } #ifdef UI_OUT - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); do_cleanups (old_chain); #endif } @@ -3552,109 +3524,22 @@ gdb_breakpoint_query (/* output object, */ int bnum) NULL, RETURN_MASK_ALL); } -/* Return non-zero if B is user settable (breakpoints, watchpoints, - catchpoints, et.al.). */ - -static int -user_settable_breakpoint (const struct breakpoint *b) -{ - return (b->type == bp_breakpoint - || b->type == bp_catch_load - || b->type == bp_catch_unload - || b->type == bp_catch_fork - || b->type == bp_catch_vfork - || b->type == bp_catch_exec - || b->type == bp_catch_catch - || b->type == bp_catch_throw - || b->type == bp_hardware_breakpoint - || b->type == bp_watchpoint - || b->type == bp_read_watchpoint - || b->type == bp_access_watchpoint - || b->type == bp_hardware_watchpoint); -} - -/* Print information on user settable breakpoint (watchpoint, etc) - number BNUM. If BNUM is -1 print all user settable breakpoints. - If ALLFLAG is non-zero, include non- user settable breakpoints. */ +/* Print information on breakpoint number BNUM, or -1 if all. + If WATCHPOINTS is zero, process only breakpoints; if WATCHPOINTS + is nonzero, process only watchpoints. */ static void breakpoint_1 (int bnum, int allflag) { register struct breakpoint *b; CORE_ADDR last_addr = (CORE_ADDR) -1; - int nr_printable_breakpoints; + int found_a_breakpoint = 0; - /* Compute the number of rows in the table. */ - nr_printable_breakpoints = 0; - ALL_BREAKPOINTS (b) - if (bnum == -1 - || bnum == b->number) - { - if (allflag || user_settable_breakpoint (b)) - nr_printable_breakpoints++; - } - #ifdef UI_OUT if (addressprint) - ui_out_table_begin (uiout, 6, nr_printable_breakpoints, "BreakpointTable"); + ui_out_table_begin (uiout, 6, "BreakpointTable"); else - ui_out_table_begin (uiout, 5, nr_printable_breakpoints, "BreakpointTable"); -#endif /* UI_OUT */ - -#ifdef UI_OUT - if (nr_printable_breakpoints > 0) - annotate_breakpoints_headers (); - if (nr_printable_breakpoints > 0) - annotate_field (0); - ui_out_table_header (uiout, 3, ui_left, "number", "Num"); /* 1 */ - if (nr_printable_breakpoints > 0) - annotate_field (1); - ui_out_table_header (uiout, 14, ui_left, "type", "Type"); /* 2 */ - if (nr_printable_breakpoints > 0) - annotate_field (2); - ui_out_table_header (uiout, 4, ui_left, "disp", "Disp"); /* 3 */ - if (nr_printable_breakpoints > 0) - annotate_field (3); - ui_out_table_header (uiout, 3, ui_left, "enabled", "Enb"); /* 4 */ - if (addressprint) - { - if (nr_printable_breakpoints > 0) - annotate_field (4); - if (TARGET_ADDR_BIT <= 32) - ui_out_table_header (uiout, 10, ui_left, "addr", "Address");/* 5 */ - else - ui_out_table_header (uiout, 18, ui_left, "addr", "Address");/* 5 */ - } - if (nr_printable_breakpoints > 0) - annotate_field (5); - ui_out_table_header (uiout, 40, ui_noalign, "what", "What"); /* 6 */ - ui_out_table_body (uiout); - if (nr_printable_breakpoints > 0) - annotate_breakpoints_table (); -#else - if (nr_printable_breakpoints > 0) - { - annotate_breakpoints_headers (); - annotate_field (0); - printf_filtered ("Num "); - annotate_field (1); - printf_filtered ("Type "); - annotate_field (2); - printf_filtered ("Disp "); - annotate_field (3); - printf_filtered ("Enb "); - if (addressprint) - { - annotate_field (4); - if (TARGET_ADDR_BIT <= 32) - printf_filtered ("Address "); - else - printf_filtered ("Address "); - } - annotate_field (5); - printf_filtered ("What\n"); - annotate_breakpoints_table (); - } + ui_out_table_begin (uiout, 5, "BreakpointTable"); #endif /* UI_OUT */ ALL_BREAKPOINTS (b) @@ -3663,16 +3548,72 @@ breakpoint_1 (int bnum, int allflag) { /* We only print out user settable breakpoints unless the allflag is set. */ - if (allflag || user_settable_breakpoint (b)) - print_one_breakpoint (b, &last_addr); - } - - + if (!allflag + && b->type != bp_breakpoint + && b->type != bp_catch_load + && b->type != bp_catch_unload + && b->type != bp_catch_fork + && b->type != bp_catch_vfork + && b->type != bp_catch_exec + && b->type != bp_catch_catch + && b->type != bp_catch_throw + && b->type != bp_hardware_breakpoint + && b->type != bp_watchpoint + && b->type != bp_read_watchpoint + && b->type != bp_access_watchpoint + && b->type != bp_hardware_watchpoint) + continue; + + if (!found_a_breakpoint++) + { + annotate_breakpoints_headers (); #ifdef UI_OUT - ui_out_table_end (uiout); + annotate_field (0); + ui_out_table_header (uiout, 3, ui_left, "Num"); /* 1 */ + annotate_field (1); + ui_out_table_header (uiout, 14, ui_left, "Type"); /* 2 */ + annotate_field (2); + ui_out_table_header (uiout, 4, ui_left, "Disp"); /* 3 */ + annotate_field (3); + ui_out_table_header (uiout, 3, ui_left, "Enb"); /* 4 */ + if (addressprint) + { + annotate_field (4); + if (TARGET_ADDR_BIT <= 32) + ui_out_table_header (uiout, 10, ui_left, "Address"); /* 5 */ + else + ui_out_table_header (uiout, 18, ui_left, "Address"); /* 5 */ + } + annotate_field (5); + ui_out_table_header (uiout, 40, ui_noalign, "What"); /* 6 */ + ui_out_table_body (uiout); +#else + annotate_field (0); + printf_filtered ("Num "); + annotate_field (1); + printf_filtered ("Type "); + annotate_field (2); + printf_filtered ("Disp "); + annotate_field (3); + printf_filtered ("Enb "); + if (addressprint) + { + annotate_field (4); + if (TARGET_ADDR_BIT <= 32) + printf_filtered ("Address "); + else + printf_filtered ("Address "); + } + annotate_field (5); + printf_filtered ("What\n"); #endif /* UI_OUT */ - - if (nr_printable_breakpoints == 0) + annotate_breakpoints_table (); + } + + print_one_breakpoint (b, &last_addr); + } + + if (!found_a_breakpoint) { #ifdef UI_OUT if (bnum == -1) @@ -3695,6 +3636,9 @@ breakpoint_1 (int bnum, int allflag) set_next_address (last_addr); } +#ifdef UI_OUT + ui_out_table_end (uiout); +#endif /* UI_OUT */ /* FIXME? Should this be moved up so that it is only called when there have been breakpoints? */ annotate_breakpoints_table_end (); @@ -3775,56 +3719,20 @@ set_default_breakpoint (int valid, CORE_ADDR addr, struct symtab *symtab, default_breakpoint_line = line; } -/* Return true iff it is meaningful to use the address member of - BPT. For some breakpoint types, the address member is irrelevant - and it makes no sense to attempt to compare it to other addresses - (or use it for any other purpose either). - - More specifically, each of the following breakpoint types will always - have a zero valued address and we don't want check_duplicates() to mark - breakpoints of any of these types to be a duplicate of an actual - breakpoint at address zero: - - bp_watchpoint - bp_hardware_watchpoint - bp_read_watchpoint - bp_access_watchpoint - bp_catch_exec - bp_longjmp_resume - bp_catch_fork - bp_catch_vork */ - -static int -breakpoint_address_is_meaningful (struct breakpoint *bpt) -{ - enum bptype type = bpt->type; - - return (type != bp_watchpoint - && type != bp_hardware_watchpoint - && type != bp_read_watchpoint - && type != bp_access_watchpoint - && type != bp_catch_exec - && type != bp_longjmp_resume - && type != bp_catch_fork - && type != bp_catch_vfork); -} - -/* Rescan breakpoints at the same address and section as BPT, +/* Rescan breakpoints at address ADDRESS, marking the first one as "first" and any others as "duplicates". This is so that the bpt instruction is only inserted once. - If we have a permanent breakpoint at the same place as BPT, make - that one the official one, and the rest as duplicates. */ + If we have a permanent breakpoint at ADDRESS, make that one + the official one, and the rest as duplicates. */ static void -check_duplicates (struct breakpoint *bpt) +check_duplicates (CORE_ADDR address, asection *section) { register struct breakpoint *b; register int count = 0; struct breakpoint *perm_bp = 0; - CORE_ADDR address = bpt->address; - asection *section = bpt->section; - if (! breakpoint_address_is_meaningful (bpt)) + if (address == 0) /* Watchpoints are uninteresting */ return; ALL_BREAKPOINTS (b) @@ -3832,8 +3740,7 @@ check_duplicates (struct breakpoint *bpt) && b->enable != shlib_disabled && b->enable != call_disabled && b->address == address - && (overlay_debugging == 0 || b->section == section) - && breakpoint_address_is_meaningful (b)) + && (overlay_debugging == 0 || b->section == section)) { /* Have we found a permanent breakpoint? */ if (b->enable == permanent) @@ -3871,30 +3778,24 @@ check_duplicates (struct breakpoint *bpt) && b->enable != shlib_disabled && b->enable != call_disabled && b->address == address - && (overlay_debugging == 0 || b->section == section) - && breakpoint_address_is_meaningful (b)) + && (overlay_debugging == 0 || b->section == section)) b->duplicate = 1; } } } -/* set_raw_breakpoint() is a low level routine for allocating and - partially initializing a breakpoint of type BPTYPE. The newly - created breakpoint's address, section, source file name, and line - number are provided by SAL. The newly created and partially - initialized breakpoint is added to the breakpoint chain and - is also returned as the value of this function. +/* Low level routine to set a breakpoint. + Takes as args the three things that every breakpoint must have. + Returns the breakpoint object so caller can set other things. + Does not set the breakpoint number! + Does not print anything. - It is expected that the caller will complete the initialization of - the newly created breakpoint struct as well as output any status - information regarding the creation of a new breakpoint. In - particular, set_raw_breakpoint() does NOT set the breakpoint - number! Care should be taken to not allow an error() to occur - prior to completing the initialization of the breakpoint. If this - should happen, a bogus breakpoint will be left on the chain. */ + ==> This routine should not be called if there is a chance of later + error(); otherwise it leaves a bogus breakpoint on the chain. Validate + your arguments BEFORE calling this routine! */ struct breakpoint * -set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype) +set_raw_breakpoint (struct symtab_and_line sal) { register struct breakpoint *b, *b1; @@ -3907,7 +3808,6 @@ set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype) b->source_file = savestring (sal.symtab->filename, strlen (sal.symtab->filename)); b->section = sal.section; - b->type = bptype; b->language = current_language->la_language; b->input_radix = input_radix; b->thread = -1; @@ -3937,7 +3837,7 @@ set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype) b1->next = b; } - check_duplicates (b); + check_duplicates (sal.pc, sal.section); breakpoints_changed (); return b; @@ -3976,9 +3876,11 @@ create_longjmp_breakpoint (char *func_name) return; } sal.section = find_pc_overlay (sal.pc); - b = set_raw_breakpoint (sal, - func_name != NULL ? bp_longjmp : bp_longjmp_resume); + b = set_raw_breakpoint (sal); + if (!b) + return; + b->type = func_name != NULL ? bp_longjmp : bp_longjmp_resume; b->disposition = donttouch; b->enable = disabled; b->silent = 1; @@ -4002,7 +3904,7 @@ enable_longjmp_breakpoint (void) if (b->type == bp_longjmp) { b->enable = enabled; - check_duplicates (b); + check_duplicates (b->address, b->section); } } @@ -4016,7 +3918,7 @@ disable_longjmp_breakpoint (void) || b->type == bp_longjmp_resume) { b->enable = disabled; - check_duplicates (b); + check_duplicates (b->address, b->section); } } @@ -4030,10 +3932,13 @@ create_thread_event_breakpoint (CORE_ADDR address) INIT_SAL (&sal); /* initialize to zeroes */ sal.pc = address; sal.section = find_pc_overlay (sal.pc); - b = set_raw_breakpoint (sal, bp_thread_event); + if ((b = set_raw_breakpoint (sal)) == NULL) + return NULL; b->number = internal_breakpoint_number--; b->disposition = donttouch; + b->type = bp_thread_event; /* XXX: do we need a new type? + bp_thread_event */ b->enable = enabled; /* addr_string has to be used or breakpoint_re_set will delete me. */ sprintf (addr_string, "*0x%s", paddr (b->address)); @@ -4072,9 +3977,10 @@ create_solib_event_breakpoint (CORE_ADDR address) INIT_SAL (&sal); /* initialize to zeroes */ sal.pc = address; sal.section = find_pc_overlay (sal.pc); - b = set_raw_breakpoint (sal, bp_shlib_event); + b = set_raw_breakpoint (sal); b->number = internal_breakpoint_number--; b->disposition = donttouch; + b->type = bp_shlib_event; return b; } @@ -4182,7 +4088,7 @@ solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname, if (canonical != (char **) NULL) discard_cleanups (canonical_strings_chain); - b = set_raw_breakpoint (sals.sals[0], bp_kind); + b = set_raw_breakpoint (sals.sals[0]); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; b->cond = NULL; @@ -4205,6 +4111,7 @@ solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname, b->dll_pathname = (char *) xmalloc (strlen (dll_pathname) + 1); strcpy (b->dll_pathname, dll_pathname); } + b->type = bp_kind; mention (b); do_cleanups (old_chain); @@ -4239,7 +4146,7 @@ create_fork_vfork_event_catchpoint (int tempflag, char *cond_string, sal.symtab = NULL; sal.line = 0; - b = set_raw_breakpoint (sal, bp_kind); + b = set_raw_breakpoint (sal); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; b->cond = NULL; @@ -4251,6 +4158,8 @@ create_fork_vfork_event_catchpoint (int tempflag, char *cond_string, b->disposition = tempflag ? del : donttouch; b->forked_inferior_pid = 0; + b->type = bp_kind; + mention (b); } @@ -4278,7 +4187,7 @@ create_exec_event_catchpoint (int tempflag, char *cond_string) sal.symtab = NULL; sal.line = 0; - b = set_raw_breakpoint (sal, bp_catch_exec); + b = set_raw_breakpoint (sal); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; b->cond = NULL; @@ -4289,6 +4198,8 @@ create_exec_event_catchpoint (int tempflag, char *cond_string) b->enable = enabled; b->disposition = tempflag ? del : donttouch; + b->type = bp_catch_exec; + mention (b); } @@ -4350,7 +4261,7 @@ set_longjmp_resume_breakpoint (CORE_ADDR pc, struct frame_info *frame) b->frame = frame->frame; else b->frame = 0; - check_duplicates (b); + check_duplicates (b->address, b->section); return; } } @@ -4370,7 +4281,7 @@ disable_watchpoints_before_interactive_call_start (void) && (b->enable == enabled)) { b->enable = call_disabled; - check_duplicates (b); + check_duplicates (b->address, b->section); } } } @@ -4390,7 +4301,7 @@ enable_watchpoints_after_interactive_call_stop (void) && (b->enable == call_disabled)) { b->enable = enabled; - check_duplicates (b); + check_duplicates (b->address, b->section); } } } @@ -4405,7 +4316,8 @@ set_momentary_breakpoint (struct symtab_and_line sal, struct frame_info *frame, enum bptype type) { register struct breakpoint *b; - b = set_raw_breakpoint (sal, type); + b = set_raw_breakpoint (sal); + b->type = type; b->enable = enabled; b->disposition = donttouch; b->frame = (frame ? frame->frame : 0); @@ -4451,21 +4363,21 @@ mention (struct breakpoint *b) #ifdef UI_OUT case bp_watchpoint: ui_out_text (uiout, "Watchpoint "); - ui_out_tuple_begin (uiout, "wpt"); + ui_out_list_begin (uiout, "wpt"); ui_out_field_int (uiout, "number", b->number); ui_out_text (uiout, ": "); print_expression (b->exp, stb->stream); ui_out_field_stream (uiout, "exp", stb); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); break; case bp_hardware_watchpoint: ui_out_text (uiout, "Hardware watchpoint "); - ui_out_tuple_begin (uiout, "wpt"); + ui_out_list_begin (uiout, "wpt"); ui_out_field_int (uiout, "number", b->number); ui_out_text (uiout, ": "); print_expression (b->exp, stb->stream); ui_out_field_stream (uiout, "exp", stb); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); break; #else case bp_watchpoint: @@ -4480,21 +4392,21 @@ mention (struct breakpoint *b) #ifdef UI_OUT case bp_read_watchpoint: ui_out_text (uiout, "Hardware read watchpoint "); - ui_out_tuple_begin (uiout, "hw-rwpt"); + ui_out_list_begin (uiout, "hw-rwpt"); ui_out_field_int (uiout, "number", b->number); ui_out_text (uiout, ": "); print_expression (b->exp, stb->stream); ui_out_field_stream (uiout, "exp", stb); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); break; case bp_access_watchpoint: ui_out_text (uiout, "Hardware access (read/write) watchpoint "); - ui_out_tuple_begin (uiout, "hw-awpt"); + ui_out_list_begin (uiout, "hw-awpt"); ui_out_field_int (uiout, "number", b->number); ui_out_text (uiout, ": "); print_expression (b->exp, stb->stream); ui_out_field_stream (uiout, "exp", stb); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); break; #else case bp_read_watchpoint: @@ -4509,7 +4421,7 @@ mention (struct breakpoint *b) #endif case bp_breakpoint: #ifdef UI_OUT - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) { say_where = 0; break; @@ -4520,7 +4432,7 @@ mention (struct breakpoint *b) break; case bp_hardware_breakpoint: #ifdef UI_OUT - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) { say_where = 0; break; @@ -4583,7 +4495,7 @@ mention (struct breakpoint *b) do_cleanups (old_chain); #endif #ifdef UI_OUT - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) return; #endif printf_filtered ("\n"); @@ -4629,9 +4541,10 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string, if (from_tty) describe_other_breakpoints (sal.pc, sal.section); - b = set_raw_breakpoint (sal, type); + b = set_raw_breakpoint (sal); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; + b->type = type; b->cond = cond[i]; b->thread = thread; b->addr_string = addr_string[i]; @@ -5431,13 +5344,8 @@ watch_command_1 (char *arg, int accessflag, int from_tty) } #endif /* HPUXHPPA */ - /* Change the type of breakpoint to an ordinary watchpoint if a hardware - watchpoint could not be set. */ - if (!mem_cnt || target_resources_ok <= 0) - bp_type = bp_watchpoint; - /* Now set up the breakpoint. */ - b = set_raw_breakpoint (sal, bp_type); + b = set_raw_breakpoint (sal); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; b->disposition = donttouch; @@ -5460,6 +5368,11 @@ watch_command_1 (char *arg, int accessflag, int from_tty) else b->watchpoint_frame = (CORE_ADDR) 0; + if (mem_cnt && target_resources_ok > 0) + b->type = bp_type; + else + b->type = bp_watchpoint; + /* If the expression is "local", then set up a "watchpoint scope" breakpoint at the point where we've left the scope of the watchpoint expression. */ @@ -5474,11 +5387,11 @@ watch_command_1 (char *arg, int accessflag, int from_tty) scope_sal.pc = get_frame_pc (prev_frame); scope_sal.section = find_pc_overlay (scope_sal.pc); - scope_breakpoint = set_raw_breakpoint (scope_sal, - bp_watchpoint_scope); + scope_breakpoint = set_raw_breakpoint (scope_sal); set_breakpoint_count (breakpoint_count + 1); scope_breakpoint->number = breakpoint_count; + scope_breakpoint->type = bp_watchpoint_scope; scope_breakpoint->enable = enabled; /* Automatically delete the breakpoint when it hits. */ @@ -6208,24 +6121,11 @@ create_exception_catchpoint (int tempflag, char *cond_string, { struct breakpoint *b; int thread = -1; /* All threads. */ - enum bptype bptype; if (!sal) /* no exception support? */ return; - switch (ex_event) - { - case EX_EVENT_THROW: - bptype = bp_catch_throw; - break; - case EX_EVENT_CATCH: - bptype = bp_catch_catch; - break; - default: /* error condition */ - error ("Internal error -- invalid catchpoint kind"); - } - - b = set_raw_breakpoint (*sal, bptype); + b = set_raw_breakpoint (*sal); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; b->cond = NULL; @@ -6235,6 +6135,19 @@ create_exception_catchpoint (int tempflag, char *cond_string, b->addr_string = NULL; b->enable = enabled; b->disposition = tempflag ? del : donttouch; + switch (ex_event) + { + case EX_EVENT_THROW: + b->type = bp_catch_throw; + break; + case EX_EVENT_CATCH: + b->type = bp_catch_catch; + break; + default: /* error condition */ + b->type = bp_none; + b->enable = disabled; + error ("Internal error -- invalid catchpoint kind"); + } mention (b); } @@ -6387,14 +6300,16 @@ handle_gnu_4_16_catch_command (char *arg, int tempflag, int from_tty) if (from_tty) describe_other_breakpoints (sal.pc, sal.section); + b = set_raw_breakpoint (sal); + set_breakpoint_count (breakpoint_count + 1); + b->number = breakpoint_count; + /* Important -- this is an ordinary breakpoint. For platforms with callback support for exceptions, create_exception_catchpoint() will create special bp types (bp_catch_catch and bp_catch_throw), and there is code in insert_breakpoints() and elsewhere that depends on that. */ - b = set_raw_breakpoint (sal, bp_breakpoint); - set_breakpoint_count (breakpoint_count + 1); - b->number = breakpoint_count; + b->type = bp_breakpoint; b->cond = cond; b->enable = enabled; @@ -6425,8 +6340,11 @@ create_temp_exception_breakpoint (CORE_ADDR pc) sal.symtab = NULL; sal.line = 0; - b = set_raw_breakpoint (sal, bp_breakpoint); + b = set_raw_breakpoint (sal); + if (!b) + error ("Internal error -- couldn't set temp exception breakpoint"); + b->type = bp_breakpoint; b->disposition = del; b->enable = enabled; b->silent = 1; @@ -6562,9 +6480,10 @@ struct breakpoint * set_breakpoint_sal (struct symtab_and_line sal) { struct breakpoint *b; - b = set_raw_breakpoint (sal, bp_breakpoint); + b = set_raw_breakpoint (sal); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; + b->type = bp_breakpoint; b->cond = 0; b->thread = -1; return b; @@ -6797,7 +6716,7 @@ delete_breakpoint (struct breakpoint *bpt) breakpoint_delete_event (bpt->number); if (bpt->inserted) - remove_breakpoint (bpt, mark_inserted); + remove_breakpoint (bpt, mark_uninserted); if (breakpoint_chain == bpt) breakpoint_chain = bpt->next; @@ -6851,7 +6770,7 @@ delete_breakpoint (struct breakpoint *bpt) } } - check_duplicates (bpt); + check_duplicates (bpt->address, bpt->section); /* If this breakpoint was inserted, and there is another breakpoint at the same address, we need to insert the other breakpoint. */ if (bpt->inserted @@ -7094,7 +7013,7 @@ breakpoint_re_set_one (PTR bint) /* Now that this is re-enabled, check_duplicates can be used. */ - check_duplicates (b); + check_duplicates (b->address, b->section); } xfree (sals.sals); @@ -7359,7 +7278,7 @@ disable_breakpoint (struct breakpoint *bpt) bpt->enable = disabled; - check_duplicates (bpt); + check_duplicates (bpt->address, bpt->section); if (modify_breakpoint_hook) modify_breakpoint_hook (bpt); @@ -7424,7 +7343,7 @@ do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition) if (bpt->enable != permanent) bpt->enable = enabled; bpt->disposition = disposition; - check_duplicates (bpt); + check_duplicates (bpt->address, bpt->section); breakpoints_changed (); if (bpt->type == bp_watchpoint || @@ -7616,29 +7535,24 @@ then no output is printed when it is hit, except what the commands print."); Usage is `condition N COND', where N is an integer and COND is an\n\ expression to be evaluated whenever breakpoint N is reached. "); - c = add_com ("tbreak", class_breakpoint, tbreak_command, - "Set a temporary breakpoint. Args like \"break\" command.\n\ + add_com ("tbreak", class_breakpoint, tbreak_command, + "Set a temporary breakpoint. Args like \"break\" command.\n\ Like \"break\" except the breakpoint is only temporary,\n\ so it will be deleted when hit. Equivalent to \"break\" followed\n\ by using \"enable delete\" on the breakpoint number."); - c->completer = location_completer; - - c = add_com ("txbreak", class_breakpoint, tbreak_at_finish_command, - "Set temporary breakpoint at procedure exit. Either there should\n\ + add_com ("txbreak", class_breakpoint, tbreak_at_finish_command, + "Set temporary breakpoint at procedure exit. Either there should\n\ be no argument or the argument must be a depth.\n"); - c->completer = location_completer; - c = add_com ("hbreak", class_breakpoint, hbreak_command, - "Set a hardware assisted breakpoint. Args like \"break\" command.\n\ + add_com ("hbreak", class_breakpoint, hbreak_command, + "Set a hardware assisted breakpoint. Args like \"break\" command.\n\ Like \"break\" except the breakpoint requires hardware support,\n\ some target hardware may not have this support."); - c->completer = location_completer; - c = add_com ("thbreak", class_breakpoint, thbreak_command, - "Set a temporary hardware assisted breakpoint. Args like \"break\" command.\n\ + add_com ("thbreak", class_breakpoint, thbreak_command, + "Set a temporary hardware assisted breakpoint. Args like \"break\" command.\n\ Like \"hbreak\" except the breakpoint is only temporary,\n\ so it will be deleted when hit."); - c->completer = location_completer; add_prefix_cmd ("enable", class_breakpoint, enable_command, "Enable some breakpoints.\n\ @@ -7740,8 +7654,8 @@ is executing in.\n\ \n\ See also the \"delete\" command which clears breakpoints by number.", NULL)); - c = add_com ("break", class_breakpoint, break_command, - concat ("Set breakpoint at specified line or function.\n\ + add_com ("break", class_breakpoint, break_command, + concat ("Set breakpoint at specified line or function.\n\ Argument may be line number, function name, or \"*\" and an address.\n\ If line number is specified, break at start of code for that line.\n\ If function is specified, break at start of code for that function.\n\ @@ -7752,8 +7666,6 @@ This is useful for breaking on return to a stack frame.\n\ Multiple breakpoints at one place are permitted, and useful if conditional.\n\ \n\ Do \"help breakpoints\" for info on other commands dealing with breakpoints.", NULL)); - c->completer = location_completer; - add_com_alias ("b", "break", class_run, 1); add_com_alias ("br", "break", class_run, 1); add_com_alias ("bre", "break", class_run, 1); @@ -7899,23 +7811,20 @@ Like \"catch\" except the catchpoint is only temporary,\n\ so it will be deleted when hit. Equivalent to \"catch\" followed\n\ by using \"enable delete\" on the catchpoint number."); - c = add_com ("watch", class_breakpoint, watch_command, - "Set a watchpoint for an expression.\n\ + add_com ("watch", class_breakpoint, watch_command, + "Set a watchpoint for an expression.\n\ A watchpoint stops execution of your program whenever the value of\n\ an expression changes."); - c->completer = location_completer; - c = add_com ("rwatch", class_breakpoint, rwatch_command, - "Set a read watchpoint for an expression.\n\ + add_com ("rwatch", class_breakpoint, rwatch_command, + "Set a read watchpoint for an expression.\n\ A watchpoint stops execution of your program whenever the value of\n\ an expression is read."); - c->completer = location_completer; - c = add_com ("awatch", class_breakpoint, awatch_command, - "Set a watchpoint for an expression.\n\ + add_com ("awatch", class_breakpoint, awatch_command, + "Set a watchpoint for an expression.\n\ A watchpoint stops execution of your program whenever the value of\n\ an expression is either read or written."); - c->completer = location_completer; add_info ("watchpoints", breakpoints_info, "Synonym for ``info breakpoints''."); diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 1ef4a799e58..cd9d1b7a242 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -193,17 +193,16 @@ struct breakpoint /* Number assigned to distinguish breakpoints. */ int number; - /* Address to break at. - Note that zero is a perfectly valid code address on some - platforms (for example, the mn10200 and mn10300 simulators). - NULL is not a special value for this field. */ + /* Address to break at, or NULL if not a breakpoint. */ CORE_ADDR address; - /* Line number of this address. */ + /* Line number of this address. Only matters if address is + non-NULL. */ int line_number; - /* Source file name of this address. */ + /* Source file name of this address. Only matters if address is + non-NULL. */ char *source_file; @@ -218,10 +217,11 @@ struct breakpoint control of the target insert_breakpoint and remove_breakpoint routines. No other code should assume anything about the value(s) here. */ char shadow_contents[BREAKPOINT_MAX]; - /* Nonzero if this breakpoint is now inserted. */ + /* Nonzero if this breakpoint is now inserted. Only matters if address + is non-NULL. */ char inserted; /* Nonzero if this is not the first breakpoint in the list - for the given address. */ + for the given address. Only matters if address is non-NULL. */ char duplicate; /* Chain of command lines to execute when this breakpoint is hit. */ struct command_line *commands; @@ -231,7 +231,8 @@ struct breakpoint /* Conditional. Break only if this expression's value is nonzero. */ struct expression *cond; - /* String we used to set the breakpoint (malloc'd). */ + /* String we used to set the breakpoint (malloc'd). Only matters if + address is non-NULL. */ char *addr_string; /* Language we used to set the breakpoint. */ enum language language; diff --git a/gdb/cli-out.c b/gdb/cli-out.c index 9bcfa4684a1..d6fa98ec763 100644 --- a/gdb/cli-out.c +++ b/gdb/cli-out.c @@ -24,7 +24,6 @@ #include "ui-out.h" #include "cli-out.h" #include "gdb_string.h" -#include "gdb_assert.h" /* Convenience macro for allocting typesafe memory. */ @@ -35,36 +34,31 @@ struct ui_out_data { struct ui_file *stream; - int suppress_output; }; /* These are the CLI output functions */ -static void cli_table_begin (struct ui_out *uiout, int nbrofcols, - int nr_rows, const char *tblid); +static void cli_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid); static void cli_table_body (struct ui_out *uiout); static void cli_table_end (struct ui_out *uiout); static void cli_table_header (struct ui_out *uiout, int width, - enum ui_align alig, const char *col_name, - const char *colhdr); -static void cli_begin (struct ui_out *uiout, enum ui_out_type type, - int level, const char *lstid); -static void cli_end (struct ui_out *uiout, enum ui_out_type type, int level); + enum ui_align alig, char *colhdr); +static void cli_list_begin (struct ui_out *uiout, int list_flag, char *lstid); +static void cli_list_end (struct ui_out *uiout, int list_flag); static void cli_field_int (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, const char *fldname, int value); + enum ui_align alig, char *fldname, int value); static void cli_field_skip (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, const char *fldname); + enum ui_align alig, char *fldname); static void cli_field_string (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, const char *fldname, + enum ui_align alig, char *fldname, const char *string); static void cli_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align, - const char *fldname, const char *format, - va_list args); + char *fldname, char *format, va_list args); static void cli_spaces (struct ui_out *uiout, int numspaces); -static void cli_text (struct ui_out *uiout, const char *string); -static void cli_message (struct ui_out *uiout, int verbosity, - const char *format, va_list args); +static void cli_text (struct ui_out *uiout, char *string); +static void cli_message (struct ui_out *uiout, int verbosity, char *format, + va_list args); static void cli_wrap_hint (struct ui_out *uiout, char *identstring); static void cli_flush (struct ui_out *uiout); @@ -79,8 +73,8 @@ static struct ui_out_impl cli_ui_out_impl = cli_table_body, cli_table_end, cli_table_header, - cli_begin, - cli_end, + cli_list_begin, + cli_list_end, cli_field_int, cli_field_skip, cli_field_string, @@ -89,8 +83,7 @@ static struct ui_out_impl cli_ui_out_impl = cli_text, cli_message, cli_wrap_hint, - cli_flush, - 0, /* Does not need MI hacks (i.e. needs CLI hacks). */ + cli_flush }; /* Prototypes for local functions */ @@ -99,9 +92,8 @@ extern void _initialize_cli_out (void); static void field_separator (void); -static void out_field_fmt (struct ui_out *uiout, int fldno, - const char *fldname, - const char *format,...); +static void out_field_fmt (struct ui_out *uiout, int fldno, char *fldname, + char *format,...); /* local variables */ @@ -110,17 +102,8 @@ static void out_field_fmt (struct ui_out *uiout, int fldno, /* Mark beginning of a table */ void -cli_table_begin (struct ui_out *uiout, int nbrofcols, - int nr_rows, - const char *tblid) +cli_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid) { - struct ui_out_data *data = ui_out_data (uiout); - if (nr_rows == 0) - data->suppress_output = 1; - else - /* Only the table suppresses the output and, fortunatly, a table - is not a recursive data structure. */ - gdb_assert (data->suppress_output == 0); } /* Mark beginning of a table body */ @@ -128,9 +111,6 @@ cli_table_begin (struct ui_out *uiout, int nbrofcols, void cli_table_body (struct ui_out *uiout) { - struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; /* first, close the table header line */ cli_text (uiout, "\n"); } @@ -140,60 +120,39 @@ cli_table_body (struct ui_out *uiout) void cli_table_end (struct ui_out *uiout) { - struct ui_out_data *data = ui_out_data (uiout); - data->suppress_output = 0; } /* Specify table header */ void cli_table_header (struct ui_out *uiout, int width, enum ui_align alignment, - const char *col_name, - const char *colhdr) + char *colhdr) { - struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; cli_field_string (uiout, 0, width, alignment, 0, colhdr); } /* Mark beginning of a list */ void -cli_begin (struct ui_out *uiout, - enum ui_out_type type, - int level, - const char *id) +cli_list_begin (struct ui_out *uiout, int list_flag, char *lstid) { - struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; } /* Mark end of a list */ void -cli_end (struct ui_out *uiout, - enum ui_out_type type, - int level) +cli_list_end (struct ui_out *uiout, int list_flag) { - struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; } /* output an int field */ void cli_field_int (struct ui_out *uiout, int fldno, int width, - enum ui_align alignment, - const char *fldname, int value) + enum ui_align alignment, char *fldname, int value) { char buffer[20]; /* FIXME: how many chars long a %d can become? */ - struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; sprintf (buffer, "%d", value); cli_field_string (uiout, fldno, width, alignment, fldname, buffer); } @@ -202,12 +161,8 @@ cli_field_int (struct ui_out *uiout, int fldno, int width, void cli_field_skip (struct ui_out *uiout, int fldno, int width, - enum ui_align alignment, - const char *fldname) + enum ui_align alignment, char *fldname) { - struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; cli_field_string (uiout, fldno, width, alignment, fldname, ""); } @@ -219,16 +174,12 @@ cli_field_string (struct ui_out *uiout, int fldno, int width, enum ui_align align, - const char *fldname, + char *fldname, const char *string) { int before = 0; int after = 0; - struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; - if ((align != ui_noalign) && string) { before = width - strlen (string); @@ -268,14 +219,9 @@ cli_field_string (struct ui_out *uiout, void cli_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align, - const char *fldname, - const char *format, - va_list args) + char *fldname, char *format, va_list args) { struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; - vfprintf_filtered (data->stream, format, args); if (align != ui_noalign) @@ -286,27 +232,20 @@ void cli_spaces (struct ui_out *uiout, int numspaces) { struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; print_spaces_filtered (numspaces, data->stream); } void -cli_text (struct ui_out *uiout, const char *string) +cli_text (struct ui_out *uiout, char *string) { struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; fputs_filtered (string, data->stream); } void -cli_message (struct ui_out *uiout, int verbosity, - const char *format, va_list args) +cli_message (struct ui_out *uiout, int verbosity, char *format, va_list args) { struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; if (ui_out_get_verblvl (uiout) >= verbosity) vfprintf_unfiltered (data->stream, format, args); } @@ -314,9 +253,6 @@ cli_message (struct ui_out *uiout, int verbosity, void cli_wrap_hint (struct ui_out *uiout, char *identstring) { - struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; wrap_here (identstring); } @@ -334,9 +270,8 @@ cli_flush (struct ui_out *uiout) /* VARARGS */ static void -out_field_fmt (struct ui_out *uiout, int fldno, - const char *fldname, - const char *format,...) +out_field_fmt (struct ui_out *uiout, int fldno, char *fldname, + char *format,...) { struct ui_out_data *data = ui_out_data (uiout); va_list args; @@ -365,7 +300,6 @@ cli_out_new (struct ui_file *stream) struct ui_out_data *data = XMALLOC (struct ui_out_data); data->stream = stream; - data->suppress_output = 0; return ui_out_new (&cli_ui_out_impl, data, flags); } diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 660bbaf13c8..c1c5f7b747e 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -23,7 +23,6 @@ #include "target.h" /* For baud_rate, remote_debug and remote_timeout */ #include "gdb_wait.h" /* For shell escape implementation */ #include "gnu-regex.h" /* Used by apropos_command */ -#include "filenames.h" /* for DOSish file names */ #ifdef UI_OUT #include "ui-out.h" @@ -293,7 +292,7 @@ cd_command (char *dir, int from_tty) if (chdir (dir) < 0) perror_with_name (dir); -#ifdef HAVE_DOS_BASED_FILE_SYSTEM +#if defined(_WIN32) || defined(__MSDOS__) /* There's too much mess with DOSish names like "d:", "d:.", "d:./foo" etc. Instead of having lots of special #ifdef'ed code, simply get the canonicalized name of the current directory. */ @@ -301,24 +300,24 @@ cd_command (char *dir, int from_tty) #endif len = strlen (dir); - if (IS_DIR_SEPARATOR (dir[len - 1])) + if (SLASH_P (dir[len - 1])) { /* Remove the trailing slash unless this is a root directory (including a drive letter on non-Unix systems). */ if (!(len == 1) /* "/" */ -#ifdef HAVE_DOS_BASED_FILE_SYSTEM - && !(len == 3 && dir[1] == ':') /* "d:/" */ +#if defined(_WIN32) || defined(__MSDOS__) + && !(!SLASH_P (*dir) && ROOTED_P (dir) && len <= 3) /* "d:/" */ #endif ) len--; } dir = savestring (dir, len); - if (IS_ABSOLUTE_PATH (dir)) + if (ROOTED_P (dir)) current_directory = dir; else { - if (IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])) + if (SLASH_P (current_directory[strlen (current_directory) - 1])) current_directory = concat (current_directory, dir, NULL); else current_directory = concat (current_directory, SLASH_STRING, dir, NULL); @@ -330,18 +329,17 @@ cd_command (char *dir, int from_tty) found_real_path = 0; for (p = current_directory; *p;) { - if (IS_DIR_SEPARATOR (p[0]) && p[1] == '.' - && (p[2] == 0 || IS_DIR_SEPARATOR (p[2]))) + if (SLASH_P (p[0]) && p[1] == '.' && (p[2] == 0 || SLASH_P (p[2]))) strcpy (p, p + 2); - else if (IS_DIR_SEPARATOR (p[0]) && p[1] == '.' && p[2] == '.' - && (p[3] == 0 || IS_DIR_SEPARATOR (p[3]))) + else if (SLASH_P (p[0]) && p[1] == '.' && p[2] == '.' + && (p[3] == 0 || SLASH_P (p[3]))) { if (found_real_path) { /* Search backwards for the directory just before the "/.." and obliterate it and the "/..". */ char *q = p; - while (q != current_directory && !IS_DIR_SEPARATOR (q[-1])) + while (q != current_directory && !SLASH_P (q[-1])) --q; if (q == current_directory) diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index 69fc4fb31ae..d4a9def73f8 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -1028,7 +1028,6 @@ free_command_lines (struct command_line **lptr) xfree (l); l = next; } - *lptr = NULL; } static void diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index bd3dd1a8c7b..47ad244a6e7 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -422,7 +422,7 @@ void cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix) { #ifdef UI_OUT - ui_out_tuple_begin (uiout, "showlist"); + ui_out_list_begin (uiout, "showlist"); #endif for (; list != NULL; list = list->next) { @@ -431,19 +431,19 @@ cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix) #ifdef UI_OUT if (list->prefixlist && !list->abbrev_flag) { - ui_out_tuple_begin (uiout, "optionlist"); + ui_out_list_begin (uiout, "optionlist"); ui_out_field_string (uiout, "prefix", list->prefixname + 5); cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); } if (list->type == show_cmd) { - ui_out_tuple_begin (uiout, "option"); + ui_out_list_begin (uiout, "option"); ui_out_text (uiout, prefix); ui_out_field_string (uiout, "name", list->name); ui_out_text (uiout, ": "); do_setshow_command ((char *) NULL, from_tty, list); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); } #else if (list->prefixlist && !list->abbrev_flag) @@ -458,7 +458,7 @@ cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix) #endif } #ifdef UI_OUT - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); #endif } diff --git a/gdb/coff-solib.c b/gdb/coff-solib.c index fc13bca7b00..0f3bc76e408 100644 --- a/gdb/coff-solib.c +++ b/gdb/coff-solib.c @@ -25,8 +25,6 @@ #include "bfd.h" #include "gdbcore.h" #include "symtab.h" -#include "symfile.h" -#include "objfiles.h" /* diff --git a/gdb/coffread.c b/gdb/coffread.c index 60ef89640a8..a343a6825d5 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -312,7 +312,7 @@ struct find_targ_sec_arg asection **resultp; }; -static void find_targ_sec (bfd *, asection *, PTR); +static void find_targ_sec (bfd *, asection *, void *); static void find_targ_sec (bfd *abfd, asection *sect, PTR obj) @@ -689,11 +689,6 @@ coff_symfile_read (struct objfile *objfile, int mainline) info->stabsects, info->stabstrsect->filepos, stabstrsize); } - if (dwarf2_has_info (abfd)) - { - /* DWARF2 sections. */ - dwarf2_build_psymtabs (objfile, mainline); - } do_cleanups (back_to); } diff --git a/gdb/completer.c b/gdb/completer.c index 19db617f9cd..57aced8f4e0 100644 --- a/gdb/completer.c +++ b/gdb/completer.c @@ -22,14 +22,12 @@ #include "symtab.h" #include "gdbtypes.h" #include "expression.h" -#include "filenames.h" /* for DOSish file names */ /* FIXME: This is needed because of lookup_cmd_1(). We should be calling a hook instead so we eliminate the CLI dependency. */ #include "gdbcmd.h" -/* Needed for rl_completer_word_break_characters() and for - filename_completion_function. */ +/* Needed for rl_completer_word_break_characters() */ #include /* readline defines this. */ @@ -66,7 +64,7 @@ static char *gdb_completer_command_word_break_characters = break characters any characters that are commonly used in file names, such as '-', '+', '~', etc. Otherwise, readline displays incorrect completion candidates. */ -#ifdef HAVE_DOS_BASED_FILE_SYSTEM +#ifdef __MSDOS__ /* MS-DOS and MS-Windows use colon as part of the drive spec, and most programs support @foo style response files. */ static char *gdb_completer_file_name_break_characters = " \t\n*|\"';?><@"; @@ -74,10 +72,6 @@ static char *gdb_completer_file_name_break_characters = " \t\n*|\"';?><@"; static char *gdb_completer_file_name_break_characters = " \t\n*|\"';:?><"; #endif -/* These are used when completing on locations, which can mix file - names and symbol names separated by a colon. */ -static char *gdb_completer_loc_break_characters = " \t\n*|\"';:?><,"; - /* Characters that can be used to quote completion strings. Note that we can't include '"' because the gdb C parser treats such quoted sequences as strings. */ @@ -101,6 +95,8 @@ get_gdb_completer_quote_characters (void) char ** filename_completer (char *text, char *word) { + /* From readline. */ +extern char *filename_completion_function (char *, int); int subsequent_name; char **return_val; int return_val_used; @@ -174,153 +170,6 @@ filename_completer (char *text, char *word) return return_val; } -/* Complete on locations, which might be of two possible forms: - - file:line - or - symbol+offset - - This is intended to be used in commands that set breakpoints etc. */ -char ** -location_completer (char *text, char *word) -{ - int n_syms = 0, n_files = 0; - char ** fn_list = NULL; - char ** list = NULL; - char *p; - int quote_found = 0; - int quoted = *text == '\'' || *text == '"'; - int quote_char = '\0'; - char *colon = NULL; - char *file_to_match = NULL; - char *symbol_start = text; - char *orig_text = text; - size_t text_len; - - /* Do we have an unquoted colon, as in "break foo.c::bar"? */ - for (p = text; *p != '\0'; ++p) - { - if (*p == '\\' && p[1] == '\'') - p++; - else if (*p == '\'' || *p == '"') - { - quote_found = *p; - quote_char = *p++; - while (*p != '\0' && *p != quote_found) - { - if (*p == '\\' && p[1] == quote_found) - p++; - p++; - } - - if (*p == quote_found) - quote_found = 0; - else - break; /* hit the end of text */ - } -#if HAVE_DOS_BASED_FILE_SYSTEM - /* If we have a DOS-style absolute file name at the beginning of - TEXT, and the colon after the drive letter is the only colon - we found, pretend the colon is not there. */ - else if (p < text + 3 && *p == ':' && p == text + 1 + quoted) - ; -#endif - else if (*p == ':' && !colon) - { - colon = p; - symbol_start = p + 1; - } - else if (strchr (gdb_completer_word_break_characters, *p)) - symbol_start = p + 1; - } - - if (quoted) - text++; - text_len = strlen (text); - - /* Where is the file name? */ - if (colon) - { - char *s; - - file_to_match = (char *) xmalloc (colon - text + 1); - strncpy (file_to_match, text, colon - text + 1); - /* Remove trailing colons and quotes from the file name. */ - for (s = file_to_match + (colon - text); - s > file_to_match; - s--) - if (*s == ':' || *s == quote_char) - *s = '\0'; - } - /* If the text includes a colon, they want completion only on a - symbol name after the colon. Otherwise, we need to complete on - symbols as well as on files. */ - if (colon) - { - list = make_file_symbol_completion_list (symbol_start, word, - file_to_match); - xfree (file_to_match); - } - else - { - list = make_symbol_completion_list (symbol_start, word); - /* If text includes characters which cannot appear in a file - name, they cannot be asking for completion on files. */ - if (strcspn (text, gdb_completer_file_name_break_characters) == text_len) - fn_list = make_source_files_completion_list (text, text); - } - - /* How many completions do we have in both lists? */ - if (fn_list) - for ( ; fn_list[n_files]; n_files++) - ; - if (list) - for ( ; list[n_syms]; n_syms++) - ; - - /* Make list[] large enough to hold both lists, then catenate - fn_list[] onto the end of list[]. */ - if (n_syms && n_files) - { - list = xrealloc (list, (n_syms + n_files + 1) * sizeof (char *)); - memcpy (list + n_syms, fn_list, (n_files + 1) * sizeof (char *)); - xfree (fn_list); - } - else if (n_files) - { - /* If we only have file names as possible completion, we should - bring them in sync with what rl_complete expects. The - problem is that if the user types "break /foo/b TAB", and the - possible completions are "/foo/bar" and "/foo/baz" - rl_complete expects us to return "bar" and "baz", without the - leading directories, as possible completions, because `word' - starts at the "b". But we ignore the value of `word' when we - call make_source_files_completion_list above (because that - would not DTRT when the completion results in both symbols - and file names), so make_source_files_completion_list returns - the full "/foo/bar" and "/foo/baz" strings. This produces - wrong results when, e.g., there's only one possible - completion, because rl_complete will prepend "/foo/" to each - candidate completion. The loop below removes that leading - part. */ - for (n_files = 0; fn_list[n_files]; n_files++) - { - memmove (fn_list[n_files], fn_list[n_files] + (word - text), - strlen (fn_list[n_files]) + 1 - (word - text)); - } - /* Return just the file-name list as the result. */ - list = fn_list; - } - else if (!n_syms) - { - /* No completions at all. As the final resort, try completing - on the entire text as a symbol. */ - list = make_symbol_completion_list (orig_text, word); - } - - return list; -} - /* Here are some useful test cases for completion. FIXME: These should be put in the test suite. They should be tested with both M-? and TAB. @@ -513,7 +362,7 @@ line_completion_function (char *text, int matches, char *line_buffer, int point) to complete the entire text after the command, just the last word. To this end, we need to find the beginning of the - file name by starting at `word' and going + file name starting at `word' and going backwards. */ for (p = word; p > tmp_command @@ -523,16 +372,6 @@ line_completion_function (char *text, int matches, char *line_buffer, int point) rl_completer_word_break_characters = gdb_completer_file_name_break_characters; } - else if (c->completer == location_completer) - { - /* Commands which complete on locations want to - see the entire argument. */ - for (p = word; - p > tmp_command - && p[-1] != ' ' && p[-1] != '\t'; - p--) - ; - } list = (*c->completer) (p, word); } } @@ -591,14 +430,6 @@ line_completion_function (char *text, int matches, char *line_buffer, int point) rl_completer_word_break_characters = gdb_completer_file_name_break_characters; } - else if (c->completer == location_completer) - { - for (p = word; - p > tmp_command - && p[-1] != ' ' && p[-1] != '\t'; - p--) - ; - } list = (*c->completer) (p, word); } } diff --git a/gdb/completer.h b/gdb/completer.h index ae27395a2b8..abb3b8c8a4a 100644 --- a/gdb/completer.h +++ b/gdb/completer.h @@ -23,8 +23,6 @@ extern char *line_completion_function (char *, int, char *, int); extern char **filename_completer (char *, char *); -extern char **location_completer (char *, char *); - extern char *get_gdb_completer_word_break_characters (void); extern char *get_gdb_completer_quote_characters (void); diff --git a/gdb/config/alpha/alpha-osf1.mh b/gdb/config/alpha/alpha-osf1.mh index 62654e8c00c..6ed0f95ffcf 100644 --- a/gdb/config/alpha/alpha-osf1.mh +++ b/gdb/config/alpha/alpha-osf1.mh @@ -2,5 +2,4 @@ XDEPFILES= XM_FILE= xm-alphaosf.h NAT_FILE= nm-osf.h -NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o \ - solib-osf.o solib.o +NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o osfsolib.o diff --git a/gdb/config/alpha/alpha-osf2.mh b/gdb/config/alpha/alpha-osf2.mh index 8b4d841c960..bb200d8236e 100644 --- a/gdb/config/alpha/alpha-osf2.mh +++ b/gdb/config/alpha/alpha-osf2.mh @@ -3,5 +3,4 @@ XDEPFILES= XM_FILE= xm-alphaosf.h NAT_FILE= nm-osf2.h NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o \ - solib-osf.o solib.o procfs.o proc-api.o proc-events.o proc-flags.o \ - proc-why.o + osfsolib.o procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o diff --git a/gdb/config/alpha/alpha-osf3.mh b/gdb/config/alpha/alpha-osf3.mh index 1ad20856a8b..6af28084d66 100644 --- a/gdb/config/alpha/alpha-osf3.mh +++ b/gdb/config/alpha/alpha-osf3.mh @@ -3,5 +3,5 @@ XDEPFILES= XM_FILE= xm-alphaosf.h NAT_FILE= nm-osf3.h NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o \ - solib-osf.o solib.o procfs.o proc-api.o proc-events.o proc-flags.o \ - proc-why.o + osfsolib.o procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o + diff --git a/gdb/config/arm/tm-arm.h b/gdb/config/arm/tm-arm.h index b773adff671..5df0454941d 100644 --- a/gdb/config/arm/tm-arm.h +++ b/gdb/config/arm/tm-arm.h @@ -23,7 +23,6 @@ #define TM_ARM_H #include "regcache.h" -#include "floatformat.h" /* Forward declarations for prototypes. */ struct type; diff --git a/gdb/config/djgpp/djconfig.sh b/gdb/config/djgpp/djconfig.sh index 65a4df8e13c..ae3006d0288 100644 --- a/gdb/config/djgpp/djconfig.sh +++ b/gdb/config/djgpp/djconfig.sh @@ -126,12 +126,6 @@ export DEFAULT_LEX=flex # Define explicitly the .exe extension because on W95 with LFN=y # the check might fail export am_cv_exeext=.exe -# ltconfig wants to compute the maximum command-line length, but -# Bash 2.04 doesn't like that (it doesn't have any limit ;-), and -# reboots the system. We know our limit in advance, so we don't -# need all that crap. Assuming that the environment size is less -# than 4KB, we can afford 12KB of command-line arguments. -export lt_cv_sys_max_cmd_len=12288 # The configure script needs to see the `install-sh' script, otherwise # it decides the source installation is broken. But "make install" will diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst index a6f7bd8a852..70471f1e1c8 100644 --- a/gdb/config/djgpp/fnchange.lst +++ b/gdb/config/djgpp/fnchange.lst @@ -1,41 +1,4 @@ -@V@/bfd/ChangeLog-9193 @V@/bfd/ChangeLog.9193 -@V@/bfd/ChangeLog-9495 @V@/bfd/ChangeLog.9495 -@V@/bfd/ChangeLog-9697 @V@/bfd/ChangeLog.9697 -@V@/bfd/ChangeLog-9899 @V@/bfd/ChangeLog.9899 -@V@/bfd/coff-tic54x.c @V@/bfd/coff-tc54x.c -@V@/bfd/coff-tic80.c @V@/bfd/coff-tc80.c -@V@/bfd/cpu-ia64-opc.c @V@/bfd/cpuia64-opc.c -@V@/bfd/cpu-m68hc11.c @V@/bfd/cm68hc11.c -@V@/bfd/cpu-m68hc12.c @V@/bfd/cm68hc12.c -@V@/bfd/efi-app-ia32.c @V@/bfd/efi-ia32-app.c -@V@/bfd/efi-app-ia64.c @V@/bfd/efi-ia64-app.c -@V@/bfd/elf32-i370.c @V@/bfd/elf32-i7.c -@V@/bfd/elf32-m68hc11.c @V@/bfd/em68hc11.c -@V@/bfd/elf32-m68hc12.c @V@/bfd/em68hc12.c -@V@/bfd/elf32-m68k.c @V@/bfd/em68k.c -@V@/bfd/elf32-sh-lin.c @V@/bfd/elf32-slin.c -@V@/dejagnu/baseboards/mn10200-cygmon.exp @V@/dejagnu/baseboards/mn10200cygmon.exp -@V@/dejagnu/baseboards/mn10200-sim.exp @V@/dejagnu/baseboards/mn10200sim.exp -@V@/dejagnu/baseboards/mn10300-cygmon.exp @V@/dejagnu/baseboards/mn10300cygmon.exp -@V@/dejagnu/baseboards/mn10300-sim.exp @V@/dejagnu/baseboards/mn10300sim.exp -@V@/dejagnu/baseboards/powerpc-bug1.exp @V@/dejagnu/baseboards/powerpc1-bug.exp -@V@/dejagnu/baseboards/powerpc-sim.exp @V@/dejagnu/baseboards/powerpcsim.exp -@V@/dejagnu/baseboards/sparclite-coff.exp @V@/dejagnu/baseboards/sl-coff.exp -@V@/dejagnu/baseboards/sparclite-cygmon.exp @V@/dejagnu/baseboards/sl-cygmon.exp -@V@/dejagnu/baseboards/sparclite-sim-le.exp @V@/dejagnu/baseboards/sl-sim-le.exp -@V@/dejagnu/baseboards/sparclite-sim.exp @V@/dejagnu/baseboards/sl-sim.exp -@V@/dejagnu/contrib/test-g++ @V@/dejagnu/contrib/test-gxx -@V@/dejagnu/doc/.cvsignore @V@/dejagnu/doc/_cvsignore -@V@/dejagnu/example/calc/calc.h.in @V@/dejagnu/example/calc/calc.h-in -@V@/expect/Dbg_cf.h.in @V@/expect/Dbg_cf.h-in -@V@/expect/example/beer.exp.out @V@/expect/example/beer_exp.out -@V@/expect/example/chesslib++.c @V@/expect/example/chesslibxx.c -@V@/expect/example/chesslib.c @V@/expect/example/chesslb.c -@V@/expect/example/chesslib2.c @V@/expect/example/chesslb2.c -@V@/expect/example/chesslibxx.c @V@/expect/example/chesslbxx.c -@V@/expect/exp_main_sub.c @V@/expect/exp_m_sub.c -@V@/expect/exp_main_tk.c @V@/expect/exp_m_tk.c -@V@/expect/expect_cf.h.in @V@/expect/expect_cf.h-in +@V@/gdb/ChangeLog-3.x @V@/gdb/ChangeLog.3-x @V@/gdb/ChangeLog-1990 @V@/gdb/ChangeLog.90 @V@/gdb/ChangeLog-1991 @V@/gdb/ChangeLog.91 @V@/gdb/ChangeLog-1992 @V@/gdb/ChangeLog.92 @@ -48,10 +11,40 @@ @V@/gdb/ChangeLog-1999 @V@/gdb/ChangeLog.99 @V@/gdb/ChangeLog-2000 @V@/gdb/ChangeLog.000 @V@/gdb/ChangeLog-2001 @V@/gdb/ChangeLog.001 -@V@/gdb/ChangeLog-3.x @V@/gdb/ChangeLog.3-x -@V@/gdb/arm-linux-nat.c @V@/gdb/armlin-nat.c +@V@/gdb/ppc-linux-tdep.c @V@/gdb/ppc-linx-tdep.c +@V@/gdb/remote-adapt.c @V@/gdb/rmt-adapt.c +@V@/gdb/remote-array.c @V@/gdb/rmt-array.c +@V@/gdb/remote-e7000.c @V@/gdb/rmt-e7000.c +@V@/gdb/remote-eb.c @V@/gdb/rmt-eb.c +@V@/gdb/remote-es.c @V@/gdb/rmt-es.c +@V@/gdb/remote-est.c @V@/gdb/rmt-est.c +@V@/gdb/remote-mips.c @V@/gdb/emt-mips.c +@V@/gdb/remote-mm.c @V@/gdb/emt-mm.c +@V@/gdb/remote-nindy.c @V@/gdb/rmt-nindy.c +@V@/gdb/remote-nrom.c @V@/gdb/rmt-nrom.c +@V@/gdb/remote-rdi.c @V@/gdb/rmt-rdi.c +@V@/gdb/remote-rdp.c @V@/gdb/rmt-rdp.c +@V@/gdb/remote-sds.c @V@/gdb/rmt-sds.c +@V@/gdb/remote-sim.c @V@/gdb/rmt-sim.c +@V@/gdb/remote-st.c @V@/gdb/rmt-st.c +@V@/gdb/remote-udi.c @V@/gdb/rmt-udi.c +@V@/gdb/remote-vx.c @V@/gdb/rmt-vx.c +@V@/gdb/remote-vx29k.c @V@/gdb/rmt-vx29k.c +@V@/gdb/remote-vx68.c @V@/gdb/rmt-vx68.c +@V@/gdb/remote-vx960.c @V@/gdb/rmt-vx960.c +@V@/gdb/remote-vxmips.c @V@/gdb/rmt-vxmips.c +@V@/gdb/remote-vxsparc.c @V@/gdb/rmt-vxsparc.c +@V@/gdb/sparclet-rom.c @V@/gdb/splet-rom.c +@V@/gdb/sparclet-stub.c @V@/gdb/splet-stub.c +@V@/gdb/m68knbsd-nat.c @V@/gdb/m6nbsd-nat.c +@V@/gdb/m68knbsd-tdep.c @V@/gdb/m6nbsd-tdep.c +@V@/gdb/i386nbsd-nat.c @V@/gdb/i3nbsd-nat.c +@V@/gdb/i386nbsd-tdep.c @V@/gdb/i3nbsd-tdep.c +@V@/gdb/i386-linux-tdep.c @V@/gdb/i386linux-tdep.c @V@/gdb/arm-linux-tdep.c @V@/gdb/armlin-tdep.c -@V@/gdb/c-exp.tab.c @V@/gdb/c-exp_tab.c +@V@/gdb/arm-linux-nat.c @V@/gdb/armlin-nat.c +@V@/gdb/ia64-aix-nat.c @V@/gdb/ia64aix-nat.c +@V@/gdb/ia64-linux-nat.c @V@/gdb/ia64linux-nat.c @V@/gdb/config/alpha/alpha-osf1.mh @V@/gdb/config/alpha/alphosf1.mh @V@/gdb/config/alpha/alpha-osf2.mh @V@/gdb/config/alpha/alphosf2.mh @V@/gdb/config/alpha/alpha-osf3.mh @V@/gdb/config/alpha/alphosf3.mh @@ -96,57 +89,64 @@ @V@/gdb/config/sparc/tm-sparclynx.h @V@/gdb/config/sparc/tm-splynx.h @V@/gdb/config/sparc/xm-sparclynx.h @V@/gdb/config/sparc/xm-xplynx.h @V@/gdb/config/vax/xm-vaxult2.h @V@/gdb/config/vax/xm-vaxut2.h -@V@/gdb/f-exp.tab.c @V@/gdb/f-exp_tab.c -@V@/gdb/gdbtk/generic/ChangeLog-1997 @V@/gdb/gdbtk/generic/ChangeLog.97 -@V@/gdb/gdbtk/generic/ChangeLog-1998 @V@/gdb/gdbtk/generic/ChangeLog.98 -@V@/gdb/gdbtk/generic/ChangeLog-1999 @V@/gdb/gdbtk/generic/ChangeLog.99 -@V@/gdb/gdbtk/generic/ChangeLog-2000 @V@/gdb/gdbtk/generic/ChangeLog.000 -@V@/gdb/gdbtk/generic/ChangeLog-2001 @V@/gdb/gdbtk/generic/ChangeLog.001 @V@/gdb/gdbtk/generic/gdbtk-varobj.c @V@/gdb/gdbtk/generic/gdbtk-vobj.c -@V@/gdb/gdbtk/library/ChangeLog-1997 @V@/gdb/gdbtk/library/ChangeLog.97 -@V@/gdb/gdbtk/library/ChangeLog-1998 @V@/gdb/gdbtk/library/ChangeLog.98 -@V@/gdb/gdbtk/library/ChangeLog-1999 @V@/gdb/gdbtk/library/ChangeLog.99 -@V@/gdb/gdbtk/library/ChangeLog-2000 @V@/gdb/gdbtk/library/ChangeLog.000 -@V@/gdb/gdbtk/library/ChangeLog-2001 @V@/gdb/gdbtk/library/ChangeLog.001 -@V@/gdb/i386-linux-tdep.c @V@/gdb/i386linux-tdep.c -@V@/gdb/i386nbsd-nat.c @V@/gdb/i3nbsd-nat.c -@V@/gdb/i386nbsd-tdep.c @V@/gdb/i3nbsd-tdep.c -@V@/gdb/ia64-aix-nat.c @V@/gdb/ia64aix-nat.c -@V@/gdb/ia64-linux-nat.c @V@/gdb/ia64linux-nat.c +@V@/gdb/osf-share/cma_stack_int.h @V@/gdb/osf-share/cma_stkint.h +@V@/gdb/testsuite/gdb.base/coremaker2.c @V@/gdb/testsuite/gdb.base/core2maker.c +@V@/gdb/tui/tuiSourceWin.c @V@/gdb/tui/tuiWinSource.c +@V@/gdb/tui/tuiSourceWin.h @V@/gdb/tui/tuiWinSource.h +@V@/bfd/ChangeLog-9193 @V@/bfd/ChangeLog.9193 +@V@/bfd/ChangeLog-9495 @V@/bfd/ChangeLog.9495 +@V@/bfd/ChangeLog-9697 @V@/bfd/ChangeLog.9697 +@V@/bfd/ChangeLog-9899 @V@/bfd/ChangeLog.9899 +@V@/bfd/coff-tic80.c @V@/bfd/coff-tc80.c +@V@/bfd/coff-tic54x.c @V@/bfd/coff-tc54x.c +@V@/bfd/elf32-i370.c @V@/bfd/elf32-i7.c +@V@/bfd/elf32-sh-lin.c @V@/bfd/elf32-slin.c +@V@/sim/mips/dv-tx3904irc.c @V@/sim/mips/dv-tx3irc.c +@V@/sim/mips/dv-tx3904sio.c @V@/sim/mips/dv-tx3sio.c +@V@/sim/mips/dv-tx3904tmr.c @V@/sim/mips/dv-tx3tmr.c +@V@/sim/mn10300/dv-mn103int.c @V@/sim/mn10300/dv-mn1int.c +@V@/sim/mn10300/dv-mn103iop.c @V@/sim/mn10300/dv-mn1iop.c +@V@/sim/mn10300/dv-mn103ser.c @V@/sim/mn10300/dv-mn1ser.c +@V@/sim/mn10300/dv-mn103tim.c @V@/sim/mn10300/dv-mn1tim.c +@V@/sim/ppc/corefile-n.h @V@/sim/ppc/corefle-n.h +@V@/sim/ppc/idecode_branch.h @V@/sim/ppc/idec_branch.h +@V@/sim/ppc/idecode_expression.h @V@/sim/ppc/idec_expression.h +@V@/sim/ppc/idecode_fields.h @V@/sim/ppc/idec_fields.h +@V@/sim/ppc/sim-endian-n.h @V@/sim/ppc/sim-endn.h +@V@/sim/testsuite/d10v-elf/t-ae-ld-d.s @V@/sim/testsuite/d10v-elf/t-ld-d.s +@V@/sim/testsuite/d10v-elf/t-ae-ld-i.s @V@/sim/testsuite/d10v-elf/t-ld-i.s +@V@/sim/testsuite/d10v-elf/t-ae-ld-id.s @V@/sim/testsuite/d10v-elf/t-ld-id.s +@V@/sim/testsuite/d10v-elf/t-ae-ld-im.s @V@/sim/testsuite/d10v-elf/t-ld-im.s +@V@/sim/testsuite/d10v-elf/t-ae-ld-ip.s @V@/sim/testsuite/d10v-elf/t-ld-ip.s +@V@/sim/testsuite/d10v-elf/t-ae-ld2w-d.s @V@/sim/testsuite/d10v-elf/t-ld2-d.s +@V@/sim/testsuite/d10v-elf/t-ae-ld2w-i.s @V@/sim/testsuite/d10v-elf/t-ld2-i.s +@V@/sim/testsuite/d10v-elf/t-ae-ld2w-id.s @V@/sim/testsuite/d10v-elf/t-ld2-id.s +@V@/sim/testsuite/d10v-elf/t-ae-ld2w-im.s @V@/sim/testsuite/d10v-elf/t-ld2-im.s +@V@/sim/testsuite/d10v-elf/t-ae-ld2w-ip.s @V@/sim/testsuite/d10v-elf/t-ld2-ip.s +@V@/sim/testsuite/d10v-elf/t-ae-st-d.s @V@/sim/testsuite/d10v-elf/t-st-d.s +@V@/sim/testsuite/d10v-elf/t-ae-st-i.s @V@/sim/testsuite/d10v-elf/t-st-i.s +@V@/sim/testsuite/d10v-elf/t-ae-st-id.s @V@/sim/testsuite/d10v-elf/t-st-id.s +@V@/sim/testsuite/d10v-elf/t-ae-st-im.s @V@/sim/testsuite/d10v-elf/t-st-im.s +@V@/sim/testsuite/d10v-elf/t-ae-st-ip.s @V@/sim/testsuite/d10v-elf/t-st-ip.s +@V@/sim/testsuite/d10v-elf/t-ae-st-is.s @V@/sim/testsuite/d10v-elf/t-st-is.s +@V@/sim/testsuite/d10v-elf/t-ae-st2w-d.s @V@/sim/testsuite/d10v-elf/t-st2-d.s +@V@/sim/testsuite/d10v-elf/t-ae-st2w-i.s @V@/sim/testsuite/d10v-elf/t-st2-i.s +@V@/sim/testsuite/d10v-elf/t-ae-st2w-id.s @V@/sim/testsuite/d10v-elf/t-st2-id.s +@V@/sim/testsuite/d10v-elf/t-ae-st2w-im.s @V@/sim/testsuite/d10v-elf/t-st2-im.s +@V@/sim/testsuite/d10v-elf/t-ae-st2w-ip.s @V@/sim/testsuite/d10v-elf/t-st2-ip.s +@V@/sim/testsuite/d10v-elf/t-ae-st2w-is.s @V@/sim/testsuite/d10v-elf/t-st2-is.s +@V@/sim/testsuite/d30v-elf/ls-ld4bhu.S @V@/sim/testsuite/d30v-elf/ls-ld4bu.S +@V@/intl/po2tbl.sed.in @V@/intl/po2tblsed.in +@V@/intl/intlh.inst.in @V@/intl/intlh_inst.in +@V@/readline/config.h.in @V@/readline/config.h-in +@V@/readline/config.h.bot @V@/readline/config.h-bot +@V@/gdb/nindy-share/b.out.h @V@/gdb/nindy-share/b_out.h +@V@/gdb/c-exp.tab.c @V@/gdb/c-exp_tab.c @V@/gdb/jv-exp.tab.c @V@/gdb/jv-exp_tab.c +@V@/gdb/f-exp.tab.c @V@/gdb/f-exp_tab.c @V@/gdb/m2-exp.tab.c @V@/gdb/m2-exp_tab.c -@V@/gdb/m68knbsd-nat.c @V@/gdb/m6nbsd-nat.c -@V@/gdb/m68knbsd-tdep.c @V@/gdb/m6nbsd-tdep.c -@V@/gdb/nindy-share/b.out.h @V@/gdb/nindy-share/b_out.h -@V@/gdb/osf-share/cma_stack_int.h @V@/gdb/osf-share/cma_stkint.h @V@/gdb/p-exp.tab.c @V@/gdb/p-exp_tab.c -@V@/gdb/ppc-linux-tdep.c @V@/gdb/ppc-linx-tdep.c -@V@/gdb/remote-adapt.c @V@/gdb/rmt-adapt.c -@V@/gdb/remote-array.c @V@/gdb/rmt-array.c -@V@/gdb/remote-e7000.c @V@/gdb/rmt-e7000.c -@V@/gdb/remote-eb.c @V@/gdb/rmt-eb.c -@V@/gdb/remote-es.c @V@/gdb/rmt-es.c -@V@/gdb/remote-est.c @V@/gdb/rmt-est.c -@V@/gdb/remote-mips.c @V@/gdb/emt-mips.c -@V@/gdb/remote-mm.c @V@/gdb/emt-mm.c -@V@/gdb/remote-nindy.c @V@/gdb/rmt-nindy.c -@V@/gdb/remote-nrom.c @V@/gdb/rmt-nrom.c -@V@/gdb/remote-rdi.c @V@/gdb/rmt-rdi.c -@V@/gdb/remote-rdp.c @V@/gdb/rmt-rdp.c -@V@/gdb/remote-sds.c @V@/gdb/rmt-sds.c -@V@/gdb/remote-sim.c @V@/gdb/rmt-sim.c -@V@/gdb/remote-st.c @V@/gdb/rmt-st.c -@V@/gdb/remote-udi.c @V@/gdb/rmt-udi.c -@V@/gdb/remote-vx.c @V@/gdb/rmt-vx.c -@V@/gdb/remote-vx29k.c @V@/gdb/rmt-vx29k.c -@V@/gdb/remote-vx68.c @V@/gdb/rmt-vx68.c -@V@/gdb/remote-vx960.c @V@/gdb/rmt-vx960.c -@V@/gdb/remote-vxmips.c @V@/gdb/rmt-vxmips.c -@V@/gdb/remote-vxsparc.c @V@/gdb/rmt-vxsparc.c -@V@/gdb/sparclet-rom.c @V@/gdb/splet-rom.c -@V@/gdb/sparclet-stub.c @V@/gdb/splet-stub.c -@V@/gdb/testsuite/.gdbinit @V@/gdb/testsuite/gdb.ini -@V@/gdb/testsuite/gdb.base/coremaker2.c @V@/gdb/testsuite/gdb.base/core2maker.c @V@/gdb/testsuite/gdb.c++ @V@/gdb/testsuite/gdb.cxx @V@/gdb/testsuite/gdb.c++/Makefile.in @V@/gdb/testsuite/gdb.cxx/Makefile.in @V@/gdb/testsuite/gdb.c++/ambiguous.cc @V@/gdb/testsuite/gdb.cxx/ambiguous.cc @@ -177,8 +177,6 @@ @V@/gdb/testsuite/gdb.c++/method.exp @V@/gdb/testsuite/gdb.cxx/method.exp @V@/gdb/testsuite/gdb.c++/misc.cc @V@/gdb/testsuite/gdb.cxx/misc.cc @V@/gdb/testsuite/gdb.c++/misc.exp @V@/gdb/testsuite/gdb.cxx/misc.exp -@V@/gdb/testsuite/gdb.c++/namespace.cc @V@/gdb/testsuite/gdb.cxx/namespace.cc -@V@/gdb/testsuite/gdb.c++/namespace.exp @V@/gdb/testsuite/gdb.cxx/namespace.exp @V@/gdb/testsuite/gdb.c++/overload.cc @V@/gdb/testsuite/gdb.cxx/overload.cc @V@/gdb/testsuite/gdb.c++/overload.exp @V@/gdb/testsuite/gdb.cxx/overload.exp @V@/gdb/testsuite/gdb.c++/ovldbreak.cc @V@/gdb/testsuite/gdb.cxx/ovldbreak.cc @@ -192,23 +190,19 @@ @V@/gdb/testsuite/gdb.c++/virtfunc.cc @V@/gdb/testsuite/gdb.cxx/virtfunc.cc @V@/gdb/testsuite/gdb.c++/virtfunc.exp @V@/gdb/testsuite/gdb.cxx/virtfunc.exp @V@/gdb/testsuite/gdb.mi/mi-var-cmd.exp @V@/gdb/testsuite/gdb.mi/mi-varcmd.exp -@V@/gdb/testsuite/gdb.mi/mi0-var-block.exp @V@/gdb/testsuite/gdb.mi/mi0varblock.exp -@V@/gdb/testsuite/gdb.mi/mi0-var-child.exp @V@/gdb/testsuite/gdb.mi/mi0varchild.exp -@V@/gdb/testsuite/gdb.mi/mi0-var-cmd.exp @V@/gdb/testsuite/gdb.mi/mi0varcmd.exp -@V@/gdb/testsuite/gdb.mi/mi0-var-display.exp @V@/gdb/testsuite/gdb.mi/mi0vardisplay.exp -@V@/gdb/tui/tuiSourceWin.c @V@/gdb/tui/tuiWinSource.c -@V@/gdb/tui/tuiSourceWin.h @V@/gdb/tui/tuiWinSource.h -@V@/intl/intlh.inst.in @V@/intl/intlh_inst.in -@V@/intl/po2tbl.sed.in @V@/intl/po2tblsed.in +@V@/gdb/testsuite/.gdbinit @V@/gdb/testsuite/gdb.ini +@V@/sim/ppc/.gdbinit @V@/sim/ppc/gdb.ini +@V@/tcl/cygwin/tclConfig.sh.in @V@/tcl/cygwin/tclConfig.sh-in +@V@/tcl/mac/tclMacProjects.sea.hqx @V@/tcl/mac/tclMacProjects.shqx +@V@/tcl/unix/tclConfig.sh.in @V@/tcl/unix/tclConfig.sh-in +@V@/tk/doc/tk4.0.ps @V@/tk/doc/tk4-0.ps +@V@/tk/mac/tkMacProjects.sit.hqx @V@/tk/mac/tkMacProjects.shqx +@V@/tk/unix/tkConfig.sh.in @V@/tk/unix/tkConfig.sh-in @V@/itcl/itcl/itclConfig.sh.in @V@/itcl/itcl/itclConfig.sh-in @V@/itcl/itcl/unix/pkgIndex.tcl.in @V@/itcl/itcl/unix/pkgIndex.t-in @V@/itcl/itk/itkConfig.sh.in @V@/itcl/itk/itkConfig.sh-in @V@/itcl/itk/unix/pkgIndex.tcl.in @V@/itcl/itk/unix/pkgIndex.t-in @V@/itcl/iwidgets3.0.0 @V@/itcl/iwidgets3.0-0 -@V@/itcl/iwidgets3.0.0/demos/extfileselectionbox @V@/itcl/iwidgets3.0-0/demos/efselbox -@V@/itcl/iwidgets3.0.0/demos/extfileselectiondialog @V@/itcl/iwidgets3.0-0/demos/efseldialog -@V@/itcl/iwidgets3.0.0/demos/fileselectionbox @V@/itcl/iwidgets3.0-0/demos/fselectbox -@V@/itcl/iwidgets3.0.0/demos/fileselectiondialog @V@/itcl/iwidgets3.0-0/demos/fselectdialog @V@/itcl/iwidgets3.0.0/demos/html/buttonbox.n.html @V@/itcl/iwidgets3.0-0/demos/html/buttonbox.n-html @V@/itcl/iwidgets3.0.0/demos/html/canvasprintbox.n.html @V@/itcl/iwidgets3.0-0/demos/html/cprintbox.n-html @V@/itcl/iwidgets3.0.0/demos/html/canvasprintdialog.n.html @V@/itcl/iwidgets3.0-0/demos/html/cprintdialog.n-html @@ -245,61 +239,73 @@ @V@/itcl/iwidgets3.0.0/demos/html/tabnotebook.n.html @V@/itcl/iwidgets3.0-0/demos/html/tabnotebook.n-html @V@/itcl/iwidgets3.0.0/demos/html/tabset.n.html @V@/itcl/iwidgets3.0-0/demos/html/tabset.n-html @V@/itcl/iwidgets3.0.0/demos/html/toolbar.n.html @V@/itcl/iwidgets3.0-0/demos/html/toolbar.n-html -@V@/itcl/iwidgets3.0.0/demos/scrolledcanvas @V@/itcl/iwidgets3.0-0/demos/scrolcanvas -@V@/itcl/iwidgets3.0.0/demos/scrolledframe @V@/itcl/iwidgets3.0-0/demos/scrolframe -@V@/itcl/iwidgets3.0.0/demos/scrolledhtml @V@/itcl/iwidgets3.0-0/demos/scrolhtml -@V@/itcl/iwidgets3.0.0/demos/scrolledlistbox @V@/itcl/iwidgets3.0-0/demos/scroldlistbox -@V@/itcl/iwidgets3.0.0/demos/scrolledtext @V@/itcl/iwidgets3.0-0/demos/scroltext -@V@/itcl/iwidgets3.0.0/demos/selectionbox @V@/itcl/iwidgets3.0-0/demos/selectbox -@V@/itcl/iwidgets3.0.0/demos/selectiondialog @V@/itcl/iwidgets3.0-0/demos/selectdialog -@V@/itcl/iwidgets3.0.0/doc/canvasprintbox.n @V@/itcl/iwidgets3.0-0/doc/cprintbox.n -@V@/itcl/iwidgets3.0.0/doc/canvasprintdialog.n @V@/itcl/iwidgets3.0-0/doc/cprintdialog.n -@V@/itcl/iwidgets3.0.0/doc/extfileselectionbox.n @V@/itcl/iwidgets3.0-0/doc/efselbox.n -@V@/itcl/iwidgets3.0.0/doc/extfileselectiondialog.n @V@/itcl/iwidgets3.0-0/doc/efseldialog.n -@V@/itcl/iwidgets3.0.0/doc/fileselectionbox.n @V@/itcl/iwidgets3.0-0/doc/fselectbox.n -@V@/itcl/iwidgets3.0.0/doc/fileselectiondialog.n @V@/itcl/iwidgets3.0-0/doc/fselectdialog.n @V@/itcl/iwidgets3.0.0/doc/scopedobject.n.backup @V@/itcl/iwidgets3.0-0/doc/scopedobject.n-backup -@V@/itcl/iwidgets3.0.0/doc/scrolledcanvas.n @V@/itcl/iwidgets3.0-0/doc/scrolcanvas.n -@V@/itcl/iwidgets3.0.0/doc/scrolledframe.n @V@/itcl/iwidgets3.0-0/doc/scrolframe.n -@V@/itcl/iwidgets3.0.0/doc/scrolledhtml.n @V@/itcl/iwidgets3.0-0/doc/scrolhtml.n -@V@/itcl/iwidgets3.0.0/doc/scrolledlistbox.n @V@/itcl/iwidgets3.0-0/doc/scrollistbox.n -@V@/itcl/iwidgets3.0.0/doc/scrolledtext.n @V@/itcl/iwidgets3.0-0/doc/scroltext.n -@V@/itcl/iwidgets3.0.0/doc/selectionbox.n @V@/itcl/iwidgets3.0-0/doc/selectbox.n -@V@/itcl/iwidgets3.0.0/doc/selectiondialog.n @V@/itcl/iwidgets3.0-0/doc/selectdialog.n +@V@/itcl/iwidgets3.0.0/unix/iwidgets.tcl.in @V@/itcl/iwidgets3.0-0/unix/iwidgets.t-in +@V@/itcl/iwidgets3.0.0/unix/pkgIndex.tcl.in @V@/itcl/iwidgets3.0-0/unix/pkgIndex.t-in +@V@/tix/tixConfig.sh.in @V@/tix/tixConfig.sh-in +@V@/tix/docs/Release-4.1.0.html @V@/tix/docs/Rel4_10.html +@V@/tix/docs/Release-4.1.0.txt @V@/tix/docs/Rel4_10.txt +@V@/tix/docs/Release-4.1a2.html @V@/tix/docs/Rel4_1a2.html +@V@/tix/docs/Release-4.1a2.txt @V@/tix/docs/Rel4_1a2.txt +@V@/tix/docs/Release-4.1a3.html @V@/tix/docs/Rel4_1a3.html +@V@/tix/docs/Release-4.1a3.txt @V@/tix/docs/Rel4_1a3.txt +@V@/tix/docs/Release-4.1b1.html @V@/tix/docs/Rel4_1b1.html +@V@/tix/docs/Release-4.1b1.txt @V@/tix/docs/Rel4_1b1.txt +@V@/tix/docs/Release-4.1b2.html @V@/tix/docs/Rel4_1b2.html +@V@/tix/docs/Release-4.1b2.txt @V@/tix/docs/Rel4_1b2.txt +@V@/tix/unix/tk4.2/pkgIndex.tcl.in @V@/tix/unix/tk4.2/pkgIndex.t-in +@V@/tix/unix/tk8.0/pkgIndex.tcl.in @V@/tix/unix/tk8.0/pkgIndex.t-in +@V@/tix/unix/tk8.1/pkgIndex.tcl.in @V@/tix/unix/tk8.1/pkgIndex.t-in +@V@/libgui/config.h.in @V@/libgui/config.h-in +@V@/expect/Dbg_cf.h.in @V@/expect/Dbg_cf.h-in +@V@/expect/expect_cf.h.in @V@/expect/expect_cf.h-in +@V@/expect/example/beer.exp.out @V@/expect/example/beer_exp.out +@V@/expect/example/chesslib++.c @V@/expect/example/chesslibxx.c +@V@/expect/example/chesslib.c @V@/expect/example/chesslb.c +@V@/dejagnu/contrib/test-g++ @V@/dejagnu/contrib/test-gxx +@V@/dejagnu/doc/.cvsignore @V@/dejagnu/doc/_cvsignore +@V@/dejagnu/example/calc/calc.h.in @V@/dejagnu/example/calc/calc.h-in @V@/itcl/iwidgets3.0.0/generic/canvasprintbox.itk @V@/itcl/iwidgets3.0-0/generic/cprintbox.itk @V@/itcl/iwidgets3.0.0/generic/canvasprintdialog.itk @V@/itcl/iwidgets3.0-0/generic/cprintdialog.itk -@V@/itcl/iwidgets3.0.0/generic/extfileselectionbox.itk @V@/itcl/iwidgets3.0-0/generic/efselbox.itk -@V@/itcl/iwidgets3.0.0/generic/extfileselectiondialog.itk @V@/itcl/iwidgets3.0-0/generic/efseldialog.itk -@V@/itcl/iwidgets3.0.0/generic/fileselectionbox.itk @V@/itcl/iwidgets3.0-0/generic/fselectbox.itk -@V@/itcl/iwidgets3.0.0/generic/fileselectiondialog.itk @V@/itcl/iwidgets3.0-0/generic/fselectdialog.itk -@V@/itcl/iwidgets3.0.0/generic/scrolledcanvas.itk @V@/itcl/iwidgets3.0-0/generic/scrolcanvas.itk -@V@/itcl/iwidgets3.0.0/generic/scrolledframe.itk @V@/itcl/iwidgets3.0-0/generic/scrolframe.itk -@V@/itcl/iwidgets3.0.0/generic/scrolledhtml.itk @V@/itcl/iwidgets3.0-0/generic/scrolhtml.itk -@V@/itcl/iwidgets3.0.0/generic/scrolledlistbox.itk @V@/itcl/iwidgets3.0-0/generic/scrollistbox.itk -@V@/itcl/iwidgets3.0.0/generic/scrolledtext.itk @V@/itcl/iwidgets3.0-0/generic/scroltext.itk -@V@/itcl/iwidgets3.0.0/generic/scrolledwidget.itk @V@/itcl/iwidgets3.0-0/generic/scrolwidget.itk -@V@/itcl/iwidgets3.0.0/generic/selectionbox.itk @V@/itcl/iwidgets3.0-0/generic/selectbox.itk -@V@/itcl/iwidgets3.0.0/generic/selectiondialog.itk @V@/itcl/iwidgets3.0-0/generic/selectdialog.itk +@V@/itcl/iwidgets3.0.0/doc/canvasprintbox.n @V@/itcl/iwidgets3.0-0/doc/cprintbox.n +@V@/itcl/iwidgets3.0.0/doc/canvasprintdialog.n @V@/itcl/iwidgets3.0-0/doc/cprintdialog.n @V@/itcl/iwidgets3.0.0/tests/canvasprintbox.test @V@/itcl/iwidgets3.0-0/tests/cprintbox.test @V@/itcl/iwidgets3.0.0/tests/canvasprintdialog.test @V@/itcl/iwidgets3.0-0/tests/cprintdialog.test +@V@/expect/example/chesslib2.c @V@/expect/example/chesslb2.c +@V@/tk/doc/ConfigWidg.3 @V@/tk/doc/CfgWidg.3 +@V@/tk/doc/ConfigWind.3 @V@/tk/doc/CfgWind.3 +@V@/bfd/cpu-ia64-opc.c @V@/bfd/cpuia64-opc.c +@V@/bfd/cpu-m68hc11.c @V@/bfd/cm68hc11.c +@V@/bfd/cpu-m68hc12.c @V@/bfd/cm68hc12.c +@V@/sim/m68hc11/dv-m68hc11eepr.c @V@/sim/m68hc11/dv-eepr.c +@V@/sim/m68hc11/dv-m68hc11sio.c @V@/sim/m68hc11/dv-sio.c +@V@/sim/m68hc11/dv-m68hc11spi.c @V@/sim/m68hc11/dv-spi.c +@V@/sim/m68hc11/dv-m68hc11tim.c @V@/sim/m68hc11/dv-tim.c +@V@/bfd/efi-app-ia32.c @V@/bfd/efi-ia32-app.c +@V@/bfd/efi-app-ia64.c @V@/bfd/efi-ia64-app.c +@V@/bfd/elf32-m68hc11.c @V@/bfd/em68hc11.c +@V@/bfd/elf32-m68hc12.c @V@/bfd/em68hc12.c +@V@/bfd/elf32-m68k.c @V@/bfd/em68k.c +@V@/tcl/doc/ExprLongObj.3 @V@/tcl/doc/ExprLObj.3 +@V@/expect/exp_main_sub.c @V@/expect/exp_m_sub.c +@V@/expect/exp_main_tk.c @V@/expect/exp_m_tk.c +@V@/expect/example/chesslibxx.c @V@/expect/example/chesslbxx.c +@V@/itcl/iwidgets3.0.0/demos/extfileselectionbox @V@/itcl/iwidgets3.0-0/demos/efselbox +@V@/itcl/iwidgets3.0.0/demos/extfileselectiondialog @V@/itcl/iwidgets3.0-0/demos/efseldialog +@V@/itcl/iwidgets3.0.0/generic/extfileselectionbox.itk @V@/itcl/iwidgets3.0-0/generic/efselbox.itk +@V@/itcl/iwidgets3.0.0/generic/extfileselectiondialog.itk @V@/itcl/iwidgets3.0-0/generic/efseldialog.itk +@V@/itcl/iwidgets3.0.0/doc/extfileselectionbox.n @V@/itcl/iwidgets3.0-0/doc/efselbox.n +@V@/itcl/iwidgets3.0.0/doc/extfileselectiondialog.n @V@/itcl/iwidgets3.0-0/doc/efseldialog.n @V@/itcl/iwidgets3.0.0/tests/extfileselectionbox.test @V@/itcl/iwidgets3.0-0/tests/efselbox.test @V@/itcl/iwidgets3.0.0/tests/extfileselectiondialog.test @V@/itcl/iwidgets3.0-0/tests/efseldialog.test +@V@/itcl/iwidgets3.0.0/demos/fileselectionbox @V@/itcl/iwidgets3.0-0/demos/fselectbox +@V@/itcl/iwidgets3.0.0/demos/fileselectiondialog @V@/itcl/iwidgets3.0-0/demos/fselectdialog +@V@/itcl/iwidgets3.0.0/generic/fileselectionbox.itk @V@/itcl/iwidgets3.0-0/generic/fselectbox.itk +@V@/itcl/iwidgets3.0.0/generic/fileselectiondialog.itk @V@/itcl/iwidgets3.0-0/generic/fselectdialog.itk +@V@/itcl/iwidgets3.0.0/doc/fileselectionbox.n @V@/itcl/iwidgets3.0-0/doc/fselectbox.n +@V@/itcl/iwidgets3.0.0/doc/fileselectiondialog.n @V@/itcl/iwidgets3.0-0/doc/fselectdialog.n @V@/itcl/iwidgets3.0.0/tests/fileselectionbox.test @V@/itcl/iwidgets3.0-0/tests/fselectbox.test @V@/itcl/iwidgets3.0.0/tests/fileselectiondialog.test @V@/itcl/iwidgets3.0-0/tests/fselectdialog.test -@V@/itcl/iwidgets3.0.0/tests/scrolledcanvas.test @V@/itcl/iwidgets3.0-0/tests/scrolcanvas.test -@V@/itcl/iwidgets3.0.0/tests/scrolledframe.test @V@/itcl/iwidgets3.0-0/tests/scrolframe.test -@V@/itcl/iwidgets3.0.0/tests/scrolledhtml.test @V@/itcl/iwidgets3.0-0/tests/scrolhtml.test -@V@/itcl/iwidgets3.0.0/tests/scrolledlistbox.test @V@/itcl/iwidgets3.0-0/tests/scrollistbox.test -@V@/itcl/iwidgets3.0.0/tests/scrolledtext.test @V@/itcl/iwidgets3.0-0/tests/scroltext.test -@V@/itcl/iwidgets3.0.0/tests/selectionbox.test @V@/itcl/iwidgets3.0-0/tests/selectbox.test -@V@/itcl/iwidgets3.0.0/tests/selectiondialog.test @V@/itcl/iwidgets3.0-0/tests/selectdialog.test -@V@/itcl/iwidgets3.0.0/unix/iwidgets.tcl.in @V@/itcl/iwidgets3.0-0/unix/iwidgets.t-in -@V@/itcl/iwidgets3.0.0/unix/pkgIndex.tcl.in @V@/itcl/iwidgets3.0-0/unix/pkgIndex.t-in -@V@/libgui/config.h.in @V@/libgui/config.h-in -@V@/libgui/src/tkTableCell.c @V@/libgui/src/tkTabCell.c -@V@/libgui/src/tkTableCmd.c @V@/libgui/src/tkTabCmd.c -@V@/libgui/src/tkWinPrintCanvas.c @V@/libgui/src/tkWPrtCanvas.c -@V@/libgui/src/tkWinPrintText.c @V@/libgui/src/tkWPrtText.c @V@/opcodes/ChangeLog-9297 @V@/opcodes/ChangeLog.9297 @V@/opcodes/ChangeLog-9899 @V@/opcodes/ChangeLog.9899 @V@/opcodes/ia64-opc-a.c @V@/opcodes/ia64opca.c @@ -312,106 +318,82 @@ @V@/opcodes/ia64-opc.c @V@/opcodes/ia64-opc.c @V@/opcodes/m68hc11-dis.c @V@/opcodes/m68hc11dis.c @V@/opcodes/m68hc11-opc.c @V@/opcodes/m68hc11opc.c -@V@/opcodes/openris-dis.c @V@/opcodes/orisc-dis.c @V@/opcodes/openrisc-asm.c @V@/opcodes/orisc-asm.c @V@/opcodes/openrisc-desc.c @V@/opcodes/orisc-desc.c +@V@/opcodes/openris-dis.c @V@/opcodes/orisc-dis.c @V@/opcodes/openrisc-ibld.c @V@/opcodes/orisc-ibld.c @V@/opcodes/openrisc-opc.c @V@/opcodes/orisc-opc.c @V@/opcodes/openrisc-opc.h @V@/opcodes/orisc-opc.h -@V@/readline/config.h.bot @V@/readline/config.h-bot -@V@/readline/config.h.in @V@/readline/config.h-in -@V@/sim/m68hc11/dv-m68hc11eepr.c @V@/sim/m68hc11/dv-eepr.c -@V@/sim/m68hc11/dv-m68hc11sio.c @V@/sim/m68hc11/dv-sio.c -@V@/sim/m68hc11/dv-m68hc11spi.c @V@/sim/m68hc11/dv-spi.c -@V@/sim/m68hc11/dv-m68hc11tim.c @V@/sim/m68hc11/dv-tim.c -@V@/sim/mips/dv-tx3904irc.c @V@/sim/mips/dv-tx3irc.c -@V@/sim/mips/dv-tx3904sio.c @V@/sim/mips/dv-tx3sio.c -@V@/sim/mips/dv-tx3904tmr.c @V@/sim/mips/dv-tx3tmr.c -@V@/sim/mn10300/dv-mn103int.c @V@/sim/mn10300/dv-mn1int.c -@V@/sim/mn10300/dv-mn103iop.c @V@/sim/mn10300/dv-mn1iop.c -@V@/sim/mn10300/dv-mn103ser.c @V@/sim/mn10300/dv-mn1ser.c -@V@/sim/mn10300/dv-mn103tim.c @V@/sim/mn10300/dv-mn1tim.c -@V@/sim/ppc/.gdbinit @V@/sim/ppc/gdb.ini -@V@/sim/ppc/corefile-n.h @V@/sim/ppc/corefle-n.h -@V@/sim/ppc/idecode_branch.h @V@/sim/ppc/idec_branch.h -@V@/sim/ppc/idecode_expression.h @V@/sim/ppc/idec_expression.h -@V@/sim/ppc/idecode_fields.h @V@/sim/ppc/idec_fields.h -@V@/sim/ppc/sim-endian-n.h @V@/sim/ppc/sim-endn.h -@V@/sim/testsuite/d10v-elf/t-ae-ld-d.s @V@/sim/testsuite/d10v-elf/t-ld-d.s -@V@/sim/testsuite/d10v-elf/t-ae-ld-i.s @V@/sim/testsuite/d10v-elf/t-ld-i.s -@V@/sim/testsuite/d10v-elf/t-ae-ld-id.s @V@/sim/testsuite/d10v-elf/t-ld-id.s -@V@/sim/testsuite/d10v-elf/t-ae-ld-im.s @V@/sim/testsuite/d10v-elf/t-ld-im.s -@V@/sim/testsuite/d10v-elf/t-ae-ld-ip.s @V@/sim/testsuite/d10v-elf/t-ld-ip.s -@V@/sim/testsuite/d10v-elf/t-ae-ld2w-d.s @V@/sim/testsuite/d10v-elf/t-ld2-d.s -@V@/sim/testsuite/d10v-elf/t-ae-ld2w-i.s @V@/sim/testsuite/d10v-elf/t-ld2-i.s -@V@/sim/testsuite/d10v-elf/t-ae-ld2w-id.s @V@/sim/testsuite/d10v-elf/t-ld2-id.s -@V@/sim/testsuite/d10v-elf/t-ae-ld2w-im.s @V@/sim/testsuite/d10v-elf/t-ld2-im.s -@V@/sim/testsuite/d10v-elf/t-ae-ld2w-ip.s @V@/sim/testsuite/d10v-elf/t-ld2-ip.s -@V@/sim/testsuite/d10v-elf/t-ae-st-d.s @V@/sim/testsuite/d10v-elf/t-st-d.s -@V@/sim/testsuite/d10v-elf/t-ae-st-i.s @V@/sim/testsuite/d10v-elf/t-st-i.s -@V@/sim/testsuite/d10v-elf/t-ae-st-id.s @V@/sim/testsuite/d10v-elf/t-st-id.s -@V@/sim/testsuite/d10v-elf/t-ae-st-im.s @V@/sim/testsuite/d10v-elf/t-st-im.s -@V@/sim/testsuite/d10v-elf/t-ae-st-ip.s @V@/sim/testsuite/d10v-elf/t-st-ip.s -@V@/sim/testsuite/d10v-elf/t-ae-st-is.s @V@/sim/testsuite/d10v-elf/t-st-is.s -@V@/sim/testsuite/d10v-elf/t-ae-st2w-d.s @V@/sim/testsuite/d10v-elf/t-st2-d.s -@V@/sim/testsuite/d10v-elf/t-ae-st2w-i.s @V@/sim/testsuite/d10v-elf/t-st2-i.s -@V@/sim/testsuite/d10v-elf/t-ae-st2w-id.s @V@/sim/testsuite/d10v-elf/t-st2-id.s -@V@/sim/testsuite/d10v-elf/t-ae-st2w-im.s @V@/sim/testsuite/d10v-elf/t-st2-im.s -@V@/sim/testsuite/d10v-elf/t-ae-st2w-ip.s @V@/sim/testsuite/d10v-elf/t-st2-ip.s -@V@/sim/testsuite/d10v-elf/t-ae-st2w-is.s @V@/sim/testsuite/d10v-elf/t-st2-is.s -@V@/sim/testsuite/d30v-elf/ls-ld4bhu.S @V@/sim/testsuite/d30v-elf/ls-ld4bu.S -@V@/tcl/cygwin/tclConfig.sh.in @V@/tcl/cygwin/tclConfig.sh-in -@V@/tcl/doc/ExprLongObj.3 @V@/tcl/doc/ExprLObj.3 -@V@/tcl/mac/tclMacBOAAppInit.c @V@/tcl/mac/tclBOAAppInit.c -@V@/tcl/mac/tclMacBOAMain.c @V@/tcl/mac/tclBOAMain.c -@V@/tcl/mac/tclMacInit.c @V@/tcl/mac/tclInit.c -@V@/tcl/mac/tclMacInterupt.c @V@/tcl/mac/tclInterupt.c -@V@/tcl/mac/tclMacProjects.sea.hqx @V@/tcl/mac/tclMacProjects.shqx +@V@/dejagnu/baseboards/mn10200-cygmon.exp @V@/dejagnu/baseboards/mn10200cygmon.exp +@V@/dejagnu/baseboards/mn10200-sim.exp @V@/dejagnu/baseboards/mn10200sim.exp +@V@/dejagnu/baseboards/mn10300-cygmon.exp @V@/dejagnu/baseboards/mn10300cygmon.exp +@V@/dejagnu/baseboards/mn10300-sim.exp @V@/dejagnu/baseboards/mn10300sim.exp @V@/tcl/tests/namespace-old.test @V@/tcl/tests/namespace.otest -@V@/tcl/unix/tclConfig.sh.in @V@/tcl/unix/tclConfig.sh-in +@V@/tk/tests/option.file1 @V@/tk/tests/option1.file +@V@/tk/tests/option.file2 @V@/tk/tests/option2.file +@V@/tix/unix/tk8.0/pkgIndex.tcl.in @V@/tix/unix/tk8.0/pkgIndex.t-in +@V@/dejagnu/baseboards/powerpc-bug1.exp @V@/dejagnu/baseboards/powerpc1-bug.exp +@V@/dejagnu/baseboards/powerpc-sim.exp @V@/dejagnu/baseboards/powerpcsim.exp +@V@/tk/library/images/pwrdLogo100.gif @V@/tk/library/images/pwLogo100.gif +@V@/tk/library/images/pwrdLogo150.gif @V@/tk/library/images/pwLogo150.gif +@V@/tk/library/images/pwrdLogo175.gif @V@/tk/library/images/pwLogo175.gif +@V@/tk/library/images/pwrdLogo200.gif @V@/tk/library/images/pwLogo200.gif +@V@/tk/library/images/pwrdLogo75.gif @V@/tk/library/images/pwLogo75.gif +@V@/itcl/iwidgets3.0.0/demos/scrolledcanvas @V@/itcl/iwidgets3.0-0/demos/scrolcanvas +@V@/itcl/iwidgets3.0.0/demos/scrolledframe @V@/itcl/iwidgets3.0-0/demos/scrolframe +@V@/itcl/iwidgets3.0.0/demos/scrolledhtml @V@/itcl/iwidgets3.0-0/demos/scrolhtml +@V@/itcl/iwidgets3.0.0/demos/scrolledlistbox @V@/itcl/iwidgets3.0-0/demos/scroldlistbox +@V@/itcl/iwidgets3.0.0/demos/scrolledtext @V@/itcl/iwidgets3.0-0/demos/scroltext +@V@/itcl/iwidgets3.0.0/generic/scrolledcanvas.itk @V@/itcl/iwidgets3.0-0/generic/scrolcanvas.itk +@V@/itcl/iwidgets3.0.0/generic/scrolledframe.itk @V@/itcl/iwidgets3.0-0/generic/scrolframe.itk +@V@/itcl/iwidgets3.0.0/generic/scrolledhtml.itk @V@/itcl/iwidgets3.0-0/generic/scrolhtml.itk +@V@/itcl/iwidgets3.0.0/generic/scrolledlistbox.itk @V@/itcl/iwidgets3.0-0/generic/scrollistbox.itk +@V@/itcl/iwidgets3.0.0/generic/scrolledtext.itk @V@/itcl/iwidgets3.0-0/generic/scroltext.itk +@V@/itcl/iwidgets3.0.0/generic/scrolledwidget.itk @V@/itcl/iwidgets3.0-0/generic/scrolwidget.itk +@V@/itcl/iwidgets3.0.0/doc/scrolledcanvas.n @V@/itcl/iwidgets3.0-0/doc/scrolcanvas.n +@V@/itcl/iwidgets3.0.0/doc/scrolledframe.n @V@/itcl/iwidgets3.0-0/doc/scrolframe.n +@V@/itcl/iwidgets3.0.0/doc/scrolledhtml.n @V@/itcl/iwidgets3.0-0/doc/scrolhtml.n +@V@/itcl/iwidgets3.0.0/doc/scrolledlistbox.n @V@/itcl/iwidgets3.0-0/doc/scrollistbox.n +@V@/itcl/iwidgets3.0.0/doc/scrolledtext.n @V@/itcl/iwidgets3.0-0/doc/scroltext.n +@V@/itcl/iwidgets3.0.0/tests/scrolledcanvas.test @V@/itcl/iwidgets3.0-0/tests/scrolcanvas.test +@V@/itcl/iwidgets3.0.0/tests/scrolledframe.test @V@/itcl/iwidgets3.0-0/tests/scrolframe.test +@V@/itcl/iwidgets3.0.0/tests/scrolledhtml.test @V@/itcl/iwidgets3.0-0/tests/scrolhtml.test +@V@/itcl/iwidgets3.0.0/tests/scrolledlistbox.test @V@/itcl/iwidgets3.0-0/tests/scrollistbox.test +@V@/itcl/iwidgets3.0.0/tests/scrolledtext.test @V@/itcl/iwidgets3.0-0/tests/scroltext.test +@V@/itcl/iwidgets3.0.0/demos/selectionbox @V@/itcl/iwidgets3.0-0/demos/selectbox +@V@/itcl/iwidgets3.0.0/demos/selectiondialog @V@/itcl/iwidgets3.0-0/demos/selectdialog +@V@/itcl/iwidgets3.0.0/generic/selectionbox.itk @V@/itcl/iwidgets3.0-0/generic/selectbox.itk +@V@/itcl/iwidgets3.0.0/generic/selectiondialog.itk @V@/itcl/iwidgets3.0-0/generic/selectdialog.itk +@V@/itcl/iwidgets3.0.0/doc/selectionbox.n @V@/itcl/iwidgets3.0-0/doc/selectbox.n +@V@/itcl/iwidgets3.0.0/doc/selectiondialog.n @V@/itcl/iwidgets3.0-0/doc/selectdialog.n +@V@/itcl/iwidgets3.0.0/tests/selectionbox.test @V@/itcl/iwidgets3.0-0/tests/selectbox.test +@V@/itcl/iwidgets3.0.0/tests/selectiondialog.test @V@/itcl/iwidgets3.0-0/tests/selectdialog.test +@V@/dejagnu/baseboards/sparclite-coff.exp @V@/dejagnu/baseboards/sl-coff.exp +@V@/dejagnu/baseboards/sparclite-cygmon.exp @V@/dejagnu/baseboards/sl-cygmon.exp +@V@/dejagnu/baseboards/sparclite-sim-le.exp @V@/dejagnu/baseboards/sl-sim-le.exp +@V@/dejagnu/baseboards/sparclite-sim.exp @V@/dejagnu/baseboards/sl-sim.exp @V@/tcl/unix/tclLoadAix.c @V@/tcl/unix/tclLdAix.c @V@/tcl/unix/tclLoadAout.c @V@/tcl/unix/tclLdAout.c @V@/tcl/unix/tclLoadDl.c @V@/tcl/unix/tclLdDl.c @V@/tcl/unix/tclLoadDld.c @V@/tcl/unix/tclLdDld.c +@V@/tcl/mac/tclMacBOAAppInit.c @V@/tcl/mac/tclBOAAppInit.c +@V@/tcl/mac/tclMacBOAMain.c @V@/tcl/mac/tclBOAMain.c +@V@/tcl/mac/tclMacInit.c @V@/tcl/mac/tclInit.c +@V@/tcl/mac/tclMacInterupt.c @V@/tcl/mac/tclInterupt.c @V@/tcl/unix/tclUnixFCmd.c @V@/tcl/unix/tclFCmd.c @V@/tcl/unix/tclUnixFile.c @V@/tcl/unix/tclFile.c @V@/tcl/unix/tclUnixTest.c @V@/tcl/unix/tclTest.c @V@/tcl/unix/tclUnixTime.c @V@/tcl/unix/tclTime.c -@V@/tix/docs/Release-4.1.0.html @V@/tix/docs/Rel4_10.html -@V@/tix/docs/Release-4.1.0.txt @V@/tix/docs/Rel4_10.txt -@V@/tix/docs/Release-4.1a2.html @V@/tix/docs/Rel4_1a2.html -@V@/tix/docs/Release-4.1a2.txt @V@/tix/docs/Rel4_1a2.txt -@V@/tix/docs/Release-4.1a3.html @V@/tix/docs/Rel4_1a3.html -@V@/tix/docs/Release-4.1a3.txt @V@/tix/docs/Rel4_1a3.txt -@V@/tix/docs/Release-4.1b1.html @V@/tix/docs/Rel4_1b1.html -@V@/tix/docs/Release-4.1b1.txt @V@/tix/docs/Rel4_1b1.txt -@V@/tix/docs/Release-4.1b2.html @V@/tix/docs/Rel4_1b2.html -@V@/tix/docs/Release-4.1b2.txt @V@/tix/docs/Rel4_1b2.txt -@V@/tix/tixConfig.sh.in @V@/tix/tixConfig.sh-in -@V@/tix/unix/tk4.2/pkgIndex.tcl.in @V@/tix/unix/tk4.2/pkgIndex.t-in -@V@/tix/unix/tk8.0/pkgIndex.tcl.in @V@/tix/unix/tk8.0/pkgIndex.t-in -@V@/tix/unix/tk8.0/pkgIndex.tcl.in @V@/tix/unix/tk8.0/pkgIndex.t-in -@V@/tix/unix/tk8.1/pkgIndex.tcl.in @V@/tix/unix/tk8.1/pkgIndex.t-in @V@/tix/win/tkConsole41.c @V@/tix/win/tkCon41.c @V@/tix/win/tkConsole42.c @V@/tix/win/tkCon42.c @V@/tix/win/tkConsole80a1.c @V@/tix/win/tkCon80a1.c @V@/tix/win/tkConsole80b1.c @V@/tix/win/tkCon80b1.c @V@/tix/win/tkConsole81.c @V@/tix/win/tkCon81.c -@V@/tk/doc/ConfigWidg.3 @V@/tk/doc/CfgWidg.3 -@V@/tk/doc/ConfigWind.3 @V@/tk/doc/CfgWind.3 -@V@/tk/doc/tk4.0.ps @V@/tk/doc/tk4-0.ps -@V@/tk/library/images/pwrdLogo100.gif @V@/tk/library/images/pwLogo100.gif -@V@/tk/library/images/pwrdLogo150.gif @V@/tk/library/images/pwLogo150.gif -@V@/tk/library/images/pwrdLogo175.gif @V@/tk/library/images/pwLogo175.gif -@V@/tk/library/images/pwrdLogo200.gif @V@/tk/library/images/pwLogo200.gif -@V@/tk/library/images/pwrdLogo75.gif @V@/tk/library/images/pwLogo75.gif @V@/tk/mac/tkMacMenu.c @V@/tk/mac/tkMenu.c @V@/tk/mac/tkMacMenubutton.c @V@/tk/mac/tkMenubutton.c @V@/tk/mac/tkMacMenus.c @V@/tk/mac/tkMenus.c -@V@/tk/mac/tkMacProjects.sit.hqx @V@/tk/mac/tkMacProjects.shqx -@V@/tk/tests/option.file1 @V@/tk/tests/option1.file -@V@/tk/tests/option.file2 @V@/tk/tests/option2.file -@V@/tk/unix/tkConfig.sh.in @V@/tk/unix/tkConfig.sh-in +@V@/libgui/src/tkTableCell.c @V@/libgui/src/tkTabCell.c +@V@/libgui/src/tkTableCmd.c @V@/libgui/src/tkTabCmd.c @V@/tk/unix/tkUnixFocus.c @V@/tk/unix/tkFocus.c @V@/tk/unix/tkUnixFont.c @V@/tk/unix/tkFont.c @V@/tk/unix/tkUnixMenu.c @V@/tk/unix/tkMenu.c @@ -420,3 +402,15 @@ @V@/tk/unix/tkUnixScrlbr.c @V@/tk/unix/tkScrlbr.c @V@/tk/unix/tkUnixSelect.c @V@/tk/unix/tkSelect.c @V@/tk/unix/tkUnixSend.c @V@/tk/unix/tkSend.c +@V@/libgui/src/tkWinPrintCanvas.c @V@/libgui/src/tkWPrtCanvas.c +@V@/libgui/src/tkWinPrintText.c @V@/libgui/src/tkWPrtText.c +@V@/gdb/gdbtk/generic/ChangeLog-1997 @V@/gdb/gdbtk/generic/ChangeLog.97 +@V@/gdb/gdbtk/generic/ChangeLog-1998 @V@/gdb/gdbtk/generic/ChangeLog.98 +@V@/gdb/gdbtk/generic/ChangeLog-1999 @V@/gdb/gdbtk/generic/ChangeLog.99 +@V@/gdb/gdbtk/generic/ChangeLog-2000 @V@/gdb/gdbtk/generic/ChangeLog.000 +@V@/gdb/gdbtk/generic/ChangeLog-2001 @V@/gdb/gdbtk/generic/ChangeLog.001 +@V@/gdb/gdbtk/library/ChangeLog-1997 @V@/gdb/gdbtk/library/ChangeLog.97 +@V@/gdb/gdbtk/library/ChangeLog-1998 @V@/gdb/gdbtk/library/ChangeLog.98 +@V@/gdb/gdbtk/library/ChangeLog-1999 @V@/gdb/gdbtk/library/ChangeLog.99 +@V@/gdb/gdbtk/library/ChangeLog-2000 @V@/gdb/gdbtk/library/ChangeLog.000 +@V@/gdb/gdbtk/library/ChangeLog-2001 @V@/gdb/gdbtk/library/ChangeLog.001 diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/i386/tm-i386.h index 9248f184e71..8939d86ca1c 100644 --- a/gdb/config/i386/tm-i386.h +++ b/gdb/config/i386/tm-i386.h @@ -238,17 +238,23 @@ extern int i386_register_virtual_size[]; /* Largest value REGISTER_VIRTUAL_SIZE can have. */ #define MAX_REGISTER_VIRTUAL_SIZE 16 -/* Return the GDB type object for the "standard" data type of data in - register REGNUM. */ - -#define REGISTER_VIRTUAL_TYPE(regnum) i386_register_virtual_type (regnum) -extern struct type *i386_register_virtual_type (int regnum); - -/* Return true iff register REGNUM's virtual format is different from - its raw format. */ - -#define REGISTER_CONVERTIBLE(regnum) i386_register_convertible (regnum) -extern int i386_register_convertible (int regnum); +/* Return the GDB type object for the "standard" data type of data in + register N. Perhaps si and di should go here, but potentially they + could be used for things other than address. */ + +#define REGISTER_VIRTUAL_TYPE(N) \ + (((N) == PC_REGNUM || (N) == FP_REGNUM || (N) == SP_REGNUM) \ + ? lookup_pointer_type (builtin_type_void) \ + : IS_FP_REGNUM(N) ? builtin_type_long_double \ + : IS_SSE_REGNUM(N) ? builtin_type_v4sf \ + : builtin_type_int) + +/* REGISTER_CONVERTIBLE(N) is true iff register N's virtual format is + different from its raw format. Note that this definition assumes + that the host supports IEEE 32-bit floats, since it doesn't say + that SSE registers need conversion. Even if we can't find a + counterexample, this is still sloppy. */ +#define REGISTER_CONVERTIBLE(n) (IS_FP_REGNUM (n)) /* Convert data from raw format for register REGNUM in buffer FROM to virtual format with type TYPE in buffer TO. */ @@ -330,10 +336,15 @@ extern CORE_ADDR i386_frame_chain (struct frame_info *frame); i386_frameless_function_invocation (frame) extern int i386_frameless_function_invocation (struct frame_info *frame); -/* Return the saved program counter for FRAME. */ +/* Saved Pc. Get it from sigcontext if within sigtramp. */ + +#define FRAME_SAVED_PC(FRAME) \ + (((FRAME)->signal_handler_caller \ + ? sigtramp_saved_pc (FRAME) \ + : read_memory_unsigned_integer ((FRAME)->frame + 4, 4)) \ + ) -#define FRAME_SAVED_PC(frame) i386_frame_saved_pc (frame) -extern CORE_ADDR i386_frame_saved_pc (struct frame_info *frame); +extern CORE_ADDR sigtramp_saved_pc (struct frame_info *); #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame) diff --git a/gdb/config/i386/tm-i386sol2.h b/gdb/config/i386/tm-i386sol2.h index bc2a5f8b810..f3ebcd91aef 100644 --- a/gdb/config/i386/tm-i386sol2.h +++ b/gdb/config/i386/tm-i386sol2.h @@ -51,4 +51,12 @@ extern char *sunpro_static_transform_name (char *); #define FAULTED_USE_SIGINFO +/* Macros to extract process id and thread id from a composite pid/tid. + Allocate lower 16 bits for process id, next 15 bits for thread id, and + one bit for a flag to indicate a user thread vs. a kernel thread. */ +#define PIDGET0(PID) (((PID) & 0xffff)) +#define PIDGET(PID) ((PIDGET0 (PID) == 0xffff) ? -1 : PIDGET0 (PID)) +#define TIDGET(PID) (((PID) & 0x7fffffff) >> 16) +#define MERGEPID(PID, TID) (((PID) & 0xffff) | ((TID) << 16)) + #endif /* ifndef TM_I386SOL2_H */ diff --git a/gdb/config/i386/tm-i386v.h b/gdb/config/i386/tm-i386v.h index 57e3d8a469f..c451bf82901 100644 --- a/gdb/config/i386/tm-i386v.h +++ b/gdb/config/i386/tm-i386v.h @@ -1,6 +1,6 @@ /* Macro definitions for i386, Unix System V. Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 1999, - 2000, 2001 Free Software Foundation, Inc. + 2000 Free Software Foundation, Inc. This file is part of GDB. @@ -81,4 +81,10 @@ #undef FRAME_NUM_ARGS #define FRAME_NUM_ARGS(fi) (-1) +/* Forward decl's for prototypes */ +struct frame_info; +struct frame_saved_regs; + +extern int i386_frame_num_args (struct frame_info *); + #endif /* ifndef TM_I386V_H */ diff --git a/gdb/config/i386/tm-i386v42mp.h b/gdb/config/i386/tm-i386v42mp.h index 5671e42944c..e70bc4d424d 100644 --- a/gdb/config/i386/tm-i386v42mp.h +++ b/gdb/config/i386/tm-i386v42mp.h @@ -30,7 +30,6 @@ #define UNIXWARE -#if 0 /* The following macros extract process and lwp/thread ids from a composite id. @@ -44,7 +43,8 @@ #define PIDBITS 16 /* Return the process id stored in composite PID. */ -#define PIDGET(PID) (((PID) & ((1 << PIDBITS) - 1))) +#define PIDGET0(PID) (((PID) & ((1 << PIDBITS) - 1))) +#define PIDGET(PID) ((PIDGET0 (PID) == ((1 << PIDBITS) -1)) ? -1 : PIDGET0 (PID)) /* Return the thread or lwp id stored in composite PID. */ #define TIDGET(PID) (((PID) & 0x3fffffff) >> PIDBITS) @@ -61,33 +61,5 @@ /* Return whether PID contains a user-space thread id. */ #define ISTID(PID) ((PID) & 0x40000000) -#endif - -/* New definitions of the ptid stuff. Due to the way the - code is structured in uw-thread.c, I'm overloading the thread id - and lwp id onto the lwp field. The tid field is used to indicate - whether the lwp is a tid or not. - - FIXME: Check that core file support is not broken. (See original - #if 0'd comments above.) - FIXME: Restructure uw-thread.c so that the struct ptid fields - can be used as intended. */ - -/* Return the process id stored in composite PID. */ -#define PIDGET(PID) (ptid_get_pid (PID)) - -/* Return the thread or lwp id stored in composite PID. */ -#define TIDGET(PID) (ptid_get_lwp (PID)) -#define LIDGET(PID) TIDGET(PID) - -#define MERGEPID(PID, LID) (ptid_build ((PID), (LID), 0)) -#define MKLID(PID, LID) (ptid_build ((PID), (LID), 0)) - -/* Construct a composite id from thread TID and the process portion of - composite PID. */ -#define MKTID(PID, TID) (ptid_build ((PID), (TID), 1)) - -/* Return whether PID contains a user-space thread id. */ -#define ISTID(PID) (ptid_get_tid (PID)) #endif /* ifndef TM_I386V42MP_H */ diff --git a/gdb/config/i386/xm-cygwin.h b/gdb/config/i386/xm-cygwin.h index a1662d2ce90..1e210c76da9 100644 --- a/gdb/config/i386/xm-cygwin.h +++ b/gdb/config/i386/xm-cygwin.h @@ -24,6 +24,11 @@ #define GDBINIT_FILENAME "gdb.ini" +#define SLASH_P(X) ((X)=='\\' || (X) == '/') +#define ROOTED_P(X) ((SLASH_P((X)[0]))|| ((X)[1] ==':')) +#define SLASH_CHAR '/' +#define SLASH_STRING "/" + /* Define this if source files use \r\n rather than just \n. */ #define CRLF_SOURCE_FILES diff --git a/gdb/config/i386/xm-go32.h b/gdb/config/i386/xm-go32.h index eed92073a45..79b8f273705 100644 --- a/gdb/config/i386/xm-go32.h +++ b/gdb/config/i386/xm-go32.h @@ -24,8 +24,17 @@ #define GDBINIT_FILENAME "gdb.ini" +#define SLASH_P(X) ((X)=='\\' || (X) == '/') + +#define ROOTED_P(X) ((SLASH_P((X)[0])) || ((X)[0] && (X)[1] ==':')) + +#define SLASH_CHAR '/' +#define SLASH_STRING "/" + #define CRLF_SOURCE_FILES #define DIRNAME_SEPARATOR ';' +#define HOST_I386 + #define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext diff --git a/gdb/config/i386/xm-linux.h b/gdb/config/i386/xm-linux.h index 8dc48e223f7..36cf15c77e3 100644 --- a/gdb/config/i386/xm-linux.h +++ b/gdb/config/i386/xm-linux.h @@ -22,6 +22,8 @@ #ifndef XM_LINUX_H #define XM_LINUX_H +#define HOST_I386 + #define HOST_BYTE_ORDER LITTLE_ENDIAN #define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext diff --git a/gdb/config/mips/irix6.mh b/gdb/config/mips/irix6.mh deleted file mode 100644 index f2817a97581..00000000000 --- a/gdb/config/mips/irix6.mh +++ /dev/null @@ -1,8 +0,0 @@ -# Host: SGI Iris running irix 6.x -XDEPFILES= -XM_FILE= xm-irix6.h -NAT_FILE= nm-irix6.h -NATDEPFILES= fork-child.o solib.o irix5-nat.o corelow.o procfs.o \ - proc-api.o proc-events.o proc-flags.o proc-why.o - -XM_CLIBS=-lbsd diff --git a/gdb/config/mips/irix6.mt b/gdb/config/mips/irix6.mt deleted file mode 100644 index c5c5ccea8aa..00000000000 --- a/gdb/config/mips/irix6.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: MIPS SGI running Irix 6.x -TDEPFILES= mips-tdep.o -TM_FILE= tm-irix6.h diff --git a/gdb/config/mips/nm-irix6.h b/gdb/config/mips/nm-irix6.h deleted file mode 100644 index 301b62922db..00000000000 --- a/gdb/config/mips/nm-irix6.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Definitions for native support of irix6. - - Copyright 2001 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 "mips/nm-irix5.h" diff --git a/gdb/config/mips/tm-irix6.h b/gdb/config/mips/tm-irix6.h deleted file mode 100644 index 2d90b2ef998..00000000000 --- a/gdb/config/mips/tm-irix6.h +++ /dev/null @@ -1,139 +0,0 @@ -/* Target machine description for SGI Iris under Irix 6.x, for GDB. - Copyright 2001 - 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 "mips/tm-bigmips.h" - -/* SGI's assembler doesn't grok dollar signs in identifiers. - So we use dots instead. This item must be coordinated with G++. */ -#undef CPLUS_MARKER -#define CPLUS_MARKER '.' - -/* Redefine register numbers for SGI. */ - -#undef NUM_REGS -#undef MIPS_REGISTER_NAMES -#undef FP0_REGNUM -#undef PC_REGNUM -#undef HI_REGNUM -#undef LO_REGNUM -#undef CAUSE_REGNUM -#undef BADVADDR_REGNUM -#undef FCRCS_REGNUM -#undef FCRIR_REGNUM -#undef FP_REGNUM - -/* Number of machine registers */ - -#define NUM_REGS 71 - -/* Initializer for an array of names of registers. - There should be NUM_REGS strings in this initializer. */ - -#define MIPS_REGISTER_NAMES \ - { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \ - "a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3", \ - "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \ - "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra", \ - "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", "cause", "bad", "hi", "lo", "fsr", "fir" \ - } - -/* Register numbers of various important registers. - Note that some of these values are "real" register numbers, - and correspond to the general registers of the machine, - and some are "phony" register numbers which are too large - to be actual register numbers as far as the user is concerned - but do serve to get the desired values when passed to read_register. */ - -#define FP0_REGNUM 32 /* Floating point register 0 (single float) */ -#define PC_REGNUM 64 /* Contains program counter */ -#define CAUSE_REGNUM 65 /* describes last exception */ -#define BADVADDR_REGNUM 66 /* bad vaddr for addressing exception */ -#define HI_REGNUM 67 /* Multiple/divide temp */ -#define LO_REGNUM 68 /* ... */ -#define FCRCS_REGNUM 69 /* FP control/status */ -#define FCRIR_REGNUM 70 /* FP implementation/revision */ -#define FP_REGNUM 30 /* S8 register is the Frame Pointer */ - - -#undef REGISTER_BYTES -#define REGISTER_BYTES (MIPS_NUMREGS * 8 + (NUM_REGS - MIPS_NUMREGS) * MIPS_REGSIZE) - -#undef REGISTER_BYTE -#define REGISTER_BYTE(N) \ - (((N) < FP0_REGNUM) ? (N) * MIPS_REGSIZE : \ - ((N) < FP0_REGNUM + 32) ? \ - FP0_REGNUM * MIPS_REGSIZE + \ - ((N) - FP0_REGNUM) * sizeof(double) : \ - 32 * sizeof(double) + ((N) - 32) * MIPS_REGSIZE) - -#undef REGISTER_VIRTUAL_TYPE -#define REGISTER_VIRTUAL_TYPE(N) \ - (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \ - : ((N) == 32 /*SR*/) ? builtin_type_uint32 \ - : ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \ - : builtin_type_int) - -#undef MIPS_LAST_ARG_REGNUM -#define MIPS_LAST_ARG_REGNUM 11 /* N32 uses R4 through R11 for args */ - -/* MIPS_STACK_ARGSIZE -- how many bytes does a pushed function arg take - up on the stack? For the n32 ABI, eight bytes are reserved for each - register. Like MIPS_SAVED_REGSIZE but different. */ -#define MIPS_DEFAULT_STACK_ARGSIZE 8 - -/* N32 does not reserve home space for registers used to carry - parameters. */ -#define MIPS_REGS_HAVE_HOME_P 0 - -/* Force N32 ABI as the default. */ -#define MIPS_DEFAULT_ABI MIPS_ABI_N32 - - -/* The signal handler trampoline is called _sigtramp. */ -#undef IN_SIGTRAMP -#define IN_SIGTRAMP(pc, name) ((name) && STREQ ("_sigtramp", name)) - -/* Offsets for register values in _sigtramp frame. - sigcontext is immediately above the _sigtramp frame on Irix. */ -#undef SIGFRAME_BASE -#define SIGFRAME_BASE 0 - -/* Irix 5 saves a full 64 bits for each register. We skip 2 * 4 to - get to the saved PC (the register mask and status register are both - 32 bits) and then another 4 to get to the lower 32 bits. We skip - the same 4 bytes, plus the 8 bytes for the PC to get to the - registers, and add another 4 to get to the lower 32 bits. We skip - 8 bytes per register. */ -#undef SIGFRAME_PC_OFF -#define SIGFRAME_PC_OFF (SIGFRAME_BASE + 2 * 4 + 4) -#undef SIGFRAME_REGSAVE_OFF -#define SIGFRAME_REGSAVE_OFF (SIGFRAME_BASE + 2 * 4 + 8 + 4) -#undef SIGFRAME_FPREGSAVE_OFF -#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 2 * 4 + 8 + 32 * 8 + 4) -#define SIGFRAME_REG_SIZE 8 - -/* Select the disassembler */ -#undef TM_PRINT_INSN_MACH -#define TM_PRINT_INSN_MACH bfd_mach_mips8000 diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h index a865e96223d..447c9e79012 100644 --- a/gdb/config/mips/tm-mips.h +++ b/gdb/config/mips/tm-mips.h @@ -55,6 +55,11 @@ struct value; #define DEFAULT_MIPS_TYPE "generic" +/* Remove useless bits from an instruction address. */ + +#define ADDR_BITS_REMOVE(addr) mips_addr_bits_remove(addr) +CORE_ADDR mips_addr_bits_remove (CORE_ADDR addr); + /* Remove useless bits from the stack pointer. */ #define TARGET_READ_SP() ADDR_BITS_REMOVE (read_register (SP_REGNUM)) @@ -383,6 +388,15 @@ extern void mips_pop_frame (void); #define CALL_DUMMY_ADDRESS() (mips_call_dummy_address ()) extern CORE_ADDR mips_call_dummy_address (void); +/* There's a mess in stack frame creation. See comments in blockframe.c + near reference to INIT_FRAME_PC_FIRST. */ + +#define INIT_FRAME_PC(fromleaf, prev) /* nada */ + +#define INIT_FRAME_PC_FIRST(fromleaf, prev) \ + mips_init_frame_pc_first(fromleaf, prev) +extern void mips_init_frame_pc_first (int, struct frame_info *); + /* Special symbol found in blocks associated with routines. We can hang mips_extra_func_info_t's off of this. */ @@ -502,6 +516,3 @@ extern void mips_set_processor_type_command (char *, int); /* MIPS sign extends addresses */ #define POINTER_TO_ADDRESS(TYPE,BUF) (signed_pointer_to_address (TYPE, BUF)) #define ADDRESS_TO_POINTER(TYPE,BUF,ADDR) (address_to_signed_pointer (TYPE, BUF, ADDR)) - -/* Single step based on where the current instruction will take us. */ -extern void mips_software_single_step (enum target_signal, int); diff --git a/gdb/config/mips/xm-irix6.h b/gdb/config/mips/xm-irix6.h deleted file mode 100644 index a8a4c68de54..00000000000 --- a/gdb/config/mips/xm-irix6.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Definitions for irix6 hosting support. - - Copyright 2001 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 "mips/xm-irix5.h" diff --git a/gdb/config/mn10300/tm-mn10300.h b/gdb/config/mn10300/tm-mn10300.h index 5178015eeb8..33e22ba1dbd 100644 --- a/gdb/config/mn10300/tm-mn10300.h +++ b/gdb/config/mn10300/tm-mn10300.h @@ -43,10 +43,12 @@ #define REGISTER_RAW_SIZE(REG) 4 #endif -#define D0_REGNUM 0 +#define MAX_REGISTER_VIRTUAL_SIZE 4 + +#define REGISTER_BYTES (NUM_REGS * REGISTER_SIZE) + #define D2_REGNUM 2 #define D3_REGNUM 3 -#define A0_REGNUM 4 #define A2_REGNUM 6 #define A3_REGNUM 7 #define SP_REGNUM 8 @@ -55,25 +57,113 @@ #define PSW_REGNUM 11 #define LIR_REGNUM 12 #define LAR_REGNUM 13 -#define MDRQ_REGNUM 14 #define E0_REGNUM 15 -#define MCRH_REGNUM 26 -#define MCRL_REGNUM 27 -#define MCVF_REGNUM 28 - -enum movm_register_bits { - movm_exother_bit = 0x01, - movm_exreg1_bit = 0x02, - movm_exreg0_bit = 0x04, - movm_other_bit = 0x08, - movm_a3_bit = 0x10, - movm_a2_bit = 0x20, - movm_d3_bit = 0x40, - movm_d2_bit = 0x80 -}; +/* Pseudo register that contains true address of executing stack frame */ +#define FP_REGNUM 31 + +/* BREAKPOINT_FROM_PC uses the program counter value to determine the + breakpoint that should be used */ +extern breakpoint_from_pc_fn mn10300_breakpoint_from_pc; +#define BREAKPOINT_FROM_PC(pcptr, lenptr) mn10300_breakpoint_from_pc (pcptr, lenptr) + +#define FUNCTION_START_OFFSET 0 + +#define DECR_PC_AFTER_BREAK 0 + +#define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) + +extern CORE_ADDR mn10300_saved_pc_after_call (struct frame_info *frame); +#define SAVED_PC_AFTER_CALL(frame) \ + mn10300_saved_pc_after_call (frame) + +struct frame_info; +struct type; +struct value; + +extern void mn10300_init_extra_frame_info (struct frame_info *); +#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) mn10300_init_extra_frame_info (fi) #define INIT_FRAME_PC /* Not necessary */ +#define FRAME_INIT_SAVED_REGS(fi) /* handled by init_extra_frame_info */ + +extern CORE_ADDR mn10300_frame_chain (struct frame_info *); +#define FRAME_CHAIN(fi) mn10300_frame_chain (fi) +#define FRAME_CHAIN_VALID(FP, FI) generic_file_frame_chain_valid (FP, FI) + +extern CORE_ADDR mn10300_find_callers_reg (struct frame_info *, int); +extern CORE_ADDR mn10300_frame_saved_pc (struct frame_info *); +#define FRAME_SAVED_PC(FI) (mn10300_frame_saved_pc (FI)) + +/* Extract from an array REGBUF containing the (raw) register state + a function return value of type TYPE, and copy that, in virtual format, + into VALBUF. */ + +extern void mn10300_extract_return_value (struct type *type, char *regbuf, + char *valbuf); +#define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \ + mn10300_extract_return_value (TYPE, REGBUF, VALBUF) + +CORE_ADDR mn10300_extract_struct_value_address (char *regbuf); +#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ + mn10300_extract_struct_value_address (REGBUF) + +void mn10300_store_return_value (struct type *type, char *valbuf); +#define STORE_RETURN_VALUE(TYPE, VALBUF) \ + mn10300_store_return_value (TYPE, VALBUF) + + +extern CORE_ADDR mn10300_store_struct_return (CORE_ADDR addr, CORE_ADDR sp); +#define STORE_STRUCT_RETURN(STRUCT_ADDR, SP) \ + (mn10300_store_struct_return (STRUCT_ADDR, SP)) + +extern CORE_ADDR mn10300_skip_prologue (CORE_ADDR); +#define SKIP_PROLOGUE(pc) (mn10300_skip_prologue (pc)) + +#define FRAME_ARGS_SKIP 0 + +#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame) +#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) +#define FRAME_NUM_ARGS(fi) (-1) + +extern void mn10300_pop_frame (struct frame_info *); +#define POP_FRAME mn10300_pop_frame (get_current_frame ()) + +#define USE_GENERIC_DUMMY_FRAMES 1 +#define CALL_DUMMY {0} +#define CALL_DUMMY_START_OFFSET (0) +#define CALL_DUMMY_BREAKPOINT_OFFSET (0) +#define CALL_DUMMY_LOCATION AT_ENTRY_POINT +#define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP) +#define CALL_DUMMY_ADDRESS() entry_point_address () + +#define TARGET_READ_FP() read_sp () + +extern CORE_ADDR mn10300_push_return_address (CORE_ADDR, CORE_ADDR); +#define PUSH_RETURN_ADDRESS(PC, SP) mn10300_push_return_address (PC, SP) + +#define PUSH_DUMMY_FRAME generic_push_dummy_frame () +#define SAVE_DUMMY_FRAME_TOS(SP) generic_save_dummy_frame_tos (SP) + +extern CORE_ADDR +mn10300_push_arguments (int, struct value **, CORE_ADDR, + int, CORE_ADDR); +#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \ + (mn10300_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)) + +#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP) + +#define REG_STRUCT_HAS_ADDR(gcc_p,TYPE) \ + (TYPE_LENGTH (TYPE) > 8) + +extern use_struct_convention_fn mn10300_use_struct_convention; +#define USE_STRUCT_CONVENTION(GCC_P, TYPE) mn10300_use_struct_convention (GCC_P, TYPE) + +/* override the default get_saved_register function with + one that takes account of generic CALL_DUMMY frames */ +#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \ + generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) + /* Cons up virtual frame pointer for trace */ extern void mn10300_virtual_frame_pointer (CORE_ADDR, long *, long *); #define TARGET_VIRTUAL_FRAME_POINTER(PC, REGP, OFFP) \ diff --git a/gdb/config/nm-linux.h b/gdb/config/nm-linux.h index f1e785c95e7..19d685776f6 100644 --- a/gdb/config/nm-linux.h +++ b/gdb/config/nm-linux.h @@ -49,6 +49,14 @@ extern int linuxthreads_prepare_to_proceed (int step); /* Defined to make stepping-over-breakpoints be thread-atomic. */ #define USE_THREAD_STEP_NEEDED 1 +/* Macros to extract process id and thread id from a composite pid/tid. + Allocate lower 19 bits for process id, next 12 bits for thread id, and + one bit for a flag to indicate a user thread vs. a kernel thread. */ +#define PIDGET0(PID) (((PID) & 0xffff)) +#define PIDGET(PID) ((PIDGET0 (PID) == 0xffff) ? -1 : PIDGET0 (PID)) +#define TIDGET(PID) (((PID) & 0x7fffffff) >> 16) +#define MERGEPID(PID, TID) (((PID) & 0xffff) | ((TID) << 16)) + /* Use elf_gregset_t and elf_fpregset_t, rather than gregset_t and fpregset_t. */ diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index c3c320ee466..65b2bbfed6b 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -568,7 +568,7 @@ extern void hppa_pop_frame (void); #else /* defined PA_LEVEL_0 */ /* This is the call dummy for a level 0 PA. Level 0's don't have space - registers (or floating point?), so we skip all that inter-space call stuff, + registers (or floating point??), so we skip all that inter-space call stuff, and avoid touching the fp regs. call_dummy diff --git a/gdb/config/powerpc/ppc-eabi.mt b/gdb/config/powerpc/ppc-eabi.mt index 2751e1d0baf..a142c86dc5b 100644 --- a/gdb/config/powerpc/ppc-eabi.mt +++ b/gdb/config/powerpc/ppc-eabi.mt @@ -1,3 +1,3 @@ # Target: PowerPC running eabi -TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-linux-tdep.o +TDEPFILES= ser-ocd.o rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-linux-tdep.o TM_FILE= tm-ppc-eabi.h diff --git a/gdb/config/powerpc/ppc-sim.mt b/gdb/config/powerpc/ppc-sim.mt index a647cadd9d7..a798d10a64d 100644 --- a/gdb/config/powerpc/ppc-sim.mt +++ b/gdb/config/powerpc/ppc-sim.mt @@ -1,5 +1,5 @@ # Target: PowerPC running eabi and including the simulator -TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-linux-tdep.o +TDEPFILES= ser-ocd.o rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-linux-tdep.o TM_FILE= tm-ppc-eabi.h SIM_OBS = remote-sim.o diff --git a/gdb/config/powerpc/ppcle-eabi.mt b/gdb/config/powerpc/ppcle-eabi.mt index 202c6b1c8f0..6de3f1d98fd 100644 --- a/gdb/config/powerpc/ppcle-eabi.mt +++ b/gdb/config/powerpc/ppcle-eabi.mt @@ -1,3 +1,3 @@ # Target: PowerPC running eabi in little endian mode -TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o ppc-bdm.o ocd.o ppc-linux-tdep.o +TDEPFILES= ser-ocd.o rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o ppc-bdm.o ocd.o ppc-linux-tdep.o TM_FILE= tm-ppcle-eabi.h diff --git a/gdb/config/powerpc/ppcle-sim.mt b/gdb/config/powerpc/ppcle-sim.mt index e3be0d8d4f4..401a809586f 100644 --- a/gdb/config/powerpc/ppcle-sim.mt +++ b/gdb/config/powerpc/ppcle-sim.mt @@ -1,5 +1,5 @@ # Target: PowerPC running eabi in little endian mode under the simulator -TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o ppc-bdm.o ocd.o ppc-linux-tdep.o +TDEPFILES= ser-ocd.o rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o ppc-bdm.o ocd.o ppc-linux-tdep.o TM_FILE= tm-ppcle-eabi.h SIM_OBS = remote-sim.o diff --git a/gdb/config/sparc/tm-sun4sol2.h b/gdb/config/sparc/tm-sun4sol2.h index e3c59f630de..09f36bbd6f1 100644 --- a/gdb/config/sparc/tm-sun4sol2.h +++ b/gdb/config/sparc/tm-sun4sol2.h @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL +#define GDB_MULTI_ARCH 2 #include "sparc/tm-sparc.h" #include "tm-sysv4.h" @@ -80,3 +80,9 @@ extern char *sunpro_static_transform_name (char *); /* Enable handling of shared libraries for a.out executables. */ #define HANDLE_SVR4_EXEC_EMULATORS + +/* Macros to extract process id and thread id from a composite pid/tid */ +#define PIDGET0(PID) (((PID) & 0xffff)) +#define PIDGET(PID) ((PIDGET0 (PID) == 0xffff) ? -1 : PIDGET0 (PID)) +#define TIDGET(PID) (((PID) & 0x7fffffff) >> 16) +#define MERGEPID(PID, TID) (((PID) & 0xffff) | ((TID) << 16)) diff --git a/gdb/configure b/gdb/configure index faec838d73b..16e6a379da0 100755 --- a/gdb/configure +++ b/gdb/configure @@ -79,7 +79,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -194,7 +193,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -365,11 +363,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -535,16 +528,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -585,7 +574,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:589: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:578: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -611,7 +600,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:615: checking for $ac_word" >&5 +echo "configure:604: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -641,7 +630,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:645: checking for $ac_word" >&5 +echo "configure:634: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -692,7 +681,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:696: checking for $ac_word" >&5 +echo "configure:685: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -724,7 +713,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:728: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:717: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -735,12 +724,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 739 "configure" +#line 728 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -766,12 +755,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:770: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:759: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:775: checking whether we are using GNU C" >&5 +echo "configure:764: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -780,7 +769,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -799,7 +788,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:803: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:792: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -831,7 +820,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:835: checking how to run the C preprocessor" >&5 +echo "configure:824: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -846,13 +835,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:845: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -863,13 +852,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:862: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -880,13 +869,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:879: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -911,9 +900,9 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:915: checking for AIX" >&5 +echo "configure:904: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:939: checking for POSIXized ISC" >&5 +echo "configure:928: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -959,7 +948,7 @@ fi echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 -echo "configure:963: checking for ${CC-cc} option to accept ANSI C" >&5 +echo "configure:952: checking for ${CC-cc} option to accept ANSI C" >&5 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -975,7 +964,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__ do CC="$ac_save_CC $ac_arg" cat > conftest.$ac_ext < #include @@ -1012,7 +1001,7 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } EOF -if { (eval echo configure:1016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1005: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_prog_cc_stdc="$ac_arg"; break else @@ -1083,7 +1072,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1087: checking host system type" >&5 +echo "configure:1076: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1104,7 +1093,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:1108: checking target system type" >&5 +echo "configure:1097: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -1122,7 +1111,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1126: checking build system type" >&5 +echo "configure:1115: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1147,7 +1136,7 @@ test "$host_alias" != "$target_alias" && ALL_LINGUAS= echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1151: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1140: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1176,7 +1165,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1180: checking for $ac_word" >&5 +echo "configure:1169: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1204,12 +1193,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1208: checking for ANSI C header files" >&5 +echo "configure:1197: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1217,7 +1206,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1210: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1234,7 +1223,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1252,7 +1241,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1273,7 +1262,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1284,7 +1273,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1308,12 +1297,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1312: checking for working const" >&5 +echo "configure:1301: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1383,21 +1372,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1387: checking for inline" >&5 +echo "configure:1376: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1423,12 +1412,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1427: checking for off_t" >&5 +echo "configure:1416: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1456,12 +1445,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1460: checking for size_t" >&5 +echo "configure:1449: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1491,19 +1480,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1495: checking for working alloca.h" >&5 +echo "configure:1484: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -1524,12 +1513,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1528: checking for alloca" >&5 +echo "configure:1517: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -1589,12 +1578,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1593: checking whether alloca needs Cray hooks" >&5 +echo "configure:1582: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1623: checking for $ac_func" >&5 +echo "configure:1612: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1674,7 +1663,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:1678: checking stack direction for C alloca" >&5 +echo "configure:1667: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1682,7 +1671,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -1726,17 +1715,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1730: checking for $ac_hdr" >&5 +echo "configure:1719: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1740: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1765,12 +1754,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1769: checking for $ac_func" >&5 +echo "configure:1758: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1818,7 +1807,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:1822: checking for working mmap" >&5 +echo "configure:1811: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1826,7 +1815,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -1994,17 +1983,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1998: checking for $ac_hdr" >&5 +echo "configure:1987: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2034,12 +2023,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2038: checking for $ac_func" >&5 +echo "configure:2027: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2091,12 +2080,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2095: checking for $ac_func" >&5 +echo "configure:2084: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2153,19 +2142,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:2157: checking for LC_MESSAGES" >&5 +echo "configure:2146: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:2169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -2186,7 +2175,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:2190: checking whether NLS is requested" >&5 +echo "configure:2179: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -2206,7 +2195,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:2210: checking whether included gettext is requested" >&5 +echo "configure:2199: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -2225,17 +2214,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:2229: checking for libintl.h" >&5 +echo "configure:2218: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2252,19 +2241,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:2256: checking for gettext in libc" >&5 +echo "configure:2245: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:2268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -2280,7 +2269,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:2284: checking for bindtextdomain in -lintl" >&5 +echo "configure:2273: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2288,7 +2277,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2315,19 +2304,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:2319: checking for gettext in libintl" >&5 +echo "configure:2308: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -2355,7 +2344,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2359: checking for $ac_word" >&5 +echo "configure:2348: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2389,12 +2378,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2393: checking for $ac_func" >&5 +echo "configure:2382: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2444,7 +2433,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2448: checking for $ac_word" >&5 +echo "configure:2437: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2480,7 +2469,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2484: checking for $ac_word" >&5 +echo "configure:2473: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2512,7 +2501,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -2552,7 +2541,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2556: checking for $ac_word" >&5 +echo "configure:2545: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2586,7 +2575,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2590: checking for $ac_word" >&5 +echo "configure:2579: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2622,7 +2611,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2626: checking for $ac_word" >&5 +echo "configure:2615: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2712,7 +2701,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:2716: checking for catalogs to be installed" >&5 +echo "configure:2705: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -2740,17 +2729,17 @@ echo "configure:2716: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:2744: checking for linux/version.h" >&5 +echo "configure:2733: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2873,7 +2862,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2877: checking for $ac_word" >&5 +echo "configure:2866: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2914,7 +2903,7 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2918: checking for a BSD compatible install" >&5 +echo "configure:2907: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2975,7 +2964,7 @@ fi # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2979: checking for $ac_word" >&5 +echo "configure:2968: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3007,7 +2996,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3011: checking for $ac_word" >&5 +echo "configure:3000: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3039,7 +3028,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3043: checking for $ac_word" >&5 +echo "configure:3032: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3074,7 +3063,7 @@ fi # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3078: checking for $ac_word" >&5 +echo "configure:3067: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3106,7 +3095,7 @@ fi # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3110: checking for $ac_word" >&5 +echo "configure:3099: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3140,7 +3129,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3144: checking for $ac_word" >&5 +echo "configure:3133: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3174,7 +3163,7 @@ test -n "$YACC" || YACC="yacc" # Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args. set dummy ${ac_tool_prefix}mig; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3178: checking for $ac_word" >&5 +echo "configure:3167: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3225,12 +3214,12 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3229: checking return type of signal handlers" >&5 +echo "configure:3218: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3247,7 +3236,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:3251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3267,12 +3256,12 @@ EOF echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3271: checking for ANSI C header files" >&5 +echo "configure:3260: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3280,7 +3269,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3273: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3297,7 +3286,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3315,7 +3304,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3336,7 +3325,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3347,7 +3336,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3391,17 +3380,17 @@ for ac_hdr in ctype.h endian.h nlist.h link.h thread_db.h proc_service.h \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3395: checking for $ac_hdr" >&5 +echo "configure:3384: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3428,12 +3417,12 @@ fi done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:3432: checking whether stat file-mode macros are broken" >&5 +echo "configure:3421: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3485,12 +3474,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3489: checking for working const" >&5 +echo "configure:3478: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3532: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3563,12 +3552,12 @@ fi for ac_func in setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3567: checking for $ac_func" >&5 +echo "configure:3556: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3616,12 +3605,12 @@ fi done echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3620: checking for pid_t" >&5 +echo "configure:3609: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3650,17 +3639,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:3654: checking for vfork.h" >&5 +echo "configure:3643: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3664: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3685,18 +3674,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:3689: checking for working vfork" >&5 +echo "configure:3678: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:3695: checking for vfork" >&5 +echo "configure:3684: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -3741,7 +3730,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -3836,7 +3825,7 @@ main() { } } EOF -if { (eval echo configure:3840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -3861,19 +3850,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:3865: checking for working alloca.h" >&5 +echo "configure:3854: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3894,12 +3883,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3898: checking for alloca" >&5 +echo "configure:3887: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -3959,12 +3948,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3963: checking whether alloca needs Cray hooks" >&5 +echo "configure:3952: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3993: checking for $ac_func" >&5 +echo "configure:3982: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4044,7 +4033,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4048: checking stack direction for C alloca" >&5 +echo "configure:4037: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4052,7 +4041,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -4096,19 +4085,19 @@ fi # See if supports the %fs and %gs i386 segment registers. # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6 -echo "configure:4100: checking for r_fs in struct reg" >&5 +echo "configure:4089: checking for r_fs in struct reg" >&5 if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct reg r; r.r_fs; ; return 0; } EOF -if { (eval echo configure:4112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4101: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_fs=yes else @@ -4128,19 +4117,19 @@ EOF fi echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6 -echo "configure:4132: checking for r_gs in struct reg" >&5 +echo "configure:4121: checking for r_gs in struct reg" >&5 if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct reg r; r.r_gs; ; return 0; } EOF -if { (eval echo configure:4144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4133: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_gs=yes else @@ -4162,19 +4151,19 @@ fi # See if provides the PTRACE_GETREGS request. echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6 -echo "configure:4166: checking for PTRACE_GETREGS" >&5 +echo "configure:4155: checking for PTRACE_GETREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { PTRACE_GETREGS; ; return 0; } EOF -if { (eval echo configure:4178: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4167: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getregs=yes else @@ -4196,19 +4185,19 @@ fi # See if provides the PTRACE_GETFPXREGS request. echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6 -echo "configure:4200: checking for PTRACE_GETFPXREGS" >&5 +echo "configure:4189: checking for PTRACE_GETFPXREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { PTRACE_GETFPXREGS; ; return 0; } EOF -if { (eval echo configure:4212: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getfpxregs=yes else @@ -4230,12 +4219,12 @@ fi # See if provides the PT_GETDBREGS request. echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6 -echo "configure:4234: checking for PT_GETDBREGS" >&5 +echo "configure:4223: checking for PT_GETDBREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_pt_getdbregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4243,7 +4232,7 @@ int main() { PT_GETDBREGS; ; return 0; } EOF -if { (eval echo configure:4247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getdbregs=yes else @@ -4265,7 +4254,7 @@ fi echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6 -echo "configure:4269: checking for socketpair in -lsocket" >&5 +echo "configure:4258: checking for socketpair in -lsocket" >&5 ac_lib_var=`echo socket'_'socketpair | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4273,7 +4262,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4314,12 +4303,12 @@ fi for ac_func in socketpair do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4318: checking for $ac_func" >&5 +echo "configure:4307: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4369,12 +4358,12 @@ done echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:4373: checking whether malloc must be declared" >&5 +echo "configure:4362: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4395,7 +4384,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:4399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -4416,12 +4405,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:4420: checking whether realloc must be declared" >&5 +echo "configure:4409: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4442,7 +4431,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:4446: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -4463,12 +4452,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:4467: checking whether free must be declared" >&5 +echo "configure:4456: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4489,7 +4478,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4510,12 +4499,12 @@ EOF fi echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6 -echo "configure:4514: checking whether strerror must be declared" >&5 +echo "configure:4503: checking whether strerror must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4536,7 +4525,7 @@ int main() { char *(*pfn) = (char *(*)) strerror ; return 0; } EOF -if { (eval echo configure:4540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strerror=no else @@ -4557,12 +4546,12 @@ EOF fi echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6 -echo "configure:4561: checking whether strdup must be declared" >&5 +echo "configure:4550: checking whether strdup must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4583,7 +4572,7 @@ int main() { char *(*pfn) = (char *(*)) strdup ; return 0; } EOF -if { (eval echo configure:4587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4576: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strdup=no else @@ -4604,12 +4593,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4608: checking whether strstr must be declared" >&5 +echo "configure:4597: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4630,7 +4619,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4623: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4657,9 +4646,9 @@ fi # could be expunged. --jsm 1999-03-22 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6 -echo "configure:4661: checking for HPUX save_state structure" >&5 +echo "configure:4650: checking for HPUX save_state structure" >&5 cat > conftest.$ac_ext < EOF @@ -4674,7 +4663,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -4744,12 +4733,12 @@ fi if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4748: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:4737: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -4780,12 +4769,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4784: checking for prrun_t in sys/procfs.h" >&5 +echo "configure:4773: checking for prrun_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prrun_t=yes else @@ -4816,12 +4805,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6 echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4820: checking for gregset_t in sys/procfs.h" >&5 +echo "configure:4809: checking for gregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_gregset_t=yes else @@ -4852,12 +4841,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6 echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4856: checking for fpregset_t in sys/procfs.h" >&5 +echo "configure:4845: checking for fpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_fpregset_t=yes else @@ -4888,12 +4877,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6 echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4892: checking for prgregset_t in sys/procfs.h" >&5 +echo "configure:4881: checking for prgregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset_t=yes else @@ -4924,12 +4913,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6 echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4928: checking for prfpregset_t in sys/procfs.h" >&5 +echo "configure:4917: checking for prfpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4931: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset_t=yes else @@ -4960,12 +4949,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6 echo $ac_n "checking for prgregset32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4964: checking for prgregset32_t in sys/procfs.h" >&5 +echo "configure:4953: checking for prgregset32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4967: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset32_t=yes else @@ -4996,12 +4985,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset32_t" 1>&6 echo $ac_n "checking for prfpregset32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5000: checking for prfpregset32_t in sys/procfs.h" >&5 +echo "configure:4989: checking for prfpregset32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset32_t=yes else @@ -5032,12 +5021,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset32_t" 1>&6 echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5036: checking for lwpid_t in sys/procfs.h" >&5 +echo "configure:5025: checking for lwpid_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5039: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpid_t=yes else @@ -5068,12 +5057,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6 echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5072: checking for psaddr_t in sys/procfs.h" >&5 +echo "configure:5061: checking for psaddr_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psaddr_t=yes else @@ -5104,12 +5093,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6 echo $ac_n "checking for prsysent_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5108: checking for prsysent_t in sys/procfs.h" >&5 +echo "configure:5097: checking for prsysent_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prsysent_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prsysent_t=yes else @@ -5140,12 +5129,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prsysent_t" 1>&6 echo $ac_n "checking for pr_sigset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5144: checking for pr_sigset_t in sys/procfs.h" >&5 +echo "configure:5133: checking for pr_sigset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigset_t=yes else @@ -5176,12 +5165,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigset_t" 1>&6 echo $ac_n "checking for pr_sigaction64_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5180: checking for pr_sigaction64_t in sys/procfs.h" >&5 +echo "configure:5169: checking for pr_sigaction64_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigaction64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes else @@ -5212,12 +5201,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" 1>&6 echo $ac_n "checking for pr_siginfo64_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5216: checking for pr_siginfo64_t in sys/procfs.h" >&5 +echo "configure:5205: checking for pr_siginfo64_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_siginfo64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes else @@ -5253,7 +5242,7 @@ EOF if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6 -echo "configure:5257: checking whether prfpregset_t type is broken" >&5 +echo "configure:5246: checking whether prfpregset_t type is broken" >&5 if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5261,7 +5250,7 @@ else gdb_cv_prfpregset_t_broken=yes else cat > conftest.$ac_ext < int main () @@ -5271,7 +5260,7 @@ else return 0; } EOF -if { (eval echo configure:5275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_prfpregset_t_broken=no else @@ -5296,12 +5285,12 @@ EOF echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5300: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 +echo "configure:5289: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5314,7 +5303,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5307: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_procfs_piocset=yes else @@ -5338,19 +5327,19 @@ fi if test ${host} = ${target} ; then echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6 -echo "configure:5342: checking for member l_addr in struct link_map" >&5 +echo "configure:5331: checking for member l_addr in struct link_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_l_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct link_map lm; (void) lm.l_addr; ; return 0; } EOF -if { (eval echo configure:5354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_l_members=yes else @@ -5372,12 +5361,12 @@ EOF echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6 -echo "configure:5376: checking for member lm_addr in struct link_map" >&5 +echo "configure:5365: checking for member lm_addr in struct link_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_lm_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5385,7 +5374,7 @@ int main() { struct link_map lm; (void) lm.lm_addr; ; return 0; } EOF -if { (eval echo configure:5389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_lm_members=yes else @@ -5407,23 +5396,20 @@ EOF echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6 -echo "configure:5411: checking for member som_addr in struct so_map" >&5 +echo "configure:5400: checking for member som_addr in struct so_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_so_map_with_som_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -#ifdef HAVE_NLIST_H -#include -#endif #include int main() { struct so_map lm; (void) lm.som_addr; ; return 0; } EOF -if { (eval echo configure:5427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_so_map_with_som_members=yes else @@ -5445,12 +5431,12 @@ EOF echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6 -echo "configure:5449: checking for struct link_map32 in sys/link.h" >&5 +echo "configure:5435: checking for struct link_map32 in sys/link.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5458,7 +5444,7 @@ int main() { struct link_map32 l; ; return 0; } EOF -if { (eval echo configure:5462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map32=yes else @@ -5480,7 +5466,7 @@ EOF fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5484: checking for main in -lm" >&5 +echo "configure:5470: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5488,14 +5474,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5524,7 +5510,7 @@ fi echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6 -echo "configure:5528: checking for wctype in -lc" >&5 +echo "configure:5514: checking for wctype in -lc" >&5 ac_lib_var=`echo c'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5532,7 +5518,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5562,7 +5548,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6 -echo "configure:5566: checking for wctype in -lw" >&5 +echo "configure:5552: checking for wctype in -lw" >&5 ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5570,7 +5556,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lw $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5613,12 +5599,12 @@ fi echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:5617: checking for long long support in compiler" >&5 +echo "configure:5603: checking for long long support in compiler" >&5 if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -5650,7 +5636,7 @@ fi echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:5654: checking for long long support in printf" >&5 +echo "configure:5640: checking for long long support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5658,7 +5644,7 @@ else gdb_cv_printf_has_long_long=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_long=yes else @@ -5696,19 +5682,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6 echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6 -echo "configure:5700: checking for long double support in compiler" >&5 +echo "configure:5686: checking for long double support in compiler" >&5 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -5730,7 +5716,7 @@ fi echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:5734: checking for long double support in printf" >&5 +echo "configure:5720: checking for long double support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5738,7 +5724,7 @@ else gdb_cv_printf_has_long_double=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_double=yes else @@ -5772,7 +5758,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6 echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6 -echo "configure:5776: checking for long double support in scanf" >&5 +echo "configure:5762: checking for long double support in scanf" >&5 if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5780,7 +5766,7 @@ else gdb_cv_scanf_has_long_double=no else cat > conftest.$ac_ext < 3.14159 && f < 3.14160); } EOF -if { (eval echo configure:5794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_scanf_has_long_double=yes else @@ -5816,17 +5802,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5820: checking for $ac_hdr" >&5 +echo "configure:5806: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5830: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5855,12 +5841,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5859: checking for $ac_func" >&5 +echo "configure:5845: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5908,7 +5894,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:5912: checking for working mmap" >&5 +echo "configure:5898: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5916,7 +5902,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -6085,7 +6071,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then case ${host_os} in hpux*) echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6 -echo "configure:6089: checking for HPUX/OSF thread support" >&5 +echo "configure:6075: checking for HPUX/OSF thread support" >&5 if test -f /usr/include/dce/cma_config.h ; then if test "$GCC" = "yes" ; then echo "$ac_t""yes" 1>&6 @@ -6104,7 +6090,7 @@ EOF ;; solaris*) echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6 -echo "configure:6108: checking for Solaris thread debugging library" >&5 +echo "configure:6094: checking for Solaris thread debugging library" >&5 if test -f /usr/lib/libthread_db.so.1 ; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -6114,7 +6100,7 @@ EOF CONFIG_LIB_OBS="${CONFIG_LIB_OBS} sol-thread.o" CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:6118: checking for dlopen in -ldl" >&5 +echo "configure:6104: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6122,7 +6108,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6165,17 +6151,17 @@ fi # all symbols visible in the dynamic symbol table. hold_ldflags=$LDFLAGS echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6 -echo "configure:6169: checking for the ld -export-dynamic flag" >&5 +echo "configure:6155: checking for the ld -export-dynamic flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -6194,13 +6180,13 @@ rm -f conftest* # Sun randomly tweaked the prototypes in # at one point. echo $ac_n "checking if is old""... $ac_c" 1>&6 -echo "configure:6198: checking if is old" >&5 +echo "configure:6184: checking if is old" >&5 if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -6211,7 +6197,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6215: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_proc_service_is_old=no else @@ -6288,8 +6274,6 @@ if test "${enable_gdbmi+set}" = set; then ;; esac -else - enable_gdbmi=yes fi case ${enable_gdbmi} in @@ -6430,7 +6414,7 @@ WERROR_CFLAGS="" if test "x${build_warnings}" != x -a "x$GCC" = xyes then echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6 -echo "configure:6434: checking compiler warning flags" >&5 +echo "configure:6418: checking compiler warning flags" >&5 # Separate out the -Werror flag as some files just cannot be # compiled with it enabled. for w in ${build_warnings}; do @@ -6493,12 +6477,12 @@ fi if test $want_included_regex = false; then echo $ac_n "checking for GNU regex""... $ac_c" 1>&6 -echo "configure:6497: checking for GNU regex" >&5 +echo "configure:6481: checking for GNU regex" >&5 if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6510,7 +6494,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6498: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_gnu_regex=yes else @@ -6539,12 +6523,12 @@ fi # In the Cygwin environment, we need some additional flags. echo $ac_n "checking for cygwin""... $ac_c" 1>&6 -echo "configure:6543: checking for cygwin" >&5 +echo "configure:6527: checking for cygwin" >&5 if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6586: checking for tgetent in -lncurses" >&5 +echo "configure:6570: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6590,7 +6574,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6620,7 +6604,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6 -echo "configure:6624: checking for tgetent in -lHcurses" >&5 +echo "configure:6608: checking for tgetent in -lHcurses" >&5 ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6628,7 +6612,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lHcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6658,7 +6642,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6 -echo "configure:6662: checking for tgetent in -ltermlib" >&5 +echo "configure:6646: checking for tgetent in -ltermlib" >&5 ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6666,7 +6650,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermlib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6696,7 +6680,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:6700: checking for tgetent in -ltermcap" >&5 +echo "configure:6684: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6704,7 +6688,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6734,7 +6718,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:6738: checking for tgetent in -lcurses" >&5 +echo "configure:6722: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6742,7 +6726,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6772,7 +6756,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6 -echo "configure:6776: checking for tgetent in -lterminfo" >&5 +echo "configure:6760: checking for tgetent in -lterminfo" >&5 ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6780,7 +6764,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lterminfo $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6949,7 +6933,7 @@ if test "${with_tclconfig+set}" = set; then fi echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 -echo "configure:6953: checking for Tcl configuration" >&5 +echo "configure:6937: checking for Tcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7057,7 +7041,7 @@ if test "${with_tkconfig+set}" = set; then fi echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6 -echo "configure:7061: checking for Tk configuration" >&5 +echo "configure:7045: checking for Tk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7153,7 +7137,7 @@ fi no_tcl=true echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6 -echo "configure:7157: checking for Tcl private headers. dir=${configdir}" >&5 +echo "configure:7141: checking for Tcl private headers. dir=${configdir}" >&5 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" @@ -7219,17 +7203,17 @@ fi if test x"${ac_cv_c_tclh}" = x ; then ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6 -echo "configure:7223: checking for tclInt.h" >&5 +echo "configure:7207: checking for tclInt.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7289,7 +7273,7 @@ fi # no_tk=true echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6 -echo "configure:7293: checking for Tk private headers" >&5 +echo "configure:7277: checking for Tk private headers" >&5 # Check whether --with-tkinclude or --without-tkinclude was given. if test "${with_tkinclude+set}" = set; then withval="$with_tkinclude" @@ -7355,17 +7339,17 @@ fi if test x"${ac_cv_c_tkh}" = x ; then ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tk.h""... $ac_c" 1>&6 -echo "configure:7359: checking for tk.h" >&5 +echo "configure:7343: checking for tk.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7353: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7411,7 +7395,7 @@ fi echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:7415: checking for Itcl private headers. srcdir=${srcdir}" >&5 +echo "configure:7399: checking for Itcl private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itclh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do if test -f $i/generic/itcl.h ; then @@ -7434,7 +7418,7 @@ fi echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:7438: checking for Itk private headers. srcdir=${srcdir}" >&5 +echo "configure:7422: checking for Itk private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itkh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do if test -f $i/generic/itk.h ; then @@ -7457,7 +7441,7 @@ fi echo $ac_n "checking for Tix private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:7461: checking for Tix private headers. srcdir=${srcdir}" >&5 +echo "configure:7445: checking for Tix private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_tixh}" = x ; then for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do if test -f $i/generic/tix.h ; then @@ -7495,7 +7479,7 @@ if test "${with_itclconfig+set}" = set; then fi echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6 -echo "configure:7499: checking for Itcl configuration" >&5 +echo "configure:7483: checking for Itcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7607,7 +7591,7 @@ if test "${with_itkconfig+set}" = set; then fi echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6 -echo "configure:7611: checking for Itk configuration" >&5 +echo "configure:7595: checking for Itk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7719,7 +7703,7 @@ if test "${with_tixconfig+set}" = set; then fi echo $ac_n "checking for Tix configuration""... $ac_c" 1>&6 -echo "configure:7723: checking for Tix configuration" >&5 +echo "configure:7707: checking for Tix configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tixconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7859,7 +7843,7 @@ fi # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:7863: checking for X" >&5 +echo "configure:7847: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -7921,12 +7905,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7995,14 +7979,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -8342,7 +8326,7 @@ fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:8346: checking whether ln -s works" >&5 +echo "configure:8330: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8366,12 +8350,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:8370: checking for Cygwin environment" >&5 +echo "configure:8354: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -8399,19 +8383,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:8403: checking for mingw32 environment" >&5 +echo "configure:8387: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -8430,7 +8414,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:8434: checking for executable suffix" >&5 +echo "configure:8418: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8440,10 +8424,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:8444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:8428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done diff --git a/gdb/configure.host b/gdb/configure.host index c7268fea243..ff09bdce17a 100644 --- a/gdb/configure.host +++ b/gdb/configure.host @@ -18,7 +18,6 @@ m68*) gdb_host_cpu=m68k ;; m88*) gdb_host_cpu=m88k ;; powerpc*) gdb_host_cpu=powerpc ;; sparc64) gdb_host_cpu=sparc ;; -s390*) gdb_host_cpu=s390 ;; *) gdb_host_cpu=$host_cpu ;; esac @@ -116,7 +115,8 @@ mips-little-*) gdb_host=littlemips ;; mips-sgi-irix3*) gdb_host=irix3 ;; mips-sgi-irix4*) gdb_host=irix4 ;; mips-sgi-irix5*) gdb_host=irix5 ;; -mips-sgi-irix6*) gdb_host=irix6 ;; +# Close enough for now. +mips-sgi-irix6*) gdb_host=irix5 ;; mips-sony-*) gdb_host=news-mips ;; mips-*-mach3*) gdb_host=mipsm3 ;; mips-*-sysv4*) gdb_host=mipsv4 ;; @@ -140,8 +140,6 @@ rs6000-*-lynxos*) gdb_host=rs6000lynx ;; rs6000-*-aix4*) gdb_host=aix4 ;; rs6000-*-*) gdb_host=rs6000 ;; -s390*-*-*) gdb_host=s390 ;; - sparc-*-linux*) gdb_host=linux ;; sparc-*-lynxos*) gdb_host=sparclynx ;; sparc-*-netbsdelf*) gdb_host=nbsdelf ;; diff --git a/gdb/configure.in b/gdb/configure.in index 436867569a0..8bbcb18d8da 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -341,9 +341,6 @@ if test ${host} = ${target} ; then AC_MSG_CHECKING(for member som_addr in struct so_map) AC_CACHE_VAL(gdb_cv_have_struct_so_map_with_som_members, [AC_TRY_COMPILE([#include -#ifdef HAVE_NLIST_H -#include -#endif #include ], [struct so_map lm; (void) lm.som_addr;], gdb_cv_have_struct_so_map_with_som_members=yes, @@ -583,8 +580,7 @@ AC_ARG_ENABLE(gdbmi, AC_MSG_ERROR(Bad value for --enable-gdbmi: ${enableval}) ;; esac -], -[enable_gdbmi=yes]) +]) case ${enable_gdbmi} in "yes" ) if test -d "${srcdir}/mi" ; then diff --git a/gdb/configure.tgt b/gdb/configure.tgt index b9f1d17067c..23f406979d5 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -23,7 +23,6 @@ mips*) gdb_target_cpu=mips ;; powerpc*) gdb_target_cpu=powerpc ;; sparc*) gdb_target_cpu=sparc ;; thumb*) gdb_target_cpu=arm ;; -s390*) gdb_target_cpu=s390 ;; strongarm*) gdb_target_cpu=arm ;; xscale*) gdb_target_cpu=arm ;; v850*) gdb_target_cpu=v850 ;; @@ -208,7 +207,7 @@ mips*-*-elf*) gdb_target=embed ;; mips*-little-*) gdb_target=littlemips ;; mips*-*-lnews*) gdb_target=embedl ;; mips*-sgi-irix5*) gdb_target=irix5 ;; -mips*-sgi-irix6*) gdb_target=irix6 ;; +mips*-sgi-irix6*) gdb_target=irix5 ;; mips*-sgi-*) gdb_target=irix3 ;; mips*-sony-*) gdb_target=bigmips ;; mips*-*-mach3*) gdb_target=mipsm3 ;; @@ -257,9 +256,6 @@ rs6000-*-lynxos*) gdb_target=rs6000lynx rs6000-*-aix4*) gdb_target=aix4 ;; rs6000-*-*) gdb_target=rs6000 ;; -s390-*-*) gdb_target=s390 ;; -s390x-*-*) gdb_target=s390x ;; - sh*-*-pe) gdb_target=wince ;; sh-*-hms) gdb_target=embed ;; sh-*-coff*) gdb_target=embed ;; diff --git a/gdb/corelow.c b/gdb/corelow.c index 5d8d3ceb972..e0a4b6a7274 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -248,7 +248,14 @@ add_to_thread_list (bfd *abfd, asection *asect, PTR reg_sect_arg) if (reg_sect != NULL && asect->filepos == reg_sect->filepos) /* Did we find .reg? */ +#ifdef pid_to_ptid + /* Needed to prevent regressions in ptid conversion phase 1. This + bit of code will be deleted in favor of the #else branch in + phase 3. */ + inferior_ptid = thread_id; /* Yes, make it current */ +#else inferior_ptid = pid_to_ptid (thread_id); /* Yes, make it current */ +#endif } /* This routine opens and sets up the core file bfd. */ @@ -406,8 +413,16 @@ get_core_register_section (char *name, bfd_size_type size; char *contents; +#ifdef pid_to_ptid + /* Needed to prevent regressions in ptid conversion phase 1. This + bit of code will be deleted in favor of the #else branch in + phase 3. */ + if (inferior_ptid) + sprintf (section_name, "%s/%d", name, inferior_ptid); +#else if (PIDGET (inferior_ptid)) sprintf (section_name, "%s/%d", name, PIDGET (inferior_ptid)); +#endif else strcpy (section_name, name); diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h index bd5430d5a93..059816a9f7b 100644 --- a/gdb/cp-abi.h +++ b/gdb/cp-abi.h @@ -25,12 +25,6 @@ #ifndef CP_ABI_H_ #define CP_ABI_H_ 1 -/* The functions here that attempt to determine what sort of thing a - mangled name refers to may well be revised in the future. It would - certainly be cleaner to carry this information explicitly in GDB's - data structures than to derive it from the mangled name. */ - - /* Kinds of constructors. All these values are guaranteed to be non-zero. */ enum ctor_kinds { @@ -46,11 +40,6 @@ enum ctor_kinds { complete_object_allocating_ctor }; -/* Return non-zero iff NAME is the mangled name of a constructor. - Actually, return an `enum ctor_kind' value describing what *kind* - of constructor it is. */ -extern enum ctor_kinds is_constructor_name (const char *name); - /* Kinds of destructors. All these values are guaranteed to be non-zero. */ @@ -68,68 +57,6 @@ enum dtor_kinds { base_object_dtor }; -/* Return non-zero iff NAME is the mangled name of a destructor. - Actually, return an `enum dtor_kind' value describing what *kind* - of destructor it is. */ -extern enum dtor_kinds is_destructor_name (const char *name); - - -/* Return non-zero iff NAME is the mangled name of a vtable. */ -extern int is_vtable_name (const char *name); - - -/* Return non-zero iff NAME is the un-mangled name of an operator, - perhaps scoped within some class. */ -extern int is_operator_name (const char *name); - - -/* Return an object's virtual function as a value. - - VALUEP is a pointer to a pointer to a value, holding the object - whose virtual function we want to invoke. If the ABI requires a - virtual function's caller to adjust the `this' pointer by an amount - retrieved from the vtable before invoking the function (i.e., we're - not using "vtable thunks" to do the adjustment automatically), then - this function may set *VALUEP to point to a new object with an - appropriately tweaked address. - - The J'th element of the overload set F is the virtual function of - *VALUEP we want to invoke. - - TYPE is the base type of *VALUEP whose method we're invoking --- - this is the type containing F. OFFSET is the offset of that base - type within *VALUEP. */ -extern value_ptr value_virtual_fn_field (value_ptr *valuep, - struct fn_field *f, int j, - struct type *type, int offset); - - -/* Try to find the run-time type of VALUE, using C++ run-time type - information. Return the run-time type, or zero if we can't figure - it out. - - If we do find the run-time type: - - Set *FULL to non-zero if VALUE already contains the complete - run-time object, not just some embedded base class of the object. - - Set *TOP and *USING_ENC to indicate where the enclosing object - starts relative to VALUE: - - If *USING_ENC is zero, then *TOP is the offset from the start - of the complete object to the start of the embedded subobject - VALUE represents. In other words, the enclosing object starts - at VALUE_ADDR (VALUE) + VALUE_OFFSET (VALUE) + - VALUE_EMBEDDED_OFFSET (VALUE) + *TOP - - If *USING_ENC is non-zero, then *TOP is the offset from the - address of the complete object to the enclosing object stored - in VALUE. In other words, the enclosing object starts at - VALUE_ADDR (VALUE) + VALUE_OFFSET (VALUE) + *TOP. - If VALUE's type and enclosing type are the same, then these two - cases are equivalent. - - FULL, TOP, and USING_ENC can each be zero, in which case we don't - provide the corresponding piece of information. */ -extern struct type *value_rtti_type (struct value *value, - int *full, int *top, int *using_enc); - struct cp_abi_ops { @@ -137,21 +64,66 @@ struct cp_abi_ops const char *longname; const char *doc; - /* ABI-specific implementations for the functions declared above. */ + /* The functions here that attempt to determine what sort of thing a + mangled name refers to may well be revised in the future. It + would certainly be cleaner to carry this information explicitly + in GDB's data structures than to derive it from the mangled name. */ + + /* Return non-zero iff NAME is the mangled name of a constructor. + Actually, return an `enum ctor_kind' value describing what *kind* + of constructor it is. */ enum ctor_kinds (*is_constructor_name) (const char *name); + + /* Return non-zero iff NAME is the mangled name of a destructor. + Actually, return an `enum dtor_kind' value describing what *kind* + of destructor it is. */ enum dtor_kinds (*is_destructor_name) (const char *name); + + /* Return non-zero iff NAME is the mangled name of a vtable. */ int (*is_vtable_name) (const char *name); + + /* Return non-zero iff NAME is the un-mangled name of an operator, + perhaps scoped within some class. */ int (*is_operator_name) (const char *name); + value_ptr (*virtual_fn_field) (value_ptr * arg1p, struct fn_field * f, int j, struct type * type, int offset); + + /* Find the real run-time type of a value using RTTI. + * V is a pointer to the value. + * A pointer to the struct type entry of the run-time type + * is returneed. + * FULL is a flag that is set only if the value V includes + * the entire contents of an object of the RTTI type. + * TOP is the offset to the top of the enclosing object of + * the real run-time type. This offset may be for the embedded + * object, or for the enclosing object of V. + * USING_ENC is the flag that distinguishes the two cases. + * If it is 1, then the offset is for the enclosing object, + * otherwise for the embedded object. + * + */ + struct type *(*rtti_type) (value_ptr v, int *full, int *top, int *using_enc); }; extern struct cp_abi_ops *cp_abis; + extern int num_cp_abis; + extern struct cp_abi_ops current_cp_abi; + +extern enum ctor_kinds is_constructor_name (const char *name); +extern enum dtor_kinds is_destructor_name (const char *name); +extern int is_vtable_name (const char *name); +extern int is_operator_name (const char *name); +extern value_ptr value_virtual_fn_field (value_ptr * arg1p, + struct fn_field *f, int j, + struct type *type, int offset); +extern struct type *value_rtti_type (value_ptr v, int *full, int *top, + int *using_enc); extern int register_cp_abi (struct cp_abi_ops abi); extern int switch_to_cp_abi (const char *short_name); diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 2a3c18b5c5a..ee0a80282b0 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -96,11 +96,11 @@ static void d10v_eva_get_trace_data (void); static int prologue_find_regs (unsigned short op, struct frame_info *fi, CORE_ADDR addr); -static void d10v_frame_init_saved_regs (struct frame_info *); +extern void d10v_frame_init_saved_regs (struct frame_info *); static void do_d10v_pop_frame (struct frame_info *fi); -static int +int d10v_frame_chain_valid (CORE_ADDR chain, struct frame_info *frame) { return ((chain) != 0 && (frame) != 0 && (frame)->pc > IMEM_START); @@ -119,14 +119,14 @@ d10v_stack_align (CORE_ADDR len) The d10v returns anything less than 8 bytes in size in registers. */ -static int +int d10v_use_struct_convention (int gcc_p, struct type *type) { return (TYPE_LENGTH (type) > 8); } -static unsigned char * +unsigned char * d10v_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) { static unsigned char breakpoint[] = @@ -193,20 +193,7 @@ d10v_ts3_register_name (int reg_nr) return register_names[reg_nr]; } -/* Access the DMAP/IMAP registers in a target independent way. - - Divide the D10V's 64k data space into four 16k segments: - 0x0000 -- 0x3fff, 0x4000 -- 0x7fff, 0x8000 -- 0xbfff, and - 0xc000 -- 0xffff. - - On the TS2, the first two segments (0x0000 -- 0x3fff, 0x4000 -- - 0x7fff) always map to the on-chip data RAM, and the fourth always - maps to I/O space. The third (0x8000 - 0xbfff) can be mapped into - unified memory or instruction memory, under the control of the - single DMAP register. - - On the TS3, there are four DMAP registers, each of which controls - one of the segments. */ +/* Access the DMAP/IMAP registers in a target independent way. */ static unsigned long d10v_ts2_dmap_register (int reg_nr) @@ -289,7 +276,7 @@ d10v_ts3_register_sim_regno (int nr) /* Index within `registers' of the first byte of the space for register REG_NR. */ -static int +int d10v_register_byte (int reg_nr) { if (reg_nr < A0_REGNUM) @@ -306,7 +293,7 @@ d10v_register_byte (int reg_nr) /* Number of bytes of storage in the actual machine representation for register REG_NR. */ -static int +int d10v_register_raw_size (int reg_nr) { if (reg_nr < A0_REGNUM) @@ -320,7 +307,7 @@ d10v_register_raw_size (int reg_nr) /* Number of bytes of storage in the program's representation for register N. */ -static int +int d10v_register_virtual_size (int reg_nr) { return TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (reg_nr)); @@ -329,7 +316,7 @@ d10v_register_virtual_size (int reg_nr) /* Return the GDB type object for the "standard" data type of data in register N. */ -static struct type * +struct type * d10v_register_virtual_type (int reg_nr) { if (reg_nr >= A0_REGNUM @@ -343,13 +330,13 @@ d10v_register_virtual_type (int reg_nr) } /* convert $pc and $sp to/from virtual addresses */ -static int +int d10v_register_convertible (int nr) { return ((nr) == PC_REGNUM || (nr) == SP_REGNUM); } -static void +void d10v_register_convert_to_virtual (int regnum, struct type *type, char *from, char *to) { @@ -361,7 +348,7 @@ d10v_register_convert_to_virtual (int regnum, struct type *type, char *from, store_unsigned_integer (to, TYPE_LENGTH (type), x); } -static void +void d10v_register_convert_to_raw (struct type *type, int regnum, char *from, char *to) { @@ -373,38 +360,38 @@ d10v_register_convert_to_raw (struct type *type, int regnum, char *from, } -static CORE_ADDR +CORE_ADDR d10v_make_daddr (CORE_ADDR x) { return ((x) | DMEM_START); } -static CORE_ADDR +CORE_ADDR d10v_make_iaddr (CORE_ADDR x) { return (((x) << 2) | IMEM_START); } -static int +int d10v_daddr_p (CORE_ADDR x) { return (((x) & 0x3000000) == DMEM_START); } -static int +int d10v_iaddr_p (CORE_ADDR x) { return (((x) & 0x3000000) == IMEM_START); } -static CORE_ADDR +CORE_ADDR d10v_convert_iaddr_to_raw (CORE_ADDR x) { return (((x) >> 2) & 0xffff); } -static CORE_ADDR +CORE_ADDR d10v_convert_daddr_to_raw (CORE_ADDR x) { return ((x) & 0xffff); @@ -416,7 +403,7 @@ d10v_convert_daddr_to_raw (CORE_ADDR x) We store structs through a pointer passed in the first Argument register. */ -static void +void d10v_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) { write_register (ARG1_REGNUM, (addr)); @@ -427,7 +414,7 @@ d10v_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) Things always get returned in RET1_REGNUM, RET2_REGNUM, ... */ -static void +void d10v_store_return_value (struct type *type, char *valbuf) { write_register_bytes (REGISTER_BYTE (RET1_REGNUM), @@ -439,7 +426,7 @@ d10v_store_return_value (struct type *type, char *valbuf) the address in which a function should return its structure value, as a CORE_ADDR (or an expression that can be used as one). */ -static CORE_ADDR +CORE_ADDR d10v_extract_struct_value_address (char *regbuf) { return (extract_address ((regbuf) + REGISTER_BYTE (ARG1_REGNUM), @@ -447,7 +434,7 @@ d10v_extract_struct_value_address (char *regbuf) | DMEM_START); } -static CORE_ADDR +CORE_ADDR d10v_frame_saved_pc (struct frame_info *frame) { return ((frame)->extra_info->return_pc); @@ -457,7 +444,7 @@ d10v_frame_saved_pc (struct frame_info *frame) use frame->return_pc beause that is determined by reading R13 off the stack and that may not be written yet. */ -static CORE_ADDR +CORE_ADDR d10v_saved_pc_after_call (struct frame_info *frame) { return ((read_register (LR_REGNUM) << 2) @@ -467,7 +454,7 @@ d10v_saved_pc_after_call (struct frame_info *frame) /* Discard from the stack the innermost frame, restoring all saved registers. */ -static void +void d10v_pop_frame (void) { generic_pop_current_frame (do_d10v_pop_frame); @@ -546,7 +533,7 @@ check_prologue (unsigned short op) return 0; } -static CORE_ADDR +CORE_ADDR d10v_skip_prologue (CORE_ADDR pc) { unsigned long op; @@ -614,7 +601,7 @@ d10v_skip_prologue (CORE_ADDR pc) INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame. */ -static CORE_ADDR +CORE_ADDR d10v_frame_chain (struct frame_info *fi) { d10v_frame_init_saved_regs (fi); @@ -636,7 +623,7 @@ d10v_frame_chain (struct frame_info *fi) REGISTER_RAW_SIZE (FP_REGNUM))) return (CORE_ADDR) 0; - return d10v_make_daddr (read_memory_unsigned_integer (fi->saved_regs[FP_REGNUM], + return D10V_MAKE_DADDR (read_memory_unsigned_integer (fi->saved_regs[FP_REGNUM], REGISTER_RAW_SIZE (FP_REGNUM))); } @@ -713,7 +700,7 @@ prologue_find_regs (unsigned short op, struct frame_info *fi, CORE_ADDR addr) in the stack frame. sp is even more special: the address we return for it IS the sp for the next frame. */ -static void +void d10v_frame_init_saved_regs (struct frame_info *fi) { CORE_ADDR fp, pc; @@ -780,7 +767,7 @@ d10v_frame_init_saved_regs (struct frame_info *fi) fi->extra_info->size = -next_addr; if (!(fp & 0xffff)) - fp = d10v_make_daddr (read_register (SP_REGNUM)); + fp = D10V_MAKE_DADDR (read_register (SP_REGNUM)); for (i = 0; i < NUM_REGS - 1; i++) if (fi->saved_regs[i]) @@ -791,11 +778,11 @@ d10v_frame_init_saved_regs (struct frame_info *fi) if (fi->saved_regs[LR_REGNUM]) { CORE_ADDR return_pc = read_memory_unsigned_integer (fi->saved_regs[LR_REGNUM], REGISTER_RAW_SIZE (LR_REGNUM)); - fi->extra_info->return_pc = d10v_make_iaddr (return_pc); + fi->extra_info->return_pc = D10V_MAKE_IADDR (return_pc); } else { - fi->extra_info->return_pc = d10v_make_iaddr (read_register (LR_REGNUM)); + fi->extra_info->return_pc = D10V_MAKE_IADDR (read_register (LR_REGNUM)); } /* th SP is not normally (ever?) saved, but check anyway */ @@ -814,7 +801,7 @@ d10v_frame_init_saved_regs (struct frame_info *fi) } } -static void +void d10v_init_extra_frame_info (int fromleaf, struct frame_info *fi) { fi->extra_info = (struct frame_extra_info *) @@ -843,7 +830,7 @@ show_regs (char *args, int from_tty) int a; printf_filtered ("PC=%04lx (0x%lx) PSW=%04lx RPT_S=%04lx RPT_E=%04lx RPT_C=%04lx\n", (long) read_register (PC_REGNUM), - (long) d10v_make_iaddr (read_register (PC_REGNUM)), + (long) D10V_MAKE_IADDR (read_register (PC_REGNUM)), (long) read_register (PSW_REGNUM), (long) read_register (24), (long) read_register (25), @@ -897,7 +884,7 @@ show_regs (char *args, int from_tty) printf_filtered ("\n"); } -static CORE_ADDR +CORE_ADDR d10v_read_pc (ptid_t ptid) { ptid_t save_ptid; @@ -908,53 +895,53 @@ d10v_read_pc (ptid_t ptid) inferior_ptid = ptid; pc = (int) read_register (PC_REGNUM); inferior_ptid = save_ptid; - retval = d10v_make_iaddr (pc); + retval = D10V_MAKE_IADDR (pc); return retval; } -static void +void d10v_write_pc (CORE_ADDR val, ptid_t ptid) { ptid_t save_ptid; save_ptid = inferior_ptid; inferior_ptid = ptid; - write_register (PC_REGNUM, d10v_convert_iaddr_to_raw (val)); + write_register (PC_REGNUM, D10V_CONVERT_IADDR_TO_RAW (val)); inferior_ptid = save_ptid; } -static CORE_ADDR +CORE_ADDR d10v_read_sp (void) { - return (d10v_make_daddr (read_register (SP_REGNUM))); + return (D10V_MAKE_DADDR (read_register (SP_REGNUM))); } -static void +void d10v_write_sp (CORE_ADDR val) { - write_register (SP_REGNUM, d10v_convert_daddr_to_raw (val)); + write_register (SP_REGNUM, D10V_CONVERT_DADDR_TO_RAW (val)); } -static void +void d10v_write_fp (CORE_ADDR val) { - write_register (FP_REGNUM, d10v_convert_daddr_to_raw (val)); + write_register (FP_REGNUM, D10V_CONVERT_DADDR_TO_RAW (val)); } -static CORE_ADDR +CORE_ADDR d10v_read_fp (void) { - return (d10v_make_daddr (read_register (FP_REGNUM))); + 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 +CORE_ADDR d10v_push_return_address (CORE_ADDR pc, CORE_ADDR sp) { - write_register (LR_REGNUM, d10v_convert_iaddr_to_raw (CALL_DUMMY_ADDRESS ())); + write_register (LR_REGNUM, D10V_CONVERT_IADDR_TO_RAW (CALL_DUMMY_ADDRESS ())); return sp; } @@ -995,7 +982,7 @@ pop_stack_item (struct stack_item *si) } -static CORE_ADDR +CORE_ADDR d10v_push_arguments (int nargs, value_ptr *args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { @@ -1021,12 +1008,12 @@ d10v_push_arguments (int nargs, value_ptr *args, CORE_ADDR sp, && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC)) { /* function pointer */ - val = d10v_convert_iaddr_to_raw (val); + val = D10V_CONVERT_IADDR_TO_RAW (val); } - else if (d10v_iaddr_p (val)) + else if (D10V_IADDR_P (val)) { /* also function pointer! */ - val = d10v_convert_daddr_to_raw (val); + val = D10V_CONVERT_DADDR_TO_RAW (val); } else { @@ -1092,7 +1079,7 @@ d10v_push_arguments (int nargs, value_ptr *args, CORE_ADDR sp, /* Given a return value in `regbuf' with a type `valtype', extract and copy its value into `valbuf'. */ -static void +void d10v_extract_return_value (struct type *type, char regbuf[REGISTER_BYTES], char *valbuf) { @@ -1106,7 +1093,7 @@ d10v_extract_return_value (struct type *type, char regbuf[REGISTER_BYTES], int num; short snum; snum = extract_address (regbuf + REGISTER_BYTE (RET1_REGNUM), REGISTER_RAW_SIZE (RET1_REGNUM)); - store_address (valbuf, 4, d10v_make_iaddr (snum)); + store_address (valbuf, 4, D10V_MAKE_IADDR (snum)); } else if (TYPE_CODE (type) == TYPE_CODE_PTR) { @@ -1114,7 +1101,7 @@ d10v_extract_return_value (struct type *type, char regbuf[REGISTER_BYTES], int num; short snum; snum = extract_address (regbuf + REGISTER_BYTE (RET1_REGNUM), REGISTER_RAW_SIZE (RET1_REGNUM)); - store_address (valbuf, 4, d10v_make_daddr (snum)); + store_address (valbuf, 4, D10V_MAKE_DADDR (snum)); } else { diff --git a/gdb/defs.h b/gdb/defs.h index aa69216ca3a..166dde89471 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -73,12 +73,9 @@ #define GDB_MULTI_ARCH_PARTIAL 1 -/* The target is partially multi-arched. Both the multi-arch vector - and "tm.h" provide definitions. "tm.h" cannot override a definition - provided by the multi-arch vector. It is detected as a compilation - error. - - This setting is only useful during a multi-arch conversion. */ +/* The target is multi-arched. The MULTI-ARCH vector provides all + definitions. "tm.h" is included and may provide definitions of + non- multi-arch macros.. */ #define GDB_MULTI_ARCH_TM 2 @@ -345,75 +342,11 @@ enum target_signal /* Yes, this pains me, too. But LynxOS didn't have SIG32, and now Linux does, and we can't disturb the numbering, since it's part - of the remote protocol. Note that in some GDB's - TARGET_SIGNAL_REALTIME_32 is number 76. */ + of the protocol. Note that in some GDB's TARGET_SIGNAL_REALTIME_32 + is number 76. */ TARGET_SIGNAL_REALTIME_32, - /* Yet another pain, IRIX 6 has SIG64. */ + /* Yet another pain, IRIX 6 has SIG64. */ TARGET_SIGNAL_REALTIME_64, - /* Yet another pain, Linux/MIPS might go up to 128. */ - TARGET_SIGNAL_REALTIME_65, - TARGET_SIGNAL_REALTIME_66, - TARGET_SIGNAL_REALTIME_67, - TARGET_SIGNAL_REALTIME_68, - TARGET_SIGNAL_REALTIME_69, - TARGET_SIGNAL_REALTIME_70, - TARGET_SIGNAL_REALTIME_71, - TARGET_SIGNAL_REALTIME_72, - TARGET_SIGNAL_REALTIME_73, - TARGET_SIGNAL_REALTIME_74, - TARGET_SIGNAL_REALTIME_75, - TARGET_SIGNAL_REALTIME_76, - TARGET_SIGNAL_REALTIME_77, - TARGET_SIGNAL_REALTIME_78, - TARGET_SIGNAL_REALTIME_79, - TARGET_SIGNAL_REALTIME_80, - TARGET_SIGNAL_REALTIME_81, - TARGET_SIGNAL_REALTIME_82, - TARGET_SIGNAL_REALTIME_83, - TARGET_SIGNAL_REALTIME_84, - TARGET_SIGNAL_REALTIME_85, - TARGET_SIGNAL_REALTIME_86, - TARGET_SIGNAL_REALTIME_87, - TARGET_SIGNAL_REALTIME_88, - TARGET_SIGNAL_REALTIME_89, - TARGET_SIGNAL_REALTIME_90, - TARGET_SIGNAL_REALTIME_91, - TARGET_SIGNAL_REALTIME_92, - TARGET_SIGNAL_REALTIME_93, - TARGET_SIGNAL_REALTIME_94, - TARGET_SIGNAL_REALTIME_95, - TARGET_SIGNAL_REALTIME_96, - TARGET_SIGNAL_REALTIME_97, - TARGET_SIGNAL_REALTIME_98, - TARGET_SIGNAL_REALTIME_99, - TARGET_SIGNAL_REALTIME_100, - TARGET_SIGNAL_REALTIME_101, - TARGET_SIGNAL_REALTIME_102, - TARGET_SIGNAL_REALTIME_103, - TARGET_SIGNAL_REALTIME_104, - TARGET_SIGNAL_REALTIME_105, - TARGET_SIGNAL_REALTIME_106, - TARGET_SIGNAL_REALTIME_107, - TARGET_SIGNAL_REALTIME_108, - TARGET_SIGNAL_REALTIME_109, - TARGET_SIGNAL_REALTIME_110, - TARGET_SIGNAL_REALTIME_111, - TARGET_SIGNAL_REALTIME_112, - TARGET_SIGNAL_REALTIME_113, - TARGET_SIGNAL_REALTIME_114, - TARGET_SIGNAL_REALTIME_115, - TARGET_SIGNAL_REALTIME_116, - TARGET_SIGNAL_REALTIME_117, - TARGET_SIGNAL_REALTIME_118, - TARGET_SIGNAL_REALTIME_119, - TARGET_SIGNAL_REALTIME_120, - TARGET_SIGNAL_REALTIME_121, - TARGET_SIGNAL_REALTIME_122, - TARGET_SIGNAL_REALTIME_123, - TARGET_SIGNAL_REALTIME_124, - TARGET_SIGNAL_REALTIME_125, - TARGET_SIGNAL_REALTIME_126, - TARGET_SIGNAL_REALTIME_127, #if defined(MACH) || defined(__MACH__) /* Mach exceptions */ @@ -765,7 +698,7 @@ extern void print_address (CORE_ADDR, struct ui_file *); /* From source.c */ -extern int openp (const char *, int, const char *, int, int, char **); +extern int openp (char *, int, char *, int, int, char **); extern int source_full_path_of (char *, char **); @@ -911,37 +844,36 @@ enum val_prettyprint Val_pretty_default }; -/* The ptid struct is a collection of the various "ids" necessary - for identifying the inferior. This consists of the process id - (pid), thread id (tid), and other fields necessary for uniquely - identifying the inferior process/thread being debugged. When - manipulating ptids, the constructors, accessors, and predicate - declared in inferior.h should be used. These are as follows: - - ptid_build - Make a new ptid from a pid, lwp, and tid. - pid_to_ptid - Make a new ptid from just a pid. - ptid_get_pid - Fetch the pid component of a ptid. - ptid_get_lwp - Fetch the lwp component of a ptid. - ptid_get_tid - Fetch the tid component of a ptid. - ptid_equal - Test to see if two ptids are equal. - - Please do NOT access the struct ptid members directly (except, of - course, in the implementation of the above ptid manipulation - functions). */ - -struct ptid - { - /* Process id */ - int pid; +/* A collection of the various "ids" necessary for identifying + the inferior. This consists of the process id (pid, thread + id (tid), and other fields necessary for uniquely identifying + the inferior process/thread being debugged. - /* Lightweight process id */ - long lwp; + The present typedef is obviously quite naive with respect to + the magnitudes that real life pids and tids can take on and + will be replaced with something more robust shortly. */ - /* Thread id */ - long tid; - }; +typedef int ptid_t; + +/* Convert a pid to a ptid_t. This macro is temporary and will + be replaced shortly. */ + +#define pid_to_ptid(PID) ((ptid_t) MERGEPID ((PID),0)) + +/* Define a value for the null (or zero) pid. This macro is temporary + and will go away shortly. */ + +#define null_ptid (pid_to_ptid (0)) -typedef struct ptid ptid_t; +/* Define a value for the -1 pid. This macro is temporary and will go + away shortly. */ + +#define minus_one_ptid (pid_to_ptid (-1)) + +/* Define a ptid comparison operator. This macro is temporary and will + be replaced with a real function shortly. */ + +#define ptid_equal(PTID1,PTID2) ((PTID1) == (PTID2)) @@ -987,7 +919,13 @@ typedef struct ptid ptid_t; #include "fopen-same.h" #endif +/* Microsoft C can't deal with const pointers */ + +#ifdef _MSC_VER +#define CONST_PTR +#else #define CONST_PTR const +#endif /* Defaults for system-wide constants (if not defined by xm.h, we fake it). FIXME: Assumes 2's complement arithmetic */ @@ -1153,6 +1091,11 @@ extern char *getenv (const char *); #endif #ifdef HAVE_STDLIB_H +#if defined(_MSC_VER) && !defined(__cplusplus) +/* msvc defines these in stdlib.h for c code */ +#undef min +#undef max +#endif #include #endif #ifndef min @@ -1326,6 +1269,19 @@ extern char *floatformat_mantissa (const struct floatformat *, char *); extern DOUBLEST extract_floating (void *, int); extern void store_floating (void *, int, DOUBLEST); +/* On some machines there are bits in addresses which are not really + part of the address, but are used by the kernel, the hardware, etc. + for special purposes. ADDR_BITS_REMOVE takes out any such bits + so we get a "real" address such as one would find in a symbol + table. This is used only for addresses of instructions, and even then + I'm not sure it's used in all contexts. It exists to deal with there + being a few stray bits in the PC which would mislead us, not as some sort + of generic thing to handle alignment or segmentation (it's possible it + should be in TARGET_READ_PC instead). */ +#if !defined (ADDR_BITS_REMOVE) +#define ADDR_BITS_REMOVE(addr) (addr) +#endif /* No ADDR_BITS_REMOVE. */ + /* From valops.c */ extern CORE_ADDR push_bytes (CORE_ADDR, char *, int); @@ -1407,24 +1363,43 @@ extern int use_windows; #define DIRNAME_SEPARATOR ':' #endif +#ifndef SLASH_P +#if defined(__GO32__)||defined(_WIN32) +#define SLASH_P(X) ((X)=='\\') +#else +#define SLASH_P(X) ((X)=='/') +#endif +#endif + +#ifndef SLASH_CHAR +#if defined(__GO32__)||defined(_WIN32) +#define SLASH_CHAR '\\' +#else +#define SLASH_CHAR '/' +#endif +#endif + #ifndef SLASH_STRING -#ifdef _WIN32 +#if defined(__GO32__)||defined(_WIN32) #define SLASH_STRING "\\" #else #define SLASH_STRING "/" #endif #endif -/* Provide default definitions of PIDGET, TIDGET, and MERGEPID. - The name ``TIDGET'' is a historical accident. Many uses of TIDGET - in the code actually refer to a lightweight process id, i.e, - something that can be considered a process id in its own right for - certain purposes. */ +#ifndef ROOTED_P +#define ROOTED_P(X) (SLASH_P((X)[0])) +#endif + +/* On some systems, PIDGET is defined to extract the inferior pid from + an internal pid that has the thread id and pid in seperate bit + fields. If not defined, then just use the entire internal pid as + the actual pid. */ #ifndef PIDGET -#define PIDGET(PTID) (ptid_get_pid (PTID)) -#define TIDGET(PTID) (ptid_get_lwp (PTID)) -#define MERGEPID(PID, TID) ptid_build (PID, TID, 0) +#define PIDGET(PID) (PID) +#define TIDGET(PID) 0 +#define MERGEPID(PID, TID) (PID) #endif /* Define well known filenos if the system does not define them. */ diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index ef38bc5c299..42b5517d443 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,63 +1,3 @@ -2001-07-04 Andrew Cagney - - * gdb.texinfo (Mode Options): Mention the mi0 and mi1 - interpreters. - -2001-06-15 Andrew Cagney - - * gdbint.texinfo (Target Architecture Definition): GDBARCH is a C - structure and not macros. - (Host Definition): Document that much of this chapter is obsolete. - (Target Architecture Definition): Update list of files that make - up a target architecture. - (Coding): Update. - -2001-06-28 Andrew Cagney - - * gdbint.texinfo (Target Architecture Definition): Update - EXTRACT_STRUCT_VALUE_ADDRESS and EXTRACT_STRUCT_VALUE_ADDRESS_P. - The latter has been changed to a true predicate. - -2001-06-17 Eli Zaretskii - - * annotate.texi: Add @noindent where needed. From Dmitry - Sivachenko . - * gdb.texinfo: Indexing fix. From Dmitry Sivachenko. - -2001-06-16 Andrew Cagney - - * gdb.texinfo (Protocol): Fix typo. Extra parenthesis. - -2001-06-14 Andrew Cagney - - * gdb.texinfo (Remote Protocol): Document that the ``!'' packet - returns ``OK''. Document that the ``R'' packet does not reply. - -2001-06-13 Michael Snyder - - * gdb.texinfo (Protocol): Add doc for new packet "qSymbol:". - -2001-06-13 Eli Zaretskii - - * gdb.texinfo (Signals): Clarify the default setting of signal - handling. - -2001-05-14 Andrew Cagney - - * gdbint.texinfo (CLEAR_DEFERRED_STORES): Delete stray @item - (FRAME_ARGS_ADDRESS_CORRECT): Ditto. - -2001-05-12 Andrew Cagney - - * Makefile.in (GDBvn.texi): Set GDBVN from ../version.in. - -2001-05-10 Eli Zaretskii - - * gdbint.texinfo (Clean Design and Portable Implementation): - Renamed from "Clean Design". - (Clean Design and Portable Implementation): Document portable - methods of handling file names, and the associated macros. - 2001-04-02 Eli Zaretskii * gdb.texinfo (Tracepoint Actions): Mention the "info scope" diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index d483330a5c6..52e9b1a8c19 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -215,9 +215,9 @@ refcard.dvi : refcard.tex $(REFEDITS) refcard.ps : refcard.dvi $(DVIPS) -t landscape -o $@ $? -# File to record current GDB version number (copied from main dir version.in) -GDBvn.texi : ${gdbdir}/version.in - echo "@set GDBVN `head -1 $(srcdir)/../version.in`" > ./GDBvn.new +# File to record current GDB version number (copied from main dir Makefile.in) +GDBvn.texi : ${gdbdir}/Makefile.in + echo "@set GDBVN `sed <$(srcdir)/../Makefile.in -n 's/^VERSION *= *//p'`" > ./GDBvn.new mv GDBvn.new GDBvn.texi # Updated atomically diff --git a/gdb/doc/annotate.texi b/gdb/doc/annotate.texi index 0d7e1177543..2a5a8bce5af 100644 --- a/gdb/doc/annotate.texi +++ b/gdb/doc/annotate.texi @@ -158,7 +158,6 @@ the annotation looks like ^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 @@ -193,7 +192,6 @@ from the @code{backtrace} command), it annotates it as follows: ^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 @@ -216,7 +214,6 @@ When printing a structure, @value{GDBN} annotates it as follows: ^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 @@ -228,7 +225,6 @@ When printing an array, @value{GDBN} annotates it as follows: ^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 @@ -284,7 +280,6 @@ The frame annotation begins with @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 @@ -433,7 +428,6 @@ the results of the display are annotated: ^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 @@ -556,7 +550,6 @@ The output from the @code{info breakpoints} command is annotated as follows: ^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 @@ -670,7 +663,6 @@ annotation continues: @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}. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index ea9dd2d24c2..11a959a9437 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -1045,12 +1045,9 @@ Run using @var{device} for your program's standard input and output. @cindex @code{--interpreter} Use the interpreter @var{interp} for interface with the controlling program or device. This option is meant to be set by programs which -communicate with @value{GDBN} using it as a back end. - -@samp{--interpreter=mi} (or @samp{--interpreter=mi1}) causes -@value{GDBN} to use the @dfn{gdb/mi interface} (@pxref{GDB/MI, , The -@sc{gdb/mi} Interface}). The older @sc{gdb/mi} interface, included in -@value{GDBN} version 5.0 can be selected with @samp{--interpreter=mi0}. +communicate with @value{GDBN} using it as a back end. For example, +@samp{--interpreter=mi} causes @value{GDBN} to use the @dfn{gdbmi +interface} (@pxref{GDB/MI, , The @sc{gdb/mi} Interface}). @item -write @cindex @code{--write} @@ -3457,9 +3454,8 @@ program. You can tell @value{GDBN} in advance what to do for each kind of signal. @cindex handling signals -Normally, @value{GDBN} is set up to let the non-erroneous signals like -@code{SIGALRM} be silently passed to your program -(so as not to interfere with their role in the program's functioning) +Normally, @value{GDBN} is set up to ignore non-erroneous signals like @code{SIGALRM} +(so as not to interfere with their role in the functioning of your program) but to stop your program immediately whenever an error signal happens. You can change these settings with the @code{handle} command. @@ -3477,7 +3473,7 @@ the defined types of signals. @item handle @var{signal} @var{keywords}@dots{} Change the way @value{GDBN} handles signal @var{signal}. @var{signal} can be the number of a signal or its name (with or without the -@samp{SIG} at the beginning); a list of signal numbers of the form +@samp{SIG} at the beginning); a list of signal numberss of the form @samp{@var{low}-@var{high}}; or the word @samp{all}, meaning all the known signals. The @var{keywords} say what change to make. @end table @@ -3523,11 +3519,6 @@ after @value{GDBN} reports a signal, you can use the @code{handle} command with @code{pass} or @code{nopass} to control whether your program sees that signal when you continue. -The default is set to @code{nostop}, @code{noprint}, @code{pass} for -non-erroneous signals such as @code{SIGALRM}, @code{SIGWINCH} and -@code{SIGCHLD}, and to @code{stop}, @code{print}, @code{pass} for the -erroneous signals. - You can also use the @code{signal} command to prevent your program from seeing a signal, or cause it to see a signal it normally would not see, or to give it any signal at any time. For example, if your program stopped @@ -7323,10 +7314,9 @@ treats the use of the operator @code{IN}, or the use of operators @code{<=}, and @code{>=} on sets as an error. @end quotation - +@cindex Modula-2 built-ins @node Built-In Func/Proc @subsubsection Built-in functions and procedures -@cindex Modula-2 built-ins Modula-2 also makes available several built-in procedures and functions. In describing these, the following metavariables are used: @@ -9782,16 +9772,17 @@ their corresponding response @var{data}: @tab Request @tab Description -@item extended mode +@item extended ops @tab @code{!} @tab -Enable extended mode. In extended mode, the remote server is made -persistent. The @samp{R} packet is used to restart the program being -debugged. +Use the extended remote protocol. Sticky---only needs to be set once. +The extended remote protocol supports the @samp{R} packet. @item -@tab reply @samp{OK} +@tab reply @samp{} @tab -The remote target both supports and has enabled extended mode. +Stubs that support the extended remote protocol return @samp{} which, +unfortunately, is identical to the response returned by stubs that do not +support protocol extensions. @item last signal @tab @code{?} @@ -10084,13 +10075,9 @@ Reset the entire system. @item remote restart @tab @code{R}@var{XX} @tab -Restart the program being debugged. @var{XX}, while needed, is ignored. -This packet is only available in extended mode. -@item -@tab -no reply -@tab -The @samp{R} packet has no reply. +Restart the remote server. @var{XX} while needed has no clear +definition. FIXME: @emph{An example interaction explaining how this +packet is used in extended-remote mode is needed}. @item step @tab @code{s}@var{addr} @@ -10414,52 +10401,6 @@ Indicate a badly formed request. @tab When @samp{q}@samp{Rcmd} is not recognized. -@item symbol lookup -@tab @code{qSymbol::} -@tab -Notify the target that @value{GDBN} is prepared to serve symbol lookup -requests. Accept requests from the target for the values of symbols. -@item -@tab -@tab -@item -@tab reply @code{OK} -@tab -The target does not need to look up any (more) symbols. -@item -@tab reply @code{qSymbol:}@var{sym_name} -@tab -The target requests the value of symbol @var{sym_name} (hex encoded). -@value{GDBN} may provide the value by using the -@code{qSymbol:}@var{sym_value}:@var{sym_name} -message, described below. - -@item symbol value -@tab @code{qSymbol:}@var{sym_value}:@var{sym_name} -@tab -Set the value of SYM_NAME to SYM_VALUE. -@item -@tab -@tab -@var{sym_name} (hex encoded) is the name of a symbol whose value -the target has previously requested. -@item -@tab -@tab -@var{sym_value} (hex) is the value for symbol @var{sym_name}. -If @value{GDBN} cannot supply a value for @var{sym_name}, then this -field will be empty. -@item -@tab reply @code{OK} -@tab -The target does not need to look up any (more) symbols. -@item -@tab reply @code{qSymbol:}@var{sym_name} -@tab -The target requests the value of a new symbol @var{sym_name} (hex encoded). -@value{GDBN} will continue to supply the values of symbols (if available), -until the target ceases to request them. - @end multitable The following @samp{g}/@samp{G} packets have previously been defined. diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index f772be5cb4c..77db258912a 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -1886,11 +1886,6 @@ distribution! @chapter Host Definition -@emph{Maintainer's note: In theory, new targets no longer need to use -the host framework described below. Instead it should be possible to -handle everything using autoconf. Patches eliminating this framework -welcome.} - With the advent of Autoconf, it's rarely necessary to have host definition machinery anymore. @@ -2204,9 +2199,8 @@ Define this to override the defaults of @code{__volatile__} or machine-language programs @value{GDBN} can work with, and how it works with them. -The target architecture object is implemented as the C structure -@code{struct gdbarch *}. The structure, and its methods, are generated -using the Bourn shell script @file{gdbarch.sh}. +At present, the target architecture definition consists of a number of C +macros. @section Registers and Memory @@ -2390,11 +2384,6 @@ C@t{++} reference type. @cindex register data formats, converting @cindex @code{struct value}, converting register contents to -@emph{Maintainer's note: The way GDB manipulates registers is undergoing -significant change. Many of the macros and functions refered to in the -sections below are likely to be made obsolete. See the file @file{TODO} -for more up-to-date information.} - Some architectures use one representation for a value when it lives in a register, but use a different representation when it lives in memory. In @value{GDBN}'s terminology, the @dfn{raw} representation is the one used in @@ -2678,7 +2667,7 @@ status words, and other special registers. If this is not defined, @value{GDBN} will assume that all registers may be written. @item DO_DEFERRED_STORES -@itemx CLEAR_DEFERRED_STORES +@itemx CLEAR_DEFERRED_STORES@item @findex CLEAR_DEFERRED_STORES @findex DO_DEFERRED_STORES Define this to execute any deferred stores of registers into the inferior, @@ -2774,13 +2763,12 @@ into @var{valbuf}. @item EXTRACT_STRUCT_VALUE_ADDRESS(@var{regbuf}) @findex EXTRACT_STRUCT_VALUE_ADDRESS -When defined, extract from the array @var{regbuf} (containing the raw -register state) the @code{CORE_ADDR} at which a function should return -its structure value. +When @code{EXTRACT_STRUCT_VALUE_ADDRESS_P} is non-zero, this is used to extract +from an array @var{regbuf} (containing the raw register state) the +address in which a function should return its structure value, as a +@code{CORE_ADDR} (or an expression that can be used as one). -If not defined, @code{EXTRACT_RETURN_VALUE} is used. - -@item EXTRACT_STRUCT_VALUE_ADDRESS_P() +@item EXTRACT_STRUCT_VALUE_ADDRESS_P @findex EXTRACT_STRUCT_VALUE_ADDRESS_P Predicate for @code{EXTRACT_STRUCT_VALUE_ADDRESS}. @@ -2803,7 +2791,7 @@ Define this to an expression that returns 1 if the function invocation represented by @var{fi} does not have a stack frame associated with it. Otherwise return 0. -@item FRAME_ARGS_ADDRESS_CORRECT +@item FRAME_ARGS_ADDRESS_CORRECT@item @findex FRAME_ARGS_ADDRESS_CORRECT See @file{stack.c}. @@ -3464,7 +3452,7 @@ Defaults to @code{1}. @section Adding a New Target @cindex adding a target -The following files add a target to @value{GDBN}: +The following files define a target to @value{GDBN}: @table @file @vindex TDEPFILES @@ -3479,6 +3467,11 @@ You can also define @samp{TM_CFLAGS}, @samp{TM_CLIBS}, @samp{TM_CDEPS}, but these are now deprecated, replaced by autoconf, and may go away in future versions of @value{GDBN}. +@item gdb/config/@var{arch}/tm-@var{ttt}.h +(@file{tm.h} is a link to this file, created by @code{configure}). Contains +macro definitions about the target machine's registers, stack frame +format and instructions. + @item gdb/@var{ttt}-tdep.c Contains any miscellaneous code required for this target machine. On some machines it doesn't exist at all. Sometimes the macros in @@ -3487,28 +3480,15 @@ as functions here instead, and the macro is simply defined to call the function. This is vastly preferable, since it is easier to understand and debug. -@item gdb/@var{arch}-tdep.c -@itemx gdb/@var{arch}-tdep.h -This often exists to describe the basic layout of the target machine's -processor chip (registers, stack, etc.). If used, it is included by -@file{@var{ttt}-tdep.h}. It can be shared among many targets that use -the same processor. - -@item gdb/config/@var{arch}/tm-@var{ttt}.h -(@file{tm.h} is a link to this file, created by @code{configure}). Contains -macro definitions about the target machine's registers, stack frame -format and instructions. - -New targets do not need this file and should not create it. - @item gdb/config/@var{arch}/tm-@var{arch}.h This often exists to describe the basic layout of the target machine's processor chip (registers, stack, etc.). If used, it is included by @file{tm-@var{ttt}.h}. It can be shared among many targets that use the same processor. -New targets do not need this file and should not create it. - +@item gdb/@var{arch}-tdep.c +Similarly, there are often common subroutines that are shared by all +target machines that use this particular architecture. @end table If you are adding a new operating system for an existing CPU chip, add a @@ -4058,112 +4038,20 @@ print warnings are a good example. @value{GDBN} follows the GNU coding standards, as described in @file{etc/standards.texi}. This file is also available for anonymous -FTP from GNU archive sites. @value{GDBN} takes a strict interpretation -of the standard; in general, when the GNU standard recommends a practice -but does not require it, @value{GDBN} requires it. +FTP from GNU archive sites. @value{GDBN} takes a strict interpretation of the +standard; in general, when the GNU standard recommends a practice but +does not require it, @value{GDBN} requires it. @value{GDBN} follows an additional set of coding standards specific to @value{GDBN}, as described in the following sections. - -@subsection ISO-C - -@value{GDBN} assumes an ISO-C compliant compiler. - -@value{GDBN} does not assume an ISO-C or POSIX compliant C library. - - -@subsection Memory Management - -@value{GDBN} does not use the functions @code{malloc}, @code{realloc}, -@code{calloc}, @code{free} and @code{asprintf}. - -@value{GDBN} uses the functions @code{xmalloc}, @code{xrealloc} and -@code{xcalloc} when allocating memory. Unlike @code{malloc} et.al.@: -these functions do not return when the memory pool is empty. Instead, -they unwind the stack using cleanups. These functions return -@code{NULL} when requested to allocate a chunk of memory of size zero. - -@emph{Pragmatics: By using these functions, the need to check every -memory allocation is removed. These functions provide portable -behavior.} - -@value{GDBN} does not use the function @code{free}. - -@value{GDBN} uses the function @code{xfree} to return memory to the -memory pool. Consistent with ISO-C, this function ignores a request to -free a @code{NULL} pointer. - -@emph{Pragmatics: On some systems @code{free} fails when passed a -@code{NULL} pointer.} - -@value{GDBN} can use the non-portable function @code{alloca} for the -allocation of small temporary values (such as strings). - -@emph{Pragmatics: This function is very non-portable. Some systems -restrict the memory being allocated to no more than a few kilobytes.} - -@value{GDBN} uses the string function @code{xstrdup} and the print -function @code{xasprintf}. - -@emph{Pragmatics: @code{asprintf} and @code{strdup} can fail. Print -functions such as @code{sprintf} are very prone to buffer overflow -errors.} - - -@subsection Compiler Warnings @cindex compiler warnings - -With few exceptions, developers should include the configuration option -@samp{--enable-gdb-build-warnings=,-Werror} when building @value{GDBN}. -The exceptions are listed in the file @file{gdb/MAINTAINERS}. - -This option causes @value{GDBN} (when built using GCC) to be compiled -with a carefully selected list of compiler warning flags. Any warnings -from those flags being treated as errors. - -The current list of warning flags includes: - -@table @samp -@item -Wimplicit -Since @value{GDBN} coding standard requires all functions to be declared -using a prototype, the flag has the side effect of ensuring that -prototyped functions are always visible with out resorting to -@samp{-Wstrict-prototypes}. - -@item -Wreturn-type -Such code often appears to work except on instruction set architectures -that use register windows. - -@item -Wcomment - -@item -Wtrigraphs - -@item -Wformat -Since @value{GDBN} uses the @code{format printf} attribute on all -@code{printf} like functions this checks not just @code{printf} calls -but also calls to functions such as @code{fprintf_unfiltered}. - -@item -Wparentheses -This warning includes uses of the assignment operator within an -@code{if} statement. - -@item -Wpointer-arith - -@item -Wuninitialized -@end table - -@emph{Pragmatics: Due to the way that @value{GDBN} is implemented most -functions have unused parameters. Consequently the warning -@samp{-Wunused-parameter} is precluded from the list. The macro -@code{ATTRIBUTE_UNUSED} is not used as it leads to false negatives --- -it is not an error to have @code{ATTRIBUTE_UNUSED} on a parameter that -is being used. The options @samp{-Wall} and @samp{-Wunused} are also -precluded because they both include @samp{-Wunused-parameter}.} - -@emph{Pragmatics: @value{GDBN} has not simply accepted the warnings -enabled by @samp{-Wall -Werror -W...}. Instead it is selecting warnings -when and where their benefits can be demonstrated.} +You can configure with @samp{--enable-build-warnings} or +@samp{--enable-gdb-build-warnings} to get GCC to check on a number of +these rules. @value{GDBN} sources ought not to engender any complaints, +unless they are caused by bogus host systems. (The exact set of enabled +warnings is currently @samp{-Wimplicit -Wreturn-type -Wcomment +-Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized}. @subsection Formatting @@ -4171,54 +4059,28 @@ when and where their benefits can be demonstrated.} The standard GNU recommendations for formatting must be followed strictly. -A function declaration should not have its name in column zero. A -function definition should have its name in column zero. - -@example -/* Declaration */ -static void foo (void); -/* Definition */ -void -foo (void) -@{ -@} -@end example - -@emph{Pragmatics: This simplifies scripting. Function definitions can -be found using @samp{^function-name}.} +Note that while in a definition, the function's name must be in column +zero; in a function declaration, the name must be on the same line as +the return type. -There must be a space between a function or macro name and the opening -parenthesis of its argument list (except for macro definitions, as -required by C). There must not be a space after an open paren/bracket -or before a close paren/bracket. +In addition, there must be a space between a function or macro name and +the opening parenthesis of its argument list (except for macro +definitions, as required by C). There must not be a space after an open +paren/bracket or before a close paren/bracket. While additional whitespace is generally helpful for reading, do not use more than one blank line to separate blocks, and avoid adding whitespace -after the end of a program line (as of 1/99, some 600 lines had -whitespace after the semicolon). Excess whitespace causes difficulties -for @code{diff} and @code{patch} utilities. - -Pointers are declared using the traditional K&R C style: - -@example -void *foo; -@end example - -@noindent -and not: - -@example -void * foo; -void* foo; -@end example +after the end of a program line (as of 1/99, some 600 lines had whitespace +after the semicolon). Excess whitespace causes difficulties for +@code{diff} and @code{patch} utilities. @subsection Comments @cindex comment formatting The standard GNU requirements on comments must be followed strictly. -Block comments must appear in the following form, with no @code{/*}- or -@code{*/}-only lines, and no leading @code{*}: +Block comments must appear in the following form, with no @samp{/*}- or +@samp{*/}-only lines, and no leading @samp{*}: @example /* Wait for control to return from inferior to debugger. If inferior @@ -4255,101 +4117,23 @@ limited by the target interface (whether serial line or system call). However, use functions with moderation. A thousand one-line functions are just as hard to understand as a single thousand-line function. -@emph{Macros are bad, M'kay.} - -@cindex types - -Declarations like @samp{struct foo *} should be used in preference to -declarations like @samp{typedef struct foo @{ @dots{} @} *foo_ptr}. - - @subsection Function Prototypes -@cindex function prototypes -Prototypes must be used when both @emph{declaring} and @emph{defining} -a function. Prototypes for @value{GDBN} functions must include both the -argument type and name, with the name matching that used in the actual -function definition. +@cindex function prototypes +Prototypes must be used to @emph{declare} functions, and may be used +to @emph{define} them. Prototypes for @value{GDBN} functions must +include both the argument type and name, with the name matching that +used in the actual function definition. All external functions should have a declaration in a header file that callers include, except for @code{_initialize_*} functions, which must be external so that @file{init.c} construction works, but shouldn't be visible to random source files. -Where a source file needs a forward declaration of a static function, -that declaration must appear in a block near the top of the source file. - - -@subsection Internal Error Recovery - -During its execution, @value{GDBN} can encounter two types of errors. -User errors and internal errors. User errors include not only a user -entering an incorrect command but also problems arising from corrupt -object files and system errors when interacting with the target. -Internal errors include situtations where @value{GDBN} has detected, at -run time, a corrupt or erroneous situtation. - -When reporting an internal error, @value{GDBN} uses -@code{internal_error} and @code{gdb_assert}. - -@value{GDBN} must not call @code{abort} or @code{assert}. - -@emph{Pragmatics: There is no @code{internal_warning} function. Either -the code detected a user error, recovered from it and issued a -@code{warning} or the code failed to correctly recover from the user -error and issued an @code{internal_error}.} - -@subsection File Names - -Any file used when building the core of @value{GDBN} must be in lower -case. Any file used when building the core of @value{GDBN} must be 8.3 -unique. These requirements apply to both source and generated files. - -@emph{Pragmatics: The core of @value{GDBN} must be buildable on many -platforms including DJGPP and MacOS/HFS. Every time an unfriendly file -is introduced to the build process both @file{Makefile.in} and -@file{configure.in} need to be modified accordingly. Compare the -convoluted conversion process needed to transform @file{COPYING} into -@file{copying.c} with the conversion needed to transform -@file{version.in} into @file{version.c}.} - -Any file non 8.3 compliant file (that is not used when building the core -of @value{GDBN}) must be added to @file{gdb/config/djgpp/fnchange.lst}. - -@emph{Pragmatics: This is clearly a compromise.} +All static functions must be declared in a block near the top of the +source file. -When @value{GDBN} has a local version of a system header file (ex -@file{string.h}) the file name based on the POSIX header prefixed with -@file{gdb_} (@file{gdb_string.h}). - -For other files @samp{-} is used as the separator. - - -@subsection Include Files - -All @file{.c} files should include @file{defs.h} first. - -All @file{.c} files should explicitly include the headers for any -declarations they refer to. They should not rely on files being -included indirectly. - -With the exception of the global definitions supplied by @file{defs.h}, -a header file should explictily include the header declaring any -@code{typedefs} et.al.@: it refers to. - -@code{extern} declarations should never appear in @code{.c} files. - -All include files should be wrapped in: - -@example -#ifndef INCLUDE_FILE_NAME_H -#define INCLUDE_FILE_NAME_H -header body -#endif -@end example - - -@subsection Clean Design and Portable Implementation +@subsection Clean Design @cindex design In addition to getting the syntax right, there's the little question of @@ -4392,68 +4176,48 @@ time, as new versions of your system come out that behave differently with regard to this feature. Adding code that handles specific architectures, operating systems, -target interfaces, or hosts, is not acceptable in generic code. - -@cindex portable file name handling -@cindex file names, portability -One particularly notorious area where system dependencies tend to -creep in is handling of file names. The mainline @value{GDBN} code -assumes Posix semantics of file names: absolute file names begin with -a forward slash @file{/}, slashes are used to separate leading -directories, case-sensitive file names. These assumptions are not -necessarily true on non-Posix systems such as MS-Windows. To avoid -system-dependent code where you need to take apart or construct a file -name, use the following portable macros: +target interfaces, or hosts, is not acceptable in generic code. If a +hook is needed at that point, invent a generic hook and define it for +your configuration, with something like: -@table @code -@findex HAVE_DOS_BASED_FILE_SYSTEM -@item HAVE_DOS_BASED_FILE_SYSTEM -This preprocessing symbol is defined to a non-zero value on hosts -whose filesystems belong to the MS-DOS/MS-Windows family. Use this -symbol to write conditional code which should only be compiled for -such hosts. - -@findex IS_DIR_SEPARATOR -@item IS_DIR_SEPARATOR (@var{c} -Evaluates to a non-zero value if @var{c} is a directory separator -character. On Unix and GNU/Linux systems, only a slash @file{/} is -such a character, but on Windows, both @file{/} and @file{\} will -pass. - -@findex IS_ABSOLUTE_PATH -@item IS_ABSOLUTE_PATH (@var{file}) -Evaluates to a non-zero value if @var{file} is an absolute file name. -For Unix and GNU/Linux hosts, a name which begins with a slash -@file{/} is absolute. On DOS and Windows, @file{d:/foo} and -@file{x:\bar} are also absolute file names. - -@findex FILENAME_CMP -@item FILENAME_CMP (@var{f1}, @var{f2}) -Calls a function which compares file names @var{f1} and @var{f2} as -appropriate for the underlying host filesystem. For Posix systems, -this simply calls @code{strcmp}; on case-insensitive filesystems it -will call @code{strcasecmp} instead. - -@findex DIRNAME_SEPARATOR -@item DIRNAME_SEPARATOR -Evaluates to a character which separates directories in -@code{PATH}-style lists, typically held in environment variables. -This character is @samp{:} on Unix, @samp{;} on DOS and Windows. - -@findex SLASH_STRING -@item SLASH_STRING -This evaluates to a constant string you should use to produce an -absolute filename from leading directories and the file's basename. -@code{SLASH_STRING} is @code{"/"} on most systems, but might be -@code{"\\"} for some Windows-based ports. -@end table +@example +#ifdef WRANGLE_SIGNALS + WRANGLE_SIGNALS (signo); +#endif +@end example + +In your host, target, or native configuration file, as appropriate, +define @code{WRANGLE_SIGNALS} to do the machine-dependent thing. Take a +bit of care in defining the hook, so that it can be used by other ports +in the future, if they need a hook in the same place. -In addition to using these macros, be sure to use portable library -functions whenever possible. For example, to extract a directory or a -basename part from a file name, use the @code{dirname} and -@code{basename} library functions (available in @code{libiberty} for -platforms which don't provide them), instead of searching for a slash -with @code{strrchr}. +If the hook is not defined, the code should do whatever ``most'' machines +want. Using @code{#ifdef}, as above, is the preferred way to do this, +but sometimes that gets convoluted, in which case use + +@example +#ifndef SPECIAL_FOO_HANDLING +#define SPECIAL_FOO_HANDLING(pc, sp) (0) +#endif +@end example + +@noindent +where the macro is used or in an appropriate header file. + +Whether to include a @dfn{small} hook, a hook around the exact pieces of +code which are system-dependent, or whether to replace a whole function +with a hook, depends on the case. A good example of this dilemma can be +found in @code{get_saved_register}. All machines that @value{GDBN} 2.8 ran on +just needed the @code{FRAME_FIND_SAVED_REGS} hook to find the saved +registers. Then the SPARC and Pyramid came along, and +@code{HAVE_REGISTER_WINDOWS} and @code{REGISTER_IN_WINDOW_P} were +introduced. Then the 29k and 88k required the @code{GET_SAVED_REGISTER} +hook. The first three are examples of small hooks; the latter replaces +a whole function. In this specific case, it is useful to have both +kinds; it would be a bad idea to replace all the uses of the small hooks +with @code{GET_SAVED_REGISTER}, since that would result in much +duplicated code. Other times, duplicating a few lines of code here or +there is much cleaner than introducing a large number of small hooks. Another way to generalize @value{GDBN} along a particular interface is with an attribute struct. For example, @value{GDBN} has been generalized to handle @@ -4478,11 +4242,7 @@ with variations between systems the same way any system-independent file would (hooks, @code{#if defined}, etc.), and machines which are radically different don't need to use @file{infptrace.c} at all. -All debugging code must be controllable using the @samp{set debug -@var{module}} command. Do not use @code{printf} to print trace -messages. Use @code{fprintf_unfiltered(gdb_stdlog, ...}. Do not use -@code{#ifdef DEBUG}. - +Don't put debugging @code{printf}s in the code. @node Porting GDB diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index a3ca771eef5..17e0701d8e9 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -194,7 +194,6 @@ struct partial_die_info unsigned int offset; unsigned int abbrev; char *name; - int has_pc_info; CORE_ADDR lowpc; CORE_ADDR highpc; struct dwarf_block *locdesc; @@ -587,7 +586,7 @@ static void dwarf2_empty_abbrev_table (PTR); static struct abbrev_info *dwarf2_lookup_abbrev (unsigned int); static char *read_partial_die (struct partial_die_info *, - bfd *, char *, + bfd *, char *, int *, const struct comp_unit_head *); static char *read_full_die (struct die_info **, bfd *, char *, @@ -728,8 +727,7 @@ static void read_tag_string_type (struct die_info *, struct objfile *); static void read_subroutine_type (struct die_info *, struct objfile *, const struct comp_unit_head *); -static struct die_info *read_comp_unit (char *, bfd *, - const struct comp_unit_head *); +struct die_info *read_comp_unit (char *, bfd *, const struct comp_unit_head *); static void free_die_list (struct die_info *); @@ -758,19 +756,19 @@ static char *dwarf_cfi_name (unsigned int); struct die_info *copy_die (struct die_info *); #endif -static struct die_info *sibling_die (struct die_info *); +struct die_info *sibling_die (struct die_info *); -static void dump_die (struct die_info *); +void dump_die (struct die_info *); -static void dump_die_list (struct die_info *); +void dump_die_list (struct die_info *); -static void store_in_ref_table (unsigned int, struct die_info *); +void store_in_ref_table (unsigned int, struct die_info *); static void dwarf2_empty_hash_tables (void); static unsigned int dwarf2_get_ref_die_offset (struct attribute *); -static struct die_info *follow_die_ref (unsigned int); +struct die_info *follow_die_ref (unsigned int); static struct type *dwarf2_fundamental_type (struct objfile *, int); @@ -972,6 +970,7 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline) struct partial_die_info comp_unit_die; struct partial_symtab *pst; struct cleanup *back_to; + int comp_unit_has_pc_info; CORE_ADDR lowpc, highpc; info_ptr = dwarf_info_buffer; @@ -980,20 +979,8 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline) obstack_init (&dwarf2_tmp_obstack); back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL); - /* Since the objects we're extracting from dwarf_info_buffer vary in - length, only the individual functions to extract them (like - read_comp_unit_head and read_partial_die) can really know whether - the buffer is large enough to hold another complete object. - - At the moment, they don't actually check that. If - dwarf_info_buffer holds just one extra byte after the last - compilation unit's dies, then read_comp_unit_head will happily - read off the end of the buffer. read_partial_die is similarly - casual. Those functions should be fixed. - - For this loop condition, simply checking whether there's any data - left at all should be sufficient. */ - while (info_ptr < dwarf_info_buffer + dwarf_info_size) + while ((unsigned int) (info_ptr - dwarf_info_buffer) + + ((info_ptr - dwarf_info_buffer) % 4) < dwarf_info_size) { struct comp_unit_head cu_header; beg_of_comp_unit = info_ptr; @@ -1025,7 +1012,7 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline) /* Read the compilation unit die */ info_ptr = read_partial_die (&comp_unit_die, abfd, info_ptr, - &cu_header); + &comp_unit_has_pc_info, &cu_header); /* Set the language we're debugging */ set_cu_language (comp_unit_die.language); @@ -1060,7 +1047,7 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline) /* If the compilation unit didn't have an explicit address range, then use the information extracted from its child dies. */ - if (! comp_unit_die.has_pc_info) + if (!comp_unit_has_pc_info) { comp_unit_die.lowpc = lowpc; comp_unit_die.highpc = highpc; @@ -1103,20 +1090,22 @@ scan_partial_symbols (char *info_ptr, struct objfile *objfile, back to that level. */ int nesting_level = 1; + int has_pc_info; *lowpc = ((CORE_ADDR) -1); *highpc = ((CORE_ADDR) 0); while (nesting_level) { - info_ptr = read_partial_die (&pdi, abfd, info_ptr, cu_header); + info_ptr = read_partial_die (&pdi, abfd, info_ptr, + &has_pc_info, cu_header); if (pdi.name) { switch (pdi.tag) { case DW_TAG_subprogram: - if (pdi.has_pc_info) + if (has_pc_info) { if (pdi.lowpc < *lowpc) { @@ -2910,7 +2899,7 @@ read_base_type (struct die_info *die, struct objfile *objfile) /* Read a whole compilation unit into a linked list of dies. */ -static struct die_info * +struct die_info * read_comp_unit (char *info_ptr, bfd *abfd, const struct comp_unit_head *cu_header) { @@ -3134,7 +3123,8 @@ dwarf2_lookup_abbrev (unsigned int number) static char * read_partial_die (struct partial_die_info *part_die, bfd *abfd, - char *info_ptr, const struct comp_unit_head *cu_header) + char *info_ptr, int *has_pc_info, + const struct comp_unit_head *cu_header) { unsigned int abbrev_number, bytes_read, i; struct abbrev_info *abbrev; @@ -3145,6 +3135,7 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd, int has_high_pc_attr = 0; *part_die = zeroed_partial_die; + *has_pc_info = 0; abbrev_number = read_unsigned_leb128 (abfd, info_ptr, &bytes_read); info_ptr += bytes_read; if (!abbrev_number) @@ -3230,7 +3221,7 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd, int dummy; spec_ptr = dwarf_info_buffer + dwarf2_get_ref_die_offset (&spec_attr); - read_partial_die (&spec_die, abfd, spec_ptr, cu_header); + read_partial_die (&spec_die, abfd, spec_ptr, &dummy, cu_header); if (spec_die.name) { part_die->name = spec_die.name; @@ -3253,7 +3244,7 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd, && part_die->lowpc < part_die->highpc && (part_die->lowpc != 0 || (bfd_get_file_flags (abfd) & HAS_RELOC))) - part_die->has_pc_info = 1; + *has_pc_info = 1; return info_ptr; } @@ -3730,9 +3721,6 @@ set_cu_language (unsigned int lang) case DW_LANG_Mips_Assembler: cu_language = language_asm; break; - case DW_LANG_Java: - cu_language = language_java; - break; case DW_LANG_Ada83: case DW_LANG_Cobol74: case DW_LANG_Cobol85: @@ -4725,7 +4713,7 @@ copy_die (struct die_info *old_die) /* Return sibling of die, NULL if no sibling. */ -static struct die_info * +struct die_info * sibling_die (struct die_info *die) { int nesting_level = 0; @@ -5511,7 +5499,7 @@ dwarf_cfi_name (register unsigned cfi_opc) } #endif -static void +void dump_die (struct die_info *die) { unsigned int i; @@ -5573,7 +5561,7 @@ dump_die (struct die_info *die) } } -static void +void dump_die_list (struct die_info *die) { while (die) @@ -5583,7 +5571,7 @@ dump_die_list (struct die_info *die) } } -static void +void store_in_ref_table (unsigned int offset, struct die_info *die) { int h; @@ -5625,7 +5613,7 @@ dwarf2_get_ref_die_offset (struct attribute *attr) return result; } -static struct die_info * +struct die_info * follow_die_ref (unsigned int offset) { struct die_info *die; diff --git a/gdb/elfread.c b/gdb/elfread.c index 4394e5a5187..71e383dc187 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -76,7 +76,7 @@ static void elf_symfile_finish (struct objfile *); static void elf_symtab_read (struct objfile *, int); -static void free_elfinfo (PTR); +static void free_elfinfo (void *); static struct minimal_symbol *record_minimal_symbol_and_info (char *, CORE_ADDR, @@ -88,7 +88,7 @@ static struct minimal_symbol *record_minimal_symbol_and_info (char *, struct objfile *); -static void elf_locate_sections (bfd *, asection *, PTR); +static void elf_locate_sections (bfd *, asection *, void *); /* We are called once per section from elf_symfile_read. We need to examine each section we are passed, check to see diff --git a/gdb/gdb-events.c b/gdb/gdb-events.c index d1181088d98..ff76640ad4f 100644 --- a/gdb/gdb-events.c +++ b/gdb/gdb-events.c @@ -1,5 +1,5 @@ /* User Interface Events. - Copyright 1999, 2001 Free Software Foundation, Inc. + Copyright 1999, 2000 Free Software Foundation, Inc. Contributed by Cygnus Solutions. @@ -81,36 +81,6 @@ breakpoint_modify_event (int b) current_event_hooks->breakpoint_modify (b); } -void -tracepoint_create_event (int number) -{ - if (gdb_events_debug) - fprintf_unfiltered (gdb_stdlog, "tracepoint_create_event\n"); - if (!current_event_hooks->tracepoint_create) - return; - current_event_hooks->tracepoint_create (number); -} - -void -tracepoint_delete_event (int number) -{ - if (gdb_events_debug) - fprintf_unfiltered (gdb_stdlog, "tracepoint_delete_event\n"); - if (!current_event_hooks->tracepoint_delete) - return; - current_event_hooks->tracepoint_delete (number); -} - -void -tracepoint_modify_event (int number) -{ - if (gdb_events_debug) - fprintf_unfiltered (gdb_stdlog, "tracepoint_modify_event\n"); - if (!current_event_hooks->tracepoint_modify) - return; - current_event_hooks->tracepoint_modify (number); -} - #endif #if WITH_GDB_EVENTS @@ -131,9 +101,6 @@ enum gdb_event breakpoint_create, breakpoint_delete, breakpoint_modify, - tracepoint_create, - tracepoint_delete, - tracepoint_modify, nr_gdb_events }; @@ -152,21 +119,6 @@ struct breakpoint_modify int b; }; -struct tracepoint_create - { - int number; - }; - -struct tracepoint_delete - { - int number; - }; - -struct tracepoint_modify - { - int number; - }; - struct event { enum gdb_event type; @@ -176,9 +128,6 @@ struct event struct breakpoint_create breakpoint_create; struct breakpoint_delete breakpoint_delete; struct breakpoint_modify breakpoint_modify; - struct tracepoint_create tracepoint_create; - struct tracepoint_delete tracepoint_delete; - struct tracepoint_modify tracepoint_modify; } data; }; @@ -222,33 +171,6 @@ queue_breakpoint_modify (int b) append (event); } -static void -queue_tracepoint_create (int number) -{ - struct event *event = XMALLOC (struct event); - event->type = tracepoint_create; - event->data.tracepoint_create.number = number; - append (event); -} - -static void -queue_tracepoint_delete (int number) -{ - struct event *event = XMALLOC (struct event); - event->type = tracepoint_delete; - event->data.tracepoint_delete.number = number; - append (event); -} - -static void -queue_tracepoint_modify (int number) -{ - struct event *event = XMALLOC (struct event); - event->type = tracepoint_modify; - event->data.tracepoint_modify.number = number; - append (event); -} - void gdb_events_deliver (struct gdb_events *vector) { @@ -282,18 +204,6 @@ gdb_events_deliver (struct gdb_events *vector) vector->breakpoint_modify (event->data.breakpoint_modify.b); break; - case tracepoint_create: - vector->tracepoint_create - (event->data.tracepoint_create.number); - break; - case tracepoint_delete: - vector->tracepoint_delete - (event->data.tracepoint_delete.number); - break; - case tracepoint_modify: - vector->tracepoint_modify - (event->data.tracepoint_modify.number); - break; } delivering_events = event->next; xfree (event); @@ -309,9 +219,6 @@ _initialize_gdb_events (void) queue_event_hooks.breakpoint_create = queue_breakpoint_create; queue_event_hooks.breakpoint_delete = queue_breakpoint_delete; queue_event_hooks.breakpoint_modify = queue_breakpoint_modify; - queue_event_hooks.tracepoint_create = queue_tracepoint_create; - queue_event_hooks.tracepoint_delete = queue_tracepoint_delete; - queue_event_hooks.tracepoint_modify = queue_tracepoint_modify; #endif c = add_set_cmd ("eventdebug", class_maintenance, var_zinteger, diff --git a/gdb/gdb-events.h b/gdb/gdb-events.h index 7d0d86f38ec..65450e867de 100644 --- a/gdb/gdb-events.h +++ b/gdb/gdb-events.h @@ -1,5 +1,5 @@ /* User Interface Events. - Copyright 1999, 2001 Free Software Foundation, Inc. + Copyright 1999, 2000 Free Software Foundation, Inc. Contributed by Cygnus Solutions. @@ -54,9 +54,6 @@ typedef void (gdb_events_breakpoint_create_ftype) (int b); typedef void (gdb_events_breakpoint_delete_ftype) (int b); typedef void (gdb_events_breakpoint_modify_ftype) (int b); -typedef void (gdb_events_tracepoint_create_ftype) (int number); -typedef void (gdb_events_tracepoint_delete_ftype) (int number); -typedef void (gdb_events_tracepoint_modify_ftype) (int number); /* gdb-events: object. */ @@ -66,9 +63,6 @@ struct gdb_events gdb_events_breakpoint_create_ftype *breakpoint_create; gdb_events_breakpoint_delete_ftype *breakpoint_delete; gdb_events_breakpoint_modify_ftype *breakpoint_modify; - gdb_events_tracepoint_create_ftype *tracepoint_create; - gdb_events_tracepoint_delete_ftype *tracepoint_delete; - gdb_events_tracepoint_modify_ftype *tracepoint_modify; }; @@ -78,9 +72,6 @@ struct gdb_events extern void breakpoint_create_event (int b); extern void breakpoint_delete_event (int b); extern void breakpoint_modify_event (int b); -extern void tracepoint_create_event (int number); -extern void tracepoint_delete_event (int number); -extern void tracepoint_modify_event (int number); /* When GDB_EVENTS are not being used, completly disable them. */ @@ -89,9 +80,6 @@ extern void tracepoint_modify_event (int number); #define breakpoint_create_event(b) 0 #define breakpoint_delete_event(b) 0 #define breakpoint_modify_event(b) 0 -#define tracepoint_create_event(number) 0 -#define tracepoint_delete_event(number) 0 -#define tracepoint_modify_event(number) 0 #endif /* Install custom gdb-events hooks. */ diff --git a/gdb/gdb-events.sh b/gdb/gdb-events.sh index d4713eccb5b..fd488ccecec 100755 --- a/gdb/gdb-events.sh +++ b/gdb/gdb-events.sh @@ -1,7 +1,7 @@ #!/bin/sh # User Interface Events. -# Copyright 1999, 2000, 2001 Free Software Foundation, Inc. +# Copyright 1999, 2000 Free Software Foundation, Inc. # # Contributed by Cygnus Solutions. # @@ -61,9 +61,6 @@ function_list () f:void:breakpoint_create:int b:b f:void:breakpoint_delete:int b:b f:void:breakpoint_modify:int b:b -f:void:tracepoint_create:int number:number -f:void:tracepoint_delete:int number:number -f:void:tracepoint_modify:int number:number #*:void:annotate_starting_hook:void #*:void:annotate_stopped_hook:void #*:void:annotate_signalled_hook:void @@ -112,7 +109,7 @@ copyright () { cat <&2 #../move-if-change new-gdb-events.h gdb-events.h -if test -r gdb-events.h +if ! test -r gdb-events.h then - diff -c gdb-events.h new-gdb-events.h - if [ $? = 1 ] - then - echo "gdb-events.h changed? cp new-gdb-events.h gdb-events.h" 1>&2 - fi -else echo "File missing? mv new-gdb-events.h gdb-events.h" 1>&2 +elif ! diff -c gdb-events.h new-gdb-events.h +then + echo "gdb-events.h changed? cp new-gdb-events.h gdb-events.h" 1>&2 fi @@ -333,34 +327,30 @@ do case "${class}" in "*" ) continue ;; "?" ) -cat <${function}; -} - -${returntype} -${function}_event (${formal}) -{ - return current_events->${function} (${actual}); -} -EOF + echo "" + echo "int" + echo "${function}_event_p (${formal})" + echo "{" + echo " return current_event_hooks->${function};" + echo "}" + echo "" + echo "${returntype}" + echo "${function}_event (${formal})" + echo "{" + echo " return current_events->${function} (${actual});" + echo "}" ;; "f" ) -cat <${function}) - return; - current_event_hooks->${function} (${actual}); -} -EOF + echo "" + echo "void" + echo "${function}_event (${formal})" + echo "{" + echo " if (gdb_events_debug)" + echo " fprintf_unfiltered (gdb_stdlog, \"${function}_event\\n\");" + echo " if (!current_event_hooks->${function})" + echo " return;" + echo " current_event_hooks->${function} (${actual});" + echo "}" ;; esac done @@ -478,7 +468,7 @@ do echo "{" echo " struct event *event = XMALLOC (struct event);" echo " event->type = ${function};" - for arg in `echo ${actual} | tr '[,]' '[:]' | tr -d '[ ]'`; do + for arg in `echo ${actual} | tr '[,]' '[ ]'`; do echo " event->data.${function}.${arg} = ${arg};" done echo " append (event);" @@ -498,7 +488,7 @@ gdb_events_deliver (struct gdb_events *vector) { struct event *event = delivering_events; delivering_events = event->next; - xfree (event); + free (event); } /* Process any pending events. Because one of the deliveries could bail out we move everything off of the pending queue onto an @@ -520,7 +510,7 @@ do echo " vector->${function}" sep=" (" ass="" - for arg in `echo ${actual} | tr '[,]' '[:]' | tr -d '[ ]'`; do + for arg in `echo ${actual} | tr '[,]' '[ ]'`; do ass="${ass}${sep}event->data.${function}.${arg}" sep=", " @@ -533,7 +523,7 @@ done cat <next; - xfree (event); + free (event); } } EOF @@ -583,13 +573,10 @@ sed < new-gdb-events.c > tmp-gdb-events.c \ -e 's/\( \)* /\1 /g' mv tmp-gdb-events.c new-gdb-events.c # Move if changed? -if test -r gdb-events.c +if ! test -r gdb-events.c then - diff -c gdb-events.c new-gdb-events.c - if [ $? = 1 ] - then - echo "gdb-events.c changed? cp new-gdb-events.c gdb-events.c" 1>&2 - fi -else echo "File missing? mv new-gdb-events.c gdb-events.c" 1>&2 +elif ! diff -c gdb-events.c new-gdb-events.c +then + echo "gdb-events.c changed? cp new-gdb-events.c gdb-events.c" 1>&2 fi diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index bac36c2948b..bc2070a5666 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -176,8 +176,6 @@ struct gdbarch gdbarch_do_registers_info_ftype *do_registers_info; gdbarch_register_sim_regno_ftype *register_sim_regno; gdbarch_register_bytes_ok_ftype *register_bytes_ok; - gdbarch_cannot_fetch_register_ftype *cannot_fetch_register; - gdbarch_cannot_store_register_ftype *cannot_store_register; int use_generic_dummy_frames; int call_dummy_location; gdbarch_call_dummy_address_ftype *call_dummy_address; @@ -192,8 +190,6 @@ struct gdbarch int call_dummy_stack_adjust_p; int call_dummy_stack_adjust; gdbarch_fix_call_dummy_ftype *fix_call_dummy; - gdbarch_init_frame_pc_first_ftype *init_frame_pc_first; - gdbarch_init_frame_pc_ftype *init_frame_pc; int believe_pcc_promotion; int believe_pcc_promotion_type; gdbarch_coerce_float_to_double_ftype *coerce_float_to_double; @@ -251,7 +247,6 @@ struct gdbarch const struct floatformat * double_format; const struct floatformat * long_double_format; gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr; - gdbarch_addr_bits_remove_ftype *addr_bits_remove; gdbarch_software_single_step_ftype *software_single_step; }; @@ -332,10 +327,6 @@ struct gdbarch startup_gdbarch = 0, 0, 0, - 0, - 0, - 0, - 0, generic_get_saved_register, 0, 0, @@ -391,21 +382,11 @@ struct gdbarch startup_gdbarch = 0, 0, 0, - 0, /* startup_gdbarch() */ }; struct gdbarch *current_gdbarch = &startup_gdbarch; -/* Do any initialization needed for a non-multiarch configuration - after the _initialize_MODULE functions have been run. */ -void -initialize_non_multiarch () -{ - alloc_gdbarch_data (&startup_gdbarch); - init_gdbarch_data (&startup_gdbarch); -} - /* Create a new ``struct gdbarch'' based on information provided by ``struct gdbarch_info''. */ @@ -459,8 +440,6 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->max_register_virtual_size = -1; gdbarch->do_registers_info = do_registers_info; gdbarch->register_sim_regno = default_register_sim_regno; - gdbarch->cannot_fetch_register = cannot_register_not; - gdbarch->cannot_store_register = cannot_register_not; gdbarch->use_generic_dummy_frames = -1; gdbarch->call_dummy_start_offset = -1; gdbarch->call_dummy_breakpoint_offset = -1; @@ -470,8 +449,6 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->call_dummy_words = legacy_call_dummy_words; gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words; gdbarch->call_dummy_stack_adjust_p = -1; - gdbarch->init_frame_pc_first = init_frame_pc_noop; - gdbarch->init_frame_pc = init_frame_pc_default; gdbarch->coerce_float_to_double = default_coerce_float_to_double; gdbarch->register_convertible = generic_register_convertible_not; gdbarch->pointer_to_address = unsigned_pointer_to_address; @@ -488,8 +465,7 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->frame_args_skip = -1; gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not; gdbarch->extra_stack_alignment_needed = 1; - gdbarch->convert_from_func_ptr_addr = core_addr_identity; - gdbarch->addr_bits_remove = core_addr_identity; + gdbarch->convert_from_func_ptr_addr = default_convert_from_func_ptr_addr; /* gdbarch_alloc() */ return gdbarch; @@ -608,8 +584,6 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of do_registers_info, invalid_p == 0 */ /* Skip verify of register_sim_regno, invalid_p == 0 */ /* Skip verify of register_bytes_ok, has predicate */ - /* Skip verify of cannot_fetch_register, invalid_p == 0 */ - /* Skip verify of cannot_store_register, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 1) && (gdbarch->use_generic_dummy_frames == -1)) internal_error (__FILE__, __LINE__, @@ -660,8 +634,6 @@ verify_gdbarch (struct gdbarch *gdbarch) && (gdbarch->fix_call_dummy == 0)) internal_error (__FILE__, __LINE__, "gdbarch: verify_gdbarch: fix_call_dummy invalid"); - /* Skip verify of init_frame_pc_first, invalid_p == 0 */ - /* Skip verify of init_frame_pc, invalid_p == 0 */ /* Skip verify of coerce_float_to_double, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 1) && (gdbarch->get_saved_register == 0)) @@ -709,7 +681,10 @@ verify_gdbarch (struct gdbarch *gdbarch) && (gdbarch->store_return_value == 0)) internal_error (__FILE__, __LINE__, "gdbarch: verify_gdbarch: store_return_value invalid"); - /* Skip verify of extract_struct_value_address, has predicate */ + if ((GDB_MULTI_ARCH >= 2) + && (gdbarch->extract_struct_value_address == 0)) + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: extract_struct_value_address invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->use_struct_convention == 0)) internal_error (__FILE__, __LINE__, @@ -788,7 +763,6 @@ verify_gdbarch (struct gdbarch *gdbarch) if (gdbarch->long_double_format == 0) gdbarch->long_double_format = &floatformat_unknown; /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */ - /* Skip verify of addr_bits_remove, invalid_p == 0 */ /* Skip verify of software_single_step, has predicate */ } @@ -1050,18 +1024,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "REGISTER_BYTES_OK(nr_bytes)", XSTRING (REGISTER_BYTES_OK (nr_bytes))); #endif -#ifdef CANNOT_FETCH_REGISTER - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "CANNOT_FETCH_REGISTER(regnum)", - XSTRING (CANNOT_FETCH_REGISTER (regnum))); -#endif -#ifdef CANNOT_STORE_REGISTER - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "CANNOT_STORE_REGISTER(regnum)", - XSTRING (CANNOT_STORE_REGISTER (regnum))); -#endif #ifdef USE_GENERIC_DUMMY_FRAMES fprintf_unfiltered (file, "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n", @@ -1136,20 +1098,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)", XSTRING (FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p))); #endif -#if defined (INIT_FRAME_PC_FIRST) && GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "INIT_FRAME_PC_FIRST(fromleaf, prev)", - XSTRING (INIT_FRAME_PC_FIRST (fromleaf, prev))); -#endif -#if defined (INIT_FRAME_PC) && GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "INIT_FRAME_PC(fromleaf, prev)", - XSTRING (INIT_FRAME_PC (fromleaf, prev))); -#endif #ifdef BELIEVE_PCC_PROMOTION fprintf_unfiltered (file, "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n", @@ -1497,12 +1445,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "CONVERT_FROM_FUNC_PTR_ADDR(addr)", XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr))); #endif -#ifdef ADDR_BITS_REMOVE - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "ADDR_BITS_REMOVE(addr)", - XSTRING (ADDR_BITS_REMOVE (addr))); -#endif #if defined (SOFTWARE_SINGLE_STEP) && GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ fprintf_unfiltered (file, @@ -1777,20 +1719,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->register_bytes_ok /*REGISTER_BYTES_OK ()*/); #endif -#ifdef CANNOT_FETCH_REGISTER - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: CANNOT_FETCH_REGISTER = 0x%08lx\n", - (long) current_gdbarch->cannot_fetch_register - /*CANNOT_FETCH_REGISTER ()*/); -#endif -#ifdef CANNOT_STORE_REGISTER - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: CANNOT_STORE_REGISTER = 0x%08lx\n", - (long) current_gdbarch->cannot_store_register - /*CANNOT_STORE_REGISTER ()*/); -#endif #ifdef USE_GENERIC_DUMMY_FRAMES fprintf_unfiltered (file, "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %ld\n", @@ -1870,20 +1798,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->fix_call_dummy /*FIX_CALL_DUMMY ()*/); #endif -#ifdef INIT_FRAME_PC_FIRST - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: INIT_FRAME_PC_FIRST = 0x%08lx\n", - (long) current_gdbarch->init_frame_pc_first - /*INIT_FRAME_PC_FIRST ()*/); -#endif -#ifdef INIT_FRAME_PC - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: INIT_FRAME_PC = 0x%08lx\n", - (long) current_gdbarch->init_frame_pc - /*INIT_FRAME_PC ()*/); -#endif #ifdef BELIEVE_PCC_PROMOTION fprintf_unfiltered (file, "gdbarch_dump: BELIEVE_PCC_PROMOTION = %ld\n", @@ -2263,13 +2177,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->convert_from_func_ptr_addr /*CONVERT_FROM_FUNC_PTR_ADDR ()*/); #endif -#ifdef ADDR_BITS_REMOVE - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: ADDR_BITS_REMOVE = 0x%08lx\n", - (long) current_gdbarch->addr_bits_remove - /*ADDR_BITS_REMOVE ()*/); -#endif #ifdef SOFTWARE_SINGLE_STEP if (GDB_MULTI_ARCH) fprintf_unfiltered (file, @@ -3088,42 +2995,6 @@ set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch->register_bytes_ok = register_bytes_ok; } -int -gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum) -{ - if (gdbarch->cannot_fetch_register == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_cannot_fetch_register invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n"); - return gdbarch->cannot_fetch_register (regnum); -} - -void -set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, - gdbarch_cannot_fetch_register_ftype cannot_fetch_register) -{ - gdbarch->cannot_fetch_register = cannot_fetch_register; -} - -int -gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum) -{ - if (gdbarch->cannot_store_register == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_cannot_store_register invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n"); - return gdbarch->cannot_store_register (regnum); -} - -void -set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, - gdbarch_cannot_store_register_ftype cannot_store_register) -{ - gdbarch->cannot_store_register = cannot_store_register; -} - int gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch) { @@ -3372,42 +3243,6 @@ set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch->fix_call_dummy = fix_call_dummy; } -void -gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) -{ - if (gdbarch->init_frame_pc_first == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_init_frame_pc_first invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc_first called\n"); - gdbarch->init_frame_pc_first (fromleaf, prev); -} - -void -set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, - gdbarch_init_frame_pc_first_ftype init_frame_pc_first) -{ - gdbarch->init_frame_pc_first = init_frame_pc_first; -} - -void -gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) -{ - if (gdbarch->init_frame_pc == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_init_frame_pc invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc called\n"); - gdbarch->init_frame_pc (fromleaf, prev); -} - -void -set_gdbarch_init_frame_pc (struct gdbarch *gdbarch, - gdbarch_init_frame_pc_ftype init_frame_pc) -{ - gdbarch->init_frame_pc = init_frame_pc; -} - int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch) { @@ -3852,12 +3687,6 @@ set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch->store_return_value = store_return_value; } -int -gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch) -{ - return gdbarch->extract_struct_value_address != 0; -} - CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf) { @@ -4438,24 +4267,6 @@ set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr; } -CORE_ADDR -gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr) -{ - if (gdbarch->addr_bits_remove == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_addr_bits_remove invalid"); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n"); - return gdbarch->addr_bits_remove (addr); -} - -void -set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, - gdbarch_addr_bits_remove_ftype addr_bits_remove) -{ - gdbarch->addr_bits_remove = addr_bits_remove; -} - int gdbarch_software_single_step_p (struct gdbarch *gdbarch) { @@ -4833,40 +4644,56 @@ gdbarch_update_p (struct gdbarch_info info) struct gdbarch_list **list; struct gdbarch_registration *rego; - /* Fill in missing parts of the INFO struct using a number of - sources: ``set ...''; INFOabfd supplied; existing target. */ - - /* ``(gdb) set architecture ...'' */ - if (info.bfd_arch_info == NULL - && !TARGET_ARCHITECTURE_AUTO) - info.bfd_arch_info = TARGET_ARCHITECTURE; - if (info.bfd_arch_info == NULL - && info.abfd != NULL - && bfd_get_arch (info.abfd) != bfd_arch_unknown - && bfd_get_arch (info.abfd) != bfd_arch_obscure) - info.bfd_arch_info = bfd_get_arch_info (info.abfd); + /* Fill in any missing bits. Most important is the bfd_architecture + which is used to select the target architecture. */ + if (info.bfd_architecture == bfd_arch_unknown) + { + if (info.bfd_arch_info != NULL) + info.bfd_architecture = info.bfd_arch_info->arch; + else if (info.abfd != NULL) + info.bfd_architecture = bfd_get_arch (info.abfd); + /* FIXME - should query BFD for its default architecture. */ + else + info.bfd_architecture = current_gdbarch->bfd_arch_info->arch; + } if (info.bfd_arch_info == NULL) - info.bfd_arch_info = TARGET_ARCHITECTURE; - - /* ``(gdb) set byte-order ...'' */ - if (info.byte_order == 0 - && !TARGET_BYTE_ORDER_AUTO) - info.byte_order = TARGET_BYTE_ORDER; - /* From the INFO struct. */ - if (info.byte_order == 0 - && info.abfd != NULL) - info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN - : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN - : 0); - /* From the current target. */ + { + if (target_architecture_auto && info.abfd != NULL) + info.bfd_arch_info = bfd_get_arch_info (info.abfd); + else + info.bfd_arch_info = current_gdbarch->bfd_arch_info; + } if (info.byte_order == 0) - info.byte_order = TARGET_BYTE_ORDER; + { + if (target_byte_order_auto && info.abfd != NULL) + info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN + : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN + : 0); + else + info.byte_order = current_gdbarch->byte_order; + /* FIXME - should query BFD for its default byte-order. */ + } + /* A default for abfd? */ - /* Must have found some sort of architecture. */ - gdb_assert (info.bfd_arch_info != NULL); + /* Find the target that knows about this architecture. */ + for (rego = gdbarch_registry; + rego != NULL; + rego = rego->next) + if (rego->bfd_architecture == info.bfd_architecture) + break; + if (rego == NULL) + { + if (gdbarch_debug) + fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n"); + return 0; + } if (gdbarch_debug) { + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: info.bfd_architecture %d (%s)\n", + info.bfd_architecture, + bfd_lookup_arch (info.bfd_architecture, 0)->printable_name); fprintf_unfiltered (gdb_stdlog, "gdbarch_update: info.bfd_arch_info %s\n", (info.bfd_arch_info != NULL @@ -4886,19 +4713,6 @@ gdbarch_update_p (struct gdbarch_info info) (long) info.tdep_info); } - /* Find the target that knows about this architecture. */ - for (rego = gdbarch_registry; - rego != NULL; - rego = rego->next) - if (rego->bfd_architecture == info.bfd_arch_info->arch) - break; - if (rego == NULL) - { - if (gdbarch_debug) - fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n"); - return 0; - } - /* Ask the target for a replacement architecture. */ new_gdbarch = rego->init (info, rego->arches); diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 0ace44bf9cf..e2982746794 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -57,18 +57,11 @@ extern struct gdbarch *current_gdbarch; #endif #endif -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE) -#error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file." -#endif - /* The following are pre-initialized by GDBARCH. */ extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch); /* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */ -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ARCHITECTURE) -#error "Non multi-arch definition of TARGET_ARCHITECTURE" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ARCHITECTURE) #define TARGET_ARCHITECTURE (gdbarch_bfd_arch_info (current_gdbarch)) @@ -77,9 +70,6 @@ extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbar extern int gdbarch_byte_order (struct gdbarch *gdbarch); /* set_gdbarch_byte_order() - not applicable - pre-initialized. */ -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BYTE_ORDER) -#error "Non multi-arch definition of TARGET_BYTE_ORDER" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BYTE_ORDER) #define TARGET_BYTE_ORDER (gdbarch_byte_order (current_gdbarch)) @@ -102,9 +92,6 @@ extern int gdbarch_byte_order (struct gdbarch *gdbarch); extern int gdbarch_short_bit (struct gdbarch *gdbarch); extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_SHORT_BIT) -#error "Non multi-arch definition of TARGET_SHORT_BIT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_SHORT_BIT) #define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch)) @@ -120,9 +107,6 @@ extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit); extern int gdbarch_int_bit (struct gdbarch *gdbarch); extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_INT_BIT) -#error "Non multi-arch definition of TARGET_INT_BIT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_INT_BIT) #define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch)) @@ -138,9 +122,6 @@ extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit); extern int gdbarch_long_bit (struct gdbarch *gdbarch); extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_BIT) -#error "Non multi-arch definition of TARGET_LONG_BIT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_BIT) #define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch)) @@ -157,9 +138,6 @@ extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit); extern int gdbarch_long_long_bit (struct gdbarch *gdbarch); extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_LONG_BIT) -#error "Non multi-arch definition of TARGET_LONG_LONG_BIT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_LONG_BIT) #define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch)) @@ -175,9 +153,6 @@ extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bi extern int gdbarch_float_bit (struct gdbarch *gdbarch); extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_BIT) -#error "Non multi-arch definition of TARGET_FLOAT_BIT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_BIT) #define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch)) @@ -193,9 +168,6 @@ extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit); extern int gdbarch_double_bit (struct gdbarch *gdbarch); extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_BIT) -#error "Non multi-arch definition of TARGET_DOUBLE_BIT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_BIT) #define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch)) @@ -211,9 +183,6 @@ extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit); extern int gdbarch_long_double_bit (struct gdbarch *gdbarch); extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_BIT) -#error "Non multi-arch definition of TARGET_LONG_DOUBLE_BIT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_BIT) #define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch)) @@ -237,9 +206,6 @@ extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_doubl extern int gdbarch_ptr_bit (struct gdbarch *gdbarch); extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PTR_BIT) -#error "Non multi-arch definition of TARGET_PTR_BIT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_PTR_BIT) #define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch)) @@ -255,9 +221,6 @@ extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit); extern int gdbarch_addr_bit (struct gdbarch *gdbarch); extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ADDR_BIT) -#error "Non multi-arch definition of TARGET_ADDR_BIT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ADDR_BIT) #define TARGET_ADDR_BIT (gdbarch_addr_bit (current_gdbarch)) @@ -273,9 +236,6 @@ extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit); extern int gdbarch_bfd_vma_bit (struct gdbarch *gdbarch); extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BFD_VMA_BIT) -#error "Non multi-arch definition of TARGET_BFD_VMA_BIT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_BFD_VMA_BIT) #define TARGET_BFD_VMA_BIT (gdbarch_bfd_vma_bit (current_gdbarch)) @@ -289,9 +249,6 @@ extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit); extern int gdbarch_ieee_float (struct gdbarch *gdbarch); extern void set_gdbarch_ieee_float (struct gdbarch *gdbarch, int ieee_float); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IEEE_FLOAT) -#error "Non multi-arch definition of IEEE_FLOAT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IEEE_FLOAT) #define IEEE_FLOAT (gdbarch_ieee_float (current_gdbarch)) @@ -306,9 +263,6 @@ extern void set_gdbarch_ieee_float (struct gdbarch *gdbarch, int ieee_float); typedef CORE_ADDR (gdbarch_read_pc_ftype) (ptid_t ptid); extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid); extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_PC) -#error "Non multi-arch definition of TARGET_READ_PC" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_PC) #define TARGET_READ_PC(ptid) (gdbarch_read_pc (current_gdbarch, ptid)) @@ -323,9 +277,6 @@ extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype typedef void (gdbarch_write_pc_ftype) (CORE_ADDR val, ptid_t ptid); extern void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid); extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_PC) -#error "Non multi-arch definition of TARGET_WRITE_PC" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_PC) #define TARGET_WRITE_PC(val, ptid) (gdbarch_write_pc (current_gdbarch, val, ptid)) @@ -340,9 +291,6 @@ extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftyp typedef CORE_ADDR (gdbarch_read_fp_ftype) (void); extern CORE_ADDR gdbarch_read_fp (struct gdbarch *gdbarch); extern void set_gdbarch_read_fp (struct gdbarch *gdbarch, gdbarch_read_fp_ftype *read_fp); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_FP) -#error "Non multi-arch definition of TARGET_READ_FP" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_FP) #define TARGET_READ_FP() (gdbarch_read_fp (current_gdbarch)) @@ -357,9 +305,6 @@ extern void set_gdbarch_read_fp (struct gdbarch *gdbarch, gdbarch_read_fp_ftype typedef void (gdbarch_write_fp_ftype) (CORE_ADDR val); extern void gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val); extern void set_gdbarch_write_fp (struct gdbarch *gdbarch, gdbarch_write_fp_ftype *write_fp); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_FP) -#error "Non multi-arch definition of TARGET_WRITE_FP" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_FP) #define TARGET_WRITE_FP(val) (gdbarch_write_fp (current_gdbarch, val)) @@ -374,9 +319,6 @@ extern void set_gdbarch_write_fp (struct gdbarch *gdbarch, gdbarch_write_fp_ftyp typedef CORE_ADDR (gdbarch_read_sp_ftype) (void); extern CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch); extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP) -#error "Non multi-arch definition of TARGET_READ_SP" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_SP) #define TARGET_READ_SP() (gdbarch_read_sp (current_gdbarch)) @@ -391,9 +333,6 @@ extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype 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" -#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)) @@ -414,9 +353,6 @@ extern void set_gdbarch_register_write (struct gdbarch *gdbarch, gdbarch_registe extern int gdbarch_num_regs (struct gdbarch *gdbarch); extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_REGS) -#error "Non multi-arch definition of NUM_REGS" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_REGS) #define NUM_REGS (gdbarch_num_regs (current_gdbarch)) @@ -435,9 +371,6 @@ extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs); extern int gdbarch_num_pseudo_regs (struct gdbarch *gdbarch); extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo_regs); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_PSEUDO_REGS) -#error "Non multi-arch definition of NUM_PSEUDO_REGS" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NUM_PSEUDO_REGS) #define NUM_PSEUDO_REGS (gdbarch_num_pseudo_regs (current_gdbarch)) @@ -446,9 +379,6 @@ extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo extern int gdbarch_sp_regnum (struct gdbarch *gdbarch); extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SP_REGNUM) -#error "Non multi-arch definition of SP_REGNUM" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SP_REGNUM) #define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch)) @@ -457,9 +387,6 @@ extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum); extern int gdbarch_fp_regnum (struct gdbarch *gdbarch); extern void set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int fp_regnum); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP_REGNUM) -#error "Non multi-arch definition of FP_REGNUM" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP_REGNUM) #define FP_REGNUM (gdbarch_fp_regnum (current_gdbarch)) @@ -468,9 +395,6 @@ extern void set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int fp_regnum); extern int gdbarch_pc_regnum (struct gdbarch *gdbarch); extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_REGNUM) -#error "Non multi-arch definition of PC_REGNUM" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_REGNUM) #define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch)) @@ -484,9 +408,6 @@ extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum); extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch); extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP0_REGNUM) -#error "Non multi-arch definition of FP0_REGNUM" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FP0_REGNUM) #define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch)) @@ -500,9 +421,6 @@ extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum); extern int gdbarch_npc_regnum (struct gdbarch *gdbarch); extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NPC_REGNUM) -#error "Non multi-arch definition of NPC_REGNUM" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NPC_REGNUM) #define NPC_REGNUM (gdbarch_npc_regnum (current_gdbarch)) @@ -516,9 +434,6 @@ extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum); extern int gdbarch_nnpc_regnum (struct gdbarch *gdbarch); extern void set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, int nnpc_regnum); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NNPC_REGNUM) -#error "Non multi-arch definition of NNPC_REGNUM" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (NNPC_REGNUM) #define NNPC_REGNUM (gdbarch_nnpc_regnum (current_gdbarch)) @@ -535,9 +450,6 @@ extern void set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, int nnpc_regnum); typedef int (gdbarch_stab_reg_to_regnum_ftype) (int stab_regnr); extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr); extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STAB_REG_TO_REGNUM) -#error "Non multi-arch definition of STAB_REG_TO_REGNUM" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STAB_REG_TO_REGNUM) #define STAB_REG_TO_REGNUM(stab_regnr) (gdbarch_stab_reg_to_regnum (current_gdbarch, stab_regnr)) @@ -554,9 +466,6 @@ extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sta typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (int ecoff_regnr); extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr); extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ECOFF_REG_TO_REGNUM) -#error "Non multi-arch definition of ECOFF_REG_TO_REGNUM" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ECOFF_REG_TO_REGNUM) #define ECOFF_REG_TO_REGNUM(ecoff_regnr) (gdbarch_ecoff_reg_to_regnum (current_gdbarch, ecoff_regnr)) @@ -573,9 +482,6 @@ extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ec typedef int (gdbarch_dwarf_reg_to_regnum_ftype) (int dwarf_regnr); extern int gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr); extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF_REG_TO_REGNUM) -#error "Non multi-arch definition of DWARF_REG_TO_REGNUM" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF_REG_TO_REGNUM) #define DWARF_REG_TO_REGNUM(dwarf_regnr) (gdbarch_dwarf_reg_to_regnum (current_gdbarch, dwarf_regnr)) @@ -594,9 +500,6 @@ extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dw typedef int (gdbarch_sdb_reg_to_regnum_ftype) (int sdb_regnr); extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr); extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SDB_REG_TO_REGNUM) -#error "Non multi-arch definition of SDB_REG_TO_REGNUM" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SDB_REG_TO_REGNUM) #define SDB_REG_TO_REGNUM(sdb_regnr) (gdbarch_sdb_reg_to_regnum (current_gdbarch, sdb_regnr)) @@ -611,9 +514,6 @@ extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_ typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (int dwarf2_regnr); extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr); extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DWARF2_REG_TO_REGNUM) -#error "Non multi-arch definition of DWARF2_REG_TO_REGNUM" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_REG_TO_REGNUM) #define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf2_regnr)) @@ -628,9 +528,6 @@ extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_d typedef char * (gdbarch_register_name_ftype) (int regnr); extern char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr); extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_NAME) -#error "Non multi-arch definition of REGISTER_NAME" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_NAME) #define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr)) @@ -639,9 +536,6 @@ extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register extern int gdbarch_register_size (struct gdbarch *gdbarch); extern void set_gdbarch_register_size (struct gdbarch *gdbarch, int register_size); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIZE) -#error "Non multi-arch definition of REGISTER_SIZE" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIZE) #define REGISTER_SIZE (gdbarch_register_size (current_gdbarch)) @@ -650,9 +544,6 @@ extern void set_gdbarch_register_size (struct gdbarch *gdbarch, int register_siz extern int gdbarch_register_bytes (struct gdbarch *gdbarch); extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_bytes); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES) -#error "Non multi-arch definition of REGISTER_BYTES" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES) #define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch)) @@ -662,9 +553,6 @@ extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_by typedef int (gdbarch_register_byte_ftype) (int reg_nr); extern int gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr); extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE) -#error "Non multi-arch definition of REGISTER_BYTE" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE) #define REGISTER_BYTE(reg_nr) (gdbarch_register_byte (current_gdbarch, reg_nr)) @@ -674,9 +562,6 @@ extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register typedef int (gdbarch_register_raw_size_ftype) (int reg_nr); extern int gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr); extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_register_raw_size_ftype *register_raw_size); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_RAW_SIZE) -#error "Non multi-arch definition of REGISTER_RAW_SIZE" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_RAW_SIZE) #define REGISTER_RAW_SIZE(reg_nr) (gdbarch_register_raw_size (current_gdbarch, reg_nr)) @@ -685,9 +570,6 @@ extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_regi extern int gdbarch_max_register_raw_size (struct gdbarch *gdbarch); extern void set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, int max_register_raw_size); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_RAW_SIZE) -#error "Non multi-arch definition of MAX_REGISTER_RAW_SIZE" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_RAW_SIZE) #define MAX_REGISTER_RAW_SIZE (gdbarch_max_register_raw_size (current_gdbarch)) @@ -697,9 +579,6 @@ extern void set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, int max_ typedef int (gdbarch_register_virtual_size_ftype) (int reg_nr); extern int gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr); extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_register_virtual_size_ftype *register_virtual_size); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_SIZE) -#error "Non multi-arch definition of REGISTER_VIRTUAL_SIZE" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_SIZE) #define REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_register_virtual_size (current_gdbarch, reg_nr)) @@ -708,9 +587,6 @@ extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_ extern int gdbarch_max_register_virtual_size (struct gdbarch *gdbarch); extern void set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, int max_register_virtual_size); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_VIRTUAL_SIZE) -#error "Non multi-arch definition of MAX_REGISTER_VIRTUAL_SIZE" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_VIRTUAL_SIZE) #define MAX_REGISTER_VIRTUAL_SIZE (gdbarch_max_register_virtual_size (current_gdbarch)) @@ -720,9 +596,6 @@ extern void set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, int typedef struct type * (gdbarch_register_virtual_type_ftype) (int reg_nr); extern struct type * gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr); extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_register_virtual_type_ftype *register_virtual_type); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE) -#error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_TYPE) #define REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_register_virtual_type (current_gdbarch, reg_nr)) @@ -737,9 +610,6 @@ extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_ typedef void (gdbarch_do_registers_info_ftype) (int reg_nr, int fpregs); extern void gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs); extern void set_gdbarch_do_registers_info (struct gdbarch *gdbarch, gdbarch_do_registers_info_ftype *do_registers_info); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DO_REGISTERS_INFO) -#error "Non multi-arch definition of DO_REGISTERS_INFO" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DO_REGISTERS_INFO) #define DO_REGISTERS_INFO(reg_nr, fpregs) (gdbarch_do_registers_info (current_gdbarch, reg_nr, fpregs)) @@ -757,9 +627,6 @@ extern void set_gdbarch_do_registers_info (struct gdbarch *gdbarch, gdbarch_do_r typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr); extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr); extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_SIM_REGNO) -#error "Non multi-arch definition of REGISTER_SIM_REGNO" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_SIM_REGNO) #define REGISTER_SIM_REGNO(reg_nr) (gdbarch_register_sim_regno (current_gdbarch, reg_nr)) @@ -779,9 +646,6 @@ extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_reg #endif extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK_P) -#error "Non multi-arch definition of REGISTER_BYTES_OK" -#endif #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK_P) #define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch)) #endif @@ -794,54 +658,14 @@ extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch); typedef int (gdbarch_register_bytes_ok_ftype) (long nr_bytes); extern int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes); extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_register_bytes_ok_ftype *register_bytes_ok); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK) -#error "Non multi-arch definition of REGISTER_BYTES_OK" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK) #define REGISTER_BYTES_OK(nr_bytes) (gdbarch_register_bytes_ok (current_gdbarch, nr_bytes)) #endif #endif -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (CANNOT_FETCH_REGISTER) -#define CANNOT_FETCH_REGISTER(regnum) (cannot_register_not (regnum)) -#endif - -typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum); -extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum); -extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_FETCH_REGISTER) -#error "Non multi-arch definition of CANNOT_FETCH_REGISTER" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_FETCH_REGISTER) -#define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum)) -#endif -#endif - -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (CANNOT_STORE_REGISTER) -#define CANNOT_STORE_REGISTER(regnum) (cannot_register_not (regnum)) -#endif - -typedef int (gdbarch_cannot_store_register_ftype) (int regnum); -extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum); -extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STORE_REGISTER) -#error "Non multi-arch definition of CANNOT_STORE_REGISTER" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STORE_REGISTER) -#define CANNOT_STORE_REGISTER(regnum) (gdbarch_cannot_store_register (current_gdbarch, regnum)) -#endif -#endif - extern int gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch); extern void set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, int use_generic_dummy_frames); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (USE_GENERIC_DUMMY_FRAMES) -#error "Non multi-arch definition of USE_GENERIC_DUMMY_FRAMES" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (USE_GENERIC_DUMMY_FRAMES) #define USE_GENERIC_DUMMY_FRAMES (gdbarch_use_generic_dummy_frames (current_gdbarch)) @@ -850,9 +674,6 @@ extern void set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, int u extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch); extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LOCATION) -#error "Non multi-arch definition of CALL_DUMMY_LOCATION" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LOCATION) #define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch)) @@ -862,9 +683,6 @@ extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_d typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) (void); extern CORE_ADDR gdbarch_call_dummy_address (struct gdbarch *gdbarch); extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_call_dummy_address_ftype *call_dummy_address); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_ADDRESS) -#error "Non multi-arch definition of CALL_DUMMY_ADDRESS" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_ADDRESS) #define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch)) @@ -873,9 +691,6 @@ extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_cal extern CORE_ADDR gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch); extern void set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_start_offset); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_START_OFFSET) -#error "Non multi-arch definition of CALL_DUMMY_START_OFFSET" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_START_OFFSET) #define CALL_DUMMY_START_OFFSET (gdbarch_call_dummy_start_offset (current_gdbarch)) @@ -884,9 +699,6 @@ extern void set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_A extern CORE_ADDR gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch); extern void set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_breakpoint_offset); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET) -#error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET) #define CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_call_dummy_breakpoint_offset (current_gdbarch)) @@ -895,9 +707,6 @@ extern void set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, C extern int gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch); extern void set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch, int call_dummy_breakpoint_offset_p); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_BREAKPOINT_OFFSET_P) -#error "Non multi-arch definition of CALL_DUMMY_BREAKPOINT_OFFSET_P" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET_P) #define CALL_DUMMY_BREAKPOINT_OFFSET_P (gdbarch_call_dummy_breakpoint_offset_p (current_gdbarch)) @@ -906,9 +715,6 @@ extern void set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch, extern int gdbarch_call_dummy_length (struct gdbarch *gdbarch); extern void set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, int call_dummy_length); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LENGTH) -#error "Non multi-arch definition of CALL_DUMMY_LENGTH" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_LENGTH) #define CALL_DUMMY_LENGTH (gdbarch_call_dummy_length (current_gdbarch)) @@ -918,9 +724,6 @@ extern void set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, int call_dum typedef int (gdbarch_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); extern int gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); extern void set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_CALL_DUMMY) -#error "Non multi-arch definition of PC_IN_CALL_DUMMY" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_CALL_DUMMY) #define PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address)) @@ -929,9 +732,6 @@ extern void set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_pc_in extern int gdbarch_call_dummy_p (struct gdbarch *gdbarch); extern void set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, int call_dummy_p); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_P) -#error "Non multi-arch definition of CALL_DUMMY_P" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_P) #define CALL_DUMMY_P (gdbarch_call_dummy_p (current_gdbarch)) @@ -945,9 +745,6 @@ extern void set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, int call_dummy_p) extern LONGEST * gdbarch_call_dummy_words (struct gdbarch *gdbarch); extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * call_dummy_words); -#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) #define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch)) @@ -961,9 +758,6 @@ extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * cal extern int gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch); extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int sizeof_call_dummy_words); -#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) #define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch)) @@ -972,9 +766,6 @@ extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int si extern int gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch); extern void set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, int call_dummy_stack_adjust_p); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_STACK_ADJUST_P) -#error "Non multi-arch definition of CALL_DUMMY_STACK_ADJUST_P" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_STACK_ADJUST_P) #define CALL_DUMMY_STACK_ADJUST_P (gdbarch_call_dummy_stack_adjust_p (current_gdbarch)) @@ -983,9 +774,6 @@ extern void set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, int extern int gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch); extern void set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, int call_dummy_stack_adjust); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_STACK_ADJUST) -#error "Non multi-arch definition of CALL_DUMMY_STACK_ADJUST" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CALL_DUMMY_STACK_ADJUST) #define CALL_DUMMY_STACK_ADJUST (gdbarch_call_dummy_stack_adjust (current_gdbarch)) @@ -995,54 +783,14 @@ extern void set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, int ca typedef void (gdbarch_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p); extern void gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p); extern void set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FIX_CALL_DUMMY) -#error "Non multi-arch definition of FIX_CALL_DUMMY" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FIX_CALL_DUMMY) #define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p)) #endif #endif -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC_FIRST) -#define INIT_FRAME_PC_FIRST(fromleaf, prev) (init_frame_pc_noop (fromleaf, prev)) -#endif - -typedef void (gdbarch_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev); -extern void gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); -extern void set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_init_frame_pc_first_ftype *init_frame_pc_first); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC_FIRST) -#error "Non multi-arch definition of INIT_FRAME_PC_FIRST" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC_FIRST) -#define INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_init_frame_pc_first (current_gdbarch, fromleaf, prev)) -#endif -#endif - -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC) -#define INIT_FRAME_PC(fromleaf, prev) (init_frame_pc_default (fromleaf, prev)) -#endif - -typedef void (gdbarch_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev); -extern void gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); -extern void set_gdbarch_init_frame_pc (struct gdbarch *gdbarch, gdbarch_init_frame_pc_ftype *init_frame_pc); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC) -#error "Non multi-arch definition of INIT_FRAME_PC" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC) -#define INIT_FRAME_PC(fromleaf, prev) (gdbarch_init_frame_pc (current_gdbarch, fromleaf, prev)) -#endif -#endif - extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch); extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION) -#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION) #define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch)) @@ -1051,9 +799,6 @@ extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int beli extern int gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch); extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int believe_pcc_promotion_type); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION_TYPE) -#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION_TYPE" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BELIEVE_PCC_PROMOTION_TYPE) #define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch)) @@ -1068,9 +813,6 @@ extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int typedef int (gdbarch_coerce_float_to_double_ftype) (struct type *formal, struct type *actual); extern int gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual); extern void set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, gdbarch_coerce_float_to_double_ftype *coerce_float_to_double); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (COERCE_FLOAT_TO_DOUBLE) -#error "Non multi-arch definition of COERCE_FLOAT_TO_DOUBLE" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (COERCE_FLOAT_TO_DOUBLE) #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (gdbarch_coerce_float_to_double (current_gdbarch, formal, actual)) @@ -1080,9 +822,6 @@ extern void set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, gdbarch typedef void (gdbarch_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); extern void gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); extern void set_gdbarch_get_saved_register (struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER) -#error "Non multi-arch definition of GET_SAVED_REGISTER" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER) #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval)) @@ -1097,9 +836,6 @@ extern void set_gdbarch_get_saved_register (struct gdbarch *gdbarch, gdbarch_get typedef int (gdbarch_register_convertible_ftype) (int nr); extern int gdbarch_register_convertible (struct gdbarch *gdbarch, int nr); extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_register_convertible_ftype *register_convertible); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERTIBLE) -#error "Non multi-arch definition of REGISTER_CONVERTIBLE" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERTIBLE) #define REGISTER_CONVERTIBLE(nr) (gdbarch_register_convertible (current_gdbarch, nr)) @@ -1114,9 +850,6 @@ extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_r typedef void (gdbarch_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to); extern void gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to); extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_VIRTUAL) -#error "Non multi-arch definition of REGISTER_CONVERT_TO_VIRTUAL" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_VIRTUAL) #define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_register_convert_to_virtual (current_gdbarch, regnum, type, from, to)) @@ -1131,9 +864,6 @@ extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gd typedef void (gdbarch_register_convert_to_raw_ftype) (struct type *type, int regnum, char *from, char *to); extern void gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to); extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_register_convert_to_raw_ftype *register_convert_to_raw); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_CONVERT_TO_RAW) -#error "Non multi-arch definition of REGISTER_CONVERT_TO_RAW" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_CONVERT_TO_RAW) #define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_register_convert_to_raw (current_gdbarch, type, regnum, from, to)) @@ -1152,9 +882,6 @@ extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarc typedef void (gdbarch_fetch_pseudo_register_ftype) (int regnum); extern void gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum); extern void set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER) -#error "Non multi-arch definition of FETCH_PSEUDO_REGISTER" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER) #define FETCH_PSEUDO_REGISTER(regnum) (gdbarch_fetch_pseudo_register (current_gdbarch, regnum)) @@ -1173,9 +900,6 @@ extern void set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, gdbarch_ typedef void (gdbarch_store_pseudo_register_ftype) (int regnum); extern void gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum); extern void set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch, gdbarch_store_pseudo_register_ftype *store_pseudo_register); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER) -#error "Non multi-arch definition of STORE_PSEUDO_REGISTER" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER) #define STORE_PSEUDO_REGISTER(regnum) (gdbarch_store_pseudo_register (current_gdbarch, regnum)) @@ -1190,9 +914,6 @@ extern void set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch, gdbarch_ typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, void *buf); extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf); extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POINTER_TO_ADDRESS) -#error "Non multi-arch definition of POINTER_TO_ADDRESS" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POINTER_TO_ADDRESS) #define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf)) @@ -1207,9 +928,6 @@ extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_poi typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, void *buf, CORE_ADDR addr); extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr); extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_TO_POINTER) -#error "Non multi-arch definition of ADDRESS_TO_POINTER" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_TO_POINTER) #define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr)) @@ -1224,9 +942,6 @@ extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_add typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type); extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type); extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_return_value_on_stack_ftype *return_value_on_stack); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (RETURN_VALUE_ON_STACK) -#error "Non multi-arch definition of RETURN_VALUE_ON_STACK" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (RETURN_VALUE_ON_STACK) #define RETURN_VALUE_ON_STACK(type) (gdbarch_return_value_on_stack (current_gdbarch, type)) @@ -1236,9 +951,6 @@ extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_ typedef void (gdbarch_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf); extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf); extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE) -#error "Non multi-arch definition of EXTRACT_RETURN_VALUE" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE) #define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regbuf, valbuf)) @@ -1248,9 +960,6 @@ extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_e 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" -#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)) @@ -1260,9 +969,6 @@ extern void set_gdbarch_push_arguments (struct gdbarch *gdbarch, gdbarch_push_ar typedef void (gdbarch_push_dummy_frame_ftype) (void); extern void gdbarch_push_dummy_frame (struct gdbarch *gdbarch); extern void set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_push_dummy_frame_ftype *push_dummy_frame); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_DUMMY_FRAME) -#error "Non multi-arch definition of PUSH_DUMMY_FRAME" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_DUMMY_FRAME) #define PUSH_DUMMY_FRAME (gdbarch_push_dummy_frame (current_gdbarch)) @@ -1272,9 +978,6 @@ extern void set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_push_ 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" -#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)) @@ -1284,9 +987,6 @@ extern void set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch_pu typedef void (gdbarch_pop_frame_ftype) (void); extern void gdbarch_pop_frame (struct gdbarch *gdbarch); extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ftype *pop_frame); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POP_FRAME) -#error "Non multi-arch definition of POP_FRAME" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POP_FRAME) #define POP_FRAME (gdbarch_pop_frame (current_gdbarch)) @@ -1303,9 +1003,6 @@ extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ft typedef CORE_ADDR (gdbarch_d10v_make_daddr_ftype) (CORE_ADDR x); extern CORE_ADDR gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x); extern void set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, gdbarch_d10v_make_daddr_ftype *d10v_make_daddr); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (D10V_MAKE_DADDR) -#error "Non multi-arch definition of D10V_MAKE_DADDR" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_MAKE_DADDR) #define D10V_MAKE_DADDR(x) (gdbarch_d10v_make_daddr (current_gdbarch, x)) @@ -1320,9 +1017,6 @@ extern void set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, gdbarch_d10v_m typedef CORE_ADDR (gdbarch_d10v_make_iaddr_ftype) (CORE_ADDR x); extern CORE_ADDR gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x); extern void set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (D10V_MAKE_IADDR) -#error "Non multi-arch definition of D10V_MAKE_IADDR" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_MAKE_IADDR) #define D10V_MAKE_IADDR(x) (gdbarch_d10v_make_iaddr (current_gdbarch, x)) @@ -1337,9 +1031,6 @@ extern void set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, gdbarch_d10v_m typedef int (gdbarch_d10v_daddr_p_ftype) (CORE_ADDR x); extern int gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x); extern void set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, gdbarch_d10v_daddr_p_ftype *d10v_daddr_p); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (D10V_DADDR_P) -#error "Non multi-arch definition of D10V_DADDR_P" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_DADDR_P) #define D10V_DADDR_P(x) (gdbarch_d10v_daddr_p (current_gdbarch, x)) @@ -1354,9 +1045,6 @@ extern void set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, gdbarch_d10v_dadd typedef int (gdbarch_d10v_iaddr_p_ftype) (CORE_ADDR x); extern int gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x); extern void set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (D10V_IADDR_P) -#error "Non multi-arch definition of D10V_IADDR_P" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_IADDR_P) #define D10V_IADDR_P(x) (gdbarch_d10v_iaddr_p (current_gdbarch, x)) @@ -1371,9 +1059,6 @@ extern void set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, gdbarch_d10v_iadd typedef CORE_ADDR (gdbarch_d10v_convert_daddr_to_raw_ftype) (CORE_ADDR x); extern CORE_ADDR gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x); extern void set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (D10V_CONVERT_DADDR_TO_RAW) -#error "Non multi-arch definition of D10V_CONVERT_DADDR_TO_RAW" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_CONVERT_DADDR_TO_RAW) #define D10V_CONVERT_DADDR_TO_RAW(x) (gdbarch_d10v_convert_daddr_to_raw (current_gdbarch, x)) @@ -1388,9 +1073,6 @@ extern void set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, gdba typedef CORE_ADDR (gdbarch_d10v_convert_iaddr_to_raw_ftype) (CORE_ADDR x); extern CORE_ADDR gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x); extern void set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (D10V_CONVERT_IADDR_TO_RAW) -#error "Non multi-arch definition of D10V_CONVERT_IADDR_TO_RAW" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (D10V_CONVERT_IADDR_TO_RAW) #define D10V_CONVERT_IADDR_TO_RAW(x) (gdbarch_d10v_convert_iaddr_to_raw (current_gdbarch, x)) @@ -1400,9 +1082,6 @@ extern void set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, gdba typedef void (gdbarch_store_struct_return_ftype) (CORE_ADDR addr, CORE_ADDR sp); extern void gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp); extern void set_gdbarch_store_struct_return (struct gdbarch *gdbarch, gdbarch_store_struct_return_ftype *store_struct_return); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_STRUCT_RETURN) -#error "Non multi-arch definition of STORE_STRUCT_RETURN" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_STRUCT_RETURN) #define STORE_STRUCT_RETURN(addr, sp) (gdbarch_store_struct_return (current_gdbarch, addr, sp)) @@ -1412,46 +1091,15 @@ extern void set_gdbarch_store_struct_return (struct gdbarch *gdbarch, gdbarch_st typedef void (gdbarch_store_return_value_ftype) (struct type *type, char *valbuf); extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf); extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_RETURN_VALUE) -#error "Non multi-arch definition of STORE_RETURN_VALUE" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_RETURN_VALUE) #define STORE_RETURN_VALUE(type, valbuf) (gdbarch_store_return_value (current_gdbarch, type, valbuf)) #endif #endif -#if defined (EXTRACT_STRUCT_VALUE_ADDRESS) -/* Legacy for systems yet to multi-arch EXTRACT_STRUCT_VALUE_ADDRESS */ -#if !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P) -#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (1) -#endif -#endif - -/* Default predicate for non- multi-arch targets. */ -#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P) -#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (0) -#endif - -extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS_P) -#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS" -#endif -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P) -#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_extract_struct_value_address_p (current_gdbarch)) -#endif - -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS) -#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0) -#endif - typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (char *regbuf); extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf); extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS) -#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS) #define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_extract_struct_value_address (current_gdbarch, regbuf)) @@ -1461,9 +1109,6 @@ extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, g typedef int (gdbarch_use_struct_convention_ftype) (int gcc_p, struct type *value_type); extern int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type); extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (USE_STRUCT_CONVENTION) -#error "Non multi-arch definition of USE_STRUCT_CONVENTION" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (USE_STRUCT_CONVENTION) #define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type)) @@ -1473,9 +1118,6 @@ extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_ typedef void (gdbarch_frame_init_saved_regs_ftype) (struct frame_info *frame); extern void gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame); extern void set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_INIT_SAVED_REGS) -#error "Non multi-arch definition of FRAME_INIT_SAVED_REGS" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_INIT_SAVED_REGS) #define FRAME_INIT_SAVED_REGS(frame) (gdbarch_frame_init_saved_regs (current_gdbarch, frame)) @@ -1485,9 +1127,6 @@ extern void set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_ typedef void (gdbarch_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame); extern void gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame); extern void set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_init_extra_frame_info_ftype *init_extra_frame_info); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_EXTRA_FRAME_INFO) -#error "Non multi-arch definition of INIT_EXTRA_FRAME_INFO" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_EXTRA_FRAME_INFO) #define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (gdbarch_init_extra_frame_info (current_gdbarch, fromleaf, frame)) @@ -1497,9 +1136,6 @@ extern void set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_ typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip); extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip); extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_PROLOGUE) -#error "Non multi-arch definition of SKIP_PROLOGUE" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SKIP_PROLOGUE) #define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip)) @@ -1514,9 +1150,6 @@ extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_pro typedef int (gdbarch_prologue_frameless_p_ftype) (CORE_ADDR ip); extern int gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip); extern void set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, gdbarch_prologue_frameless_p_ftype *prologue_frameless_p); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PROLOGUE_FRAMELESS_P) -#error "Non multi-arch definition of PROLOGUE_FRAMELESS_P" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PROLOGUE_FRAMELESS_P) #define PROLOGUE_FRAMELESS_P(ip) (gdbarch_prologue_frameless_p (current_gdbarch, ip)) @@ -1526,9 +1159,6 @@ extern void set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, gdbarch_p typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs); extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs); extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INNER_THAN) -#error "Non multi-arch definition of INNER_THAN" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INNER_THAN) #define INNER_THAN(lhs, rhs) (gdbarch_inner_than (current_gdbarch, lhs, rhs)) @@ -1543,9 +1173,6 @@ extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ typedef unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr); extern unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr); extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BREAKPOINT_FROM_PC) -#error "Non multi-arch definition of BREAKPOINT_FROM_PC" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (BREAKPOINT_FROM_PC) #define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr)) @@ -1560,9 +1187,6 @@ extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_bre typedef int (gdbarch_memory_insert_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache); extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache); extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_INSERT_BREAKPOINT) -#error "Non multi-arch definition of MEMORY_INSERT_BREAKPOINT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_INSERT_BREAKPOINT) #define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (gdbarch_memory_insert_breakpoint (current_gdbarch, addr, contents_cache)) @@ -1577,9 +1201,6 @@ extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbar typedef int (gdbarch_memory_remove_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache); extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache); extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MEMORY_REMOVE_BREAKPOINT) -#error "Non multi-arch definition of MEMORY_REMOVE_BREAKPOINT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MEMORY_REMOVE_BREAKPOINT) #define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (gdbarch_memory_remove_breakpoint (current_gdbarch, addr, contents_cache)) @@ -1588,9 +1209,6 @@ extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbar extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch); extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DECR_PC_AFTER_BREAK) -#error "Non multi-arch definition of DECR_PC_AFTER_BREAK" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DECR_PC_AFTER_BREAK) #define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch)) @@ -1605,9 +1223,6 @@ extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR typedef int (gdbarch_prepare_to_proceed_ftype) (int select_it); extern int gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it); extern void set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, gdbarch_prepare_to_proceed_ftype *prepare_to_proceed); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PREPARE_TO_PROCEED) -#error "Non multi-arch definition of PREPARE_TO_PROCEED" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PREPARE_TO_PROCEED) #define PREPARE_TO_PROCEED(select_it) (gdbarch_prepare_to_proceed (current_gdbarch, select_it)) @@ -1616,9 +1231,6 @@ extern void set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, gdbarch_pre extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch); extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FUNCTION_START_OFFSET) -#error "Non multi-arch definition of FUNCTION_START_OFFSET" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FUNCTION_START_OFFSET) #define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch)) @@ -1633,9 +1245,6 @@ extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADD typedef void (gdbarch_remote_translate_xfer_address_ftype) (CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len); extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len); extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REMOTE_TRANSLATE_XFER_ADDRESS) -#error "Non multi-arch definition of REMOTE_TRANSLATE_XFER_ADDRESS" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REMOTE_TRANSLATE_XFER_ADDRESS) #define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (gdbarch_remote_translate_xfer_address (current_gdbarch, gdb_addr, gdb_len, rem_addr, rem_len)) @@ -1644,9 +1253,6 @@ extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch); extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_SKIP) -#error "Non multi-arch definition of FRAME_ARGS_SKIP" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_SKIP) #define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch)) @@ -1661,9 +1267,6 @@ extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR fram typedef int (gdbarch_frameless_function_invocation_ftype) (struct frame_info *fi); extern int gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi); extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAMELESS_FUNCTION_INVOCATION) -#error "Non multi-arch definition of FRAMELESS_FUNCTION_INVOCATION" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAMELESS_FUNCTION_INVOCATION) #define FRAMELESS_FUNCTION_INVOCATION(fi) (gdbarch_frameless_function_invocation (current_gdbarch, fi)) @@ -1673,9 +1276,6 @@ extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, typedef CORE_ADDR (gdbarch_frame_chain_ftype) (struct frame_info *frame); extern CORE_ADDR gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame); extern void set_gdbarch_frame_chain (struct gdbarch *gdbarch, gdbarch_frame_chain_ftype *frame_chain); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN) -#error "Non multi-arch definition of FRAME_CHAIN" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN) #define FRAME_CHAIN(frame) (gdbarch_frame_chain (current_gdbarch, frame)) @@ -1685,9 +1285,6 @@ extern void set_gdbarch_frame_chain (struct gdbarch *gdbarch, gdbarch_frame_chai typedef int (gdbarch_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe); extern int gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe); extern void set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_frame_chain_valid_ftype *frame_chain_valid); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_CHAIN_VALID) -#error "Non multi-arch definition of FRAME_CHAIN_VALID" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_CHAIN_VALID) #define FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_frame_chain_valid (current_gdbarch, chain, thisframe)) @@ -1697,9 +1294,6 @@ extern void set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_fram typedef CORE_ADDR (gdbarch_frame_saved_pc_ftype) (struct frame_info *fi); extern CORE_ADDR gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi); extern void set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_frame_saved_pc_ftype *frame_saved_pc); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_SAVED_PC) -#error "Non multi-arch definition of FRAME_SAVED_PC" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_SAVED_PC) #define FRAME_SAVED_PC(fi) (gdbarch_frame_saved_pc (current_gdbarch, fi)) @@ -1709,9 +1303,6 @@ extern void set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_frame_s typedef CORE_ADDR (gdbarch_frame_args_address_ftype) (struct frame_info *fi); extern CORE_ADDR gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi); extern void set_gdbarch_frame_args_address (struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_ARGS_ADDRESS) -#error "Non multi-arch definition of FRAME_ARGS_ADDRESS" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_ARGS_ADDRESS) #define FRAME_ARGS_ADDRESS(fi) (gdbarch_frame_args_address (current_gdbarch, fi)) @@ -1721,9 +1312,6 @@ extern void set_gdbarch_frame_args_address (struct gdbarch *gdbarch, gdbarch_fra typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) (struct frame_info *fi); extern CORE_ADDR gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi); extern void set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_LOCALS_ADDRESS) -#error "Non multi-arch definition of FRAME_LOCALS_ADDRESS" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_LOCALS_ADDRESS) #define FRAME_LOCALS_ADDRESS(fi) (gdbarch_frame_locals_address (current_gdbarch, fi)) @@ -1733,9 +1321,6 @@ extern void set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, gdbarch_f typedef CORE_ADDR (gdbarch_saved_pc_after_call_ftype) (struct frame_info *frame); extern CORE_ADDR gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame); extern void set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch_saved_pc_after_call_ftype *saved_pc_after_call); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVED_PC_AFTER_CALL) -#error "Non multi-arch definition of SAVED_PC_AFTER_CALL" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVED_PC_AFTER_CALL) #define SAVED_PC_AFTER_CALL(frame) (gdbarch_saved_pc_after_call (current_gdbarch, frame)) @@ -1745,9 +1330,6 @@ extern void set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch_sa typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame); extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame); extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS) -#error "Non multi-arch definition of FRAME_NUM_ARGS" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_NUM_ARGS) #define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame)) @@ -1767,9 +1349,6 @@ extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_n #endif extern int gdbarch_stack_align_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN_P) -#error "Non multi-arch definition of STACK_ALIGN" -#endif #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN_P) #define STACK_ALIGN_P() (gdbarch_stack_align_p (current_gdbarch)) #endif @@ -1782,9 +1361,6 @@ extern int gdbarch_stack_align_p (struct gdbarch *gdbarch); typedef CORE_ADDR (gdbarch_stack_align_ftype) (CORE_ADDR sp); extern CORE_ADDR gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp); extern void set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch_stack_align_ftype *stack_align); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN) -#error "Non multi-arch definition of STACK_ALIGN" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN) #define STACK_ALIGN(sp) (gdbarch_stack_align (current_gdbarch, sp)) @@ -1798,9 +1374,6 @@ extern void set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch_stack_alig extern int gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch); extern void set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch, int extra_stack_alignment_needed); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRA_STACK_ALIGNMENT_NEEDED) -#error "Non multi-arch definition of EXTRA_STACK_ALIGNMENT_NEEDED" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRA_STACK_ALIGNMENT_NEEDED) #define EXTRA_STACK_ALIGNMENT_NEEDED (gdbarch_extra_stack_alignment_needed (current_gdbarch)) @@ -1820,9 +1393,6 @@ extern void set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch, i #endif extern int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR_P) -#error "Non multi-arch definition of REG_STRUCT_HAS_ADDR" -#endif #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR_P) #define REG_STRUCT_HAS_ADDR_P() (gdbarch_reg_struct_has_addr_p (current_gdbarch)) #endif @@ -1835,9 +1405,6 @@ extern int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch); typedef int (gdbarch_reg_struct_has_addr_ftype) (int gcc_p, struct type *type); extern int gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type); extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR) -#error "Non multi-arch definition of REG_STRUCT_HAS_ADDR" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR) #define REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_reg_struct_has_addr (current_gdbarch, gcc_p, type)) @@ -1857,9 +1424,6 @@ extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_re #endif extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS_P) -#error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS" -#endif #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS_P) #define SAVE_DUMMY_FRAME_TOS_P() (gdbarch_save_dummy_frame_tos_p (current_gdbarch)) #endif @@ -1872,9 +1436,6 @@ extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch); typedef void (gdbarch_save_dummy_frame_tos_ftype) (CORE_ADDR sp); extern void gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp); extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SAVE_DUMMY_FRAME_TOS) -#error "Non multi-arch definition of SAVE_DUMMY_FRAME_TOS" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SAVE_DUMMY_FRAME_TOS) #define SAVE_DUMMY_FRAME_TOS(sp) (gdbarch_save_dummy_frame_tos (current_gdbarch, sp)) @@ -1883,9 +1444,6 @@ extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_s extern int gdbarch_parm_boundary (struct gdbarch *gdbarch); extern void set_gdbarch_parm_boundary (struct gdbarch *gdbarch, int parm_boundary); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PARM_BOUNDARY) -#error "Non multi-arch definition of PARM_BOUNDARY" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PARM_BOUNDARY) #define PARM_BOUNDARY (gdbarch_parm_boundary (current_gdbarch)) @@ -1899,9 +1457,6 @@ extern void set_gdbarch_parm_boundary (struct gdbarch *gdbarch, int parm_boundar extern const struct floatformat * gdbarch_float_format (struct gdbarch *gdbarch); extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat * float_format); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_FORMAT) -#error "Non multi-arch definition of TARGET_FLOAT_FORMAT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_FLOAT_FORMAT) #define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch)) @@ -1915,9 +1470,6 @@ extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floa extern const struct floatformat * gdbarch_double_format (struct gdbarch *gdbarch); extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat * double_format); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_FORMAT) -#error "Non multi-arch definition of TARGET_DOUBLE_FORMAT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_DOUBLE_FORMAT) #define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch)) @@ -1931,9 +1483,6 @@ extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct flo extern const struct floatformat * gdbarch_long_double_format (struct gdbarch *gdbarch); extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat * long_double_format); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_FORMAT) -#error "Non multi-arch definition of TARGET_LONG_DOUBLE_FORMAT" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_LONG_DOUBLE_FORMAT) #define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch)) @@ -1942,48 +1491,18 @@ extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struc /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (CONVERT_FROM_FUNC_PTR_ADDR) -#define CONVERT_FROM_FUNC_PTR_ADDR(addr) (core_addr_identity (addr)) +#define CONVERT_FROM_FUNC_PTR_ADDR(addr) (default_convert_from_func_ptr_addr (addr)) #endif typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype) (CORE_ADDR addr); extern CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr); extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_FROM_FUNC_PTR_ADDR) -#error "Non multi-arch definition of CONVERT_FROM_FUNC_PTR_ADDR" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_FROM_FUNC_PTR_ADDR) #define CONVERT_FROM_FUNC_PTR_ADDR(addr) (gdbarch_convert_from_func_ptr_addr (current_gdbarch, addr)) #endif #endif -/* On some machines there are bits in addresses which are not really - part of the address, but are used by the kernel, the hardware, etc. - for special purposes. ADDR_BITS_REMOVE takes out any such bits so - we get a "real" address such as one would find in a symbol table. - This is used only for addresses of instructions, and even then I'm - not sure it's used in all contexts. It exists to deal with there - being a few stray bits in the PC which would mislead us, not as some - sort of generic thing to handle alignment or segmentation (it's - possible it should be in TARGET_READ_PC instead). */ - -/* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (ADDR_BITS_REMOVE) -#define ADDR_BITS_REMOVE(addr) (core_addr_identity (addr)) -#endif - -typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (CORE_ADDR addr); -extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr); -extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDR_BITS_REMOVE) -#error "Non multi-arch definition of ADDR_BITS_REMOVE" -#endif -#if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDR_BITS_REMOVE) -#define ADDR_BITS_REMOVE(addr) (gdbarch_addr_bits_remove (current_gdbarch, addr)) -#endif -#endif - /* FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if the target needs software single step. An ISA method to implement it. @@ -2006,9 +1525,6 @@ extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_ #endif extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP_P) -#error "Non multi-arch definition of SOFTWARE_SINGLE_STEP" -#endif #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP_P) #define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch)) #endif @@ -2021,9 +1537,6 @@ extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch); typedef void (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p); extern void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p); extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP) -#error "Non multi-arch definition of SOFTWARE_SINGLE_STEP" -#endif #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP) #define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p)) @@ -2094,6 +1607,9 @@ struct gdbarch_list struct gdbarch_info { + /* Use default: bfd_arch_unknown (ZERO). */ + enum bfd_architecture bfd_architecture; + /* Use default: NULL (ZERO). */ const struct bfd_arch_info *bfd_arch_info; @@ -2147,12 +1663,16 @@ extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gd extern void gdbarch_free (struct gdbarch *); -/* Helper function. Force an update of the current architecture. +/* Helper function. Force an update of the current architecture. Used + by legacy targets that have added their own target specific + architecture manipulation commands. - The actual architecture selected is determined by INFO, ``(gdb) set - architecture'' et.al., the existing architecture and BFD's default - architecture. INFO should be initialized to zero and then selected - fields should be updated. + The INFO parameter shall be fully initialized (``memset (&INFO, + sizeof (info), 0)'' set relevant fields) before gdbarch_update_p() + is called. gdbarch_update_p() shall initialize any ``default'' + fields using information obtained from the previous architecture or + INFO.ABFD (if specified) before calling the corresponding + architectures INIT function. Returns non-zero if the update succeeds */ @@ -2299,6 +1819,17 @@ extern disassemble_info tm_print_insn_info; #define GDB_TARGET_IS_D10V (TARGET_ARCHITECTURE->arch == bfd_arch_d10v) +/* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */ +#ifndef EXTRACT_STRUCT_VALUE_ADDRESS +#define EXTRACT_STRUCT_VALUE_ADDRESS_P (0) +#define EXTRACT_STRUCT_VALUE_ADDRESS(X) (internal_error (__FILE__, __LINE__, "gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0) +#else +#ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P +#define EXTRACT_STRUCT_VALUE_ADDRESS_P (1) +#endif +#endif + + /* Set the dynamic target-system-dependent parameters (architecture, byte-order, ...) using information found in the BFD */ @@ -2310,10 +1841,6 @@ extern void set_gdbarch_from_file (bfd *); extern void initialize_current_architecture (void); -/* For non-multiarched targets, do any initialization of the default - gdbarch object necessary after the _initialize_MODULE functions - have run. */ -extern void initialize_non_multiarch (); /* gdbarch trace variable */ extern int gdbarch_debug; diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index fa206104da3..ed7b878be07 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -85,7 +85,7 @@ EOF case "${invalid_p}" in 0 ) valid_p=1 ;; "" ) - if [ -n "${predefault}" ] + if [ "${predefault}" ] then #invalid_p="gdbarch->${function} == ${predefault}" valid_p="gdbarch->${function} != ${predefault}" @@ -104,10 +104,10 @@ EOF # always a valid definition of MEMBER as this again # ensures consistency. - if [ -n "${postdefault}" ] + if [ "${postdefault}" != "" ] then fallbackdefault="${postdefault}" - elif [ -n "${predefault}" ] + elif [ "${predefault}" != "" ] then fallbackdefault="${predefault}" else @@ -120,7 +120,7 @@ EOF break fi done - if [ -n "${class}" ] + if [ "${class}" ] then true else @@ -131,8 +131,8 @@ EOF fallback_default_p () { - [ -n "${postdefault}" -a "x${invalid_p}" != "x0" ] \ - || [ -n "${predefault}" -a "x${invalid_p}" = "x0" ] + [ "${postdefault}" != "" -a "${invalid_p}" != "0" ] \ + || [ "${predefault}" != "" -a "${invalid_p}" = "0" ] } class_is_variable_p () @@ -248,19 +248,17 @@ do predefault ) : ;; - # An initial value to assign to MEMBER of the freshly - # malloc()ed gdbarch object. After initialization, the - # freshly malloc()ed object is passed to the target - # architecture code for further updates. + # A initial value to assign to MEMBER of the freshly + # malloc()ed gdbarch object. After the gdbarch object has + # been initialized using PREDEFAULT, it is passed to the + # target code for further updates. # If PREDEFAULT is empty, zero is used. - # A non-empty PREDEFAULT, an empty POSTDEFAULT and a zero - # INVALID_P are specified, PREDEFAULT will be used as the - # default for the non- multi-arch target. - - # A zero PREDEFAULT function will force the fallback to call - # internal_error(). + # When POSTDEFAULT is empty, a non-empty PREDEFAULT and a zero + # INVALID_P will be used as default values when when + # multi-arch is disabled. Specify a zero PREDEFAULT function + # to make that fallback call internal_error(). # Variable declarations can refer to ``gdbarch'' which will # contain the current architecture. Care should be taken. @@ -268,8 +266,9 @@ do postdefault ) : ;; # A value to assign to MEMBER of the new gdbarch object should - # the target architecture code fail to change the PREDEFAULT - # value. + # the target code fail to change the PREDEFAULT value. Also + # use POSTDEFAULT as the fallback value for the non- + # multi-arch case. # If POSTDEFAULT is empty, no post update is performed. @@ -277,11 +276,6 @@ do # INVALID_P will be used to determine if MEMBER should be # changed to POSTDEFAULT. - # If a non-empty POSTDEFAULT and a zero INVALID_P are - # specified, POSTDEFAULT will be used as the default for the - # non- multi-arch target (regardless of the value of - # PREDEFAULT). - # You cannot specify both a zero INVALID_P and a POSTDEFAULT. # Variable declarations can refer to ``gdbarch'' which will @@ -429,8 +423,6 @@ f:2:DO_REGISTERS_INFO:void:do_registers_info:int reg_nr, int fpregs:reg_nr, fpre # also include/...-sim.h. f:2:REGISTER_SIM_REGNO:int:register_sim_regno:int reg_nr:reg_nr:::default_register_sim_regno::0 F:2:REGISTER_BYTES_OK:int:register_bytes_ok:long nr_bytes:nr_bytes::0:0 -f:2:CANNOT_FETCH_REGISTER:int:cannot_fetch_register:int regnum:regnum:::cannot_register_not::0 -f:2:CANNOT_STORE_REGISTER:int:cannot_store_register:int regnum:regnum:::cannot_register_not::0 # v:1:USE_GENERIC_DUMMY_FRAMES:int:use_generic_dummy_frames::::0:-1 v:2:CALL_DUMMY_LOCATION:int:call_dummy_location::::0:0 @@ -446,8 +438,6 @@ v:2:SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_ v:1:CALL_DUMMY_STACK_ADJUST_P:int:call_dummy_stack_adjust_p::::0:-1:::0x%08lx v:2:CALL_DUMMY_STACK_ADJUST:int:call_dummy_stack_adjust::::0:::gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0:0x%08lx::CALL_DUMMY_STACK_ADJUST_P 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:INIT_FRAME_PC_FIRST:void:init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_noop::0 -f:2:INIT_FRAME_PC:void:init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_default::0 # v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion::::::: v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type::::::: @@ -486,7 +476,7 @@ f:2:D10V_CONVERT_IADDR_TO_RAW:CORE_ADDR:d10v_convert_iaddr_to_raw:CORE_ADDR x:x: # f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0 f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, char *valbuf:type, valbuf:::0 -F:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:char *regbuf:regbuf:::0 +f:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:char *regbuf:regbuf:::0 f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::0 # f:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame::0:0 @@ -523,17 +513,7 @@ v:2:PARM_BOUNDARY:int:parm_boundary v:2:TARGET_FLOAT_FORMAT:const struct floatformat *:float_format::::::default_float_format (gdbarch) v:2:TARGET_DOUBLE_FORMAT:const struct floatformat *:double_format::::::default_double_format (gdbarch) v:2:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat *:long_double_format::::::&floatformat_unknown -f:2:CONVERT_FROM_FUNC_PTR_ADDR:CORE_ADDR:convert_from_func_ptr_addr:CORE_ADDR addr:addr:::core_addr_identity::0 -# On some machines there are bits in addresses which are not really -# part of the address, but are used by the kernel, the hardware, etc. -# for special purposes. ADDR_BITS_REMOVE takes out any such bits so -# we get a "real" address such as one would find in a symbol table. -# This is used only for addresses of instructions, and even then I'm -# not sure it's used in all contexts. It exists to deal with there -# being a few stray bits in the PC which would mislead us, not as some -# sort of generic thing to handle alignment or segmentation (it's -# possible it should be in TARGET_READ_PC instead). -f:2:ADDR_BITS_REMOVE:CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr:::core_addr_identity::0 +f:2:CONVERT_FROM_FUNC_PTR_ADDR:CORE_ADDR:convert_from_func_ptr_addr:CORE_ADDR addr:addr:::default_convert_from_func_ptr_addr::0 # FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if # the target needs software single step. An ISA method to implement it. # @@ -569,7 +549,7 @@ EOF kill $$ exit 1 fi - if [ "x${invalid_p}" = "x0" -a -n "${postdefault}" ] + if [ "${invalid_p}" = "0" -a "${postdefault}" != "" ] then echo "Error: postdefault is useless when invalid_p=0" 1>&2 kill $$ @@ -653,10 +633,6 @@ extern struct gdbarch *current_gdbarch; #error "FRAME_FIND_SAVED_REGS: replaced by FRAME_INIT_SAVED_REGS" #endif #endif - -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE) -#error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file." -#endif EOF # function typedef's @@ -670,9 +646,6 @@ do printf "\n" printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n" printf "/* set_gdbarch_${function}() - not applicable - pre-initialized. */\n" - printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (${macro})\n" - printf "#error \"Non multi-arch definition of ${macro}\"\n" - printf "#endif\n" printf "#if GDB_MULTI_ARCH\n" printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (${macro})\n" printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n" @@ -687,7 +660,7 @@ printf "\n" printf "/* The following are initialized by the target dependent code. */\n" function_list | while do_read do - if [ -n "${comment}" ] + if [ "${comment}" ] then echo "${comment}" | sed \ -e '2 s,#,/*,' \ @@ -719,9 +692,6 @@ do printf "#endif\n" printf "\n" printf "extern int gdbarch_${function}_p (struct gdbarch *gdbarch);\n" - printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (${macro}_P)\n" - printf "#error \"Non multi-arch definition of ${macro}\"\n" - printf "#endif\n" printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (${macro}_P)\n" printf "#define ${macro}_P() (gdbarch_${function}_p (current_gdbarch))\n" printf "#endif\n" @@ -741,9 +711,6 @@ do printf "\n" printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n" printf "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, ${returntype} ${function});\n" - printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (${macro})\n" - printf "#error \"Non multi-arch definition of ${macro}\"\n" - printf "#endif\n" printf "#if GDB_MULTI_ARCH\n" printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (${macro})\n" printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n" @@ -758,7 +725,7 @@ do printf "\n" printf "/* Default (function) for non- multi-arch platforms. */\n" printf "#if (!GDB_MULTI_ARCH) && !defined (${macro})\n" - if [ "x${fallbackdefault}" = "x0" ] + if [ "${fallbackdefault}" = "0" ] then printf "#define ${macro}(${actual}) (internal_error (__FILE__, __LINE__, \"${macro}\"), 0)\n" else @@ -769,7 +736,7 @@ do printf "#endif\n" fi printf "\n" - if [ "x${formal}" = "xvoid" ] && class_is_multiarch_p + if [ "${formal}" = "void" ] && class_is_multiarch_p then printf "typedef ${returntype} (gdbarch_${function}_ftype) (struct gdbarch *gdbarch);\n" elif class_is_multiarch_p @@ -778,7 +745,7 @@ do else printf "typedef ${returntype} (gdbarch_${function}_ftype) (${formal});\n" fi - if [ "x${formal}" = "xvoid" ] + if [ "${formal}" = "void" ] then printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n" else @@ -787,15 +754,12 @@ do printf "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, gdbarch_${function}_ftype *${function});\n" if class_is_multiarch_p ; then : else - printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (${macro})\n" - printf "#error \"Non multi-arch definition of ${macro}\"\n" - printf "#endif\n" printf "#if GDB_MULTI_ARCH\n" printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (${macro})\n" - if [ "x${actual}" = "x" ] + if [ "${actual}" = "" ] then printf "#define ${macro}() (gdbarch_${function} (current_gdbarch))\n" - elif [ "x${actual}" = "x-" ] + elif [ "${actual}" = "-" ] then printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n" else @@ -874,6 +838,9 @@ struct gdbarch_list struct gdbarch_info { + /* Use default: bfd_arch_unknown (ZERO). */ + enum bfd_architecture bfd_architecture; + /* Use default: NULL (ZERO). */ const struct bfd_arch_info *bfd_arch_info; @@ -927,12 +894,16 @@ extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gd extern void gdbarch_free (struct gdbarch *); -/* Helper function. Force an update of the current architecture. +/* Helper function. Force an update of the current architecture. Used + by legacy targets that have added their own target specific + architecture manipulation commands. - The actual architecture selected is determined by INFO, \`\`(gdb) set - architecture'' et.al., the existing architecture and BFD's default - architecture. INFO should be initialized to zero and then selected - fields should be updated. + The INFO parameter shall be fully initialized (\`\`memset (&INFO, + sizeof (info), 0)'' set relevant fields) before gdbarch_update_p() + is called. gdbarch_update_p() shall initialize any \`\`default'' + fields using information obtained from the previous architecture or + INFO.ABFD (if specified) before calling the corresponding + architectures INIT function. Returns non-zero if the update succeeds */ @@ -1079,6 +1050,17 @@ extern disassemble_info tm_print_insn_info; #define GDB_TARGET_IS_D10V (TARGET_ARCHITECTURE->arch == bfd_arch_d10v) +/* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */ +#ifndef EXTRACT_STRUCT_VALUE_ADDRESS +#define EXTRACT_STRUCT_VALUE_ADDRESS_P (0) +#define EXTRACT_STRUCT_VALUE_ADDRESS(X) (internal_error (__FILE__, __LINE__, "gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0) +#else +#ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P +#define EXTRACT_STRUCT_VALUE_ADDRESS_P (1) +#endif +#endif + + /* Set the dynamic target-system-dependent parameters (architecture, byte-order, ...) using information found in the BFD */ @@ -1090,10 +1072,6 @@ extern void set_gdbarch_from_file (bfd *); extern void initialize_current_architecture (void); -/* For non-multiarched targets, do any initialization of the default - gdbarch object necessary after the _initialize_MODULE functions - have run. */ -extern void initialize_non_multiarch (); /* gdbarch trace variable */ extern int gdbarch_debug; @@ -1275,15 +1253,6 @@ cat <${function} = ${predefault};\n" fi @@ -1377,32 +1346,32 @@ function_list | while do_read do if class_is_function_p || class_is_variable_p then - if [ "x${invalid_p}" = "x0" ] + if [ "${invalid_p}" = "0" ] then printf " /* Skip verify of ${function}, invalid_p == 0 */\n" elif class_is_predicate_p then printf " /* Skip verify of ${function}, has predicate */\n" # FIXME: See do_read for potential simplification - elif [ -n "${invalid_p}" -a -n "${postdefault}" ] + elif [ "${invalid_p}" -a "${postdefault}" ] then printf " if (${invalid_p})\n" printf " gdbarch->${function} = ${postdefault};\n" - elif [ -n "${predefault}" -a -n "${postdefault}" ] + elif [ "${predefault}" -a "${postdefault}" ] then printf " if (gdbarch->${function} == ${predefault})\n" printf " gdbarch->${function} = ${postdefault};\n" - elif [ -n "${postdefault}" ] + elif [ "${postdefault}" ] then printf " if (gdbarch->${function} == 0)\n" printf " gdbarch->${function} = ${postdefault};\n" - elif [ -n "${invalid_p}" ] + elif [ "${invalid_p}" ] then printf " if ((GDB_MULTI_ARCH >= ${level})\n" printf " && (${invalid_p}))\n" printf " internal_error (__FILE__, __LINE__,\n" printf " \"gdbarch: verify_gdbarch: ${function} invalid\");\n" - elif [ -n "${predefault}" ] + elif [ "${predefault}" ] then printf " if ((GDB_MULTI_ARCH >= ${level})\n" printf " && (gdbarch->${function} == ${predefault}))\n" @@ -1438,7 +1407,7 @@ function_list | while do_read do # multiarch functions don't have macros. class_is_multiarch_p && continue - if [ "x${returntype}" = "xvoid" ] + if [ "${returntype}" = "void" ] then printf "#if defined (${macro}) && GDB_MULTI_ARCH\n" printf " /* Macro might contain \`[{}]' when not multi-arch */\n" @@ -1469,13 +1438,13 @@ do continue fi printf "#ifdef ${macro}\n" - if [ "x${print_p}" = "x()" ] + if [ "${print_p}" = "()" ] then printf " gdbarch_dump_${function} (current_gdbarch);\n" - elif [ "x${print_p}" = "x0" ] + elif [ "${print_p}" = "0" ] then printf " /* skip print of ${macro}, print_p == 0. */\n" - elif [ -n "${print_p}" ] + elif [ "${print_p}" ] then printf " if (${print_p})\n" printf " fprintf_unfiltered (file,\n" @@ -1522,7 +1491,7 @@ do printf "int\n" printf "gdbarch_${function}_p (struct gdbarch *gdbarch)\n" printf "{\n" - if [ -n "${valid_p}" ] + if [ "${valid_p}" ] then printf " return ${valid_p};\n" else @@ -1534,7 +1503,7 @@ do then printf "\n" printf "${returntype}\n" - if [ "x${formal}" = "xvoid" ] + if [ "${formal}" = "void" ] then printf "gdbarch_${function} (struct gdbarch *gdbarch)\n" else @@ -1546,7 +1515,7 @@ do printf " \"gdbarch: gdbarch_${function} invalid\");\n" printf " if (gdbarch_debug >= 2)\n" printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n" - if [ "x${actual}" = "x-" -o "x${actual}" = "x" ] + if [ "${actual}" = "-" -o "${actual}" = "" ] then if class_is_multiarch_p then @@ -1562,7 +1531,7 @@ do params="${actual}" fi fi - if [ "x${returntype}" = "xvoid" ] + if [ "${returntype}" = "void" ] then printf " gdbarch->${function} (${params});\n" else @@ -1582,15 +1551,15 @@ do printf "${returntype}\n" printf "gdbarch_${function} (struct gdbarch *gdbarch)\n" printf "{\n" - if [ "x${invalid_p}" = "x0" ] + if [ "${invalid_p}" = "0" ] then printf " /* Skip verify of ${function}, invalid_p == 0 */\n" - elif [ -n "${invalid_p}" ] + elif [ "${invalid_p}" ] then printf " if (${invalid_p})\n" printf " internal_error (__FILE__, __LINE__,\n" printf " \"gdbarch: gdbarch_${function} invalid\");\n" - elif [ -n "${predefault}" ] + elif [ "${predefault}" ] then printf " if (gdbarch->${function} == ${predefault})\n" printf " internal_error (__FILE__, __LINE__,\n" @@ -1976,72 +1945,75 @@ gdbarch_update_p (struct gdbarch_info info) struct gdbarch_list **list; struct gdbarch_registration *rego; - /* Fill in missing parts of the INFO struct using a number of - sources: \`\`set ...''; INFOabfd supplied; existing target. */ - - /* \`\`(gdb) set architecture ...'' */ - if (info.bfd_arch_info == NULL - && !TARGET_ARCHITECTURE_AUTO) - info.bfd_arch_info = TARGET_ARCHITECTURE; - if (info.bfd_arch_info == NULL - && info.abfd != NULL - && bfd_get_arch (info.abfd) != bfd_arch_unknown - && bfd_get_arch (info.abfd) != bfd_arch_obscure) - info.bfd_arch_info = bfd_get_arch_info (info.abfd); + /* Fill in any missing bits. Most important is the bfd_architecture + which is used to select the target architecture. */ + if (info.bfd_architecture == bfd_arch_unknown) + { + if (info.bfd_arch_info != NULL) + info.bfd_architecture = info.bfd_arch_info->arch; + else if (info.abfd != NULL) + info.bfd_architecture = bfd_get_arch (info.abfd); + /* FIXME - should query BFD for its default architecture. */ + else + info.bfd_architecture = current_gdbarch->bfd_arch_info->arch; + } if (info.bfd_arch_info == NULL) - info.bfd_arch_info = TARGET_ARCHITECTURE; - - /* \`\`(gdb) set byte-order ...'' */ - if (info.byte_order == 0 - && !TARGET_BYTE_ORDER_AUTO) - info.byte_order = TARGET_BYTE_ORDER; - /* From the INFO struct. */ - if (info.byte_order == 0 - && info.abfd != NULL) - info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN - : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN - : 0); - /* From the current target. */ + { + if (target_architecture_auto && info.abfd != NULL) + info.bfd_arch_info = bfd_get_arch_info (info.abfd); + else + info.bfd_arch_info = current_gdbarch->bfd_arch_info; + } if (info.byte_order == 0) - info.byte_order = TARGET_BYTE_ORDER; + { + if (target_byte_order_auto && info.abfd != NULL) + info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN + : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN + : 0); + else + info.byte_order = current_gdbarch->byte_order; + /* FIXME - should query BFD for its default byte-order. */ + } + /* A default for abfd? */ - /* Must have found some sort of architecture. */ - gdb_assert (info.bfd_arch_info != NULL); + /* Find the target that knows about this architecture. */ + for (rego = gdbarch_registry; + rego != NULL; + rego = rego->next) + if (rego->bfd_architecture == info.bfd_architecture) + break; + if (rego == NULL) + { + if (gdbarch_debug) + fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\\n"); + return 0; + } if (gdbarch_debug) { fprintf_unfiltered (gdb_stdlog, - "gdbarch_update: info.bfd_arch_info %s\n", + "gdbarch_update: info.bfd_architecture %d (%s)\\n", + info.bfd_architecture, + bfd_lookup_arch (info.bfd_architecture, 0)->printable_name); + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: info.bfd_arch_info %s\\n", (info.bfd_arch_info != NULL ? info.bfd_arch_info->printable_name : "(null)")); fprintf_unfiltered (gdb_stdlog, - "gdbarch_update: info.byte_order %d (%s)\n", + "gdbarch_update: info.byte_order %d (%s)\\n", info.byte_order, (info.byte_order == BIG_ENDIAN ? "big" : info.byte_order == LITTLE_ENDIAN ? "little" : "default")); fprintf_unfiltered (gdb_stdlog, - "gdbarch_update: info.abfd 0x%lx\n", + "gdbarch_update: info.abfd 0x%lx\\n", (long) info.abfd); fprintf_unfiltered (gdb_stdlog, - "gdbarch_update: info.tdep_info 0x%lx\n", + "gdbarch_update: info.tdep_info 0x%lx\\n", (long) info.tdep_info); } - /* Find the target that knows about this architecture. */ - for (rego = gdbarch_registry; - rego != NULL; - rego = rego->next) - if (rego->bfd_architecture == info.bfd_arch_info->arch) - break; - if (rego == NULL) - { - if (gdbarch_debug) - fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\\n"); - return 0; - } - /* Ask the target for a replacement architecture. */ new_gdbarch = rego->init (info, rego->arches); diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index da89b36eee1..7483a53eb4b 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -44,9 +44,6 @@ struct thread_info CORE_ADDR step_range_start; CORE_ADDR step_range_end; CORE_ADDR step_frame_address; - CORE_ADDR step_sp; - int current_line; - struct symtab *current_symtab; int trap_expected; int handling_longjmp; int another_trap; @@ -81,9 +78,6 @@ extern struct thread_info *add_thread (ptid_t ptid); /* Delete an existing thread list entry. */ extern void delete_thread (ptid_t); -/* Delete a step_resume_breakpoint from the thread database. */ -extern void delete_step_resume_breakpoint (void *); - /* Translate the integer thread id (GDB's homegrown id, not the system's) into a "pid" (which may be overloaded with extra thread information). */ extern ptid_t thread_id_to_pid (int); @@ -123,10 +117,7 @@ extern void save_infrun_state (ptid_t ptid, 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 stepping_through_sigtramp); /* infrun context switch: load the debugger state previously saved for the given thread. */ @@ -144,10 +135,7 @@ extern void load_infrun_state (ptid_t ptid, int *another_trap, int *stepping_through_solib_affter_catch, bpstat *stepping_through_solib_catchpoints, - int *stepping_through_sigtramp, - int *current_line, - struct symtab **current_symtab, - CORE_ADDR *step_sp); + int *stepping_through_sigtramp); /* Commands with a prefix of `thread'. */ extern struct cmd_list_element *thread_cmd_list; diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index f2fed5f5481..ee191cdd0bb 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -74,7 +74,6 @@ struct type *builtin_type_v8qi; struct type *builtin_type_v4hi; struct type *builtin_type_v2si; struct type *builtin_type_ptr; -struct type *builtin_type_void_func_ptr; struct type *builtin_type_CORE_ADDR; struct type *builtin_type_bfd_vma; @@ -2929,36 +2928,10 @@ build_gdbtypes (void) = init_simd_type ("__builtin_v2si", builtin_type_int32, "f", 2); /* Pointer/Address types. */ - - /* NOTE: on some targets, addresses and pointers are not necessarily - the same --- for example, on the D10V, pointers are 16 bits long, - but addresses are 32 bits long. See doc/gdbint.texinfo, - ``Pointers Are Not Always Addresses''. - - The upshot is: - - gdb's `struct type' always describes the target's - representation. - - gdb's `struct value' objects should always hold values in - target form. - - gdb's CORE_ADDR values are addresses in the unified virtual - address space that the assembler and linker work with. Thus, - since target_read_memory takes a CORE_ADDR as an argument, it - can access any memory on the target, even if the processor has - separate code and data address spaces. - - So, for example: - - If v is a value holding a D10V code pointer, its contents are - in target form: a big-endian address left-shifted two bits. - - If p is a D10V pointer type, TYPE_LENGTH (p) == 2, just as - sizeof (void *) == 2 on the target. - - In this context, builtin_type_CORE_ADDR is a bit odd: it's a - target type for a value the target will never see. It's only - used to hold the values of (typeless) linker symbols, which are - indeed in the unified virtual address space. */ + /* NOTE: At present there is no way of differentiating between at + target address and the target C language pointer type type even + though the two can be different (cf d10v) */ builtin_type_ptr = make_pointer_type (builtin_type_void, NULL); - builtin_type_void_func_ptr - = lookup_pointer_type (lookup_function_type (builtin_type_void)); builtin_type_CORE_ADDR = init_type (TYPE_CODE_INT, TARGET_ADDR_BIT / 8, TYPE_FLAG_UNSIGNED, @@ -3012,7 +2985,6 @@ _initialize_gdbtypes (void) register_gdbarch_swap (&builtin_type_v4hi, sizeof (struct type *), NULL); register_gdbarch_swap (&builtin_type_v2si, sizeof (struct type *), NULL); REGISTER_GDBARCH_SWAP (builtin_type_ptr); - REGISTER_GDBARCH_SWAP (builtin_type_void_func_ptr); REGISTER_GDBARCH_SWAP (builtin_type_CORE_ADDR); REGISTER_GDBARCH_SWAP (builtin_type_bfd_vma); register_gdbarch_swap (NULL, 0, build_gdbtypes); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 981dbec4b7c..f5f9f1ad8f8 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -849,16 +849,6 @@ extern struct type *builtin_type_bool; /* (C) Language pointer type. Some target platforms use an implicitly {sign,zero} -extended 32 bit C language pointer on a 64 bit ISA. */ extern struct type *builtin_type_ptr; - -/* (C) Language `pointer to function returning void' type. Since - ANSI, C standards have explicitly said that pointers to functions - and pointers to data are not interconvertible --- that is, you - can't cast a function pointer to void * and back, and expect to get - the same value. However, all function pointer types are - interconvertible, so void (*) () can server as a generic function - pointer. */ -extern struct type *builtin_type_void_func_ptr; - /* The target CPU's address type. This is the ISA address size. */ extern struct type *builtin_type_CORE_ADDR; /* The symbol table address type. Some object file formats have a 32 diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index 0e584e9fc5d..0939931753f 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -24,7 +24,6 @@ Boston, MA 02111-1307, USA. */ -#include #include #include #include @@ -2223,7 +2222,7 @@ gnu_stop (void) } static char * -gnu_pid_to_exec_file (int pid) +gnu_pid_to_exec_file (void) { error ("to_pid_to_exec_file target function not implemented"); return NULL; @@ -2477,7 +2476,7 @@ proc_string (struct proc *proc) sprintf (tid_str, "process %d", proc->inf->pid); else sprintf (tid_str, "thread %d.%d", - proc->inf->pid, pid_to_thread_id (MERGEPID (proc->tid, 0))); + proc->inf->pid, pid_to_thread_id (proc->tid)); return tid_str; } @@ -2837,7 +2836,7 @@ set_sig_thread_cmd (char *args, int from_tty) inf->signal_thread = 0; else { - int tid = PIDGET (thread_id_to_pid (atoi (args))); + int tid = thread_id_to_pid (atoi (args)); if (tid < 0) error ("Thread ID %s not known. Use the \"info threads\" command to\n" "see the IDs of currently known threads.", args); diff --git a/gdb/gnu-regex.c b/gdb/gnu-regex.c index 89e532ef6cd..6acdcf27a5a 100644 --- a/gdb/gnu-regex.c +++ b/gdb/gnu-regex.c @@ -1590,8 +1590,21 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr, /* This is not an arbitrary limit: the arguments which represent offsets into the pattern are two bytes long. So if 2^16 bytes turns out to be too small, many things would have to change. */ -#define MAX_BUF_SIZE (1L << 16) -#define REALLOC(p,s) realloc ((p), (s)) +/* Any other compiler which, like MSC, has allocation limit below 2^16 + bytes will have to use approach similar to what was done below for + MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up + reallocating to 0 bytes. Such thing is not going to work too well. + You have been warned!! */ +#if defined _MSC_VER && !defined WIN32 +/* Microsoft C 16-bit versions limit malloc to approx 65512 bytes. + The REALLOC define eliminates a flurry of conversion warnings, + but is not required. */ +# define MAX_BUF_SIZE 65500L +# define REALLOC(p,s) realloc ((p), (size_t) (s)) +#else +# define MAX_BUF_SIZE (1L << 16) +# define REALLOC(p,s) realloc ((p), (s)) +#endif /* Extend the buffer by twice its current size via realloc and reset the pointers that pointed into the old block to point to the diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c index 8c46219971e..ad73165345a 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -22,6 +22,7 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include "gdb_regex.h" #include "gdb_string.h" #include "symtab.h" #include "gdbtypes.h" @@ -111,6 +112,7 @@ gnuv2_virtual_fn_field (value_ptr * arg1p, struct fn_field * f, int j, if (TYPE_TARGET_TYPE (context) != type1) { value_ptr tmp = value_cast (context, value_addr (arg1)); + VALUE_POINTED_TO_OFFSET (tmp) = 0; arg1 = value_ind (tmp); type1 = check_typedef (VALUE_TYPE (arg1)); } diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c deleted file mode 100644 index d9da17c8b90..00000000000 --- a/gdb/gnu-v3-abi.c +++ /dev/null @@ -1,355 +0,0 @@ -/* Abstraction of GNU v3 abi. - Contributed by Jim Blandy - Copyright 2001 Free Software Foundation, Inc. - - This file is part of GDB. - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include "defs.h" -#include "value.h" -#include "cp-abi.h" -#include "demangle.h" -#include "gdb_assert.h" - -static struct cp_abi_ops gnu_v3_abi_ops; - -static int -gnuv3_is_vtable_name (const char *name) -{ - return strncmp (name, "_ZTV", 4) == 0; -} - -static int -gnuv3_is_operator_name (const char *name) -{ - return strncmp (name, "operator", 8) == 0; -} - - -/* To help us find the components of a vtable, we build ourselves a - GDB type object representing the vtable structure. Following the - V3 ABI, it goes something like this: - - struct gdb_gnu_v3_abi_vtable { - - / * An array of virtual call and virtual base offsets. The real - length of this array depends on the class hierarchy; we use - negative subscripts to access the elements. Yucky, but - better than the alternatives. * / - ptrdiff_t vcall_and_vbase_offsets[0]; - - / * The offset from a virtual pointer referring to this table - to the top of the complete object. * / - ptrdiff_t offset_to_top; - - / * The type_info pointer for this class. This is really a - std::type_info *, but GDB doesn't really look at the - type_info object itself, so we don't bother to get the type - exactly right. * / - void *type_info; - - / * Virtual table pointers in objects point here. * / - - / * Virtual function pointers. Like the vcall/vbase array, the - real length of this table depends on the class hierarchy. * / - void (*virtual_functions[0]) (); - - }; - - The catch, of course, is that the exact layout of this table - depends on the ABI --- word size, endianness, alignment, etc. So - the GDB type object is actually a per-architecture kind of thing. - - vtable_type_gdbarch_data is a gdbarch per-architecture data pointer - which refers to the struct type * for this structure, laid out - appropriately for the architecture. */ -static struct gdbarch_data *vtable_type_gdbarch_data; - - -/* Human-readable names for the numbers of the fields above. */ -enum { - vtable_field_vcall_and_vbase_offsets, - vtable_field_offset_to_top, - vtable_field_type_info, - vtable_field_virtual_functions -}; - - -/* Return a GDB type representing `struct gdb_gnu_v3_abi_vtable', - described above, laid out appropriately for ARCH. - - We use this function as the gdbarch per-architecture data - initialization function. We assume that the gdbarch framework - calls the per-architecture data initialization functions after it - sets current_gdbarch to the new architecture. */ -static void * -build_gdb_vtable_type (struct gdbarch *arch) -{ - struct type *t; - struct field *field_list, *field; - int offset; - - struct type *void_ptr_type - = lookup_pointer_type (builtin_type_void); - struct type *ptr_to_void_fn_type - = lookup_pointer_type (lookup_function_type (builtin_type_void)); - - /* ARCH can't give us the true ptrdiff_t type, so we guess. */ - struct type *ptrdiff_type - = init_type (TYPE_CODE_INT, TARGET_PTR_BIT / TARGET_CHAR_BIT, 0, - "ptrdiff_t", 0); - - /* We assume no padding is necessary, since GDB doesn't know - anything about alignment at the moment. If this assumption bites - us, we should add a gdbarch method which, given a type, returns - the alignment that type requires, and then use that here. */ - - /* Build the field list. */ - field_list = xmalloc (sizeof (struct field [4])); - memset (field_list, 0, sizeof (struct field [4])); - field = &field_list[0]; - offset = 0; - - /* ptrdiff_t vcall_and_vbase_offsets[0]; */ - FIELD_NAME (*field) = "vcall_and_vbase_offsets"; - FIELD_TYPE (*field) - = create_array_type (0, ptrdiff_type, - create_range_type (0, builtin_type_int, 0, -1)); - FIELD_BITPOS (*field) = offset * TARGET_CHAR_BIT; - offset += TYPE_LENGTH (FIELD_TYPE (*field)); - field++; - - /* ptrdiff_t offset_to_top; */ - FIELD_NAME (*field) = "offset_to_top"; - FIELD_TYPE (*field) = ptrdiff_type; - FIELD_BITPOS (*field) = offset * TARGET_CHAR_BIT; - offset += TYPE_LENGTH (FIELD_TYPE (*field)); - field++; - - /* void *type_info; */ - FIELD_NAME (*field) = "type_info"; - FIELD_TYPE (*field) = void_ptr_type; - FIELD_BITPOS (*field) = offset * TARGET_CHAR_BIT; - offset += TYPE_LENGTH (FIELD_TYPE (*field)); - field++; - - /* void (*virtual_functions[0]) (); */ - FIELD_NAME (*field) = "virtual_functions"; - FIELD_TYPE (*field) - = create_array_type (0, ptr_to_void_fn_type, - create_range_type (0, builtin_type_int, 0, -1)); - FIELD_BITPOS (*field) = offset * TARGET_CHAR_BIT; - offset += TYPE_LENGTH (FIELD_TYPE (*field)); - field++; - - /* We assumed in the allocation above that there were four fields. */ - gdb_assert (field == (field_list + 4)); - - t = init_type (TYPE_CODE_STRUCT, offset, 0, 0, 0); - TYPE_NFIELDS (t) = field - field_list; - TYPE_FIELDS (t) = field_list; - TYPE_TAG_NAME (t) = "gdb_gnu_v3_abi_vtable"; - - return t; -} - - -/* Return the offset from the start of the imaginary `struct - gdb_gnu_v3_abi_vtable' object to the vtable's "address point" - (i.e., where objects' virtual table pointers point). */ -static int -vtable_address_point_offset () -{ - struct type *vtable_type = gdbarch_data (vtable_type_gdbarch_data); - - return (TYPE_FIELD_BITPOS (vtable_type, vtable_field_virtual_functions) - / TARGET_CHAR_BIT); -} - - -static struct type * -gnuv3_rtti_type (struct value *value, - int *full_p, int *top_p, int *using_enc_p) -{ - struct type *vtable_type = gdbarch_data (vtable_type_gdbarch_data); - struct type *value_type = check_typedef (VALUE_TYPE (value)); - CORE_ADDR vtable_address; - struct value *vtable; - struct minimal_symbol *vtable_symbol; - const char *vtable_symbol_name; - const char *class_name; - struct symbol *class_symbol; - struct type *run_time_type; - LONGEST offset_to_top; - - /* We only have RTTI for class objects. */ - if (TYPE_CODE (value_type) != TYPE_CODE_CLASS) - return NULL; - - /* If we can't find the virtual table pointer for value_type, we - can't find the RTTI. */ - fill_in_vptr_fieldno (value_type); - if (TYPE_VPTR_FIELDNO (value_type) == -1) - return NULL; - - /* Fetch VALUE's virtual table pointer, and tweak it to point at - an instance of our imaginary gdb_gnu_v3_abi_vtable structure. */ - vtable_address - = value_as_pointer (value_field (value, TYPE_VPTR_FIELDNO (value_type))); - vtable = value_at_lazy (vtable_type, - vtable_address - vtable_address_point_offset (), - VALUE_BFD_SECTION (value)); - - /* Find the linker symbol for this vtable. */ - vtable_symbol - = lookup_minimal_symbol_by_pc (VALUE_ADDRESS (vtable) - + VALUE_OFFSET (vtable) - + VALUE_EMBEDDED_OFFSET (vtable)); - if (! vtable_symbol) - return NULL; - - /* The symbol's demangled name should be something like "vtable for - CLASS", where CLASS is the name of the run-time type of VALUE. - If we didn't like this approach, we could instead look in the - type_info object itself to get the class name. But this way - should work just as well, and doesn't read target memory. */ - vtable_symbol_name = SYMBOL_DEMANGLED_NAME (vtable_symbol); - if (strncmp (vtable_symbol_name, "vtable for ", 11)) - error ("can't find linker symbol for virtual table for `%s' value", - TYPE_NAME (value_type)); - class_name = vtable_symbol_name + 11; - - /* Try to look up the class name as a type name. */ - class_symbol = lookup_symbol (class_name, 0, STRUCT_NAMESPACE, 0, 0); - if (! class_symbol) - error ("can't find class named `%s', as given by C++ RTTI", class_name); - - /* Make sure the type symbol is sane. (An earlier version of this - code would find constructor functions, who have the same name as - the class.) */ - if (SYMBOL_CLASS (class_symbol) != LOC_TYPEDEF - || TYPE_CODE (SYMBOL_TYPE (class_symbol)) != TYPE_CODE_CLASS) - error ("C++ RTTI gives a class name of `%s', but that isn't a type name", - class_name); - - /* This is the object's run-time type! */ - run_time_type = SYMBOL_TYPE (class_symbol); - - /* Get the offset from VALUE to the top of the complete object. - NOTE: this is the reverse of the meaning of *TOP_P. */ - offset_to_top - = value_as_long (value_field (vtable, vtable_field_offset_to_top)); - - if (full_p) - *full_p = (- offset_to_top == VALUE_EMBEDDED_OFFSET (value) - && (TYPE_LENGTH (VALUE_ENCLOSING_TYPE (value)) - >= TYPE_LENGTH (run_time_type))); - if (top_p) - *top_p = - offset_to_top; - if (using_enc_p) - *using_enc_p = 0; - - return run_time_type; -} - - -static struct value * -gnuv3_virtual_fn_field (struct value **value_p, - struct fn_field *f, int j, - struct type *type, int offset) -{ - struct type *vtable_type = gdbarch_data (vtable_type_gdbarch_data); - struct value *value = *value_p; - struct type *value_type = check_typedef (VALUE_TYPE (value)); - struct type *vfn_base; - CORE_ADDR vtable_address; - struct value *vtable; - struct value *vfn; - - /* Some simple sanity checks. */ - if (TYPE_CODE (value_type) != TYPE_CODE_CLASS) - error ("Only classes can have virtual functions."); - - /* Find the base class that defines this virtual function. */ - vfn_base = TYPE_FN_FIELD_FCONTEXT (f, j); - if (! vfn_base) - /* In programs compiled with G++ version 1, the debug info doesn't - say which base class defined the virtual function. We'll guess - it's the same base class that has our vtable; this is wrong for - multiple inheritance, but it's better than nothing. */ - vfn_base = TYPE_VPTR_BASETYPE (type); - - /* This type may have been defined before its virtual function table - was. If so, fill in the virtual function table entry for the - type now. */ - if (TYPE_VPTR_FIELDNO (vfn_base) < 0) - fill_in_vptr_fieldno (vfn_base); - - /* Now that we know which base class is defining our virtual - function, cast our value to that baseclass. This takes care of - any necessary `this' adjustments. */ - if (vfn_base != value_type) - /* It would be nicer to simply cast the value to the appropriate - base class (and I think that is supposed to be legal), but - value_cast only does the right magic when casting pointers. */ - value = value_ind (value_cast (vfn_base, value_addr (value))); - - /* Now value is an object of the appropriate base type. Fetch its - virtual table. */ - vtable_address - = value_as_pointer (value_field (value, TYPE_VPTR_FIELDNO (vfn_base))); - vtable = value_at_lazy (vtable_type, - vtable_address - vtable_address_point_offset (), - VALUE_BFD_SECTION (value)); - - /* Fetch the appropriate function pointer from the vtable. */ - vfn = value_subscript (value_field (vtable, vtable_field_virtual_functions), - value_from_longest (builtin_type_int, - TYPE_FN_FIELD_VOFFSET (f, j))); - - /* Cast the function pointer to the appropriate type. */ - vfn = value_cast (lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j)), - vfn); - - return vfn; -} - - -static void -init_gnuv3_ops (void) -{ - vtable_type_gdbarch_data = register_gdbarch_data (build_gdb_vtable_type, 0); - - gnu_v3_abi_ops.shortname = "gnu-v3"; - gnu_v3_abi_ops.longname = "GNU G++ Version 3 ABI"; - gnu_v3_abi_ops.doc = "G++ Version 3 ABI"; - gnu_v3_abi_ops.is_destructor_name = is_gnu_v3_mangled_dtor; - gnu_v3_abi_ops.is_constructor_name = is_gnu_v3_mangled_ctor; - gnu_v3_abi_ops.is_vtable_name = gnuv3_is_vtable_name; - gnu_v3_abi_ops.is_operator_name = gnuv3_is_operator_name; - gnu_v3_abi_ops.rtti_type = gnuv3_rtti_type; - gnu_v3_abi_ops.virtual_fn_field = gnuv3_virtual_fn_field; -} - - -void -_initialize_gnu_v3_abi (void) -{ - init_gnuv3_ops (); - - register_cp_abi (gnu_v3_abi_ops); -} diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index d7647e959ee..c77a9fc2518 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -340,7 +340,7 @@ go32_resume (ptid_t ptid, int step, enum target_signal siggnal) static char child_cwd[FILENAME_MAX]; -static ptid_t +static int go32_wait (ptid_t ptid, struct target_waitstatus *status) { int i; @@ -455,7 +455,7 @@ go32_wait (ptid_t ptid, struct target_waitstatus *status) } } } - return pid_to_ptid (SOME_PID); + return SOME_PID; } static void diff --git a/gdb/hp-symtab-read.c b/gdb/hp-symtab-read.c index 9898cfce7b6..397ea5cb09f 100644 --- a/gdb/hp-symtab-read.c +++ b/gdb/hp-symtab-read.c @@ -530,7 +530,7 @@ hpread_type_translate (dnttpointer typep) if (!typep.dntti.immediate) { error ("error in hpread_type_translate\n."); - return FT_VOID; + return; } switch (typep.dntti.type) @@ -1780,7 +1780,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, /* Enums -- will be handled by other code that takes care of DNTT_TYPE_ENUM; here we see only DNTT_TYPE_MEMENUM so it's not clear we could have handled them here at all. */ - /* FUNC_TEMPLATE: is handled by other code (?). */ + /* FUNC_TEMPLATE: is handled by other code (??). */ /* MEMACCESS: modified access for inherited member. Not sure what to do with this, ignoriing it at present. */ @@ -1863,8 +1863,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, { /* neither field nor genfield ?? is this possible?? */ /* pai:: FIXME walk to the next -- how? */ - warning ("Internal error: unexpected DNTT kind %d encountered as field of struct", - fieldp->dblock.kind); + warning ("Internal error: unexpected DNTT kind %d encountered as field of struct"); warning ("Skipping remaining fields of struct"); break; /* get out of loop of fields */ } @@ -2200,7 +2199,7 @@ hpread_read_array_type (dnttpointer hp_type, union dnttentry *dn_bufp, (!dn_bufp->darray.arrayisbytes && !dn_bufp->darray.elemisbytes))) { warning ("error in hpread_array_type.\n"); - return NULL; + return; } else if (dn_bufp->darray.arraylength == 0x7fffffff) { @@ -2303,17 +2302,14 @@ hpread_type_lookup (dnttpointer hp_type, struct objfile *objfile) /* First see if it's a simple builtin type. */ if (hp_type.dntti.immediate) - { - /* If this is a template argument, the argument number is - * encoded in the bitlength. All other cases, just return - * GDB's representation of this fundamental type. - */ - if (hp_type.dntti.type == HP_TYPE_TEMPLATE_ARG) - return hpread_get_nth_template_arg (objfile, hp_type.dntti.bitlength); - else - return lookup_fundamental_type (objfile, - hpread_type_translate (hp_type)); - } + /* If this is a template argument, the argument number is + * encoded in the bitlength. All other cases, just return + * GDB's representation of this fundamental type. + */ + if (hp_type.dntti.type == HP_TYPE_TEMPLATE_ARG) + return hpread_get_nth_template_arg (objfile, hp_type.dntti.bitlength); + else + return lookup_fundamental_type (objfile, hpread_type_translate (hp_type)); /* Not a builtin type. We'll have to read it in. */ if (hp_type.dnttp.index < LNTT_SYMCOUNT (objfile)) @@ -2429,7 +2425,7 @@ hpread_type_lookup (dnttpointer hp_type, struct objfile *objfile) else { complain (&hpread_type_lookup_complaint); - return NULL; + return; } if (dn_bufp->dblock.kind == DNTT_TYPE_STRUCT) diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 1c28e87faef..d6fa71cbf12 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -4250,7 +4250,7 @@ initialize_hp_cxx_exception_support (void) if (!eh_notify_callback_addr) { /* We can get here either if there is no plabel in the export list - for the main image, or if something strange happened (?) */ + for the main image, or if something strange happened (??) */ warning ("Couldn't find a plabel (indirect function label) for the exception callback."); warning ("GDB will not be able to intercept exception events."); return 0; @@ -4594,10 +4594,7 @@ unwind_command (char *exp, int from_tty) putting the BPT instruction in and taking it out. Note that this implementation is potentially redundant now that - default_prepare_to_proceed() has been added. - - FIXME This may not support switching threads after Ctrl-C - correctly. The default implementation does support this. */ + default_prepare_to_proceed() has been added. */ int hppa_prepare_to_proceed (void) { diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c index 8401995c485..4efeb4a5725 100644 --- a/gdb/hpux-thread.c +++ b/gdb/hpux-thread.c @@ -62,6 +62,10 @@ static ptid_t main_ptid; /* Real process ID */ static CORE_ADDR P_cma__g_known_threads; static CORE_ADDR P_cma__g_current_thread; +static struct cleanup *save_inferior_ptid (void); + +static void restore_inferior_ptid (ptid_t pid); + static void hpux_thread_resume (ptid_t ptid, int step, enum target_signal signo); @@ -69,6 +73,46 @@ static void init_hpux_thread_ops (void); static struct target_ops hpux_thread_ops; +/* + + LOCAL FUNCTION + + save_inferior_ptid - Save inferior_ptid on the cleanup list + restore_inferior_ptid - Restore inferior_ptid from the cleanup list + + SYNOPSIS + + struct cleanup *save_inferior_ptid () + void restore_inferior_ptid (int pid) + + DESCRIPTION + + These two functions act in unison to restore inferior_ptid in + case of an error. + + NOTES + + inferior_ptid is a global variable that needs to be changed by many of + these routines before calling functions in procfs.c. In order to + guarantee that inferior_ptid gets restored (in case of errors), you + need to call save_inferior_ptid before changing it. At the end of the + function, you should invoke do_cleanups to restore it. + + */ + + +static struct cleanup * +save_inferior_ptid (void) +{ + return make_cleanup (restore_inferior_ptid, inferior_ptid); +} + +static void +restore_inferior_ptid (ptid_t ptid) +{ + inferior_ptid = ptid; +} + static int find_active_thread (void); static int cached_thread; diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index 94d9ab393bd..eb222fdbcff 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -61,6 +61,17 @@ /* Prototypes for local functions. */ static void dummy_sse_values (void); +/* On Linux, threads are implemented as pseudo-processes, in which + case we may be tracing more than one process at a time. In that + case, inferior_ptid will contain the main process ID and the + individual thread (process) ID mashed together. These macros are + used to separate them out. These definitions should be overridden + if thread support is included. */ + +#if !defined (PIDGET) /* Default definition for PIDGET/TIDGET. */ +#define PIDGET(PID) PID +#define TIDGET(PID) 0 +#endif /* The register sets used in Linux ELF core-dumps are identical to the diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 0e3e34057ce..7477266f433 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -378,23 +378,6 @@ i386_frameless_function_invocation (struct frame_info *frame) return frameless_look_for_prologue (frame); } -/* Return the saved program counter for FRAME. */ - -CORE_ADDR -i386_frame_saved_pc (struct frame_info *frame) -{ - /* FIXME: kettenis/2001-05-09: Conditionalizing the next bit of code - on SIGCONTEXT_PC_OFFSET and I386V4_SIGTRAMP_SAVED_PC should be - considered a temporary hack. I plan to come up with something - better when we go multi-arch. */ -#if defined (SIGCONTEXT_PC_OFFSET) || defined (I386V4_SIGTRAMP_SAVED_PC) - if (frame->signal_handler_caller) - return sigtramp_saved_pc (frame); -#endif - - return read_memory_unsigned_integer (frame->frame + 4, 4); -} - /* Immediately after a function call, return the saved pc. */ CORE_ADDR @@ -922,37 +905,6 @@ i386_extract_struct_value_address (char *regbuf) } -/* Return the GDB type object for the "standard" data type of data in - register REGNUM. Perhaps %esi and %edi should go here, but - potentially they could be used for things other than address. */ - -struct type * -i386_register_virtual_type (int regnum) -{ - if (regnum == PC_REGNUM || regnum == FP_REGNUM || regnum == SP_REGNUM) - return lookup_pointer_type (builtin_type_void); - - if (IS_FP_REGNUM (regnum)) - return builtin_type_long_double; - - if (IS_SSE_REGNUM (regnum)) - return builtin_type_v4sf; - - return builtin_type_int; -} - -/* Return true iff register REGNUM's virtual format is different from - its raw format. Note that this definition assumes that the host - supports IEEE 32-bit floats, since it doesn't say that SSE - registers need conversion. Even if we can't find a counterexample, - this is still sloppy. */ - -int -i386_register_convertible (int regnum) -{ - return IS_FP_REGNUM (regnum); -} - /* Convert data from raw format for register REGNUM in buffer FROM to virtual format with type TYPE in buffer TO. In principle both formats are identical except that the virtual format has two extra diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c index 71cb030ca3f..e221b0c9e73 100644 --- a/gdb/i387-tdep.c +++ b/gdb/i387-tdep.c @@ -27,7 +27,6 @@ #include "gdbcore.h" #include "floatformat.h" #include "regcache.h" -#include "gdb_assert.h" /* FIXME: Eliminate the next two functions when we have the time to @@ -161,25 +160,22 @@ static void print_i387_value (char *raw) { DOUBLEST value; - int len = TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT; - char *tmp = alloca (len); - /* This code only works on targets where ... */ - gdb_assert (TARGET_LONG_DOUBLE_FORMAT == &floatformat_i387_ext); + /* Avoid call to floatformat_to_doublest if possible to preserve as + much information as possible. */ - /* Take care of the padding. FP reg is 80 bits. The same value in - memory is 96 bits. */ - gdb_assert (FPU_REG_RAW_SIZE < len); - memcpy (&tmp, raw, FPU_REG_RAW_SIZE); - memset (&tmp + FPU_REG_RAW_SIZE, 0, len - FPU_REG_RAW_SIZE); - - /* Extract the value as a DOUBLEST. */ - /* Use extract_floating() rather than floatformat_to_doublest(). - The latter is lossy in nature. Once GDB gets a host/target - independent and non-lossy FP it will become possible to bypass - extract_floating() and call floatformat*() directly. Note also - the assumptions about TARGET_LONG_DOUBLE above. */ - value = extract_floating (tmp, len); +#ifdef HAVE_LONG_DOUBLE + if (sizeof (value) == sizeof (long double) + && HOST_LONG_DOUBLE_FORMAT == &floatformat_i387_ext) + { + /* Copy straight over, but take care of the padding. */ + memcpy (&value, raw, FPU_REG_RAW_SIZE); + memset ((char *) &value + FPU_REG_RAW_SIZE, 0, + sizeof (value) - FPU_REG_RAW_SIZE); + } + else +#endif + floatformat_to_doublest (&floatformat_i387_ext, raw, &value); /* We try to print 19 digits. The last digit may or may not contain garbage, but we'd better print one too many. We need enough room diff --git a/gdb/ia64-linux-tdep.c b/gdb/ia64-linux-tdep.c index 97f88142bb3..87c6af4b440 100644 --- a/gdb/ia64-linux-tdep.c +++ b/gdb/ia64-linux-tdep.c @@ -31,7 +31,7 @@ #define GATE_AREA_END 0xa000000000010000LL /* Offset to sigcontext structure from frame of handler */ -#define IA64_LINUX_SIGCONTEXT_OFFSET 192 +#define IA64_LINUX_SIGCONTEXT_OFFSET 160 int ia64_linux_in_sigtramp (CORE_ADDR pc, char *func_name) diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index cc2d0f23adc..2a1b351b865 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -717,69 +717,6 @@ ia64_frame_saved_pc (struct frame_info *frame) } } -/* Limit the number of skipped non-prologue instructions since examining - of the prologue is expensive. */ -static int max_skip_non_prologue_insns = 10; - -/* Given PC representing the starting address of a function, and - LIM_PC which is the (sloppy) limit to which to scan when looking - for a prologue, attempt to further refine this limit by using - the line data in the symbol table. If successful, a better guess - on where the prologue ends is returned, otherwise the previous - value of lim_pc is returned. TRUST_LIMIT is a pointer to a flag - which will be set to indicate whether the returned limit may be - used with no further scanning in the event that the function is - frameless. */ - -static CORE_ADDR -refine_prologue_limit (CORE_ADDR pc, CORE_ADDR lim_pc, int *trust_limit) -{ - struct symtab_and_line prologue_sal; - CORE_ADDR start_pc = pc; - - /* Start off not trusting the limit. */ - *trust_limit = 0; - - prologue_sal = find_pc_line (pc, 0); - if (prologue_sal.line != 0) - { - int i; - CORE_ADDR addr = prologue_sal.end; - - /* Handle the case in which compiler's optimizer/scheduler - has moved instructions into the prologue. We scan ahead - in the function looking for address ranges whose corresponding - line number is less than or equal to the first one that we - found for the function. (It can be less than when the - scheduler puts a body instruction before the first prologue - instruction.) */ - for (i = 2 * max_skip_non_prologue_insns; - i > 0 && (lim_pc == 0 || addr < lim_pc); - i--) - { - struct symtab_and_line sal; - - sal = find_pc_line (addr, 0); - if (sal.line == 0) - break; - if (sal.line <= prologue_sal.line - && sal.symtab == prologue_sal.symtab) - { - prologue_sal = sal; - } - addr = sal.end; - } - - if (lim_pc == 0 || prologue_sal.end < lim_pc) - { - lim_pc = prologue_sal.end; - if (start_pc == get_pc_function_start (lim_pc)) - *trust_limit = 1; - } - } - return lim_pc; -} - #define isScratch(_regnum_) ((_regnum_) == 2 || (_regnum_) == 3 \ || (8 <= (_regnum_) && (_regnum_) <= 11) \ || (14 <= (_regnum_) && (_regnum_) <= 31)) @@ -807,7 +744,6 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) CORE_ADDR spill_addr = 0; char instores[8]; char infpstores[8]; - int trust_limit; memset (instores, 0, sizeof instores); memset (infpstores, 0, sizeof infpstores); @@ -824,8 +760,6 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) && frame->extra_info->after_prologue <= lim_pc) return frame->extra_info->after_prologue; - lim_pc = refine_prologue_limit (pc, lim_pc, &trust_limit); - /* Must start with an alloc instruction */ next_pc = fetch_instruction (pc, &it, &instr); if (pc < lim_pc && next_pc @@ -845,11 +779,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame) pc = next_pc; } else - { - pc = lim_pc; /* Frameless: We're done early. */ - if (trust_limit) - last_prologue_pc = lim_pc; - } + pc = lim_pc; /* We're done early */ /* Loop, looking for prologue instructions, keeping track of where preserved registers were spilled. */ @@ -1534,17 +1464,14 @@ is_float_or_hfa_type_recurse (struct type *t, struct type **etp) } break; case TYPE_CODE_ARRAY: - return - is_float_or_hfa_type_recurse (check_typedef (TYPE_TARGET_TYPE (t)), - etp); + return is_float_or_hfa_type_recurse (TYPE_TARGET_TYPE (t), etp); break; case TYPE_CODE_STRUCT: { int i; for (i = 0; i < TYPE_NFIELDS (t); i++) - if (!is_float_or_hfa_type_recurse - (check_typedef (TYPE_FIELD_TYPE (t, i)), etp)) + if (!is_float_or_hfa_type_recurse (TYPE_FIELD_TYPE (t, i), etp)) return 0; return 1; } @@ -1568,40 +1495,6 @@ is_float_or_hfa_type (struct type *t) } -/* Return 1 if the alignment of T is such that the next even slot - should be used. Return 0, if the next available slot should - be used. (See section 8.5.1 of the IA-64 Software Conventions - and Runtime manual.) */ - -static int -slot_alignment_is_next_even (struct type *t) -{ - switch (TYPE_CODE (t)) - { - case TYPE_CODE_INT: - case TYPE_CODE_FLT: - if (TYPE_LENGTH (t) > 8) - return 1; - else - return 0; - case TYPE_CODE_ARRAY: - return - slot_alignment_is_next_even (check_typedef (TYPE_TARGET_TYPE (t))); - case TYPE_CODE_STRUCT: - { - int i; - - for (i = 0; i < TYPE_NFIELDS (t); i++) - if (slot_alignment_is_next_even - (check_typedef (TYPE_FIELD_TYPE (t, i)))) - return 1; - return 0; - } - default: - return 0; - } -} - /* Attempt to find (and return) the global pointer for the given function. @@ -1769,7 +1662,9 @@ ia64_push_arguments (int nargs, value_ptr *args, CORE_ADDR sp, type = check_typedef (VALUE_TYPE (arg)); len = TYPE_LENGTH (type); - if ((nslots & 1) && slot_alignment_is_next_even (type)) + /* FIXME: This is crude and it is wrong (IMO), but it matches + what gcc does, I think. */ + if (len > 8 && (nslots & 1)) nslots++; if (TYPE_CODE (type) == TYPE_CODE_FUNC) @@ -1844,11 +1739,8 @@ ia64_push_arguments (int nargs, value_ptr *args, CORE_ADDR sp, } /* Normal slots */ - - /* Skip odd slot if necessary... */ - if ((slotnum & 1) && slot_alignment_is_next_even (type)) + if (len > 8 && (slotnum & 1)) slotnum++; - argoffset = 0; while (len > 0) { diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 3f8572ed323..030946495d1 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -36,7 +36,6 @@ #include "language.h" #include "symfile.h" #include "objfiles.h" -#include "completer.h" #ifdef UI_OUT #include "ui-out.h" #endif @@ -1468,11 +1467,12 @@ do_registers_info (int regnum, int fpregs) { register int i; int numregs = NUM_REGS + NUM_PSEUDO_REGS; - char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); - char *virtual_buffer = (char*) alloca (MAX_REGISTER_VIRTUAL_SIZE); for (i = 0; i < numregs; i++) { + char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE); + char *virtual_buffer = (char*) alloca (MAX_REGISTER_VIRTUAL_SIZE); + /* Decide between printing all regs, nonfloat regs, or specific reg. */ if (regnum == -1) { @@ -1795,8 +1795,8 @@ _initialize_infcmd (void) { struct cmd_list_element *c; - c = add_com ("tty", class_run, tty_command, - "Set terminal for future runs of program being debugged."); + c= add_com ("tty", class_run, tty_command, + "Set terminal for future runs of program being debugged."); c->completer = filename_completer; c = add_set_cmd ("args", class_run, var_string_noescape, @@ -1900,30 +1900,25 @@ Argument N means do this N times (or till program stops for another reason)."); Argument N means do this N times (or till program stops for another reason)."); add_com_alias ("s", "step", class_run, 1); - c = add_com ("until", class_run, until_command, - "Execute until the program reaches a source line greater than the current\n\ + add_com ("until", class_run, until_command, + "Execute until the program reaches a source line greater than the current\n\ or a specified line or address or function (same args as break command).\n\ Execution will also stop upon exit from the current stack frame."); - c->completer = location_completer; add_com_alias ("u", "until", class_run, 1); - c = add_com ("jump", class_run, jump_command, - "Continue program being debugged at specified line or address.\n\ + add_com ("jump", class_run, jump_command, + "Continue program being debugged at specified line or address.\n\ Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\ for an address to start at."); - c->completer = location_completer; if (xdb_commands) - { - c = add_com ("go", class_run, go_command, - "Usage: go \n\ + add_com ("go", class_run, go_command, + "Usage: go \n\ Continue program being debugged, stopping at specified line or \n\ address.\n\ Give as argument either LINENUM or *ADDR, where ADDR is an \n\ expression for an address to start at.\n\ This command is a combination of tbreak and jump."); - c->completer = location_completer; - } if (xdb_commands) add_com_alias ("g", "go", class_run, 1); diff --git a/gdb/inferior.h b/gdb/inferior.h index 502d3efbcc9..35ac96edf62 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -51,38 +51,6 @@ extern void write_inferior_status_register (struct inferior_status *inf_status, int regno, LONGEST val); -/* The -1 ptid, often used to indicate either an error condition - or a "don't care" condition, i.e, "run all threads." */ -extern ptid_t minus_one_ptid; - -/* The null or zero ptid, often used to indicate no process. */ -extern ptid_t null_ptid; - -/* Attempt to find and return an existing ptid with the given PID, LWP, - and TID components. If none exists, create a new one and return - that. */ -ptid_t ptid_build (int pid, long lwp, long tid); - -/* Find/Create a ptid from just a pid. */ -ptid_t pid_to_ptid (int pid); - -/* Fetch the pid (process id) component from a ptid. */ -int ptid_get_pid (ptid_t ptid); - -/* Fetch the lwp (lightweight process) component from a ptid. */ -long ptid_get_lwp (ptid_t ptid); - -/* Fetch the tid (thread id) component from a ptid. */ -long ptid_get_tid (ptid_t ptid); - -/* Compare two ptids to see if they are equal */ -extern int ptid_equal (ptid_t p1, ptid_t p2); - -/* Save value of inferior_ptid so that it may be restored by - a later call to do_cleanups(). Returns the struct cleanup - pointer needed for later doing the cleanup. */ -extern struct cleanup * save_inferior_ptid (void); - extern void set_sigint_trap (void); extern void clear_sigint_trap (void); diff --git a/gdb/infptrace.c b/gdb/infptrace.c index eede27669bf..d9eee366ccd 100644 --- a/gdb/infptrace.c +++ b/gdb/infptrace.c @@ -110,6 +110,22 @@ static void fetch_register (int); static void store_register (int); #endif +/* + * Some systems (Linux) may have threads implemented as pseudo-processes, + * in which case we may be tracing more than one process at a time. + * In that case, inferior_pid will contain the main process ID and the + * individual thread (process) id mashed together. These macros are + * used to separate them out. The definitions may be overridden in tm.h + * + * NOTE: default definitions here are for systems with no threads. + * Useful definitions MUST be provided in tm.h + */ + +#if !defined (PIDGET) /* Default definition for PIDGET/TIDGET. */ +#define PIDGET(PID) PID +#define TIDGET(PID) 0 +#endif + void _initialize_kernel_u_addr (void); void _initialize_infptrace (void); @@ -349,6 +365,11 @@ _initialize_kernel_u_addr (void) - KERNEL_U_ADDR #endif +/* Registers we shouldn't try to fetch. */ +#if !defined (CANNOT_FETCH_REGISTER) +#define CANNOT_FETCH_REGISTER(regno) 0 +#endif + /* Fetch one register. */ static void @@ -413,6 +434,11 @@ fetch_inferior_registers (int regno) } } +/* Registers we shouldn't try to store. */ +#if !defined (CANNOT_STORE_REGISTER) +#define CANNOT_STORE_REGISTER(regno) 0 +#endif + /* Store one register. */ static void diff --git a/gdb/infrun.c b/gdb/infrun.c index 8b126db6523..a62a72c069c 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -110,6 +110,31 @@ static ptid_t previous_inferior_ptid; static int may_follow_exec = MAY_FOLLOW_EXEC; +/* resume and wait_for_inferior use this to ensure that when + stepping over a hit breakpoint in a threaded application + only the thread that hit the breakpoint is stepped and the + other threads don't continue. This prevents having another + thread run past the breakpoint while it is temporarily + removed. + + This is not thread-specific, so it isn't saved as part of + the infrun state. + + Versions of gdb which don't use the "step == this thread steps + and others continue" model but instead use the "step == this + thread steps and others wait" shouldn't do this. */ + +static int thread_step_needed = 0; + +/* This is true if thread_step_needed should actually be used. At + present this is only true for HP-UX native. */ + +#ifndef USE_THREAD_STEP_NEEDED +#define USE_THREAD_STEP_NEEDED (0) +#endif + +static int use_thread_step_needed = USE_THREAD_STEP_NEEDED; + /* GET_LONGJMP_TARGET returns the PC at which longjmp() will resume the program. It needs to examine the jmp_buf argument and extract the PC from it. The return value is non-zero on success, zero otherwise. */ @@ -781,6 +806,8 @@ set_schedlock_func (char *args, int from_tty, struct cmd_list_element *c) } + + /* Resume the inferior, but allow a QUIT. This is useful if the user wants to interrupt some lengthy single-stepping operation (for child processes, the SIGINT goes to the inferior, and so @@ -796,8 +823,13 @@ resume (int step, enum target_signal sig) struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0); QUIT; - /* FIXME: calling breakpoint_here_p (read_pc ()) three times! */ - +#ifdef CANNOT_STEP_BREAKPOINT + /* Most targets can step a breakpoint instruction, thus executing it + normally. But if this one cannot, just continue and we will hit + it anyway. */ + if (step && breakpoints_inserted && breakpoint_here_p (read_pc ())) + step = 0; +#endif /* Some targets (e.g. Solaris x86) have a kernel bug when stepping over an instruction that causes a page fault without triggering @@ -880,34 +912,41 @@ resume (int step, enum target_signal sig) { ptid_t resume_ptid; - resume_ptid = RESUME_ALL; /* Default */ - - if ((step || singlestep_breakpoints_inserted_p) && - !breakpoints_inserted && breakpoint_here_p (read_pc ())) + if (use_thread_step_needed && thread_step_needed) { - /* Stepping past a breakpoint without inserting breakpoints. - Make sure only the current thread gets to step, so that - other threads don't sneak past breakpoints while they are - not inserted. */ + /* We stopped on a BPT instruction; + don't continue other threads and + just step this thread. */ + thread_step_needed = 0; - resume_ptid = inferior_ptid; + if (!breakpoint_here_p (read_pc ())) + { + /* Breakpoint deleted: ok to do regular resume + where all the threads either step or continue. */ + resume_ptid = RESUME_ALL; + } + else + { + if (!step) + { + warning ("Internal error, changing continue to step."); + remove_breakpoints (); + breakpoints_inserted = 0; + trap_expected = 1; + step = 1; + } + resume_ptid = inferior_ptid; + } } - - if ((scheduler_mode == schedlock_on) || - (scheduler_mode == schedlock_step && - (step || singlestep_breakpoints_inserted_p))) + else { - /* User-settable 'scheduler' mode requires solo thread resume. */ + /* Vanilla resume. */ + if ((scheduler_mode == schedlock_on) || + (scheduler_mode == schedlock_step && step != 0)) resume_ptid = inferior_ptid; + else + resume_ptid = RESUME_ALL; } - -#ifdef CANNOT_STEP_BREAKPOINT - /* Most targets can step a breakpoint instruction, thus executing it - normally. But if this one cannot, just continue and we will hit - it anyway. */ - if (step && breakpoints_inserted && breakpoint_here_p (read_pc ())) - step = 0; -#endif target_resume (resume_ptid, step, sig); } @@ -982,6 +1021,16 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) else { write_pc (addr); + + /* New address; we don't need to single-step a thread + over a breakpoint we just hit, 'cause we aren't + continuing from there. + + It's not worth worrying about the case where a user + asks for a "jump" at the current PC--if they get the + hiccup of re-hiting a hit breakpoint, what else do + they expect? */ + thread_step_needed = 0; } #ifdef PREPARE_TO_PROCEED @@ -999,6 +1048,7 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) if (PREPARE_TO_PROCEED (1) && breakpoint_here_p (read_pc ())) { oneproc = 1; + thread_step_needed = 1; } #endif /* PREPARE_TO_PROCEED */ @@ -1227,7 +1277,7 @@ wait_for_inferior (void) struct execution_control_state ecss; struct execution_control_state *ecs; - old_cleanups = make_cleanup (delete_step_resume_breakpoint, + old_cleanups = make_cleanup (delete_breakpoint_current_contents, &step_resume_breakpoint); make_cleanup (delete_breakpoint_current_contents, &through_sigtramp_breakpoint); @@ -1239,6 +1289,8 @@ wait_for_inferior (void) /* Fill in with reasonable starting values. */ init_execution_control_state (ecs); + thread_step_needed = 0; + /* We'll update this if & when we switch to a new thread. */ previous_inferior_ptid = inferior_ptid; @@ -1289,7 +1341,7 @@ fetch_inferior_event (void *client_data) if (!async_ecs->wait_some_more) { - old_cleanups = make_exec_cleanup (delete_step_resume_breakpoint, + old_cleanups = make_exec_cleanup (delete_breakpoint_current_contents, &step_resume_breakpoint); make_exec_cleanup (delete_breakpoint_current_contents, &through_sigtramp_breakpoint); @@ -1297,6 +1349,8 @@ fetch_inferior_event (void *client_data) /* Fill in with reasonable starting values. */ init_execution_control_state (async_ecs); + thread_step_needed = 0; + /* We'll update this if & when we switch to a new thread. */ previous_inferior_ptid = inferior_ptid; @@ -1379,49 +1433,6 @@ get_last_target_status(ptid_t *ptidp, struct target_waitstatus *status) *status = target_last_waitstatus; } -/* Switch thread contexts, maintaining "infrun state". */ - -static void -context_switch (struct execution_control_state *ecs) -{ - /* Caution: it may happen that the new thread (or the old one!) - is not in the thread list. In this case we must not attempt - to "switch context", or we run the risk that our context may - be lost. This may happen as a result of the target module - mishandling thread creation. */ - - if (in_thread_list (inferior_ptid) && in_thread_list (ecs->ptid)) - { /* Perform infrun state context switch: */ - /* Save infrun state for the old thread. */ - save_infrun_state (inferior_ptid, prev_pc, - prev_func_start, prev_func_name, - trap_expected, step_resume_breakpoint, - through_sigtramp_breakpoint, step_range_start, - step_range_end, step_frame_address, - ecs->handling_longjmp, ecs->another_trap, - ecs->stepping_through_solib_after_catch, - ecs->stepping_through_solib_catchpoints, - ecs->stepping_through_sigtramp, - ecs->current_line, ecs->current_symtab, - step_sp); - - /* Load infrun state for the new thread. */ - load_infrun_state (ecs->ptid, &prev_pc, - &prev_func_start, &prev_func_name, - &trap_expected, &step_resume_breakpoint, - &through_sigtramp_breakpoint, &step_range_start, - &step_range_end, &step_frame_address, - &ecs->handling_longjmp, &ecs->another_trap, - &ecs->stepping_through_solib_after_catch, - &ecs->stepping_through_solib_catchpoints, - &ecs->stepping_through_sigtramp, - &ecs->current_line, &ecs->current_symtab, - &step_sp); - } - inferior_ptid = ecs->ptid; -} - - /* Given an execution control state that has been freshly filled in by an event from the inferior, figure out what it means and take appropriate action. */ @@ -1440,12 +1451,12 @@ handle_inferior_event (struct execution_control_state *ecs) { switch (ecs->infwait_state) { - case infwait_thread_hop_state: - /* Cancel the waiton_ptid. */ - ecs->waiton_ptid = pid_to_ptid (-1); - /* Fall thru to the normal_state case. */ - case infwait_normal_state: + /* Since we've done a wait, we have a new event. Don't + carry over any expectations about needing to step over a + breakpoint. */ + thread_step_needed = 0; + /* See comments where a TARGET_WAITKIND_SYSCALL_RETURN event is serviced in this loop, below. */ if (ecs->enable_hw_watchpoints_after_wait) @@ -1456,6 +1467,21 @@ handle_inferior_event (struct execution_control_state *ecs) stepped_after_stopped_by_watchpoint = 0; break; + case infwait_thread_hop_state: + insert_breakpoints (); + + /* We need to restart all the threads now, + * unless we're running in scheduler-locked mode. + * FIXME: shouldn't we look at currently_stepping ()? + */ + if (scheduler_mode == schedlock_on) + target_resume (ecs->ptid, 0, TARGET_SIGNAL_0); + else + target_resume (RESUME_ALL, 0, TARGET_SIGNAL_0); + ecs->infwait_state = infwait_normal_state; + prepare_to_wait (ecs); + return; + case infwait_nullified_state: break; @@ -1617,17 +1643,7 @@ handle_inferior_event (struct execution_control_state *ecs) stop_pc = read_pc_pid (ecs->ptid); ecs->saved_inferior_ptid = inferior_ptid; inferior_ptid = ecs->ptid; - /* The second argument of bpstat_stop_status is meant to help - distinguish between a breakpoint trap and a singlestep trap. - This is only important on targets where DECR_PC_AFTER_BREAK - is non-zero. The prev_pc test is meant to distinguish between - singlestepping a trap instruction, and singlestepping thru a - jump to the instruction following a trap instruction. */ - - stop_bpstat = bpstat_stop_status (&stop_pc, - currently_stepping (ecs) && - prev_pc != - stop_pc - DECR_PC_AFTER_BREAK); + stop_bpstat = bpstat_stop_status (&stop_pc, currently_stepping (ecs)); ecs->random_signal = !bpstat_explains_signal (stop_bpstat); inferior_ptid = ecs->saved_inferior_ptid; goto process_event_stop_test; @@ -1676,17 +1692,7 @@ handle_inferior_event (struct execution_control_state *ecs) } stop_pc = read_pc (); - /* The second argument of bpstat_stop_status is meant to help - distinguish between a breakpoint trap and a singlestep trap. - This is only important on targets where DECR_PC_AFTER_BREAK - is non-zero. The prev_pc test is meant to distinguish between - singlestepping a trap instruction, and singlestepping thru a - jump to the instruction following a trap instruction. */ - - stop_bpstat = bpstat_stop_status (&stop_pc, - currently_stepping (ecs) && - prev_pc != - stop_pc - DECR_PC_AFTER_BREAK); + stop_bpstat = bpstat_stop_status (&stop_pc, currently_stepping (ecs)); ecs->random_signal = !bpstat_explains_signal (stop_bpstat); goto process_event_stop_test; @@ -1751,17 +1757,7 @@ handle_inferior_event (struct execution_control_state *ecs) stop_pc = read_pc_pid (ecs->ptid); ecs->saved_inferior_ptid = inferior_ptid; inferior_ptid = ecs->ptid; - /* The second argument of bpstat_stop_status is meant to help - distinguish between a breakpoint trap and a singlestep trap. - This is only important on targets where DECR_PC_AFTER_BREAK - is non-zero. The prev_pc test is meant to distinguish between - singlestepping a trap instruction, and singlestepping thru a - jump to the instruction following a trap instruction. */ - - stop_bpstat = bpstat_stop_status (&stop_pc, - currently_stepping (ecs) && - prev_pc != - stop_pc - DECR_PC_AFTER_BREAK); + stop_bpstat = bpstat_stop_status (&stop_pc, currently_stepping (ecs)); ecs->random_signal = !bpstat_explains_signal (stop_bpstat); inferior_ptid = ecs->saved_inferior_ptid; goto process_event_stop_test; @@ -1870,8 +1866,7 @@ handle_inferior_event (struct execution_control_state *ecs) /* Saw a breakpoint, but it was hit by the wrong thread. Just continue. */ - if (DECR_PC_AFTER_BREAK) - write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK, ecs->ptid); + write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK, ecs->ptid); remove_status = remove_breakpoints (); /* Did we fail to remove breakpoints? If so, try @@ -1883,40 +1878,39 @@ handle_inferior_event (struct execution_control_state *ecs) then either :-) or execs. */ if (remove_status != 0) { - /* FIXME! This is obviously non-portable! */ - write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK + 4, - ecs->ptid); - /* We need to restart all the threads now, - * unles we're running in scheduler-locked mode. - * Use currently_stepping to determine whether to - * step or continue. - */ - /* FIXME MVS: is there any reason not to call resume()? */ - if (scheduler_mode == schedlock_on) - target_resume (ecs->ptid, - currently_stepping (ecs), - TARGET_SIGNAL_0); - else - target_resume (RESUME_ALL, - currently_stepping (ecs), - TARGET_SIGNAL_0); - prepare_to_wait (ecs); - return; + write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK + 4, ecs->ptid); } else { /* Single step */ - breakpoints_inserted = 0; - if (!ptid_equal (inferior_ptid, ecs->ptid)) - context_switch (ecs); + target_resume (ecs->ptid, 1, TARGET_SIGNAL_0); + /* FIXME: What if a signal arrives instead of the + single-step happening? */ + ecs->waiton_ptid = ecs->ptid; ecs->wp = &(ecs->ws); - ecs->another_trap = 1; - ecs->infwait_state = infwait_thread_hop_state; - keep_going (ecs); - registers_changed (); + prepare_to_wait (ecs); return; } + + /* We need to restart all the threads now, + * unles we're running in scheduler-locked mode. + * FIXME: shouldn't we look at currently_stepping ()? + */ + if (scheduler_mode == schedlock_on) + target_resume (ecs->ptid, 0, TARGET_SIGNAL_0); + else + target_resume (RESUME_ALL, 0, TARGET_SIGNAL_0); + prepare_to_wait (ecs); + return; + } + else + { + /* This breakpoint matches--either it is the right + thread or it's a generic breakpoint for all threads. + Remember that we'll need to step just _this_ thread + on any following user continuation! */ + thread_step_needed = 1; } } } @@ -1981,7 +1975,40 @@ handle_inferior_event (struct execution_control_state *ecs) /* It's a SIGTRAP or a signal we're interested in. Switch threads, and fall into the rest of wait_for_inferior(). */ - context_switch (ecs); + /* Caution: it may happen that the new thread (or the old one!) + is not in the thread list. In this case we must not attempt + to "switch context", or we run the risk that our context may + be lost. This may happen as a result of the target module + mishandling thread creation. */ + + if (in_thread_list (inferior_ptid) && in_thread_list (ecs->ptid)) + { /* Perform infrun state context switch: */ + /* Save infrun state for the old thread. */ + save_infrun_state (inferior_ptid, prev_pc, + prev_func_start, prev_func_name, + trap_expected, step_resume_breakpoint, + through_sigtramp_breakpoint, + step_range_start, step_range_end, + step_frame_address, ecs->handling_longjmp, + ecs->another_trap, + ecs->stepping_through_solib_after_catch, + ecs->stepping_through_solib_catchpoints, + ecs->stepping_through_sigtramp); + + /* Load infrun state for the new thread. */ + load_infrun_state (ecs->ptid, &prev_pc, + &prev_func_start, &prev_func_name, + &trap_expected, &step_resume_breakpoint, + &through_sigtramp_breakpoint, + &step_range_start, &step_range_end, + &step_frame_address, &ecs->handling_longjmp, + &ecs->another_trap, + &ecs->stepping_through_solib_after_catch, + &ecs->stepping_through_solib_catchpoints, + &ecs->stepping_through_sigtramp); + } + + inferior_ptid = ecs->ptid; if (context_hook) context_hook (pid_to_thread_id (ecs->ptid)); @@ -2049,8 +2076,7 @@ handle_inferior_event (struct execution_control_state *ecs) includes evaluating watchpoints, things will come to a stop in the correct manner. */ - if (DECR_PC_AFTER_BREAK) - write_pc (stop_pc - DECR_PC_AFTER_BREAK); + write_pc (stop_pc - DECR_PC_AFTER_BREAK); remove_breakpoints (); registers_changed (); @@ -2131,14 +2157,6 @@ handle_inferior_event (struct execution_control_state *ecs) else { /* See if there is a breakpoint at the current PC. */ - - /* The second argument of bpstat_stop_status is meant to help - distinguish between a breakpoint trap and a singlestep trap. - This is only important on targets where DECR_PC_AFTER_BREAK - is non-zero. The prev_pc test is meant to distinguish between - singlestepping a trap instruction, and singlestepping thru a - jump to the instruction following a trap instruction. */ - stop_bpstat = bpstat_stop_status (&stop_pc, /* Pass TRUE if our reason for stopping is something other @@ -2148,7 +2166,6 @@ handle_inferior_event (struct execution_control_state *ecs) sigtramp, which is detected by a new stack pointer value below any usual function calling stack adjustments. */ (currently_stepping (ecs) - && prev_pc != stop_pc - DECR_PC_AFTER_BREAK && !(step_range_end && INNER_THAN (read_sp (), (step_sp - 16)))) ); @@ -2337,7 +2354,8 @@ handle_inferior_event (struct execution_control_state *ecs) interferes with us */ if (step_resume_breakpoint != NULL) { - delete_step_resume_breakpoint (&step_resume_breakpoint); + delete_breakpoint (step_resume_breakpoint); + step_resume_breakpoint = NULL; } /* Not sure whether we need to blow this away too, but probably it is like the step-resume breakpoint. */ @@ -2383,6 +2401,7 @@ handle_inferior_event (struct execution_control_state *ecs) case BPSTAT_WHAT_SINGLE: if (breakpoints_inserted) { + thread_step_needed = 1; remove_breakpoints (); } breakpoints_inserted = 0; @@ -2434,7 +2453,8 @@ handle_inferior_event (struct execution_control_state *ecs) step_resume_breakpoint = bpstat_find_step_resume_breakpoint (stop_bpstat); } - delete_step_resume_breakpoint (&step_resume_breakpoint); + delete_breakpoint (step_resume_breakpoint); + step_resume_breakpoint = NULL; break; case BPSTAT_WHAT_THROUGH_SIGTRAMP: @@ -2755,16 +2775,11 @@ handle_inferior_event (struct execution_control_state *ecs) { /* It's a subroutine call. */ - if ((step_over_calls == STEP_OVER_NONE) - || ((step_range_end == 1) - && in_prologue (prev_pc, ecs->stop_func_start))) + if (step_over_calls == STEP_OVER_NONE) { /* I presume that step_over_calls is only 0 when we're supposed to be stepping at the assembly language level ("stepi"). Just stop. */ - /* Also, maybe we just did a "nexti" inside a prolog, - so we thought it was a subroutine call but it was not. - Stop as well. FENN */ stop_step = 1; print_stop_reason (END_STEPPING_RANGE, 0); stop_stepping (ecs); @@ -3308,7 +3323,7 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info) /* Print a message only if not in the middle of doing a "step n" operation for n > 1 */ if (!step_multi || !stop_step) - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "end-stepping-range"); #endif break; @@ -3320,7 +3335,7 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info) /* The inferior was terminated by a signal. */ #ifdef UI_OUT annotate_signalled (); - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "exited-signalled"); ui_out_text (uiout, "\nProgram terminated with signal "); annotate_signal_name (); @@ -3354,7 +3369,7 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info) annotate_exited (stop_info); if (stop_info) { - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "exited"); ui_out_text (uiout, "\nProgram exited with code "); ui_out_field_fmt (uiout, "exit-code", "0%o", (unsigned int) stop_info); @@ -3362,7 +3377,7 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info) } else { - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_string (uiout, "reason", "exited-normally"); ui_out_text (uiout, "\nProgram exited normally.\n"); } @@ -3548,12 +3563,12 @@ and/or watchpoints.\n"); #ifdef UI_OUT /* For mi, have the same behavior every time we stop: print everything but the source line. */ - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) source_flag = LOC_AND_ADDRESS; #endif #ifdef UI_OUT - if (ui_out_is_mi_like_p (uiout)) + if (interpreter_p && strcmp (interpreter_p, "mi") == 0) ui_out_field_int (uiout, "thread-id", pid_to_thread_id (inferior_ptid)); #endif @@ -4177,90 +4192,6 @@ discard_inferior_status (struct inferior_status *inf_status) free_inferior_status (inf_status); } -/* Oft used ptids */ -ptid_t null_ptid; -ptid_t minus_one_ptid; - -/* Create a ptid given the necessary PID, LWP, and TID components. */ - -ptid_t -ptid_build (int pid, long lwp, long tid) -{ - ptid_t ptid; - - ptid.pid = pid; - ptid.lwp = lwp; - ptid.tid = tid; - return ptid; -} - -/* Create a ptid from just a pid. */ - -ptid_t -pid_to_ptid (int pid) -{ - return ptid_build (pid, 0, 0); -} - -/* Fetch the pid (process id) component from a ptid. */ - -int -ptid_get_pid (ptid_t ptid) -{ - return ptid.pid; -} - -/* Fetch the lwp (lightweight process) component from a ptid. */ - -long -ptid_get_lwp (ptid_t ptid) -{ - return ptid.lwp; -} - -/* Fetch the tid (thread id) component from a ptid. */ - -long -ptid_get_tid (ptid_t ptid) -{ - return ptid.tid; -} - -/* ptid_equal() is used to test equality of two ptids. */ - -int -ptid_equal (ptid_t ptid1, ptid_t ptid2) -{ - return (ptid1.pid == ptid2.pid && ptid1.lwp == ptid2.lwp - && ptid1.tid == ptid2.tid); -} - -/* restore_inferior_ptid() will be used by the cleanup machinery - to restore the inferior_ptid value saved in a call to - save_inferior_ptid(). */ - -static void -restore_inferior_ptid (void *arg) -{ - ptid_t *saved_ptid_ptr = arg; - inferior_ptid = *saved_ptid_ptr; - xfree (arg); -} - -/* Save the value of inferior_ptid so that it may be restored by a - later call to do_cleanups(). Returns the struct cleanup pointer - needed for later doing the cleanup. */ - -struct cleanup * -save_inferior_ptid (void) -{ - ptid_t *saved_ptid_ptr; - - saved_ptid_ptr = xmalloc (sizeof (ptid_t)); - *saved_ptid_ptr = inferior_ptid; - return make_cleanup (restore_inferior_ptid, saved_ptid_ptr); -} - static void build_infrun (void) @@ -4445,10 +4376,4 @@ instruction of that function. Otherwise, the function is skipped and\n\ the step command stops at a different source line.", &setlist); add_show_from_set (c, &showlist); - - /* ptid initializations */ - null_ptid = ptid_build (0, 0, 0); - minus_one_ptid = ptid_build (-1, 0, 0); - inferior_ptid = null_ptid; - target_last_wait_ptid = minus_one_ptid; } diff --git a/gdb/language.c b/gdb/language.c index 117bd2e608f..1a005b2f62e 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -720,7 +720,7 @@ longest_local_hex_string_custom (LONGEST num, char *width) num_pad_chars = field_width - strlen (temp_nbr_buf); /* possibly negative */ if (strlen (local_hex_format_prefix ()) + num_len + num_pad_chars - >= RESULT_BUF_LEN) /* paranoia */ + < RESULT_BUF_LEN) /* paranoia */ internal_error (__FILE__, __LINE__, "longest_local_hex_string_custom: insufficient space to store result"); diff --git a/gdb/lin-lwp.c b/gdb/lin-lwp.c index 91f3691903b..6df4d0dab3e 100644 --- a/gdb/lin-lwp.c +++ b/gdb/lin-lwp.c @@ -82,14 +82,6 @@ struct lwp_info /* Non-zero if this LWP is stopped. */ int stopped; - /* Non-zero if this LWP will be/has been resumed. Note that an LWP - can be marked both as stopped and resumed at the same time. This - happens if we try to resume an LWP that has a wait status - pending. We shouldn't let the LWP run until that wait status has - been processed, but we should not report that wait status if GDB - didn't try to let the LWP run. */ - int resumed; - /* If non-zero, a pending wait status. */ int status; @@ -110,10 +102,18 @@ static int num_lwps; static int threaded; -#define GET_LWP(ptid) ptid_get_lwp (ptid) -#define GET_PID(ptid) ptid_get_pid (ptid) -#define is_lwp(ptid) (GET_LWP (ptid) != 0) -#define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0) +#ifndef TIDGET +#define TIDGET(PID) (((PID) & 0x7fffffff) >> 16) +#define PIDGET0(PID) (((PID) & 0xffff)) +#define PIDGET(PID) ((PIDGET0 (PID) == 0xffff) ? -1 : PIDGET0 (PID)) +#define MERGEPID(PID, TID) (((PID) & 0xffff) | ((TID) << 16)) +#endif + +#define THREAD_FLAG 0x80000000 +#define is_lwp(pid) (((pid) & THREAD_FLAG) == 0 && TIDGET (pid)) +#define GET_LWP(pid) TIDGET (pid) +#define GET_PID(pid) PIDGET (pid) +#define BUILD_LWP(tid, pid) MERGEPID (pid, tid) #define is_cloned(pid) (GET_LWP (pid) != GET_PID (pid)) @@ -151,13 +151,10 @@ static sigset_t blocked_mask; /* Prototypes for local functions. */ -static int stop_wait_callback (struct lwp_info *lp, void *data); +static void lin_lwp_mourn_inferior (void); -/* Initialize the list of LWPs. Note that this module, contrary to - what GDB's generic threads layer does for its thread list, - re-initializes the LWP lists whenever we mourn or detach (which - doesn't involve mourning) the inferior. */ +/* Initialize the list of LWPs. */ static void init_lwp_list (void) @@ -257,27 +254,42 @@ find_lwp_pid (ptid_t ptid) struct lwp_info * iterate_over_lwps (int (*callback) (struct lwp_info *, void *), void *data) { - struct lwp_info *lp, *lpnext; + struct lwp_info *lp; - for (lp = lwp_list; lp; lp = lpnext) - { - lpnext = lp->next; - if ((*callback) (lp, data)) - return lp; - } + for (lp = lwp_list; lp; lp = lp->next) + if ((*callback) (lp, data)) + return lp; return NULL; } +/* Helper functions. */ + +static void +restore_inferior_ptid (void *arg) +{ + ptid_t *saved_ptid_ptr = arg; + inferior_ptid = *saved_ptid_ptr; + xfree (arg); +} + +static struct cleanup * +save_inferior_ptid (void) +{ + ptid_t *saved_ptid_ptr; + + saved_ptid_ptr = xmalloc (sizeof (ptid_t)); + *saved_ptid_ptr = inferior_ptid; + return make_cleanup (restore_inferior_ptid, saved_ptid_ptr); +} + + /* Implementation of the PREPARE_TO_PROCEED hook for the Linux LWP layer. Note that this implementation is potentially redundant now that - default_prepare_to_proceed() has been added. - - FIXME This may not support switching threads after Ctrl-C - correctly. The default implementation does support this. */ + default_prepare_to_proceed() has been added. */ int lin_lwp_prepare_to_proceed (void) @@ -332,101 +344,26 @@ lin_lwp_attach_lwp (ptid_t ptid, int verbose) if (verbose) printf_filtered ("[New %s]\n", target_pid_to_str (ptid)); - /* We assume that we're already tracing the initial process. */ - if (is_cloned (ptid) && ptrace (PTRACE_ATTACH, GET_LWP (ptid), 0, 0) < 0) + if (ptrace (PTRACE_ATTACH, GET_LWP (ptid), 0, 0) < 0) error ("Can't attach %s: %s", target_pid_to_str (ptid), strerror (errno)); - lp = find_lwp_pid (ptid); - if (lp == NULL) - lp = add_lwp (ptid); - - if (is_cloned (ptid)) - { - lp->signalled = 1; - stop_wait_callback (lp, NULL); - } + lp = add_lwp (ptid); + lp->signalled = 1; } static void lin_lwp_attach (char *args, int from_tty) { - struct lwp_info *lp; - /* FIXME: We should probably accept a list of process id's, and attach all of them. */ - child_ops.to_attach (args, from_tty); - - /* Add the initial process as the first LWP to the list. */ - lp = add_lwp (BUILD_LWP (PIDGET (inferior_ptid), PIDGET (inferior_ptid))); - - /* Make sure the initial process is stopped. The user-level threads - layer might want to poke around in the inferior, and that won't - work if things haven't stabilized yet. */ - lp->signalled = 1; - stop_wait_callback (lp, NULL); - gdb_assert (lp->status == 0); - - /* Fake the SIGSTOP that core GDB expects. */ - lp->status = W_STOPCODE (SIGSTOP); - lp->resumed = 1; -} - -static int -detach_callback (struct lwp_info *lp, void *data) -{ - gdb_assert (lp->status == 0 || WIFSTOPPED (lp->status)); - - if (debug_lin_lwp && lp->status) - fprintf_unfiltered (gdb_stdlog, "Pending %s for LWP %ld on detach.\n", - strsignal (WSTOPSIG (lp->status)), GET_LWP (lp->ptid)); - - while (lp->signalled && lp->stopped) - { - if (ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, - WSTOPSIG (lp->status)) < 0) - error ("Can't continue %s: %s", target_pid_to_str (lp->ptid), - strerror (errno)); - - lp->stopped = 0; - lp->signalled = 0; - lp->status = 0; - stop_wait_callback (lp, NULL); - - gdb_assert (lp->status == 0 || WIFSTOPPED (lp->status)); - } - - if (is_cloned (lp->ptid)) - { - if (ptrace (PTRACE_DETACH, GET_LWP (lp->ptid), 0, - WSTOPSIG (lp->status)) < 0) - error ("Can't detach %s: %s", target_pid_to_str (lp->ptid), - strerror (errno)); - - delete_lwp (lp->ptid); - } - - return 0; + error("Not implemented yet"); } static void lin_lwp_detach (char *args, int from_tty) { - iterate_over_lwps (detach_callback, NULL); - - /* Only the initial (uncloned) process should be left right now. */ - gdb_assert (num_lwps == 1); - - trap_ptid = null_ptid; - - /* Destroy LWP info; it's no longer valid. */ - init_lwp_list (); - - /* Restore the original signal mask. */ - sigprocmask (SIG_SETMASK, &normal_mask, NULL); - sigemptyset (&blocked_mask); - - inferior_ptid = pid_to_ptid (GET_PID (inferior_ptid)); - child_ops.to_detach (args, from_tty); + /* FIXME: Provide implementation when we implement lin_lwp_attach. */ + error ("Not implemented yet"); } @@ -487,20 +424,6 @@ resume_callback (struct lwp_info *lp, void *data) return 0; } -static int -resume_clear_callback (struct lwp_info *lp, void *data) -{ - lp->resumed = 0; - return 0; -} - -static int -resume_set_callback (struct lwp_info *lp, void *data) -{ - lp->resumed = 1; - return 0; -} - static void lin_lwp_resume (ptid_t ptid, int step, enum target_signal signo) { @@ -513,13 +436,8 @@ lin_lwp_resume (ptid_t ptid, int step, enum target_signal signo) processes, but give the signal only to this one'. */ resume_all = (PIDGET (ptid) == -1) || !step; - if (resume_all) - iterate_over_lwps (resume_set_callback, NULL); - else - iterate_over_lwps (resume_clear_callback, NULL); - /* If PID is -1, it's the current inferior that should be - handled specially. */ + handled special. */ if (PIDGET (ptid) == -1) ptid = inferior_ptid; @@ -531,9 +449,6 @@ lin_lwp_resume (ptid_t ptid, int step, enum target_signal signo) /* Remember if we're stepping. */ lp->step = step; - /* Mark this LWP as resumed. */ - lp->resumed = 1; - /* If we have a pending wait status for this thread, there is no point in resuming the process. */ if (lp->status) @@ -585,7 +500,6 @@ stop_wait_callback (struct lwp_info *lp, void *data) pid_t pid; int status; - get_another_event: gdb_assert (lp->status == 0); pid = waitpid (GET_LWP (lp->ptid), &status, @@ -651,22 +565,6 @@ stop_wait_callback (struct lwp_info *lp, void *data) write_pc_pid (read_pc_pid (pid_to_ptid (pid)) - DECR_PC_AFTER_BREAK, pid_to_ptid (pid)); - - /* Now resume this LWP and get the SIGSTOP event. */ - ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0); - goto get_another_event; - } - else if (WSTOPSIG (status) == SIGINT && - signal_pass_state (SIGINT) == 0) - { - /* Since SIGINT gets forwarded to the entire process group - (in the case where ^C/BREAK is typed at the tty/console), - just ignore all SIGINT events from all lwp's except for - the one that was caught by lin_lwp_wait. */ - - /* Now resume this LWP and get the SIGSTP event. */ - ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0); - goto get_another_event; } else { @@ -676,7 +574,7 @@ stop_wait_callback (struct lwp_info *lp, void *data) strsignal (WSTOPSIG (status)), pid); /* The thread was stopped with a signal other than - SIGSTOP, and didn't accidentally trip a breakpoint. + SIGSTOP, and didn't accidentiliy trip a breakpoint. Record the wait status. */ lp->status = status; } @@ -697,9 +595,7 @@ stop_wait_callback (struct lwp_info *lp, void *data) static int status_callback (struct lwp_info *lp, void *data) { - /* Only report a pending wait status if we pretend that this has - indeed been resumed. */ - return (lp->status != 0 && lp->resumed); + return (lp->status != 0); } /* Return non-zero if LP isn't stopped. */ @@ -710,14 +606,6 @@ running_callback (struct lwp_info *lp, void *data) return (lp->stopped == 0); } -/* Return non-zero if LP has been resumed. */ - -static int -resumed_callback (struct lwp_info *lp, void *data) -{ - return lp->resumed; -} - static ptid_t lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) { @@ -735,9 +623,6 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) retry: - /* Make sure there is at least one thread that has been resumed. */ - gdb_assert (iterate_over_lwps (resumed_callback, NULL)); - /* First check if there is a LWP with a wait status pending. */ if (pid == -1) { @@ -747,8 +632,8 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) { if (debug_lin_lwp) fprintf_unfiltered (gdb_stdlog, - "Using pending wait status for LWP %ld.\n", - GET_LWP (lp->ptid)); + "Using pending wait status for LWP %d.\n", + (int) GET_LWP (lp->ptid)); status = lp->status; lp->status = 0; @@ -763,8 +648,8 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) { if (debug_lin_lwp) fprintf_unfiltered (gdb_stdlog, - "Waiting for specific LWP %ld.\n", - GET_LWP (ptid)); + "Waiting for specific LWP %d.\n", + (int) GET_LWP (ptid)); /* We have a specific LWP to check. */ lp = find_lwp_pid (ptid); @@ -775,7 +660,7 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) if (debug_lin_lwp) if (status) fprintf_unfiltered (gdb_stdlog, - "Using pending wait status for LWP %ld.\n", + "Using pending wait status for LWP %d.\n", GET_LWP (lp->ptid)); /* If we have to wait, take into account whether PID is a cloned @@ -801,7 +686,6 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step, TARGET_SIGNAL_0); lp->stopped = 0; - gdb_assert (lp->resumed); /* This should catch the pending SIGSTOP. */ stop_wait_callback (lp, NULL); @@ -888,7 +772,6 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step, TARGET_SIGNAL_0); lp->stopped = 0; - gdb_assert (lp->resumed); /* Discard the event. */ status = 0; @@ -932,11 +815,6 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) && signal_print_state (signo) == 0 && 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. */ child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step, signo); lp->stopped = 0; status = 0; @@ -1021,22 +899,37 @@ lin_lwp_kill (void) static void lin_lwp_create_inferior (char *exec_file, char *allargs, char **env) { - child_ops.to_create_inferior (exec_file, allargs, env); + struct target_ops *target_beneath; + + init_lwp_list (); + +#if 0 + target_beneath = find_target_beneath (&lin_lwp_ops); +#else + target_beneath = &child_ops; +#endif + target_beneath->to_create_inferior (exec_file, allargs, env); } static void lin_lwp_mourn_inferior (void) { - trap_ptid = null_ptid; + struct target_ops *target_beneath; - /* Destroy LWP info; it's no longer valid. */ init_lwp_list (); + trap_ptid = null_ptid; + /* Restore the original signal mask. */ sigprocmask (SIG_SETMASK, &normal_mask, NULL); sigemptyset (&blocked_mask); - child_ops.to_mourn_inferior (); +#if 0 + target_beneath = find_target_beneath (&lin_lwp_ops); +#else + target_beneath = &child_ops; +#endif + target_beneath->to_mourn_inferior (); } static void diff --git a/gdb/lin-thread.c b/gdb/lin-thread.c index a14af7b075b..495fb4311a0 100644 --- a/gdb/lin-thread.c +++ b/gdb/lin-thread.c @@ -125,25 +125,21 @@ /* Prototypes for supply_gregset etc. */ #include "gregset.h" -/* Macros for superimposing PID and TID into inferior_ptid. */ -#define GET_PID(ptid) ptid_get_pid (ptid) -#define GET_LWP(ptid) ptid_get_lwp (ptid) -#define GET_THREAD(ptid) ptid_get_tid (ptid) - -#define is_lwp(ptid) (GET_LWP (ptid) != 0) -#define is_thread(ptid) (GET_THREAD (ptid) != 0) - -#define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0) -#define BUILD_THREAD(tid, pid) ptid_build (pid, 0, tid) - -/* From linux-thread.c. FIXME: These should go in a separate header - file, but I'm told that the life expectancy of lin-thread.c and - linux-thread.c isn't very long... */ +#ifndef TIDGET +#define TIDGET(PID) (((PID) & 0x7fffffff) >> 16) +#define PIDGET0(PID) (((PID) & 0xffff)) +#define PIDGET(PID) ((PIDGET0 (PID) == 0xffff) ? -1 : PIDGET0 (PID)) +#define MERGEPID(PID, TID) (((PID) & 0xffff) | ((TID) << 16)) +#endif -extern int linux_child_wait (int, int *, int *); -extern void check_all_signal_numbers (void); -extern void linuxthreads_discard_global_state (void); -extern void attach_thread (int); +/* Macros for superimposing PID and TID into inferior_ptid. */ +#define THREAD_FLAG 0x80000000 +#define is_thread(ARG) (((ARG) & THREAD_FLAG) != 0) +#define is_lwp(ARG) (((ARG) & THREAD_FLAG) == 0) +#define GET_LWP(PID) TIDGET (PID) +#define GET_THREAD(PID) TIDGET (PID) +#define BUILD_LWP(TID, PID) MERGEPID (PID, TID) +#define BUILD_THREAD(TID, PID) (MERGEPID (PID, TID) | THREAD_FLAG) /* * target_beneath is a pointer to the target_ops underlying this one. @@ -308,6 +304,8 @@ ps_ptwrite (gdb_ps_prochandle_t ph, /* write to text segment */ return rw_common (ph, addr, (char *) buf, size, PS_WRITE); } +static struct cleanup *save_inferior_ptid (void); +static void restore_inferior_ptid (void *saved_pid); static char *thr_err_string (td_err_e); static char *thr_state_string (td_thr_state_e); @@ -625,6 +623,52 @@ init_thread_db_library (void) * Local utility functions: */ + +/* + + LOCAL FUNCTION + + save_inferior_ptid - Save inferior_ptid on the cleanup list + restore_inferior_ptid - Restore inferior_ptid from the cleanup list + + SYNOPSIS + + struct cleanup *save_inferior_ptid (void); + void restore_inferior_ptid (void *saved_pid); + + DESCRIPTION + + These two functions act in unison to restore inferior_ptid in + case of an error. + + NOTES + + inferior_ptid is a global variable that needs to be changed by many + of these routines before calling functions in procfs.c. In order + to guarantee that inferior_ptid gets restored (in case of errors), + you need to call save_inferior_ptid before changing it. At the end + of the function, you should invoke do_cleanups to restore it. + + */ + +static struct cleanup * +save_inferior_ptid (void) +{ + ptid_t *saved_ptid_ptr; + + saved_ptid_ptr = xmalloc (sizeof (ptid_t)); + *saved_ptid_ptr = inferior_ptid; + return make_cleanup (restore_inferior_ptid, saved_ptid_ptr); +} + +static void +restore_inferior_ptid (void *arg) +{ + ptid_t *saved_ptid_ptr = arg; + inferior_ptid = *saved_ptid_ptr; + xfree (arg); +} + /* LOCAL FUNCTION diff --git a/gdb/linux-thread.c b/gdb/linux-thread.c index f93387bfc7a..922a5635704 100644 --- a/gdb/linux-thread.c +++ b/gdb/linux-thread.c @@ -374,6 +374,26 @@ linuxthreads_find_trap (int pid, int stop) return 1; } +/* Cleanup stub for save_inferior_ptid. */ +static void +restore_inferior_ptid (void *arg) +{ + ptid_t *saved_ptid_ptr = arg; + inferior_ptid = *saved_ptid_ptr; + xfree (arg); +} + +/* Register a cleanup to restore the value of inferior_ptid. */ +static struct cleanup * +save_inferior_ptid (void) +{ + ptid_t *saved_ptid_ptr; + + saved_ptid_ptr = xmalloc (sizeof (ptid_t)); + *saved_ptid_ptr = inferior_ptid; + return make_cleanup (restore_inferior_ptid, saved_ptid_ptr); +} + static void sigchld_handler (int signo) { @@ -1040,10 +1060,7 @@ quit: return 1 otherwise 0. Note that this implementation is potentially redundant now that - default_prepare_to_proceed() has been added. - - FIXME This may not support switching threads after Ctrl-C - correctly. The default implementation does support this. */ + default_prepare_to_proceed() has been added. */ int linuxthreads_prepare_to_proceed (int step) diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c index 9cd1672d336..e76406f69cc 100644 --- a/gdb/lynx-nat.c +++ b/gdb/lynx-nat.c @@ -539,6 +539,11 @@ fetch_inferior_registers (int regno) If REGNO is -1, do this for all registers. Otherwise, REGNO specifies which register (so we can save time). */ +/* Registers we shouldn't try to store. */ +#if !defined (CANNOT_STORE_REGISTER) +#define CANNOT_STORE_REGISTER(regno) 0 +#endif + void store_inferior_registers (int regno) { diff --git a/gdb/m3-nat.c b/gdb/m3-nat.c index d01e22cdb24..3ab160b3cb8 100644 --- a/gdb/m3-nat.c +++ b/gdb/m3-nat.c @@ -1575,9 +1575,6 @@ mach_thread_output_id (int mid) * * Note that this implementation is potentially redundant now that * default_prepare_to_proceed() has been added. - * - * FIXME This may not support switching threads after Ctrl-C - * correctly. The default implementation does support this. */ mach3_prepare_to_proceed (int select_it) diff --git a/gdb/m32r-rom.c b/gdb/m32r-rom.c index b4bfefdf210..ff9f5b54e0b 100644 --- a/gdb/m32r-rom.c +++ b/gdb/m32r-rom.c @@ -42,6 +42,7 @@ extern void report_transfer_performance (unsigned long, time_t, time_t); +#ifndef _MSC_VER /* * All this stuff just to get my host computer's IP address! */ @@ -51,6 +52,7 @@ extern void report_transfer_performance (unsigned long, time_t, time_t); #if 1 #include /* for inet_ntoa */ #endif +#endif static char *board_addr; /* user-settable IP address for M32R-EVA */ static char *server_addr; /* user-settable IP address for gdb host */ @@ -390,6 +392,8 @@ mon2000_open (char *args, int from_tty) monitor_open (args, &mon2000_cmds, from_tty); } +#ifndef _MSC_VER + /* Function: set_board_address Tell the BootOne monitor what it's ethernet IP address is. */ @@ -571,6 +575,8 @@ m32r_upload_command (char *args, int from_tty) clear_symtab_users (); } +#endif /* ! _MSC_VER */ + void _initialize_m32r_rom (void) { @@ -598,6 +604,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya)."; mon2000_ops.to_open = mon2000_open; add_target (&mon2000_ops); +#ifndef _MSC_VER add_show_from_set (add_set_cmd ("download-path", class_obscure, var_string, (char *) &download_path, @@ -623,4 +630,5 @@ Specify the serial device it is connected to (e.g. /dev/ttya)."; "Upload the srec file via the monitor's Ethernet upload capability."); add_com ("tload", class_obscure, m32r_load, "test upload command."); +#endif } diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 863dc907e02..a636b34c0e8 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -334,7 +334,7 @@ m68hc11_pop_frame (void) read_memory_integer (frame->saved_regs[regnum], 2)); write_register (HARD_PC_REGNUM, frame->extra_info->return_pc); - sp = (fp + frame->extra_info->size + 2) & 0x0ffff; + sp = fp + frame->extra_info->size; write_register (HARD_SP_REGNUM, sp); } flush_cached_frames (); @@ -489,12 +489,10 @@ m68hc11_analyze_instruction (struct insn_sequence *seq, CORE_ADDR *pc, v = read_memory_unsigned_integer (*pc + j + 1, 1); if (buffer[j] & 1) v |= 0xff00; - *pc = *pc + 1; } else if (buffer[j] == 0xf2) { v = read_memory_unsigned_integer (*pc + j + 1, 2); - *pc = *pc + 2; } cur_val = v; break; @@ -589,7 +587,7 @@ m68hc11_guess_from_prologue (CORE_ADDR pc, CORE_ADDR fp, func_end = pc + 128; found_frame_point = 0; *frame_offset = 0; - save_addr = fp + STACK_CORRECTION; + save_addr = fp; while (!done && pc + 2 < func_end) { struct insn_sequence *seq; diff --git a/gdb/main.c b/gdb/main.c index f7aa5188f39..ceac1327e35 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -90,6 +90,10 @@ static void print_gdb_help (struct ui_file *); extern int enable_external_editor; extern char *external_editor_command; +#ifdef __CYGWIN__ +#include /* for cygwin32_conv_to_posix_path */ +#endif + /* Call command_loop. If it happens to return, pass that through as a non-zero return status. */ @@ -530,7 +534,21 @@ extern int gdbtk_test (char *); *before* all the command line arguments are processed; it sets global parameters, which are independent of what file you are debugging or what directory you are in. */ +#ifdef __CYGWIN__ + { + char *tmp = getenv ("HOME"); + + if (tmp != NULL) + { + homedir = (char *) alloca (PATH_MAX + 1); + cygwin32_conv_to_posix_path (tmp, homedir); + } + else + homedir = NULL; + } +#else homedir = getenv ("HOME"); +#endif if (homedir) { homeinit = (char *) alloca (strlen (homedir) + @@ -688,6 +706,13 @@ extern int gdbtk_test (char *); #endif } + /* The default command loop. + The WIN32 Gui calls this main to set up gdb's state, and + has its own command loop. */ +#if !defined _WIN32 || defined __GNUC__ + /* GUIs generally have their own command loop, mainloop, or + whatever. This is a good place to gain control because many + error conditions will end up here via longjmp(). */ #if 0 /* FIXME: cagney/1999-11-06: The original main loop was like: */ while (1) @@ -723,6 +748,7 @@ extern int gdbtk_test (char *); { catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL); } +#endif /* No exit -- exit is through quit_command. */ } diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index aab357e005e..401a09ee086 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -378,7 +378,7 @@ static PTR xzalloc (unsigned int); static void sort_blocks (struct symtab *); -static int compare_blocks (const PTR, const PTR); +static int compare_blocks (const void *, const void *); static struct partial_symtab *new_psymtab (char *, struct objfile *); diff --git a/gdb/memattr.c b/gdb/memattr.c index 8e934e7a2b6..b1b4a781b16 100644 --- a/gdb/memattr.c +++ b/gdb/memattr.c @@ -1,23 +1,4 @@ -/* Memory attributes support, for GDB. - Copyright 2001 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. */ - +/* memattr.c */ #include "defs.h" #include "command.h" #include "gdbcmd.h" @@ -71,7 +52,6 @@ create_mem_region (CORE_ADDR lo, CORE_ADDR hi, printf_unfiltered ("overlapping memory region\n"); return NULL; } - n = n->next; } new = xmalloc (sizeof (struct mem_region)); diff --git a/gdb/memattr.h b/gdb/memattr.h index 6796b713427..75b5f781c1d 100644 --- a/gdb/memattr.h +++ b/gdb/memattr.h @@ -1,23 +1,4 @@ -/* Memory attributes support, for GDB. - Copyright 2001 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. */ - +/* memattr.h */ #ifndef MEMATTR_H #define MEMATTR_H diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index ab493195301..1c8aa783d33 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,190 +1,3 @@ -2001-07-04 Andrew Cagney - - * mi-out.c (mi_ui_out_impl): Initialize is_mi_like_p to one. - -2001-06-27 Andrew Cagney - - * mi-out.c (mi_table_begin): Include nr_cols and nr_rows in mi1 - table output. - * mi-out.c (mi_table_begin): Only suppress output when mi0. Change - the header to a list. - (mi_table_body): For mi1, close the header list and open a table - body list. - (mi_table_end): For mi1, close the body list. - (mi_table_header): For mi1, output a tuple containing all the - header information. - (mi_open, mi_close): Reverse logic of mi_version test. - * gdbmi.texinfo (GDB/MI Breakpoint Table Commands): Update. - -2001-06-26 Andrew Cagney - - * gdbmi.texinfo (GDB/MI Output Syntax): Delete reference to query - packet. - -2001-06-26 Andrew Cagney - - * mi-cmd-stack.c (list_args_or_locals): Output a list of "args" or - "locals" entries. - * gdbmi.texinfo (stack-list-locals, stack-list-arguments) - (exec-interrupt, target-select, thread-select): Update - documentation. - -2001-06-26 Andrew Cagney - - * mi-cmd-stack.c (mi_cmd_stack_list_frames): Output a list of - "stack" entries. - (mi_cmd_stack_list_args): Ditto for "stack-args". - * gdbmi.texinfo (stack-list-frames, stack-list-arguments): Update - documentation. - (GDB/MI Stack Manipulation Commands): Fix section title. Was - Stack Manipulation Commands in GDB/MI. - -2001-06-25 Andrew Cagney - - * gdbmi.texinfo: Update output examples that contain stop reason - output, change the args=.... to a list. - (exec-return): Ditto. - -2001-06-25 Andrew Cagney - - * mi-main.c (mi_cmd_data_read_memory): Output the memory contents - - memory and data - as a list. - * gdbmi.texinfo (data-read-memory): Update documentation. - -2001-06-25 Andrew Cagney - - * mi-main.c (mi_cmd_data_list_register_values): Output a list of - register values. - * gdbmi.texinfo (data-list-register-values): Update documentation. - -2001-06-25 Andrew Cagney - - * mi-main.c (mi_cmd_data_list_register_names): Output a list of - register names. - (mi_cmd_data_list_register_names): Include the pseudo registers. - (mi_cmd_data_list_register_names): Don't leave holes in the list, - output "" for NULL registers. - * gdbmi.texinfo (data-list-register-names): Update documentation. - -2001-06-23 Andrew Cagney - - * mi-main.c (mi_cmd_data_list_changed_registers): Output a list of - register numbers. - * gdbmi.texinfo (data-list-changed-registers): Update - documentation. - -2001-06-23 Andrew Cagney - - * gdbmi.texinfo (data-disassemble): Update documentation of - output. Produces a list of instructions and a list of source - lines. - -2001-06-22 Andrew Cagney - - * mi-cmd-disas.c (mi_cmd_disassemble): For "-data-disassemble", - output a list instead of a tupple. - -2001-06-21 Andrew Cagney - - * mi-out.c (struct ui_out_data): Replace field first_header with - suppress_output. - (mi_begin, mi_end): Check suppress_header. - (mi_field_int, mi_field_skip): Ditto. - (mi_field_string, mi_field_fmt): Ditto. - (mi_table_begin): When nr_rows is zero, set suppress_header else, - output the start of the header. - (mi_table_body): Clear suppress header. - -2001-06-21 Andrew Cagney - - * mi-out.c (mi_open): For lists, when mi_version > 0, use ``[''. - (mi_close): Ditto for ``]''. - -2001-06-20 Andrew Cagney - - * mi-out.c (mi_table_header): Add parameter ``col_name''. - -2001-06-18 Andrew Cagney - - * mi-out.c: Include "gdb_assert.h". - (mi_table_begin): Add parameter ``nr_rows''. - -2001-06-18 Andrew Cagney - - * mi-main.c: Use strncmp as the "mi" test. Allow "mi", "mi0" and - "mi1". - (mi_command_loop): Add parameter mi_version, pass to mi_out_new. - (mi1_command_loop, mi0_command_loop): New functions. - (_initialize_mi_main): Recognize "mi", "mi0" and "mi1". - * mi-out.c (mi_out_new): Add parameter mi_version. - (struct ui_out_data): Add field mi_version. - * mi-out.h (mi_out_new): Update. - -2001-06-07 Andrew Cagney - - * gdbmi.texinfo (GDB/MI Output Syntax): Add tuples and lists to - syntax. - (GDB/MI Draft Changes to Output Syntax): Delete section. - -Mon Jun 11 17:22:25 2001 Andrew Cagney - - * mi-out.c: Fix typo. s/supress/suppress/. - -2001-06-09 Andrew Cagney - - * mi-out.c (mi_table_end, mi_table_begin, mi_begin, mi_end): Move - supress_field_separator updates from here. - (mi_open, mi_close): To here. - (mi_open): Add parameter name. Output a field_separator. - (mi_table_begin): Update. - (mi_table_header): Update. - (mi_begin): Update. - -2001-06-09 Andrew Cagney - - * mi-out.c (mi_table_begin): Make char* parameters constant. - (mi_table_header): Ditto. - (mi_field_int): Ditto. - (mi_field_skip): Ditto. - (mi_field_string): Ditto. - (mi_field_fmt): Ditto. - (mi_text): Ditto. - (mi_message): Ditto. - -2001-05-12 Andrew Cagney - - * mi-out.c (mi_close, mi_open): Output ``[]'' when a list. - -Fri May 11 13:55:07 2001 Andrew Cagney - - * mi-cmd-var.c: Replace ui_out_list_begin, ui_out_list_end and - make_cleanup_ui_out_list_end with ui_out_tupple_begin, - ui_out_tupple_end and make_cleanup_ui_out_tupple_begin_end. - * mi-cmd-stack.c: Ditto. - * mi-cmd-disas.c: Ditto. - * mi-main.c: Ditto. - -2001-05-10 Andrew Cagney - - * mi-out.c (mi_open, mi_close): Replace list_open and list_close. - (mi_table_begin): Update. - (mi_table_header): Update. - (mi_begin): Update. - (mi_table_body): Update. - (mi_table_end): Update. - (mi_end): Update. - -Thu May 10 16:28:13 2001 Andrew Cagney - - * mi-main.c (mi_execute_async_cli_command): Always initialize - old_cleanups. - -2001-05-08 Andrew Cagney - - * mi-out.c (mi_begin, mi_end): Replace mi_list_begin and - mi_list_end. - (mi_ui_out_impl): Update. - 2001-03-28 Andrew Cagney * mi-main.c (mi_cmd_data_read_memory): Use xcalloc. diff --git a/gdb/mi/gdbmi.texinfo b/gdb/mi/gdbmi.texinfo index ae69649d4f8..985ac71446a 100644 --- a/gdb/mi/gdbmi.texinfo +++ b/gdb/mi/gdbmi.texinfo @@ -117,6 +117,7 @@ Elena Zannoni. * GDB/MI Thread Commands:: * GDB/MI Tracepoint Commands:: * GDB/MI Variable Objects:: +* GDB/MI Draft Changes to Output Syntax:: @end menu @c When these are implemented, they should be moved to be between Misc and @@ -256,24 +257,14 @@ corresponding output for that command will also be prefixed by that same 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} } +@code{[ @var{string} "=" ] @var{value}} @item @var{value} @expansion{} -@code{ @var{const} | @var{tuple} | @var{list} } +@code{@var{const} | "@{" @var{result} ( "," @var{result} )* "@}"} @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}} @@ -293,6 +284,14 @@ depending on the needs---this is still in development). @emph{any sequence of digits}. @end table +@noindent +In addition, the following are still being developed: + +@table @code +@item @var{query} +This action is currently undefined. +@end table + @noindent Notes: @@ -340,18 +339,14 @@ All the target output is prefixed by @samp{@@}. @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. +@xref{GDB/MI Draft Changes to Output Syntax, , @sc{gdb/mi} Draft Changes +to Output Syntax}, for proposed revisions to the current output syntax. + @node GDB/MI Simple Examples @subsection Simple Examples of @sc{gdb/mi} Interaction @cindex @sc{gdb/mi}, simple examples @@ -588,16 +583,10 @@ The corresponding @value{GDBN} command is @samp{ignore}. ^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", +^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@}, +bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", addr="0x000100d0",func="main",file="hello.c",line="5",times="0", -ignore="3"@}]@} +ignore="3"@}@} (@value{GDBP}) @end smallexample @@ -636,16 +625,10 @@ The corresponding @value{GDBN} command is @samp{condition}. ^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", +^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@}, +bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", addr="0x000100d0",func="main",file="hello.c",line="5",cond="1", -times="0",ignore="3"@}]@} +times="0",ignore="3"@}@} (@value{GDBP}) @end smallexample @@ -673,14 +656,7 @@ The corresponding @value{GDBN} command is @samp{delete}. ^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=[]@} +^done,BreakpointTable=@{@} (@value{GDBP}) @end example @@ -708,15 +684,9 @@ The corresponding @value{GDBN} command is @samp{disable}. ^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"@}]@} +^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@}, +bkpt=@{number="2",type="breakpoint",disp="keep",enabled="n", +addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}@} (@value{GDBP}) @end smallexample @@ -743,15 +713,9 @@ The corresponding @value{GDBN} command is @samp{enable}. ^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"@}]@} +^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@}, +bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y", +addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}@} (@value{GDBP}) @end smallexample @@ -849,17 +813,11 @@ The corresponding @value{GDBN} commands are @samp{break}, @samp{tbreak}, ^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", +^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@}, +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"@}]@} +addr="0x00010774",func="foo",file="recursive2.c",line="11",times="0"@}@} (@value{GDBP}) -break-insert -r foo.* ~int foo(int, int); @@ -898,7 +856,7 @@ 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. +field is an empty list. @subsubheading @value{GDBN} Command @@ -909,17 +867,11 @@ The corresponding @value{GDBN} command is @samp{info break}. @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", +^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@}, +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"@}]@} +addr="0x00010114",func="foo",file="hello.c",line="13",times="0"@}@} (@value{GDBP}) @end smallexample @@ -928,14 +880,7 @@ 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=[]@} +^done,BreakpointTable=@{@} (@value{GDBP}) @end smallexample @@ -978,7 +923,7 @@ Setting a watchpoint on a variable in the @code{main} function: ^running ^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@}, value=@{old="-268439212",new="55"@}, -frame=@{func="main",args=[],file="recursive2.c",line="5"@} +frame=@{func="main",args=@{@},file="recursive2.c",line="5"@} (@value{GDBP}) @end smallexample @@ -995,14 +940,14 @@ for the watchpoint going out of scope. ^running ^done,reason="watchpoint-trigger", wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@}, -frame=@{func="callee4",args=[], +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.\""@}], +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 @@ -1017,58 +962,40 @@ deleted. ^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", +^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@}, +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"@}]@} +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=[], +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", +^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@}, +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"@}]@} +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.\""@}], +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", +^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@}, +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"@}]@} +file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@}@} (@value{GDBP}) @end smallexample @@ -1153,7 +1080,7 @@ Disassemble from the current value of @code{$pc} to @code{$pc + 20}: (@value{GDBP}) -data-disassemble -s $pc -e "$pc + 20" -- 0 ^done, -asm_insns=[ +asm_insns=@{ @{address="0x000107c0",func-name="main",offset="4", inst="mov 2, %o0"@}, @{address="0x000107c4",func-name="main",offset="8", @@ -1163,7 +1090,7 @@ 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>"@}] +inst="or %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"@}@} (@value{GDBP}) @end smallexample @@ -1172,7 +1099,7 @@ Disassemble the whole @code{main} function. Line 32 is part of @smallexample -data-disassemble -f basics.c -l 32 -- 0 -^done,asm_insns=[ +^done,asm_insns=@{ @{address="0x000107bc",func-name="main",offset="0", inst="save %sp, -112, %sp"@}, @{address="0x000107c0",func-name="main",offset="4", @@ -1181,7 +1108,7 @@ inst="mov 2, %o0"@}, inst="sethi %hi(0x11800), %o2"@}, [@dots{}] @{address="0x0001081c",func-name="main",offset="96",inst="ret "@}, -@{address="0x00010820",func-name="main",offset="100",inst="restore "@}] +@{address="0x00010820",func-name="main",offset="100",inst="restore "@}@} (@value{GDBP}) @end smallexample @@ -1190,13 +1117,13 @@ 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=[ +^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"@}] +inst="sethi %hi(0x11800), %o2"@}@} (@value{GDBP}) @end smallexample @@ -1205,19 +1132,20 @@ 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=[ +^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=[ + testsuite/gdb.mi/basics.c",line_asm_insn=@{ @{address="0x000107bc",func-name="main",offset="0", -inst="save %sp, -112, %sp"@}]@}, +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=[ + 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"@}]@}] +inst="sethi %hi(0x11800), %o2"@}@}@}@} (@value{GDBP}) @end smallexample @@ -1291,12 +1219,12 @@ On a PPC MBX board: (@value{GDBP}) *stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main", -args=[],file="try.c",line="5"@} +args=@{@},file="try.c",line="5"@} (@value{GDBP}) -data-list-changed-registers -^done,changed-registers=["0","1","2","4","5","6","7","8","9", +^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"] +"24","25","26","27","28","30","31","64","65","66","67","69"@} (@value{GDBP}) @end smallexample @@ -1313,9 +1241,7 @@ args=[],file="try.c",line="5"@} 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. +names of the registers corresponding to the arguments. @subsubheading @value{GDBN} Command @@ -1329,16 +1255,16 @@ For the PPC MBX board: @smallexample (@value{GDBP}) -data-list-register-names -^done,register-names=["r0","r1","r2","r3","r4","r5","r6","r7", +^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"] +"pc","ps","cr","lr","ctr","xer"@} (@value{GDBP}) -data-list-register-names 1 2 3 -^done,register-names=["r1","r2","r3"] +^done,register-names=@{"r1","r2","r3"@} (@value{GDBP}) @end smallexample @@ -1386,11 +1312,11 @@ 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"@}] +^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"@}, +^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"@}, @@ -1425,7 +1351,7 @@ don't appear in the actual output): @{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"@}] +@{number="69",value="0x20002b03"@}@} (@value{GDBP}) @end smallexample @@ -1503,10 +1429,10 @@ word. Display each word in hex. 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"]@}] +prev-page="0x0000138a",memory=@{ +@{addr="0x00001390",data=@{"0x00","0x01"@}@}, +@{addr="0x00001392",data=@{"0x02","0x03"@}@}, +@{addr="0x00001394",data=@{"0x04","0x05"@}@}@} (@value{GDBP}) @end smallexample @@ -1518,8 +1444,8 @@ display as a single word formatted in decimal. 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"]@}] +next-page="0x00001512",prev-page="0x0000150e",memory=@{ +@{addr="0x00001510",data=@{"128"@}@}@} (@value{GDBP}) @end smallexample @@ -1532,15 +1458,15 @@ used as the non-printable character. 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=",-./"@}] +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 @@ -1851,7 +1777,7 @@ The corresponding @value{GDBN} corresponding is @samp{continue}. ^running (@value{GDBP}) @@Hello world -*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=[], +*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=@{@}, file="hello.c",line="13"@} (@value{GDBP}) @end smallexample @@ -1883,7 +1809,7 @@ Function returning @code{void}. ^running (@value{GDBP}) @@hello from foo -*stopped,reason="function-finished",frame=@{func="main",args=[], +*stopped,reason="function-finished",frame=@{func="main",args=@{@}, file="hello.c",line="7"@} (@value{GDBP}) @end smallexample @@ -1897,7 +1823,7 @@ value itself. ^running (@value{GDBP}) *stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo", -args=[@{name="a",value="1"],@{name="b",value="9"@}@}, +args=@{@{name="a",value="1"@},@{name="b",value="9"@}@}, file="recursive2.c",line="14"@}, gdb-result-var="$1",return-value="0" (@value{GDBP}) @@ -1935,7 +1861,7 @@ The corresponding @value{GDBN} command is @samp{interrupt}. 222^done (@value{GDBP}) 111*stopped,signal-name="SIGINT",signal-meaning="Interrupt", -frame=@{addr="0x00010140",func="foo",args=[],file="try.c",line="13"@} +frame=@{addr="0x00010140",func="foo",args=@{@},file="try.c",line="13"@} (@value{GDBP}) (@value{GDBP}) @@ -2032,7 +1958,7 @@ file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@} 000^running (@value{GDBP}) 000*stopped,reason="breakpoint-hit",bkptno="1", -frame=@{func="callee4",args=[], +frame=@{func="callee4",args=@{@}, file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@} (@value{GDBP}) 205-break-delete @@ -2040,8 +1966,8 @@ file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@} (@value{GDBP}) 111-exec-return 111^done,frame=@{level="0 ",func="callee3", -args=[@{name="strarg", -value="0x11940 \"A string argument.\""@}], +args=@{@{name="strarg", +value="0x11940 \"A string argument.\""@}@}, file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@} (@value{GDBP}) @end smallexample @@ -2075,7 +2001,7 @@ The corresponding @value{GDBN} command is @samp{run}. ^running (@value{GDBP}) *stopped,reason="breakpoint-hit",bkptno="1", -frame=@{func="main",args=[],file="recursive2.c",line="4"@} +frame=@{func="main",args=@{@},file="recursive2.c",line="4"@} (@value{GDBP}) @end smallexample @@ -2127,8 +2053,8 @@ Stepping into a function: ^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"@} +frame=@{func="foo",args=@{@{name="a",value="10"@}, +@{name="b",value="0"@}@},file="recursive2.c",line="11"@} (@value{GDBP}) @end smallexample @@ -2171,14 +2097,14 @@ The corresponding @value{GDBN} command is @samp{stepi}. (@value{GDBP}) *stopped,reason="end-stepping-range", -frame=@{func="foo",args=[],file="try.c",line="10"@} +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"@} +frame=@{addr="0x000100f4",func="foo",args=@{@},file="try.c",line="10"@} (@value{GDBP}) @end smallexample @@ -2209,7 +2135,7 @@ The corresponding @value{GDBN} command is @samp{until}. ^running (@value{GDBP}) x = 55 -*stopped,reason="location-reached",frame=@{func="main",args=[], +*stopped,reason="location-reached",frame=@{func="main",args=@{@}, file="recursive2.c",line="6"@} (@value{GDBP}) @end smallexample @@ -2553,7 +2479,7 @@ Signal handling commands are not implemented. @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node GDB/MI Stack Manipulation -@section @sc{gdb/mi} Stack Manipulation Commands +@section Stack manipulation commands in @sc{gdb/mi} @subheading The @code{-stack-info-frame} Command @@ -2645,7 +2571,7 @@ functionality of @samp{-stack-list-arguments}. (@value{GDBP}) -stack-list-frames ^done, -stack=[ +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", @@ -2655,39 +2581,39 @@ 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"@}] +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=[]@}] +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=[]@}, +stack-args=@{ +frame=@{level="0",args=@{@}@}, frame=@{level="1", - args=[@{name="strarg",value="0x11940 \"A string argument.\""@}]@}, -frame=@{level="2",args=[ + 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="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=[]@}] +@{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"]@}] +^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.\""@}]@}] +^done,stack-args=@{frame=@{level="2", +args=@{@{name="intarg",value="2"@}, +@{name="strarg",value="0x11940 \"A string argument.\""@}@}@}@} (@value{GDBP}) @end smallexample @@ -2736,7 +2662,7 @@ Full stack backtrace: (@value{GDBP}) -stack-list-frames ^done,stack= -[frame=@{level="0 ",addr="0x0001076c",func="foo", +@{frame=@{level="0 ",addr="0x0001076c",func="foo", file="recursive2.c",line="11"@}, frame=@{level="1 ",addr="0x000107a4",func="foo", file="recursive2.c",line="14"@}, @@ -2759,7 +2685,7 @@ frame=@{level="9 ",addr="0x000107a4",func="foo", frame=@{level="10",addr="0x000107a4",func="foo", file="recursive2.c",line="14"@}, frame=@{level="11",addr="0x00010738",func="main", - file="recursive2.c",line="4"@}] + file="recursive2.c",line="4"@}@} (@value{GDBP}) @end smallexample @@ -2769,12 +2695,12 @@ Show frames between @var{low_frame} and @var{high_frame}: (@value{GDBP}) -stack-list-frames 3 5 ^done,stack= -[frame=@{level="3 ",addr="0x000107a4",func="foo", +@{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"@}] + file="recursive2.c",line="14"@}@} (@value{GDBP}) @end smallexample @@ -2784,8 +2710,8 @@ Show a single frame: (@value{GDBP}) -stack-list-frames 3 3 ^done,stack= -[frame=@{level="3 ",addr="0x000107a4",func="foo", - file="recursive2.c",line="14"@}] +@{frame=@{level="3 ",addr="0x000107a4",func="foo", + file="recursive2.c",line="14"@}@} (@value{GDBP}) @end smallexample @@ -2812,11 +2738,11 @@ prints also their values. @smallexample (@value{GDBP}) -stack-list-locals 0 -^done,locals=[name="A",name="B",name="C"] +^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"@}] +^done,locals=@{@{name="A",value="1"@},@{name="B",value="2"@}, + @{name="C",value="3"@}@} (@value{GDBP}) @end smallexample @@ -3320,7 +3246,7 @@ which the target program is, in the following form: @smallexample ^connected,addr="@var{address}",func="@var{function name}", - args=[@var{arg list}] + args=@{@var{arg list}@} @end smallexample @subsubheading @value{GDBN} Command @@ -3332,7 +3258,7 @@ The corresponding @value{GDBN} command is @samp{target}. @smallexample (@value{GDBP}) -target-select async /dev/ttya -^connected,addr="0xfe00a300",func="??",args=[] +^connected,addr="0xfe00a300",func="??",args=@{@} (@value{GDBP}) @end smallexample @@ -3448,8 +3374,8 @@ number-of-threads="3" -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"@} +args=@{@{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""@}, +@{name="arg",value="0x2"@}@},file="vprintf.c",line="31"@} (@value{GDBP}) @end smallexample @@ -3816,6 +3742,164 @@ 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. +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Draft Changes to Output Syntax +@section @sc{gdb/mi} Draft Changes to Output Syntax + +@cindex draft changes to output syntax of @sc{gdb/mi} +@cindex @sc{gdb/mi}, draft changes to output syntax + +One problem identified in the existing @sc{gdb/mi} output syntax was the +difficulty in differentiating between a tuple such as: + +@example +@{number="1",type="breakpoint",disp="keep",enabled="y"@} +@end example + +where each value has a unique label, and a list such as: + +@example +@{"1","2","4"@} +@{bp="1",bp="2",bp="4"@} +@end example + +where values are un-labeled or the label is duplicated. + +What follows is a draft revision to the output specification that +addresses this problem. + +The output from @sc{gdb/mi} consists of zero or more out-of-band records +optionally followed by a single result record, the result record being +for the most recent command input. The sequence is terminated by +@samp{(@value{GDBP})}. + +Asynchronous @sc{gdb/mi} output is similar. + +Each output record directly associated with an input command is prefixed +by the input command's @code{@var{token}}. + +@table @code +@item @var{output} @expansion{} +@{ @var{out-of-band-record} @} @code{[} @var{result-record} @code{]} "@code{(@value{GDBP})}" @var{nl} + +@item @var{result-record} @expansion{} +@code{[} @var{token} @code{]} "^" @var{result-class} @{ "," @var{result} @} @var{nl} + +@item @var{out-of-band-record} @expansion{} +@var{async-record} @code{|} @var{stream-record} + +@item @var{async-record} @expansion{} +@var{exec-async-output} @code{|} @var{status-async-output} @code{|} @var{notify-async-output} + +@item @var{exec-async-output} @expansion{} +@code{[} @var{token} @code{]} "*" @var{async-output} + +@item @var{status-async-output} @expansion{} +@code{[} @var{token} @code{]} "+" @var{async-output} + +@item @var{notify-async-output} @expansion{} +@code{[} @var{token} @code{]} "=" @var{async-output} + +@item @var{async-output} @expansion{} +@var{async-class} @{ "," @var{result} @} @var{nl} + +@item @var{result-class} @expansion{} +"done" @code{|} "running" @code{|} "connected" @code{|} "error" @code{|} "exit" + +@item @var{async-class} @expansion{} +"stopped" @code{|} @emph{others depending on need as still in development} + +@item @var{result} @expansion{} +@var{string} "=" @var{value} + +@item @var{value} @expansion{} +@var{c-string} @code{|} @var{tupple} @code{|} @var{list} + +@item @var{tupple} @expansion{} +"@{@}" @code{|} "@{" @var{result} @{ "," @var{result} @} "@}" + +@item @var{list} @expansion{} +"@code{[]}" @code{|} "@code{[}" @var{value} @{ "," @var{value} @} "@code{]}" + +@item @var{string} @expansion{} +@emph{[-A-Za-z\.0-9_]*} + +@item @var{c-string} @expansion{} +@emph{See the input specification} + +@item @var{stream-record} @expansion{} +@var{console-stream-output} @code{|} @var{target-stream-output} @code{|} @var{log-stream-output} + +@item @var{console-stream-output} @expansion{} +"~" @var{c-string} + +@item @var{target-stream-output} @expansion{} +"@@" @var{c-string} + +@item @var{log-stream-output} @expansion{} +"&" @var{c-string} + +@item @var{nl} @expansion{} +CR @code{|} CR-LF + +@item @var{token} @expansion{} +"any sequence of digits" + +@end table + +In addition, the following are still being developed. + +@table @code + +@item @var{query} +This action is currently undefined. + +@end table + +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 @code{-exec-interrupt} command, the token +associated with the `*stopped' message is the one of the original +execution command, not the one of the interrupt command. + +@item +@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 the prefix @samp{+}. + +@item +@var{exec-async-output} contains asynchronous state change on the target +(stopped, started, disappeared). All async output is prefixed by +the prefix @samp{*}. + +@item +@var{notify-async-output} contains supplementary information that the +client should handle (new breakpoint information). All notify output is +prefixed by the prefix @samp{=}. + +@item +@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 the prefix @samp{~}. + +@item +@var{target-stream-output} is the output produced by the target program. +All the target output is prefixed by the prefix @samp{@@}. + +@item +@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 the prefix @samp{&}. + +@end itemize + @c Local variables: @c change-log-default-name: "ChangeLog-mi" @c End: diff --git a/gdb/mi/mi-cmd-disas.c b/gdb/mi/mi-cmd-disas.c index 0b513244c6b..1937eb05c01 100644 --- a/gdb/mi/mi-cmd-disas.c +++ b/gdb/mi/mi-cmd-disas.c @@ -377,7 +377,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc) /* Just one line to print. */ if (next_line == mle[i].line) { - ui_out_tuple_begin (uiout, "src_and_asm_line"); + ui_out_list_begin (uiout, "src_and_asm_line"); print_source_lines (symtab, next_line, mle[i].line + 1, 0); } else @@ -385,21 +385,21 @@ mi_cmd_disassemble (char *command, char **argv, int argc) /* Several source lines w/o asm instructions associated. */ for (; next_line < mle[i].line; next_line++) { - ui_out_tuple_begin (uiout, "src_and_asm_line"); + ui_out_list_begin (uiout, "src_and_asm_line"); print_source_lines (symtab, next_line, mle[i].line + 1, 0); ui_out_list_begin (uiout, "line_asm_insn"); ui_out_list_end (uiout); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); } /* Print the last line and leave list open for asm instructions to be added. */ - ui_out_tuple_begin (uiout, "src_and_asm_line"); + ui_out_list_begin (uiout, "src_and_asm_line"); print_source_lines (symtab, next_line, mle[i].line + 1, 0); } } else { - ui_out_tuple_begin (uiout, "src_and_asm_line"); + ui_out_list_begin (uiout, "src_and_asm_line"); print_source_lines (symtab, mle[i].line, mle[i].line + 1, 0); } @@ -418,7 +418,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc) else num_displayed++; } - ui_out_tuple_begin (uiout, NULL); + ui_out_list_begin (uiout, NULL); ui_out_field_core_addr (uiout, "address", pc); if (!build_address_symbolic (pc, 0, &name, &offset, &filename, &line, &unmapped)) @@ -437,12 +437,12 @@ mi_cmd_disassemble (char *command, char **argv, int argc) pc += (*tm_print_insn) (pc, &di); ui_out_field_stream (uiout, "inst", stb); ui_file_rewind (stb->stream); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); } if (close_list) { ui_out_list_end (uiout); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); close_list = 0; } if (how_many >= 0) @@ -466,7 +466,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc) else num_displayed++; } - ui_out_tuple_begin (uiout, NULL); + ui_out_list_begin (uiout, NULL); ui_out_field_core_addr (uiout, "address", pc); if (!build_address_symbolic (pc, 0, &name, &offset, &filename, &line, &unmapped)) @@ -485,7 +485,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc) pc += (*tm_print_insn) (pc, &di); ui_out_field_stream (uiout, "inst", stb); ui_file_rewind (stb->stream); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); } ui_out_list_end (uiout); } diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index 3cfdadbda8b..2d80be745ae 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -192,10 +192,10 @@ mi_cmd_stack_list_args (char *command, char **argv, int argc) i++, fi = get_prev_frame (fi)) { QUIT; - ui_out_tuple_begin (uiout, "frame"); + ui_out_list_begin (uiout, "frame"); ui_out_field_int (uiout, "level", i); list_args_or_locals (0, atoi (argv[0]), fi); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); } ui_out_list_end (uiout); @@ -265,7 +265,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi) if (print_me) { if (values) - ui_out_tuple_begin (uiout, NULL); + ui_out_list_begin (uiout, NULL); ui_out_field_string (uiout, "name", SYMBOL_NAME (sym)); if (values) @@ -280,7 +280,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi) sym2 = sym; print_variable_value (sym2, fi, stb->stream); ui_out_field_stream (uiout, "value", stb); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); } } } diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index 3ad96731e65..dfdc4a63176 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -273,11 +273,11 @@ mi_cmd_var_list_children (char *command, char **argv, int argc) if (numchild <= 0) return MI_CMD_DONE; - ui_out_tuple_begin (uiout, "children"); + ui_out_list_begin (uiout, "children"); cc = childlist; while (*cc != NULL) { - ui_out_tuple_begin (uiout, "child"); + ui_out_list_begin (uiout, "child"); ui_out_field_string (uiout, "name", varobj_get_objname (*cc)); ui_out_field_string (uiout, "exp", varobj_get_expression (*cc)); ui_out_field_int (uiout, "numchild", varobj_get_num_children (*cc)); @@ -285,10 +285,10 @@ mi_cmd_var_list_children (char *command, char **argv, int argc) /* C++ pseudo-variables (public, private, protected) do not have a type */ if (type) ui_out_field_string (uiout, "type", varobj_get_type (*cc)); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); cc++; } - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); xfree (childlist); return MI_CMD_DONE; } @@ -421,10 +421,10 @@ mi_cmd_var_update (char *command, char **argv, int argc) if ((*name == '*') && (*(name + 1) == '\0')) { nv = varobj_list (&rootlist); - ui_out_tuple_begin (uiout, "changelist"); + ui_out_list_begin (uiout, "changelist"); if (nv <= 0) { - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); return MI_CMD_DONE; } cr = rootlist; @@ -434,7 +434,7 @@ mi_cmd_var_update (char *command, char **argv, int argc) cr++; } xfree (rootlist); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); } else { @@ -443,9 +443,9 @@ mi_cmd_var_update (char *command, char **argv, int argc) if (var == NULL) error ("mi_cmd_var_update: Variable object not found"); - ui_out_tuple_begin (uiout, "changelist"); + ui_out_list_begin (uiout, "changelist"); varobj_update_one (var); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); } return MI_CMD_DONE; } diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 5187cb056c2..06638bf3aa1 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -271,7 +271,7 @@ mi_cmd_data_list_register_names (char *command, char **argv, int argc) case, some entries of REGISTER_NAME will change depending upon the particular processor being debugged. */ - numregs = NUM_REGS + NUM_PSEUDO_REGS; + numregs = NUM_REGS; ui_out_list_begin (uiout, "register-names"); @@ -283,9 +283,9 @@ mi_cmd_data_list_register_names (char *command, char **argv, int argc) { if (REGISTER_NAME (regnum) == NULL || *(REGISTER_NAME (regnum)) == '\0') - ui_out_field_string (uiout, NULL, ""); - else - ui_out_field_string (uiout, NULL, REGISTER_NAME (regnum)); + continue; + + ui_out_field_string (uiout, NULL, REGISTER_NAME (regnum)); } } @@ -293,16 +293,17 @@ mi_cmd_data_list_register_names (char *command, char **argv, int argc) for (i = 0; i < argc; i++) { regnum = atoi (argv[i]); - if (regnum < 0 || regnum >= numregs) + + if (regnum >= 0 + && regnum < numregs + && REGISTER_NAME (regnum) != NULL + && *REGISTER_NAME (regnum) != '\000') + ui_out_field_string (uiout, NULL, REGISTER_NAME (regnum)); + else { xasprintf (&mi_error_message, "bad register number"); return MI_CMD_ERROR; } - if (REGISTER_NAME (regnum) == NULL - || *(REGISTER_NAME (regnum)) == '\0') - ui_out_field_string (uiout, NULL, ""); - else - ui_out_field_string (uiout, NULL, REGISTER_NAME (regnum)); } ui_out_list_end (uiout); return MI_CMD_DONE; @@ -443,12 +444,12 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc) if (REGISTER_NAME (regnum) == NULL || *(REGISTER_NAME (regnum)) == '\0') continue; - ui_out_tuple_begin (uiout, NULL); + ui_out_list_begin (uiout, NULL); ui_out_field_int (uiout, "number", regnum); result = get_register (regnum, format); if (result == -1) return MI_CMD_ERROR; - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); } } @@ -462,12 +463,12 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc) && REGISTER_NAME (regnum) != NULL && *REGISTER_NAME (regnum) != '\000') { - ui_out_tuple_begin (uiout, NULL); + ui_out_list_begin (uiout, NULL); ui_out_field_int (uiout, "number", regnum); result = get_register (regnum, format); if (result == -1) return MI_CMD_ERROR; - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); } else { @@ -899,7 +900,7 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc) { int col; int col_byte; - ui_out_tuple_begin (uiout, NULL); + ui_out_list_begin (uiout, NULL); ui_out_field_core_addr (uiout, "addr", addr + row_byte); /* ui_out_field_core_addr_symbolic (uiout, "saddr", addr + row_byte); */ ui_out_list_begin (uiout, "data"); @@ -939,7 +940,7 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc) } ui_out_field_stream (uiout, "ascii", stream); } - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); } ui_out_stream_delete (stream); ui_out_list_end (uiout); @@ -1271,7 +1272,6 @@ mi_execute_async_cli_command (char *mi, char *args, int from_tty) xasprintf (&run, "%s %s", mi, async_args); make_exec_cleanup (free, run); add_continuation (mi_exec_async_cli_cmd_continuation, NULL); - old_cleanups = NULL; } else { @@ -1350,7 +1350,7 @@ mi_load_progress (const char *section_name, static char *previous_sect_name = NULL; int new_section; - if (!interpreter_p || strncmp (interpreter_p, "mi", 2) != 0) + if (!interpreter_p || strcmp (interpreter_p, "mi") != 0) return; update_threshold.tv_sec = 0; @@ -1376,11 +1376,11 @@ mi_load_progress (const char *section_name, if (last_async_command) fputs_unfiltered (last_async_command, raw_stdout); fputs_unfiltered ("+download", raw_stdout); - ui_out_tuple_begin (uiout, NULL); + ui_out_list_begin (uiout, NULL); ui_out_field_string (uiout, "section", section_name); ui_out_field_int (uiout, "section-size", total_section); ui_out_field_int (uiout, "total-size", grand_total); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); mi_out_put (uiout, raw_stdout); fputs_unfiltered ("\n", raw_stdout); gdb_flush (raw_stdout); @@ -1394,13 +1394,13 @@ mi_load_progress (const char *section_name, if (last_async_command) fputs_unfiltered (last_async_command, raw_stdout); fputs_unfiltered ("+download", raw_stdout); - ui_out_tuple_begin (uiout, NULL); + ui_out_list_begin (uiout, NULL); ui_out_field_string (uiout, "section", section_name); ui_out_field_int (uiout, "section-sent", sent_so_far); ui_out_field_int (uiout, "section-size", total_section); ui_out_field_int (uiout, "total-sent", total_sent); ui_out_field_int (uiout, "total-size", grand_total); - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); mi_out_put (uiout, raw_stdout); fputs_unfiltered ("\n", raw_stdout); gdb_flush (raw_stdout); @@ -1408,7 +1408,7 @@ mi_load_progress (const char *section_name, } static void -mi_command_loop (int mi_version) +mi_command_loop (void) { /* HACK: Force stdout/stderr to point at the console. This avoids any potential side effects caused by legacy code that is still @@ -1424,7 +1424,7 @@ mi_command_loop (int mi_version) /* HACK: Poke the ui_out table directly. Should we be creating a mi_out object wired up to the above gdb_stdout / gdb_stderr? */ - uiout = mi_out_new (mi_version); + uiout = mi_out_new (); /* HACK: Override any other interpreter hooks. We need to create a real event table and pass in that. */ @@ -1463,18 +1463,6 @@ mi_command_loop (int mi_version) start_event_loop (); } -static void -mi0_command_loop (void) -{ - mi_command_loop (0); -} - -static void -mi1_command_loop (void) -{ - mi_command_loop (1); -} - static void setup_architecture_data (void) { @@ -1493,30 +1481,24 @@ mi_init_ui (char *arg0) void _initialize_mi_main (void) { - if (interpreter_p == NULL) - return; - /* If we're _the_ interpreter, take control. */ - if (strcmp (interpreter_p, "mi0") == 0) - command_loop_hook = mi0_command_loop; - else if (strcmp (interpreter_p, "mi") == 0 - || strcmp (interpreter_p, "mi1") == 0) - command_loop_hook = mi1_command_loop; - else - return; - - init_ui_hook = mi_init_ui; - setup_architecture_data (); - register_gdbarch_swap (&old_regs, sizeof (old_regs), NULL); - register_gdbarch_swap (NULL, 0, setup_architecture_data); - if (event_loop_p) + if (interpreter_p + && strcmp (interpreter_p, "mi") == 0) { - /* These overwrite some of the initialization done in - _intialize_event_loop. */ - call_readline = gdb_readline2; - input_handler = mi_execute_command_wrapper; - add_file_handler (input_fd, stdin_event_handler, 0); - async_command_editing_p = 0; + init_ui_hook = mi_init_ui; + command_loop_hook = mi_command_loop; + setup_architecture_data (); + register_gdbarch_swap (&old_regs, sizeof (old_regs), NULL); + register_gdbarch_swap (NULL, 0, setup_architecture_data); + if (event_loop_p) + { + /* These overwrite some of the initialization done in + _intialize_event_loop. */ + call_readline = gdb_readline2; + input_handler = mi_execute_command_wrapper; + add_file_handler (input_fd, stdin_event_handler, 0); + async_command_editing_p = 0; + } } /* FIXME: Should we notify main that we are here as a possible interpreter? */ diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c index 7e09f2d1494..612cdf8c94d 100644 --- a/gdb/mi/mi-out.c +++ b/gdb/mi/mi-out.c @@ -31,39 +31,34 @@ struct ui_out_data { - int suppress_field_separator; - int suppress_output; - int mi_version; + int supress_field_separator; + int first_header; struct ui_file *buffer; }; /* These are the MI output functions */ -static void mi_table_begin (struct ui_out *uiout, int nbrofcols, - int nr_rows, const char *tblid); +static void mi_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid); static void mi_table_body (struct ui_out *uiout); static void mi_table_end (struct ui_out *uiout); static void mi_table_header (struct ui_out *uiout, int width, - enum ui_align alig, const char *col_name, - const char *colhdr); -static void mi_begin (struct ui_out *uiout, enum ui_out_type type, - int level, const char *id); -static void mi_end (struct ui_out *uiout, enum ui_out_type type, int level); + enum ui_align alig, char *colhdr); +static void mi_list_begin (struct ui_out *uiout, int list_flag, char *lstid); +static void mi_list_end (struct ui_out *uiout, int list_flag); static void mi_field_int (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, const char *fldname, int value); + enum ui_align alig, char *fldname, int value); static void mi_field_skip (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, const char *fldname); + enum ui_align alig, char *fldname); static void mi_field_string (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, const char *fldname, + enum ui_align alig, char *fldname, const char *string); static void mi_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align, - const char *fldname, const char *format, - va_list args); + char *fldname, char *format, va_list args); static void mi_spaces (struct ui_out *uiout, int numspaces); -static void mi_text (struct ui_out *uiout, const char *string); -static void mi_message (struct ui_out *uiout, int verbosity, - const char *format, va_list args); +static void mi_text (struct ui_out *uiout, char *string); +static void mi_message (struct ui_out *uiout, int verbosity, char *format, + va_list args); static void mi_wrap_hint (struct ui_out *uiout, char *identstring); static void mi_flush (struct ui_out *uiout); @@ -78,8 +73,8 @@ struct ui_out_impl mi_ui_out_impl = mi_table_body, mi_table_end, mi_table_header, - mi_begin, - mi_end, + mi_list_begin, + mi_list_end, mi_field_int, mi_field_skip, mi_field_string, @@ -88,17 +83,15 @@ struct ui_out_impl mi_ui_out_impl = mi_text, mi_message, mi_wrap_hint, - mi_flush, - 1, /* Needs MI hacks. */ + mi_flush }; /* Prototypes for local functions */ extern void _initialize_mi_out (void); static void field_separator (struct ui_out *uiout); -static void mi_open (struct ui_out *uiout, const char *name, - enum ui_out_type type); -static void mi_close (struct ui_out *uiout, enum ui_out_type type); +static void list_open (struct ui_out *uiout); +static void list_close (struct ui_out *uiout); static void out_field_fmt (struct ui_out *uiout, int fldno, char *fldname, char *format,...); @@ -106,26 +99,15 @@ static void out_field_fmt (struct ui_out *uiout, int fldno, char *fldname, /* Mark beginning of a table */ void -mi_table_begin (struct ui_out *uiout, - int nr_cols, - int nr_rows, - const char *tblid) +mi_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid) { struct ui_out_data *data = ui_out_data (uiout); - mi_open (uiout, tblid, ui_out_type_tuple); - if (data->mi_version == 0) - { - if (nr_rows == 0) - data->suppress_output = 1; - else - mi_open (uiout, "hdr", ui_out_type_list); - return; - } - mi_field_int (uiout, -1/*fldno*/, -1/*width*/, -1/*alin*/, - "nr_rows", nr_rows); - mi_field_int (uiout, -1/*fldno*/, -1/*width*/, -1/*alin*/, - "nr_cols", nr_cols); - mi_open (uiout, "hdr", ui_out_type_list); + field_separator (uiout); + if (tblid) + fprintf_unfiltered (data->buffer, "%s=", tblid); + list_open (uiout); + data->first_header = 0; + data->supress_field_separator = 1; } /* Mark beginning of a table body */ @@ -134,13 +116,9 @@ void mi_table_body (struct ui_out *uiout) { struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; /* close the table header line if there were any headers */ - mi_close (uiout, ui_out_type_list); - if (data->mi_version == 0) - return; - mi_open (uiout, "body", ui_out_type_list); + if (data->first_header) + list_close (uiout); } /* Mark end of a table */ @@ -149,76 +127,56 @@ void mi_table_end (struct ui_out *uiout) { struct ui_out_data *data = ui_out_data (uiout); - data->suppress_output = 0; - if (data->mi_version == 0) - { - mi_close (uiout, ui_out_type_tuple); - return; - } - mi_close (uiout, ui_out_type_list); /* body */ - mi_close (uiout, ui_out_type_tuple); + list_close (uiout); + /* If table was empty this flag did not get reset yet */ + data->supress_field_separator = 0; } /* Specify table header */ void -mi_table_header (struct ui_out *uiout, int width, int alignment, - const char *col_name, - const char *colhdr) +mi_table_header (struct ui_out *uiout, int width, int alignment, char *colhdr) { struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; - if (data->mi_version == 0) + if (!data->first_header++) { - mi_field_string (uiout, 0, width, alignment, 0, colhdr); - return; + fputs_unfiltered ("hdr=", data->buffer); + list_open (uiout); } - mi_open (uiout, NULL, ui_out_type_tuple); - mi_field_int (uiout, 0, 0, 0, "width", width); - mi_field_int (uiout, 0, 0, 0, "alignment", alignment); - mi_field_string (uiout, 0, 0, 0, "col_name", col_name); - mi_field_string (uiout, 0, width, alignment, "colhdr", colhdr); - mi_close (uiout, ui_out_type_tuple); + mi_field_string (uiout, 0, width, alignment, 0, colhdr); } /* Mark beginning of a list */ void -mi_begin (struct ui_out *uiout, - enum ui_out_type type, - int level, - const char *id) +mi_list_begin (struct ui_out *uiout, int list_flag, char *lstid) { struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; - mi_open (uiout, id, type); + field_separator (uiout); + data->supress_field_separator = 1; + if (lstid) + fprintf_unfiltered (data->buffer, "%s=", lstid); + list_open (uiout); } /* Mark end of a list */ void -mi_end (struct ui_out *uiout, - enum ui_out_type type, - int level) +mi_list_end (struct ui_out *uiout, int list_flag) { struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; - mi_close (uiout, type); + list_close (uiout); + /* If list was empty this flag did not get reset yet */ + data->supress_field_separator = 0; } /* output an int field */ void mi_field_int (struct ui_out *uiout, int fldno, int width, int alignment, - const char *fldname, int value) + char *fldname, int value) { char buffer[20]; /* FIXME: how many chars long a %d can become? */ - struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; sprintf (buffer, "%d", value); mi_field_string (uiout, fldno, width, alignment, fldname, buffer); @@ -228,11 +186,8 @@ mi_field_int (struct ui_out *uiout, int fldno, int width, int alignment, void mi_field_skip (struct ui_out *uiout, int fldno, int width, int alignment, - const char *fldname) + char *fldname) { - struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; mi_field_string (uiout, fldno, width, alignment, fldname, ""); } @@ -244,12 +199,10 @@ mi_field_string (struct ui_out *uiout, int fldno, int width, int align, - const char *fldname, + char *fldname, const char *string) { struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; field_separator (uiout); if (fldname) fprintf_unfiltered (data->buffer, "%s=", fldname); @@ -264,13 +217,9 @@ mi_field_string (struct ui_out *uiout, void mi_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align, - const char *fldname, - const char *format, - va_list args) + char *fldname, char *format, va_list args) { struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_output) - return; field_separator (uiout); if (fldname) fprintf_unfiltered (data->buffer, "%s=\"", fldname); @@ -286,14 +235,12 @@ mi_spaces (struct ui_out *uiout, int numspaces) } void -mi_text (struct ui_out *uiout, const char *string) +mi_text (struct ui_out *uiout, char *string) { } void -mi_message (struct ui_out *uiout, int verbosity, - const char *format, - va_list args) +mi_message (struct ui_out *uiout, int verbosity, char *format, va_list args) { } @@ -343,58 +290,24 @@ static void field_separator (struct ui_out *uiout) { struct ui_out_data *data = ui_out_data (uiout); - if (data->suppress_field_separator) - data->suppress_field_separator = 0; + if (data->supress_field_separator) + data->supress_field_separator = 0; else fputc_unfiltered (',', data->buffer); } static void -mi_open (struct ui_out *uiout, - const char *name, - enum ui_out_type type) +list_open (struct ui_out *uiout) { struct ui_out_data *data = ui_out_data (uiout); - field_separator (uiout); - data->suppress_field_separator = 1; - if (name) - fprintf_unfiltered (data->buffer, "%s=", name); - switch (type) - { - case ui_out_type_tuple: - fputc_unfiltered ('{', data->buffer); - break; - case ui_out_type_list: - if (data->mi_version == 0) - fputc_unfiltered ('{', data->buffer); - else - fputc_unfiltered ('[', data->buffer); - break; - default: - internal_error (__FILE__, __LINE__, "bad switch"); - } + fputc_unfiltered ('{', data->buffer); } static void -mi_close (struct ui_out *uiout, - enum ui_out_type type) +list_close (struct ui_out *uiout) { struct ui_out_data *data = ui_out_data (uiout); - switch (type) - { - case ui_out_type_tuple: - fputc_unfiltered ('}', data->buffer); - break; - case ui_out_type_list: - if (data->mi_version == 0) - fputc_unfiltered ('}', data->buffer); - else - fputc_unfiltered (']', data->buffer); - break; - default: - internal_error (__FILE__, __LINE__, "bad switch"); - } - data->suppress_field_separator = 0; + fputc_unfiltered ('}', data->buffer); } /* add a string to the buffer */ @@ -435,12 +348,11 @@ mi_out_put (struct ui_out *uiout, /* initalize private members at startup */ struct ui_out * -mi_out_new (int mi_version) +mi_out_new (void) { int flags = 0; struct ui_out_data *data = XMALLOC (struct ui_out_data); - data->suppress_field_separator = 0; - data->mi_version = mi_version; + data->supress_field_separator = 0; /* FIXME: This code should be using a ``string_file'' and not the TUI buffer hack. */ data->buffer = mem_fileopen (); diff --git a/gdb/mi/mi-out.h b/gdb/mi/mi-out.h index 1ae693f4761..37a643ca638 100644 --- a/gdb/mi/mi-out.h +++ b/gdb/mi/mi-out.h @@ -25,7 +25,7 @@ struct ui_out; struct ui_file; -extern struct ui_out *mi_out_new (int mi_version); +extern struct ui_out *mi_out_new (void); extern void mi_out_put (struct ui_out *uiout, struct ui_file *stream); extern void mi_out_rewind (struct ui_out *uiout); extern void mi_out_buffered (struct ui_out *uiout, char *string); diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 94817474318..7608297a8e8 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -47,8 +47,6 @@ #include "symfile.h" #include "objfiles.h" #include "demangle.h" -#include "value.h" -#include "cp-abi.h" /* Accumulate the minimal symbols for each objfile in bunches of BUNCH_SIZE. At the end, copy them all into one newly allocated location on an objfile's @@ -77,7 +75,7 @@ static int msym_count; /* Prototypes for local functions. */ -static int compare_minimal_symbols (const PTR, const PTR); +static int compare_minimal_symbols (const void *, const void *); static int compact_minimal_symbols (struct minimal_symbol *, int, struct objfile *); @@ -958,24 +956,9 @@ install_minimal_symbols (struct objfile *objfile) objfile->minimal_symbol_count = mcount; objfile->msymbols = msymbols; - /* Try to guess the appropriate C++ ABI by looking at the names - of the minimal symbols in the table. */ - { - int i; - - for (i = 0; i < mcount; i++) - { - const char *name = SYMBOL_NAME (&objfile->msymbols[i]); - if (name[0] == '_' && name[1] == 'Z') - { - switch_to_cp_abi ("gnu-v3"); - break; - } - } - } - /* Now walk through all the minimal symbols, selecting the newly added ones and attempting to cache their C++ demangled names. */ + for (; mcount-- > 0; msymbols++) SYMBOL_INIT_DEMANGLED_NAME (msymbols, &objfile->symbol_obstack); diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index f723e4603f9..2b312f379d5 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -669,21 +669,21 @@ mips_fetch_instruction (CORE_ADDR addr) /* These the fields of 32 bit mips instructions */ -#define mips32_op(x) (x >> 26) -#define itype_op(x) (x >> 26) -#define itype_rs(x) ((x >> 21) & 0x1f) +#define mips32_op(x) (x >> 25) +#define itype_op(x) (x >> 25) +#define itype_rs(x) ((x >> 21)& 0x1f) #define itype_rt(x) ((x >> 16) & 0x1f) -#define itype_immediate(x) (x & 0xffff) +#define itype_immediate(x) ( x & 0xffff) -#define jtype_op(x) (x >> 26) -#define jtype_target(x) (x & 0x03ffffff) +#define jtype_op(x) (x >> 25) +#define jtype_target(x) ( x & 0x03fffff) -#define rtype_op(x) (x >> 26) -#define rtype_rs(x) ((x >> 21) & 0x1f) -#define rtype_rt(x) ((x >> 16) & 0x1f) -#define rtype_rd(x) ((x >> 11) & 0x1f) -#define rtype_shamt(x) ((x >> 6) & 0x1f) -#define rtype_funct(x) (x & 0x3f) +#define rtype_op(x) (x >>25) +#define rtype_rs(x) ((x>>21) & 0x1f) +#define rtype_rt(x) ((x>>16) & 0x1f) +#define rtype_rd(x) ((x>>11) & 0x1f) +#define rtype_shamt(x) ((x>>6) & 0x1f) +#define rtype_funct(x) (x & 0x3f ) static CORE_ADDR mips32_relative_offset (unsigned long inst) @@ -706,39 +706,25 @@ mips32_next_pc (CORE_ADDR pc) unsigned long inst; int op; inst = mips_fetch_instruction (pc); - if ((inst & 0xe0000000) != 0) /* Not a special, jump or branch instruction */ + if ((inst & 0xe0000000) != 0) /* Not a special, junp or branch instruction */ { - if (itype_op (inst) >> 2 == 5) - /* BEQL, BNEL, BLEZL, BGTZL: bits 0101xx */ + if ((inst >> 27) == 5) /* BEQL BNEZ BLEZL BGTZE , bits 0101xx */ { - op = (itype_op (inst) & 0x03); + op = ((inst >> 25) & 0x03); switch (op) { - case 0: /* BEQL */ - goto equal_branch; - case 1: /* BNEL */ - goto neq_branch; - case 2: /* BLEZL */ - goto less_branch; - case 3: /* BGTZ */ - goto greater_branch; + case 0: + goto equal_branch; /* BEQL */ + case 1: + goto neq_branch; /* BNEZ */ + case 2: + goto less_branch; /* BLEZ */ + case 3: + goto greater_branch; /* BGTZ */ default: pc += 4; } } - else if (itype_op (inst) == 17 && itype_rs (inst) == 8) - /* BC1F, BC1FL, BC1T, BC1TL: 010001 01000 */ - { - int tf = itype_rt (inst) & 0x01; - int cnum = itype_rt (inst) >> 2; - int fcrcs = read_signed_register (FCRCS_REGNUM); - int cond = ((fcrcs >> 24) & 0x0e) | ((fcrcs >> 23) & 0x01); - - if (((cond >> cnum) & 0x01) == tf) - pc += mips32_relative_offset (inst) + 4; - else - pc += 8; - } else pc += 4; /* Not a branch, next instruction is easy */ } @@ -746,7 +732,7 @@ mips32_next_pc (CORE_ADDR pc) { /* This gets way messy */ /* Further subdivide into SPECIAL, REGIMM and other */ - switch (op = itype_op (inst) & 0x07) /* extract bits 28,27,26 */ + switch (op = ((inst >> 26) & 0x07)) /* extract bits 28,27,26 */ { case 0: /* SPECIAL */ op = rtype_funct (inst); @@ -761,15 +747,15 @@ mips32_next_pc (CORE_ADDR pc) pc += 4; } - break; /* end SPECIAL */ + break; /* end special */ case 1: /* REGIMM */ { - op = itype_rt (inst); /* branch condition */ - switch (op) + op = jtype_op (inst); /* branch condition */ + switch (jtype_op (inst)) { case 0: /* BLTZ */ - case 2: /* BLTZL */ - case 16: /* BLTZAL */ + case 2: /* BLTXL */ + case 16: /* BLTZALL */ case 18: /* BLTZALL */ less_branch: if (read_signed_register (itype_rs (inst)) < 0) @@ -777,7 +763,7 @@ mips32_next_pc (CORE_ADDR pc) else pc += 8; /* after the delay slot */ break; - case 1: /* BGEZ */ + case 1: /* GEZ */ case 3: /* BGEZL */ case 17: /* BGEZAL */ case 19: /* BGEZALL */ @@ -787,19 +773,19 @@ mips32_next_pc (CORE_ADDR pc) else pc += 8; /* after the delay slot */ break; - /* All of the other instructions in the REGIMM category */ + /* All of the other intructions in the REGIMM catagory */ default: pc += 4; } } - break; /* end REGIMM */ + break; /* end REGIMM */ case 2: /* J */ case 3: /* JAL */ { unsigned long reg; reg = jtype_target (inst) << 2; - /* Upper four bits get never changed... */ pc = reg + ((pc + 4) & 0xf0000000); + /* Whats this mysterious 0xf000000 adjustment ??? */ } break; /* FIXME case JALX : */ @@ -810,7 +796,7 @@ mips32_next_pc (CORE_ADDR pc) /* Add 1 to indicate 16 bit mode - Invert ISA mode */ } break; /* The new PC will be alternate mode */ - case 4: /* BEQ, BEQL */ + case 4: /* BEQ , BEQL */ equal_branch: if (read_signed_register (itype_rs (inst)) == read_signed_register (itype_rt (inst))) @@ -818,15 +804,15 @@ mips32_next_pc (CORE_ADDR pc) else pc += 8; break; - case 5: /* BNE, BNEL */ + case 5: /* BNE , BNEL */ neq_branch: if (read_signed_register (itype_rs (inst)) != - read_signed_register (itype_rt (inst))) + read_signed_register (itype_rs (inst))) pc += mips32_relative_offset (inst) + 4; else pc += 8; break; - case 6: /* BLEZ, BLEZL */ + case 6: /* BLEZ , BLEZL */ less_zero_branch: if (read_signed_register (itype_rs (inst) <= 0)) pc += mips32_relative_offset (inst) + 4; @@ -834,13 +820,14 @@ mips32_next_pc (CORE_ADDR pc) pc += 8; break; case 7: - default: - greater_branch: /* BGTZ, BGTZL */ + greater_branch: /* BGTZ BGTZL */ if (read_signed_register (itype_rs (inst) > 0)) pc += mips32_relative_offset (inst) + 4; else pc += 8; break; + default: + pc += 8; } /* switch */ } /* else */ return pc; @@ -1353,7 +1340,7 @@ read_next_frame_reg (struct frame_info *fi, int regno) /* mips_addr_bits_remove - remove useless address bits */ -static CORE_ADDR +CORE_ADDR mips_addr_bits_remove (CORE_ADDR addr) { if (GDB_TARGET_IS_MIPS64) @@ -1392,34 +1379,7 @@ mips_addr_bits_remove (CORE_ADDR addr) return addr; } -/* mips_software_single_step() is called just before we want to resume - the inferior, if we want to single-step it but there is no hardware - or kernel single-step support (MIPS on Linux for example). We find - the target of the coming instruction and breakpoint it. - - single_step is also called just after the inferior stops. If we had - set up a simulated single-step, we undo our damage. */ - void -mips_software_single_step (enum target_signal sig, int insert_breakpoints_p) -{ - static CORE_ADDR next_pc; - typedef char binsn_quantum[BREAKPOINT_MAX]; - static binsn_quantum break_mem; - CORE_ADDR pc; - - if (insert_breakpoints_p) - { - pc = read_register (PC_REGNUM); - next_pc = mips_next_pc (pc); - - target_insert_breakpoint (next_pc, break_mem); - } - else - target_remove_breakpoint (next_pc, break_mem); -} - -static void mips_init_frame_pc_first (int fromleaf, struct frame_info *prev) { CORE_ADDR pc, tmp; @@ -2233,8 +2193,8 @@ mips_push_arguments (int nargs, don't use float registers for arguments. This duplication of arguments in general registers can't hurt non-MIPS16 functions because those registers are normally skipped. */ - /* MIPS_EABI squeezes a struct that contains a single floating - point value into an FP register instead of pushing it onto the + /* MIPS_EABI squeeses a struct that contains a single floating + point value into an FP register instead of pusing it onto the stack. */ if (fp_register_arg_p (typecode, arg_type) && float_argreg <= MIPS_LAST_FP_ARG_REGNUM) @@ -3249,7 +3209,7 @@ mips_extract_return_value (struct type *valtype, { struct return_value_word lo; struct return_value_word hi; - return_value_location (valtype, &hi, &lo); + return_value_location (valtype, &lo, &hi); memcpy (valbuf + lo.buf_offset, regbuf + REGISTER_BYTE (lo.reg) + lo.reg_offset, @@ -3270,7 +3230,7 @@ mips_store_return_value (struct type *valtype, char *valbuf) char raw_buffer[MAX_REGISTER_RAW_SIZE]; struct return_value_word lo; struct return_value_word hi; - return_value_location (valtype, &hi, &lo); + return_value_location (valtype, &lo, &hi); memset (raw_buffer, 0, sizeof (raw_buffer)); memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len); @@ -3319,6 +3279,7 @@ set_mips_command (char *args, int from_tty) static void show_mipsfpu_command (char *args, int from_tty) { + char *msg; char *fpu; switch (MIPS_FPU_TYPE) { @@ -3426,7 +3387,7 @@ mips_show_processor_type_command (char *args, int from_tty) int mips_set_processor_type (char *str) { - int i; + int i, j; if (str == NULL) return 0; @@ -3532,17 +3493,16 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) { if (pc_is_mips16 (*pcptr)) { - static unsigned char mips16_big_breakpoint[] = - MIPS16_BIG_BREAKPOINT; + static char mips16_big_breakpoint[] = MIPS16_BIG_BREAKPOINT; *pcptr = UNMAKE_MIPS16_ADDR (*pcptr); *lenptr = sizeof (mips16_big_breakpoint); return mips16_big_breakpoint; } else { - static unsigned char big_breakpoint[] = BIG_BREAKPOINT; - static unsigned char pmon_big_breakpoint[] = PMON_BIG_BREAKPOINT; - static unsigned char idt_big_breakpoint[] = IDT_BIG_BREAKPOINT; + static char big_breakpoint[] = BIG_BREAKPOINT; + static char pmon_big_breakpoint[] = PMON_BIG_BREAKPOINT; + static char idt_big_breakpoint[] = IDT_BIG_BREAKPOINT; *lenptr = sizeof (big_breakpoint); @@ -3560,19 +3520,16 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr) { if (pc_is_mips16 (*pcptr)) { - static unsigned char mips16_little_breakpoint[] = - MIPS16_LITTLE_BREAKPOINT; + static char mips16_little_breakpoint[] = MIPS16_LITTLE_BREAKPOINT; *pcptr = UNMAKE_MIPS16_ADDR (*pcptr); *lenptr = sizeof (mips16_little_breakpoint); return mips16_little_breakpoint; } else { - static unsigned char little_breakpoint[] = LITTLE_BREAKPOINT; - static unsigned char pmon_little_breakpoint[] = - PMON_LITTLE_BREAKPOINT; - static unsigned char idt_little_breakpoint[] = - IDT_LITTLE_BREAKPOINT; + static char little_breakpoint[] = LITTLE_BREAKPOINT; + static char pmon_little_breakpoint[] = PMON_LITTLE_BREAKPOINT; + static char idt_little_breakpoint[] = IDT_LITTLE_BREAKPOINT; *lenptr = sizeof (little_breakpoint); @@ -3911,12 +3868,6 @@ mips_gdbarch_init (struct gdbarch_info info, int elf_flags; enum mips_abi mips_abi; - /* Reset the disassembly info, in case it was set to something - non-default. */ - tm_print_insn_info.flavour = bfd_target_unknown_flavour; - tm_print_insn_info.arch = bfd_arch_unknown; - tm_print_insn_info.mach = 0; - /* Extract the elf_flags if available */ if (info.abfd != NULL && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour) @@ -3961,10 +3912,6 @@ mips_gdbarch_init (struct gdbarch_info info, case bfd_mach_mips5000: mips_abi = MIPS_ABI_EABI64; break; - case bfd_mach_mips8000: - case bfd_mach_mips10000: - mips_abi = MIPS_ABI_N32; - break; } } #ifdef MIPS_DEFAULT_ABI @@ -4008,7 +3955,6 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_double_bit (gdbarch, 64); set_gdbarch_long_double_bit (gdbarch, 64); tdep->mips_abi = mips_abi; - switch (mips_abi) { case MIPS_ABI_O32: @@ -4080,17 +4026,6 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_long_bit (gdbarch, 32); set_gdbarch_ptr_bit (gdbarch, 32); set_gdbarch_long_long_bit (gdbarch, 64); - - /* Set up the disassembler info, so that we get the right - register names from libopcodes. */ - tm_print_insn_info.flavour = bfd_target_elf_flavour; - tm_print_insn_info.arch = bfd_arch_mips; - if (info.bfd_arch_info != NULL - && info.bfd_arch_info->arch == bfd_arch_mips - && info.bfd_arch_info->mach) - tm_print_insn_info.mach = info.bfd_arch_info->mach; - else - tm_print_insn_info.mach = bfd_mach_mips8000; break; default: tdep->mips_abi_string = "default"; @@ -4163,15 +4098,6 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_read_sp (gdbarch, generic_target_read_sp); set_gdbarch_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. */ - set_gdbarch_addr_bits_remove (gdbarch, mips_addr_bits_remove); - - /* There's a mess in stack frame creation. See comments in - blockframe.c near reference to INIT_FRAME_PC_FIRST. */ - set_gdbarch_init_frame_pc_first (gdbarch, mips_init_frame_pc_first); - set_gdbarch_init_frame_pc (gdbarch, init_frame_pc_noop); - /* Map debug register numbers onto internal register numbers. */ set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum); set_gdbarch_ecoff_reg_to_regnum (gdbarch, mips_ecoff_reg_to_regnum); @@ -4373,6 +4299,12 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "mips_dump_tdep: IGNORE_HELPER_CALL # %s\n", XSTRING (IGNORE_HELPER_CALL (PC))); + fprintf_unfiltered (file, + "mips_dump_tdep: INIT_FRAME_PC # %s\n", + XSTRING (INIT_FRAME_PC (FROMLEAF, PREV))); + fprintf_unfiltered (file, + "mips_dump_tdep: INIT_FRAME_PC_FIRST # %s\n", + XSTRING (INIT_FRAME_PC_FIRST (FROMLEAF, PREV))); fprintf_unfiltered (file, "mips_dump_tdep: IN_SIGTRAMP # %s\n", XSTRING (IN_SIGTRAMP (PC, NAME))); diff --git a/gdb/mipsread.c b/gdb/mipsread.c index 17a8fb7427e..dac06fc001d 100644 --- a/gdb/mipsread.c +++ b/gdb/mipsread.c @@ -185,7 +185,7 @@ struct alphacoff_dynsecinfo asection *got_sect; /* Section pointer for .got section */ }; -static void alphacoff_locate_sections (bfd *, asection *, PTR); +static void alphacoff_locate_sections (bfd *, asection *, void *); /* We are called once per section from read_alphacoff_dynamic_symtab. We need to examine each section we are passed, check to see diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index dd7674edc8d..506c27c83a3 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -30,7 +30,6 @@ #include "gdbcore.h" #include "symfile.h" #include "regcache.h" -#include "arch-utils.h" extern void _initialize_mn10300_tdep (void); static CORE_ADDR mn10300_analyze_prologue (struct frame_info *fi, @@ -86,13 +85,13 @@ am33_register_name (int reg) return register_name (reg, regs, sizeof regs); } -static CORE_ADDR +CORE_ADDR mn10300_saved_pc_after_call (struct frame_info *fi) { return read_memory_integer (read_register (SP_REGNUM), 4); } -static void +void mn10300_extract_return_value (struct type *type, char *regbuf, char *valbuf) { if (TYPE_CODE (type) == TYPE_CODE_PTR) @@ -101,14 +100,14 @@ mn10300_extract_return_value (struct type *type, char *regbuf, char *valbuf) memcpy (valbuf, regbuf + REGISTER_BYTE (0), TYPE_LENGTH (type)); } -static CORE_ADDR +CORE_ADDR mn10300_extract_struct_value_address (char *regbuf) { return extract_address (regbuf + REGISTER_BYTE (4), REGISTER_RAW_SIZE (4)); } -static void +void mn10300_store_return_value (struct type *type, char *valbuf) { if (TYPE_CODE (type) == TYPE_CODE_PTR) @@ -147,7 +146,7 @@ analyze_dummy_frame (CORE_ADDR pc, CORE_ADDR frame) /* Should call_function allocate stack space for a struct return? */ -static int +int mn10300_use_struct_convention (int gcc_p, struct type *type) { return (TYPE_NFIELDS (type) > 1 || TYPE_LENGTH (type) > 8); @@ -160,7 +159,7 @@ mn10300_use_struct_convention (int gcc_p, struct type *type) so we need a single byte breakpoint. Matsushita hasn't defined one, so we defined it ourselves. */ -static unsigned char * +unsigned char * mn10300_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size) { static char breakpoint[] = @@ -197,66 +196,32 @@ set_movm_offsets (struct frame_info *fi, int movm_args) if (fi == NULL || movm_args == 0) return; - if (movm_args & movm_other_bit) - { - /* The `other' bit leaves a blank area of four bytes at the - beginning of its block of saved registers, making it 32 bytes - long in total. */ - fi->saved_regs[LAR_REGNUM] = fi->frame + offset + 4; - fi->saved_regs[LIR_REGNUM] = fi->frame + offset + 8; - fi->saved_regs[MDR_REGNUM] = fi->frame + offset + 12; - fi->saved_regs[A0_REGNUM + 1] = fi->frame + offset + 16; - fi->saved_regs[A0_REGNUM] = fi->frame + offset + 20; - fi->saved_regs[D0_REGNUM + 1] = fi->frame + offset + 24; - fi->saved_regs[D0_REGNUM] = fi->frame + offset + 28; - offset += 32; - } - if (movm_args & movm_a3_bit) + if (movm_args & 0x10) { fi->saved_regs[A3_REGNUM] = fi->frame + offset; offset += 4; } - if (movm_args & movm_a2_bit) + if (movm_args & 0x20) { fi->saved_regs[A2_REGNUM] = fi->frame + offset; offset += 4; } - if (movm_args & movm_d3_bit) + if (movm_args & 0x40) { fi->saved_regs[D3_REGNUM] = fi->frame + offset; offset += 4; } - if (movm_args & movm_d2_bit) + if (movm_args & 0x80) { fi->saved_regs[D2_REGNUM] = fi->frame + offset; offset += 4; } - if (AM33_MODE) + if (AM33_MODE && movm_args & 0x02) { - if (movm_args & movm_exother_bit) - { - fi->saved_regs[MCVF_REGNUM] = fi->frame + offset; - fi->saved_regs[MCRL_REGNUM] = fi->frame + offset + 4; - fi->saved_regs[MCRH_REGNUM] = fi->frame + offset + 8; - fi->saved_regs[MDRQ_REGNUM] = fi->frame + offset + 12; - fi->saved_regs[E0_REGNUM + 1] = fi->frame + offset + 16; - fi->saved_regs[E0_REGNUM + 0] = fi->frame + offset + 20; - offset += 24; - } - if (movm_args & movm_exreg1_bit) - { - fi->saved_regs[E0_REGNUM + 7] = fi->frame + offset; - fi->saved_regs[E0_REGNUM + 6] = fi->frame + offset + 4; - fi->saved_regs[E0_REGNUM + 5] = fi->frame + offset + 8; - fi->saved_regs[E0_REGNUM + 4] = fi->frame + offset + 12; - offset += 16; - } - if (movm_args & movm_exreg0_bit) - { - fi->saved_regs[E0_REGNUM + 3] = fi->frame + offset; - fi->saved_regs[E0_REGNUM + 2] = fi->frame + offset + 4; - offset += 8; - } + fi->saved_regs[E0_REGNUM + 5] = fi->frame + offset; + fi->saved_regs[E0_REGNUM + 4] = fi->frame + offset + 4; + fi->saved_regs[E0_REGNUM + 3] = fi->frame + offset + 8; + fi->saved_regs[E0_REGNUM + 2] = fi->frame + offset + 12; } } @@ -544,32 +509,6 @@ mn10300_analyze_prologue (struct frame_info *fi, CORE_ADDR pc) return addr; } - -/* Function: saved_regs_size - Return the size in bytes of the register save area, based on the - saved_regs array in FI. */ -static int -saved_regs_size (struct frame_info *fi) -{ - int adjust = 0; - int i; - - /* Reserve four bytes for every register saved. */ - for (i = 0; i < NUM_REGS; i++) - if (fi->saved_regs[i]) - adjust += 4; - - /* If we saved LIR, then it's most likely we used a `movm' - instruction with the `other' bit set, in which case the SP is - decremented by an extra four bytes, "to simplify calculation - of the transfer area", according to the processor manual. */ - if (fi->saved_regs[LIR_REGNUM]) - adjust += 4; - - return adjust; -} - - /* Function: frame_chain Figure out and return the caller's frame pointer given current frame_info struct. @@ -577,7 +516,7 @@ saved_regs_size (struct frame_info *fi) We don't handle dummy frames yet but we would probably just return the stack pointer that was in use at the time the function call was made? */ -static CORE_ADDR +CORE_ADDR mn10300_frame_chain (struct frame_info *fi) { struct frame_info *dummy; @@ -620,7 +559,19 @@ mn10300_frame_chain (struct frame_info *fi) } else { - int adjust = saved_regs_size (fi); + int adjust = 0; + + adjust += (fi->saved_regs[D2_REGNUM] ? 4 : 0); + adjust += (fi->saved_regs[D3_REGNUM] ? 4 : 0); + adjust += (fi->saved_regs[A2_REGNUM] ? 4 : 0); + adjust += (fi->saved_regs[A3_REGNUM] ? 4 : 0); + if (AM33_MODE) + { + adjust += (fi->saved_regs[E0_REGNUM + 5] ? 4 : 0); + adjust += (fi->saved_regs[E0_REGNUM + 4] ? 4 : 0); + adjust += (fi->saved_regs[E0_REGNUM + 3] ? 4 : 0); + adjust += (fi->saved_regs[E0_REGNUM + 2] ? 4 : 0); + } /* Our caller does not have a frame pointer. So his frame starts at the base of our frame (fi->frame) + register save space @@ -632,7 +583,7 @@ mn10300_frame_chain (struct frame_info *fi) /* Function: skip_prologue Return the address of the first inst past the prologue of the function. */ -static CORE_ADDR +CORE_ADDR mn10300_skip_prologue (CORE_ADDR pc) { /* We used to check the debug symbols, but that can lose if @@ -640,41 +591,38 @@ mn10300_skip_prologue (CORE_ADDR pc) return mn10300_analyze_prologue (NULL, pc); } -/* generic_pop_current_frame calls this function if the current - frame isn't a dummy frame. */ -static void -mn10300_pop_frame_regular (struct frame_info *frame) + +/* Function: pop_frame + This routine gets called when either the user uses the `return' + command, or the call dummy breakpoint gets hit. */ + +void +mn10300_pop_frame (struct frame_info *frame) { int regnum; - write_register (PC_REGNUM, FRAME_SAVED_PC (frame)); - - /* Restore any saved registers. */ - for (regnum = 0; regnum < NUM_REGS; regnum++) - if (frame->saved_regs[regnum] != 0) - { - ULONGEST value; + if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + generic_pop_dummy_frame (); + else + { + write_register (PC_REGNUM, FRAME_SAVED_PC (frame)); - value = read_memory_unsigned_integer (frame->saved_regs[regnum], - REGISTER_RAW_SIZE (regnum)); - write_register (regnum, value); - } + /* Restore any saved registers. */ + for (regnum = 0; regnum < NUM_REGS; regnum++) + if (frame->saved_regs[regnum] != 0) + { + ULONGEST value; - /* Actually cut back the stack. */ - write_register (SP_REGNUM, FRAME_FP (frame)); + value = read_memory_unsigned_integer (frame->saved_regs[regnum], + REGISTER_RAW_SIZE (regnum)); + write_register (regnum, value); + } - /* Don't we need to set the PC?!? XXX FIXME. */ -} + /* Actually cut back the stack. */ + write_register (SP_REGNUM, FRAME_FP (frame)); -/* Function: pop_frame - This routine gets called when either the user uses the `return' - command, or the call dummy breakpoint gets hit. */ -static void -mn10300_pop_frame (void) -{ - /* This function checks for and handles generic dummy frames, and - calls back to our function for ordinary frames. */ - generic_pop_current_frame (mn10300_pop_frame_regular); + /* Don't we need to set the PC?!? XXX FIXME. */ + } /* Throw away any cached frame information. */ flush_cached_frames (); @@ -684,7 +632,7 @@ mn10300_pop_frame (void) Setup arguments for a call to the target. Arguments go in order on the stack. */ -static CORE_ADDR +CORE_ADDR mn10300_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { @@ -765,7 +713,7 @@ mn10300_push_arguments (int nargs, struct value **args, CORE_ADDR sp, 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 +CORE_ADDR mn10300_push_return_address (CORE_ADDR pc, CORE_ADDR sp) { unsigned char buf[4]; @@ -779,11 +727,12 @@ mn10300_push_return_address (CORE_ADDR pc, CORE_ADDR sp) Store the structure value return address for an inferior function call. */ -static void +CORE_ADDR mn10300_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) { /* The structure return address is passed as the first argument. */ write_register (0, addr); + return sp; } /* Function: frame_saved_pc @@ -793,10 +742,22 @@ mn10300_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) instead of RP, because that's where "caller" of the dummy-frame will be found. */ -static CORE_ADDR +CORE_ADDR mn10300_frame_saved_pc (struct frame_info *fi) { - int adjust = saved_regs_size (fi); + int adjust = 0; + + adjust += (fi->saved_regs[D2_REGNUM] ? 4 : 0); + adjust += (fi->saved_regs[D3_REGNUM] ? 4 : 0); + adjust += (fi->saved_regs[A2_REGNUM] ? 4 : 0); + adjust += (fi->saved_regs[A3_REGNUM] ? 4 : 0); + if (AM33_MODE) + { + adjust += (fi->saved_regs[E0_REGNUM + 5] ? 4 : 0); + adjust += (fi->saved_regs[E0_REGNUM + 4] ? 4 : 0); + adjust += (fi->saved_regs[E0_REGNUM + 3] ? 4 : 0); + adjust += (fi->saved_regs[E0_REGNUM + 2] ? 4 : 0); + } return (read_memory_integer (fi->frame + adjust, REGISTER_SIZE)); } @@ -815,8 +776,8 @@ mn10300_frame_saved_pc (struct frame_info *fi) First, during normal backtracing, second, while figuring out the frame pointer just prior to calling the target function (see run_stack_dummy). */ -static void -mn10300_init_extra_frame_info (int fromleaf, struct frame_info *fi) +void +mn10300_init_extra_frame_info (struct frame_info *fi) { if (fi->next) fi->pc = FRAME_SAVED_PC (fi->next); @@ -831,14 +792,6 @@ mn10300_init_extra_frame_info (int fromleaf, struct frame_info *fi) mn10300_analyze_prologue (fi, 0); } - -/* This function's job is handled by init_extra_frame_info. */ -static void -mn10300_frame_init_saved_regs (struct frame_info *frame) -{ -} - - /* Function: mn10300_virtual_frame_pointer Return the register that the function uses for a frame pointer, plus any necessary offset to be applied to the register before @@ -893,35 +846,6 @@ mn10300_register_raw_size (int reg) return 4; } -/* If DWARF2 is a register number appearing in Dwarf2 debug info, then - mn10300_dwarf2_reg_to_regnum (DWARF2) is the corresponding GDB - register number. Why don't Dwarf2 and GDB use the same numbering? - Who knows? But since people have object files lying around with - the existing Dwarf2 numbering, and other people have written stubs - to work with the existing GDB, neither of them can change. So we - just have to cope. */ -static int -mn10300_dwarf2_reg_to_regnum (int dwarf2) -{ - /* This table is supposed to be shaped like the REGISTER_NAMES - initializer in gcc/config/mn10300/mn10300.h. Registers which - appear in GCC's numbering, but have no counterpart in GDB's - world, are marked with a -1. */ - static int dwarf2_to_gdb[] = { - 0, 1, 2, 3, 4, 5, 6, 7, -1, 8, - 15, 16, 17, 18, 19, 20, 21, 22 - }; - int gdb; - - if (dwarf2 < 0 - || dwarf2 >= (sizeof (dwarf2_to_gdb) / sizeof (dwarf2_to_gdb[0])) - || dwarf2_to_gdb[dwarf2] == -1) - internal_error (__FILE__, __LINE__, - "bogus register number in debug info: %d", dwarf2); - - return dwarf2_to_gdb[dwarf2]; -} - static void mn10300_print_register (const char *name, int regnum, int reg_width) { @@ -1020,7 +944,6 @@ static struct gdbarch * mn10300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { - static LONGEST mn10300_call_dummy_words[] = { 0 }; struct gdbarch *gdbarch; struct gdbarch_tdep *tdep = NULL; int am33_mode; @@ -1058,72 +981,25 @@ mn10300_gdbarch_init (struct gdbarch_info info, return NULL; /* keep GCC happy. */ } - /* Registers. */ - set_gdbarch_num_regs (gdbarch, num_regs); - set_gdbarch_register_name (gdbarch, register_name); set_gdbarch_register_size (gdbarch, 4); - set_gdbarch_register_bytes (gdbarch, - num_regs * gdbarch_register_size (gdbarch)); set_gdbarch_max_register_raw_size (gdbarch, 4); - set_gdbarch_register_raw_size (gdbarch, mn10300_register_raw_size); + set_gdbarch_register_virtual_type (gdbarch, mn10300_register_virtual_type); set_gdbarch_register_byte (gdbarch, mn10300_register_byte); - set_gdbarch_max_register_virtual_size (gdbarch, 4); set_gdbarch_register_virtual_size (gdbarch, mn10300_register_virtual_size); - set_gdbarch_register_virtual_type (gdbarch, mn10300_register_virtual_type); - set_gdbarch_dwarf2_reg_to_regnum (gdbarch, mn10300_dwarf2_reg_to_regnum); - set_gdbarch_do_registers_info (gdbarch, mn10300_do_registers_info); - set_gdbarch_fp_regnum (gdbarch, 31); - - /* Breakpoints. */ - set_gdbarch_breakpoint_from_pc (gdbarch, mn10300_breakpoint_from_pc); - set_gdbarch_function_start_offset (gdbarch, 0); - set_gdbarch_decr_pc_after_break (gdbarch, 0); - - /* Stack unwinding. */ - set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register); - set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid); - set_gdbarch_inner_than (gdbarch, core_addr_lessthan); - set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid); - set_gdbarch_saved_pc_after_call (gdbarch, mn10300_saved_pc_after_call); - set_gdbarch_init_extra_frame_info (gdbarch, mn10300_init_extra_frame_info); - set_gdbarch_frame_init_saved_regs (gdbarch, mn10300_frame_init_saved_regs); - set_gdbarch_frame_chain (gdbarch, mn10300_frame_chain); - set_gdbarch_frame_saved_pc (gdbarch, mn10300_frame_saved_pc); - set_gdbarch_extract_return_value (gdbarch, mn10300_extract_return_value); - set_gdbarch_extract_struct_value_address - (gdbarch, mn10300_extract_struct_value_address); - set_gdbarch_store_return_value (gdbarch, mn10300_store_return_value); - set_gdbarch_store_struct_return (gdbarch, mn10300_store_struct_return); - set_gdbarch_pop_frame (gdbarch, mn10300_pop_frame); - set_gdbarch_skip_prologue (gdbarch, mn10300_skip_prologue); - set_gdbarch_frame_args_skip (gdbarch, 0); - set_gdbarch_frame_args_address (gdbarch, default_frame_address); - set_gdbarch_frame_locals_address (gdbarch, default_frame_address); - set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); - /* That's right, we're using the stack pointer as our frame pointer. */ - set_gdbarch_read_fp (gdbarch, generic_target_read_sp); - - /* Calling functions in the inferior from GDB. */ + set_gdbarch_register_raw_size (gdbarch, mn10300_register_raw_size); set_gdbarch_call_dummy_p (gdbarch, 1); - set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); - set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); - set_gdbarch_call_dummy_address (gdbarch, entry_point_address); - set_gdbarch_call_dummy_words (gdbarch, mn10300_call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, - sizeof (mn10300_call_dummy_words)); - set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); - set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); + set_gdbarch_register_name (gdbarch, register_name); set_gdbarch_use_generic_dummy_frames (gdbarch, 1); - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); + set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 0); + set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); + set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register); set_gdbarch_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_frame_chain_valid (gdbarch, generic_file_frame_chain_valid); + set_gdbarch_reg_struct_has_addr (gdbarch, mn10300_reg_struct_has_addr); set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); - set_gdbarch_use_struct_convention (gdbarch, mn10300_use_struct_convention); + set_gdbarch_num_regs (gdbarch, num_regs); + set_gdbarch_do_registers_info (gdbarch, mn10300_do_registers_info); tdep->am33_mode = am33_mode; diff --git a/gdb/monitor.c b/gdb/monitor.c index 1174dd9ff45..4abb782bf21 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -129,12 +129,6 @@ static char register_fastmap[256]; static struct re_pattern_buffer getmem_resp_delim_pattern; static char getmem_resp_delim_fastmap[256]; -static struct re_pattern_buffer setmem_resp_delim_pattern; -static char setmem_resp_delim_fastmap[256]; - -static struct re_pattern_buffer setreg_resp_delim_pattern; -static char setreg_resp_delim_fastmap[256]; - static int dump_reg_flag; /* Non-zero means do a dump_registers cmd when monitor_wait wakes up. */ @@ -758,14 +752,6 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty) compile_pattern (mon_ops->getmem.resp_delim, &getmem_resp_delim_pattern, getmem_resp_delim_fastmap); - if (mon_ops->setmem.resp_delim) - compile_pattern (mon_ops->setmem.resp_delim, &setmem_resp_delim_pattern, - setmem_resp_delim_fastmap); - - if (mon_ops->setreg.resp_delim) - compile_pattern (mon_ops->setreg.resp_delim, &setreg_resp_delim_pattern, - setreg_resp_delim_fastmap); - unpush_target (targ_ops); if (dev_name) @@ -1354,13 +1340,6 @@ monitor_store_register (int regno) else monitor_printf (current_monitor->setreg.cmd, name, val); - if (current_monitor->setreg.resp_delim) - { - monitor_debug ("EXP setreg.resp_delim\n"); - monitor_expect_regexp (&setreg_resp_delim_pattern, NULL, 0); - if (current_monitor->flags & MO_SETREG_INTERACTIVE) - monitor_printf ("%s\r", paddr_nz (val)); - } if (current_monitor->setreg.term) { monitor_debug ("EXP setreg.term\n"); @@ -1487,12 +1466,6 @@ monitor_write_memory (CORE_ADDR memaddr, char *myaddr, int len) monitor_printf_noecho (cmd, memaddr); - if (current_monitor->setmem.resp_delim) - { - monitor_debug ("EXP setmem.resp_delim"); - monitor_expect_regexp (&setmem_resp_delim_pattern, NULL, 0); - monitor_printf ("%x\r", val); - } if (current_monitor->setmem.term) { monitor_debug ("EXP setmem.term"); diff --git a/gdb/nindy-share/ttyflush.c b/gdb/nindy-share/ttyflush.c index ff3b6440229..9754472ddd7 100644 --- a/gdb/nindy-share/ttyflush.c +++ b/gdb/nindy-share/ttyflush.c @@ -22,6 +22,11 @@ #include "defs.h" #include "serial.h" +#ifdef _MSC_VER +# include +# define sleep _sleep +#endif + /* Flush all pending input and output for SERIAL, wait for a second, and then if there is a character pending, discard it and flush again. */ diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 85762c3b4df..e86270964e0 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -854,7 +854,7 @@ open_mapped_file (char *filename, long mtime, int flags) /* First try to open an existing file in the current directory, and then try the directory where the symbol file is located. */ - symsfilename = concat ("./", lbasename (filename), ".syms", (char *) NULL); + symsfilename = concat ("./", basename (filename), ".syms", (char *) NULL); if ((fd = open_existing_mapped_file (symsfilename, mtime, flags)) < 0) { xfree (symsfilename); @@ -874,7 +874,7 @@ open_mapped_file (char *filename, long mtime, int flags) if ((fd < 0) && (flags & OBJF_MAPPED)) { xfree (symsfilename); - symsfilename = concat ("./", lbasename (filename), ".syms", + symsfilename = concat ("./", basename (filename), ".syms", (char *) NULL); if ((fd = open (symsfilename, O_RDWR | O_CREAT | O_TRUNC, 0666)) < 0) { diff --git a/gdb/p-exp.y b/gdb/p-exp.y index d786af9f6e0..b09ec08e8e0 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -58,6 +58,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ +/* MSVC uses strnicmp instead of strncasecmp */ +#ifdef _MSC_VER +#define strncasecmp strnicmp +#endif + /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple yacc generated parsers in gdb. Note that these are only the variables diff --git a/gdb/partial-stab.h b/gdb/partial-stab.h index ebedef72c53..fcfb2ef7c18 100644 --- a/gdb/partial-stab.h +++ b/gdb/partial-stab.h @@ -40,9 +40,6 @@ switch (CUR_SYMBOL_TYPE) { - static struct complaint function_outside_compilation_unit = { - "function `%s' appears to be defined outside of all compilation units", 0, 0 - }; char *p; /* * Standard, external, non-debugger, symbols @@ -579,15 +576,6 @@ switch (CUR_SYMBOL_TYPE) continue; case 'f': - if (! pst) - { - int name_len = p - namestring; - char *name = xmalloc (name_len + 1); - memcpy (name, namestring, name_len); - name[name_len] = '\0'; - complain (&function_outside_compilation_unit, name); - xfree (name); - } CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); #ifdef DBXREAD_ONLY /* Kludges for ELF/STABS with Sun ACC */ @@ -612,12 +600,10 @@ switch (CUR_SYMBOL_TYPE) the bounds created by N_SO symbols. If that's the case use the address of this function as the low bound for the partial symbol table. */ - if (pst - && (textlow_not_set - || (CUR_SYMBOL_VALUE < pst->textlow - && (CUR_SYMBOL_VALUE - != ANOFFSET (objfile->section_offsets, - SECT_OFF_TEXT (objfile)))))) + if (textlow_not_set + || (pst && CUR_SYMBOL_VALUE < pst->textlow + && CUR_SYMBOL_VALUE + != ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)))) { pst->textlow = CUR_SYMBOL_VALUE; textlow_not_set = 0; @@ -634,15 +620,6 @@ switch (CUR_SYMBOL_TYPE) are put into the global psymtab like one would expect. They're also in the minimal symbol table. */ case 'F': - if (! pst) - { - int name_len = p - namestring; - char *name = xmalloc (name_len + 1); - memcpy (name, namestring, name_len); - name[name_len] = '\0'; - complain (&function_outside_compilation_unit, name); - xfree (name); - } CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); #ifdef DBXREAD_ONLY /* Kludges for ELF/STABS with Sun ACC */ @@ -670,12 +647,10 @@ switch (CUR_SYMBOL_TYPE) the bounds created by N_SO symbols. If that's the case use the address of this function as the low bound for the partial symbol table. */ - if (pst - && (textlow_not_set - || (CUR_SYMBOL_VALUE < pst->textlow - && (CUR_SYMBOL_VALUE - != ANOFFSET (objfile->section_offsets, - SECT_OFF_TEXT (objfile)))))) + if (textlow_not_set + || (pst && CUR_SYMBOL_VALUE < pst->textlow + && CUR_SYMBOL_VALUE + != ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)))) { pst->textlow = CUR_SYMBOL_VALUE; textlow_not_set = 0; diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index bcb438c543d..b80c9aedee3 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -63,7 +63,7 @@ void supply_gregset (gdb_gregset_t *gregsetp) { int regi; - register elf_greg_t *regp = (elf_greg_t *) gregsetp; + register greg_t *regp = (greg_t *) gregsetp; for (regi = 0; regi < 32; regi++) supply_register (regi, (char *) (regp + regi)); @@ -76,7 +76,7 @@ void fill_gregset (gdb_gregset_t *gregsetp, int regno) { int regi; - elf_greg_t *regp = (elf_greg_t *) gregsetp; + greg_t *regp = (greg_t *) gregsetp; #define COPY_REG(_idx_,_regi_) \ if ((regno == -1) || regno == _regi_) \ diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 746a0646cc0..c49f51b7c90 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -37,7 +37,6 @@ #include "annotate.h" #include "symfile.h" /* for overlay functions */ #include "objfiles.h" /* ditto */ -#include "completer.h" /* for completion functions */ #ifdef UI_OUT #include "ui-out.h" #endif @@ -1909,7 +1908,8 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num, annotate_arg_begin (); - list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL); + ui_out_list_begin (uiout, NULL); + list_chain = make_cleanup_ui_out_list_end (uiout); fprintf_symbol_filtered (stb->stream, SYMBOL_SOURCE_NAME (sym), SYMBOL_LANGUAGE (sym), DMGL_PARAMS | DMGL_ANSI); ui_out_field_stream (uiout, "name", stb); @@ -1952,7 +1952,7 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num, else ui_out_text (uiout, "???"); - /* Invoke ui_out_tuple_end. */ + /* Invoke ui_out_list_end. */ do_cleanups (list_chain); #else val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0, @@ -2452,8 +2452,6 @@ print_insn (CORE_ADDR memaddr, struct ui_file *stream) void _initialize_printcmd (void) { - struct cmd_list_element *c; - current_display_number = -1; add_info ("address", address_info, @@ -2476,12 +2474,11 @@ Defaults for format and size letters are those previously used.\n\ Default count is 1. Default address is following last thing printed\n\ with this command or \"print\".", NULL)); - c = add_com ("disassemble", class_vars, disassemble_command, - "Disassemble a specified section of memory.\n\ + add_com ("disassemble", class_vars, disassemble_command, + "Disassemble a specified section of memory.\n\ Default is the function surrounding the pc of the selected frame.\n\ With a single argument, the function surrounding that address is dumped.\n\ Two arguments are taken as a range of memory to dump."); - c->completer = location_completer; if (xdb_commands) add_com_alias ("va", "disassemble", class_xdb, 0); @@ -2559,12 +2556,11 @@ variable in the program being debugged. EXP is any valid expression.\n", You can see these environment settings with the \"show\" command.", NULL)); /* "call" is the same as "set", but handy for dbx users to call fns. */ - c = add_com ("call", class_vars, call_command, - "Call a function in the program.\n\ + add_com ("call", class_vars, call_command, + "Call a function in the program.\n\ The argument is the function name and arguments, in the notation of the\n\ current working language. The result is printed and saved in the value\n\ history, if it is not void."); - c->completer = location_completer; add_cmd ("variable", class_vars, set_command, "Evaluate expression EXP and assign result to variable VAR, using assignment\n\ @@ -2575,7 +2571,7 @@ variable in the program being debugged. EXP is any valid expression.\n\ This may usually be abbreviated to simply \"set\".", &setlist); - c = add_com ("print", class_vars, print_command, + add_com ("print", class_vars, print_command, concat ("Print value of expression EXP.\n\ Variables accessible are those of the lexical environment of the selected\n\ stack frame, plus all those whose scope is global or an entire file.\n\ @@ -2597,13 +2593,11 @@ resides in memory.\n", "\n\ EXP may be preceded with /FMT, where FMT is a format letter\n\ but no count or size letter (see \"x\" command).", NULL)); - c->completer = location_completer; add_com_alias ("p", "print", class_vars, 1); - c = add_com ("inspect", class_vars, inspect_command, + add_com ("inspect", class_vars, inspect_command, "Same as \"print\" command, except that if you are running in the epoch\n\ environment, the value is printed in its own window."); - c->completer = location_completer; add_show_from_set ( add_set_cmd ("max-symbolic-offset", no_class, var_uinteger, diff --git a/gdb/proc-api.c b/gdb/proc-api.c index 4cae8fd2e62..d881edc302d 100644 --- a/gdb/proc-api.c +++ b/gdb/proc-api.c @@ -27,7 +27,6 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "defs.h" #include "gdbcmd.h" -#include "completer.h" #if defined (NEW_PROC_API) #define _STRUCTURED_PROC 1 @@ -220,9 +219,7 @@ static struct trans ioctl_table[] = { int ioctl_with_trace (int fd, long opcode, void *ptr, char *file, int line) { - int i = 0; - int ret; - int arg1; + int i, ret, arg1; prepare_to_trace (); diff --git a/gdb/proc-service.c b/gdb/proc-service.c index c13929cc423..74e81ae4b18 100644 --- a/gdb/proc-service.c +++ b/gdb/proc-service.c @@ -51,11 +51,33 @@ typedef size_t gdb_ps_size_t; /* Building process ids. */ +#ifndef MERGEPID +#define MERGEPID(PID, TID) (((PID) & 0xffff) | ((TID) << 16)) +#endif + #define BUILD_LWP(tid, pid) MERGEPID (pid, tid) /* Helper functions. */ +static void +restore_inferior_ptid (void *arg) +{ + ptid_t *saved_pid_ptr = arg; + inferior_ptid = *saved_pid_ptr; + xfree (arg); +} + +static struct cleanup * +save_inferior_ptid (void) +{ + ptid_t *saved_ptid_ptr; + + saved_ptid_ptr = xmalloc (sizeof (ptid_t)); + *saved_ptid_ptr = inferior_ptid; + return make_cleanup (restore_inferior_ptid, saved_ptid_ptr); +} + /* Transfer LEN bytes of memory between BUF and address ADDR in the process specified by PH. If WRITE, transfer them to the process, else transfer them from the process. Returns PS_OK for success, diff --git a/gdb/procfs.c b/gdb/procfs.c index 5a91ed887fe..53f04896035 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -315,6 +315,18 @@ typedef prstatus_t gdb_prstatus_t; typedef prstatus_t gdb_lwpstatus_t; #endif /* NEW_PROC_API */ + +/* Provide default composite pid manipulation macros for systems that + don't have threads. */ + +#ifndef PIDGET +#define PIDGET(PID) (PID) +#define TIDGET(PID) (PID) +#endif +#ifndef MERGEPID +#define MERGEPID(PID, TID) (PID) +#endif + typedef struct procinfo { struct procinfo *next; int pid; /* Process ID */ diff --git a/gdb/rdi-share/host.h b/gdb/rdi-share/host.h index 53b65681b8a..4dffa8475fb 100644 --- a/gdb/rdi-share/host.h +++ b/gdb/rdi-share/host.h @@ -37,14 +37,13 @@ #endif #endif -/* A temporary sop to older compilers */ -#if defined (__NetBSD__) || defined (unix) +#ifdef unix /* A temporary sop to older compilers */ # ifndef __unix /* (good for long-term portability?) */ # define __unix 1 # endif #endif -#if defined(__unix) +#ifdef __unix /* Generic unix -- hopefully a split into other variants will not be */ /* needed. However, beware the 'bsd' test above and safe_toupper etc. */ /* which cope with backwards (pre-posix/X/open) unix compatility. */ @@ -60,6 +59,13 @@ # define COMPILING_ON_WINDOWS_CONSOLE 1 # define COMPILING_ON_WINDOWS 1 #endif +#ifdef _MSC_VER +# define COMPILING_ON_MSDOS 1 +# define COMPILING_ON_WINDOWS 1 +# if defined(__cplusplus) +# define IMPLEMENT_BOOL_AS_INT 1 /* VC++ doesn't have 'bool' (yet) */ +# endif +#endif /* The '(defined(__sparc) && defined(P_tmpdir) */ /* && !defined(__svr4__))' is to detect gcc on SunOS. */ /* C++ compilers don't have to define __STDC__ */ @@ -181,7 +187,8 @@ typedef char *ArgvType; # define FILENAME_MAX 256 #endif -#if (!defined(__STDC__) && !defined(__cplusplus)) || defined(COMPILING_ON_SUNOS) +#if (!defined(__STDC__) && !defined(__cplusplus) && !defined(_MSC_VER)) || \ + defined(COMPILING_ON_SUNOS) /* Use bcopy rather than memmove, as memmove is not available. */ /* There does not seem to be a header for bcopy. */ void bcopy(const char *src, char *dst, int length); diff --git a/gdb/rdi-share/hostchan.h b/gdb/rdi-share/hostchan.h index 3e6d26fd792..b9acb77919d 100644 --- a/gdb/rdi-share/hostchan.h +++ b/gdb/rdi-share/hostchan.h @@ -23,13 +23,6 @@ #endif #endif -/* A temporary sop to older compilers */ -#if defined (__NetBSD__) || defined (unix) -# ifndef __unix /* (good for long-term portability?) */ -# define __unix 1 -# endif -#endif - /* struct timeval */ #if defined(__unix) || defined(__CYGWIN32__) # include diff --git a/gdb/rdi-share/unixcomm.c b/gdb/rdi-share/unixcomm.c index 0abd4115a29..6891c0d84e2 100644 --- a/gdb/rdi-share/unixcomm.c +++ b/gdb/rdi-share/unixcomm.c @@ -96,15 +96,7 @@ #define PARPORT2 "/dev/par1" #endif -#if defined(_WIN32) || defined (__CYGWIN32__) -#define SERIAL_PREFIX "com" -#define SERPORT1 "com1" -#define SERPORT2 "com2" -#define PARPORT1 "lpt1" -#define PARPORT2 "lpt2" -#endif - -#if !defined (SERIAL_PREFIX) +#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (bsdi) #define SERIAL_PREFIX "/dev/cuaa" #define SERPORT1 "/dev/cuaa0" #define SERPORT2 "/dev/cuaa1" @@ -113,6 +105,14 @@ #endif +#if defined(_WIN32) || defined (__CYGWIN32__) +#define SERIAL_PREFIX "com" +#define SERPORT1 "com1" +#define SERPORT2 "com2" +#define PARPORT1 "lpt1" +#define PARPORT2 "lpt2" +#endif + /* diff --git a/gdb/regcache.c b/gdb/regcache.c index b939d9a8fb1..bbc83e02999 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -315,6 +315,11 @@ read_register_gen (int regnum, char *buf) /* Write register REGNUM at MYADDR to the target. MYADDR points at REGISTER_RAW_BYTES(REGNUM), which must be in target byte-order. */ +/* Registers we shouldn't try to store. */ +#if !defined (CANNOT_STORE_REGISTER) +#define CANNOT_STORE_REGISTER(regnum) 0 +#endif + static void legacy_write_register_gen (int regnum, char *myaddr) { diff --git a/gdb/remote-array.c b/gdb/remote-array.c index beb0c6bda00..35d271d8f49 100644 --- a/gdb/remote-array.c +++ b/gdb/remote-array.c @@ -44,6 +44,24 @@ extern int baud_rate; #define ARRAY_PROMPT ">> " +#define SWAP_TARGET_AND_HOST(buffer,len) \ + do \ + { \ + if (TARGET_BYTE_ORDER != HOST_BYTE_ORDER) \ + { \ + char tmp; \ + char *p = (char *)(buffer); \ + char *q = ((char *)(buffer)) + len - 1; \ + for (; p < q; p++, q--) \ + { \ + tmp = *q; \ + *q = *p; \ + *p = tmp; \ + } \ + } \ + } \ + while (0) + static void debuglogs (int, char *, ...); static void array_open (); static void array_close (); @@ -490,10 +508,22 @@ get_hex_word (void) val = 0; - for (i = 0; i < 8; i++) - val = (val << 4) + get_hex_digit (i == 0); +#if 0 + if (HOST_BYTE_ORDER == BIG_ENDIAN) + { +#endif + for (i = 0; i < 8; i++) + val = (val << 4) + get_hex_digit (i == 0); +#if 0 + } + else + { + for (i = 7; i >= 0; i--) + val = (val << 4) + get_hex_digit (i == 0); + } +#endif - debuglogs (4, "get_hex_word() got a 0x%x.", val); + debuglogs (4, "get_hex_word() got a 0x%x for a %s host.", val, (HOST_BYTE_ORDER == BIG_ENDIAN) ? "big endian" : "little endian"); return val; } @@ -765,14 +795,16 @@ array_wait (ptid_t ptid, struct target_waitstatus *status) static void array_fetch_registers (int ignored) { - char *reg = alloca (MAX_REGISTER_RAW_SIZE); - int regno; + int regno, i; char *p; - char *packet = alloca (PBUFSIZ); + unsigned char packet[PBUFSIZ]; + char regs[REGISTER_BYTES]; debuglogs (1, "array_fetch_registers (ignored=%d)\n", ignored); memset (packet, 0, PBUFSIZ); + /* Unimplemented registers read as all bits zero. */ + memset (regs, 0, REGISTER_BYTES); make_gdb_packet (packet, "g"); if (array_send_packet (packet) == 0) error ("Couldn't transmit packet\n"); @@ -784,10 +816,10 @@ array_fetch_registers (int ignored) { /* supply register stores in target byte order, so swap here */ /* FIXME: convert from ASCII hex to raw bytes */ - LONGEST i = ascii2hexword (packet + (regno * 8)); + i = ascii2hexword (packet + (regno * 8)); debuglogs (5, "Adding register %d = %x\n", regno, i); - store_unsigned_integer (®, REGISTER_RAW_SIZE (regno), i); - supply_register (regno, (char *) ®); + SWAP_TARGET_AND_HOST (&i, 4); + supply_register (regno, (char *) &i); } } diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c index 320584b94e3..4e7c97c8682 100644 --- a/gdb/remote-e7000.c +++ b/gdb/remote-e7000.c @@ -86,6 +86,8 @@ #define SR_REGNUM -1 #endif +extern void notice_quit (void); + extern void report_transfer_performance (unsigned long, time_t, time_t); extern char *sh_processor_type; @@ -258,6 +260,21 @@ expect (char *string) while (1) { c = readchar (timeout); +#if 0 + notice_quit (); + if (quit_flag == 1) + { + if (ctrl_c) + { + putchar_e7000 (CTRLC); + --ctrl_c; + } + else + { + quit (); + } + } +#endif if (echo) { @@ -650,11 +667,7 @@ e7000_open (char *args, int from_tty) if (!e7000_desc) perror_with_name (dev_name); - if (SERIAL_SETBAUDRATE (e7000_desc, baudrate)) - { - SERIAL_CLOSE (dev_name); - perror_with_name (dev_name); - } + SERIAL_SETBAUDRATE (e7000_desc, baudrate); SERIAL_RAW (e7000_desc); #ifdef GDB_TARGET_IS_H8300 diff --git a/gdb/remote-rdi.c b/gdb/remote-rdi.c index 22274b59cc9..9b7848c741d 100644 --- a/gdb/remote-rdi.c +++ b/gdb/remote-rdi.c @@ -77,7 +77,7 @@ static void arm_rdi_mourn (void); static void arm_rdi_send (char *buf); -static ptid_t arm_rdi_wait (ptid_t ptid, struct target_waitstatus *status); +static int arm_rdi_wait (ptid_t ptid, struct target_waitstatus *status); static void arm_rdi_kill (void); diff --git a/gdb/remote-sds.c b/gdb/remote-sds.c index 7d2f5477ec3..27bc2416aea 100644 --- a/gdb/remote-sds.c +++ b/gdb/remote-sds.c @@ -160,7 +160,7 @@ sds_close (int quitting) static int sds_start_remote (PTR dummy) { - int c; + char c; unsigned char buf[200]; immediate_quit++; /* Allow user to interrupt it */ diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 3e515c13af8..71af0742bef 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -611,6 +611,7 @@ gdb_os_poll_quit (host_callback *p) if (ui_loop_hook != NULL) ui_loop_hook (0); + notice_quit (); if (quit_flag) /* gdb's idea of quit */ { quit_flag = 0; /* we've stolen it */ diff --git a/gdb/remote-st.c b/gdb/remote-st.c index 55e1392642d..868c08ed484 100644 --- a/gdb/remote-st.c +++ b/gdb/remote-st.c @@ -285,11 +285,7 @@ or target st2000 \n"); if (!st2000_desc) perror_with_name (dev_name); - if (SERIAL_SETBAUDRATE (st2000_desc, baudrate)) - { - SERIAL_CLOSE (dev_name); - perror_with_name (dev_name); - } + SERIAL_SETBAUDRATE (st2000_desc, baudrate); SERIAL_RAW (st2000_desc); diff --git a/gdb/remote.c b/gdb/remote.c index 86ba3c1eb14..aeef7dd1f55 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -186,11 +186,9 @@ static void remote_find_new_threads (void); static void record_currthread (int currthread); -static int fromhex (int a); +/* exported functions */ -static int hex2bin (const char *hex, char *bin, int count); - -static int bin2hex (const char *bin, char *hex, int count); +extern int fromhex (int a); static int putpkt_binary (char *buf, int cnt); @@ -670,22 +668,6 @@ packet_ok (const char *buf, struct packet_config *config) } } -/* Should we try the 'qSymbol' (target symbol lookup service) request? */ -static struct packet_config remote_protocol_qSymbol; - -static void -set_remote_protocol_qSymbol_packet_cmd (char *args, int from_tty, - struct cmd_list_element *c) -{ - update_packet_config (&remote_protocol_qSymbol); -} - -static void -show_remote_protocol_qSymbol_packet_cmd (char *args, int from_tty) -{ - show_packet_config_cmd (&remote_protocol_qSymbol); -} - /* Should we try the 'e' (step over range) request? */ static struct packet_config remote_protocol_e; @@ -1753,9 +1735,17 @@ remote_threads_extra_info (struct thread_info *tp) getpkt (bufp, PBUFSIZ, 0); if (bufp[0] != 0) { - n = min (strlen (bufp) / 2, sizeof (display_buf)); - result = hex2bin (bufp, display_buf, n); - display_buf [result] = '\0'; + char *p; + + for (p = display_buf; + p < display_buf + sizeof(display_buf) - 1 && + bufp[0] != 0 && + bufp[1] != 0; + p++, bufp+=2) + { + *p = fromhex (bufp[0]) * 16 + fromhex (bufp[1]); + } + *p = 0; return display_buf; } } @@ -2086,7 +2076,6 @@ init_all_packet_configs (void) update_packet_config (&remote_protocol_e); update_packet_config (&remote_protocol_E); update_packet_config (&remote_protocol_P); - update_packet_config (&remote_protocol_qSymbol); for (i = 0; i < NR_Z_PACKET_TYPES; i++) update_packet_config (&remote_protocol_Z[i]); /* Force remote_write_bytes to check whether target supports binary @@ -2094,44 +2083,6 @@ init_all_packet_configs (void) update_packet_config (&remote_protocol_binary_download); } -/* Symbol look-up. */ - -static void -remote_check_symbols (struct objfile *objfile) -{ - char *msg, *reply, *tmp; - struct minimal_symbol *sym; - int end; - - if (remote_protocol_qSymbol.support == PACKET_DISABLE) - return; - - msg = alloca (PBUFSIZ); - reply = alloca (PBUFSIZ); - - /* Invite target to request symbol lookups. */ - - putpkt ("qSymbol::"); - getpkt (reply, PBUFSIZ, 0); - packet_ok (reply, &remote_protocol_qSymbol); - - while (strncmp (reply, "qSymbol:", 8) == 0) - { - tmp = &reply[8]; - end = hex2bin (tmp, msg, strlen (tmp) / 2); - msg[end] = '\0'; - sym = lookup_minimal_symbol (msg, NULL, NULL); - if (sym == NULL) - sprintf (msg, "qSymbol::%s", &reply[8]); - else - sprintf (msg, "qSymbol:%s:%s", - paddr_nz (SYMBOL_VALUE_ADDRESS (sym)), - &reply[8]); - putpkt (msg); - getpkt (reply, PBUFSIZ, 0); - } -} - static void remote_open_1 (char *name, int from_tty, struct target_ops *target, int extended_p) @@ -2192,11 +2143,6 @@ serial device is attached to the remote system\n\ someday have a notion of debugging several processes. */ inferior_ptid = pid_to_ptid (MAGIC_NULL_PID); -#ifdef SOLIB_CREATE_INFERIOR_HOOK - /* First delete any symbols previously loaded from shared libraries. */ - no_shared_libraries (NULL, 0); -#endif - /* Start the remote connection; if error (0), discard this target. In particular, if the user quits, be sure to discard it (we'd be in an inconsistent state otherwise). */ @@ -2215,19 +2161,14 @@ serial device is attached to the remote system\n\ putpkt ("!"); getpkt (buf, PBUFSIZ, 0); } -#ifdef SOLIB_CREATE_INFERIOR_HOOK /* FIXME: need a master target_open vector from which all remote_opens can be called, so that stuff like this can go there. Failing that, the following code must be copied to the open function for any remote target that wants to support svr4 shared libraries. */ - - /* Set up to detect and load shared libraries. */ +#ifdef SOLIB_CREATE_INFERIOR_HOOK if (exec_bfd) /* No use without an exec file. */ - { - SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid)); - remote_check_symbols (symfile_objfile); - } + SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid)); #endif } @@ -2302,11 +2243,6 @@ serial device is attached to the remote system\n\ implemented. */ wait_forever_enabled_p = 0; -#ifdef SOLIB_CREATE_INFERIOR_HOOK - /* First delete any symbols previously loaded from shared libraries. */ - no_shared_libraries (NULL, 0); -#endif - /* Start the remote connection; if error (0), discard this target. In particular, if the user quits, be sure to discard it (we'd be in an inconsistent state otherwise). */ @@ -2328,19 +2264,14 @@ serial device is attached to the remote system\n\ putpkt ("!"); getpkt (buf, PBUFSIZ, 0); } -#ifdef SOLIB_CREATE_INFERIOR_HOOK /* FIXME: need a master target_open vector from which all remote_opens can be called, so that stuff like this can go there. Failing that, the following code must be copied to the open function for any remote target that wants to support svr4 shared libraries. */ - - /* Set up to detect and load shared libraries. */ +#ifdef SOLIB_CREATE_INFERIOR_HOOK if (exec_bfd) /* No use without an exec file. */ - { - SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid)); - remote_check_symbols (symfile_objfile); - } + SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid)); #endif } @@ -2391,7 +2322,7 @@ remote_async_detach (char *args, int from_tty) /* Convert hex digit A to a number. */ -static int +int fromhex (int a) { if (a >= '0' && a <= '9') @@ -2404,25 +2335,6 @@ fromhex (int a) error ("Reply contains invalid hex digit %d", a); } -static int -hex2bin (const char *hex, char *bin, int count) -{ - int i; - - for (i = 0; i < count; i++) - { - if (hex[0] == 0 || hex[1] == 0) - { - /* Hex string is short, or of uneven length. - Return the count that has been converted so far. */ - return i; - } - *bin++ = fromhex (hex[0]) * 16 + fromhex (hex[1]); - hex += 2; - } - return i; -} - /* Convert number NIB to a hex digit. */ static int @@ -2433,23 +2345,6 @@ tohex (int nib) else return 'a' + nib - 10; } - -static int -bin2hex (const char *bin, char *hex, int count) -{ - int i; - /* May use a length, or a nul-terminated string as input. */ - if (count == 0) - count = strlen (bin); - - for (i = 0; i < count; i++) - { - *hex++ = tohex ((*bin >> 4) & 0xf); - *hex++ = tohex (*bin++ & 0xf); - } - *hex = 0; - return i; -} /* Tell the remote machine to resume. */ @@ -2508,7 +2403,7 @@ remote_resume (ptid_t ptid, int step, enum target_signal siggnal) putpkt (buf); getpkt (buf, PBUFSIZ, 0); - if (packet_ok (buf, &remote_protocol_E) == PACKET_OK) + if (packet_ok(buf, &remote_protocol_E) == PACKET_OK) return; } } @@ -2526,7 +2421,7 @@ remote_resume (ptid_t ptid, int step, enum target_signal siggnal) putpkt (buf); getpkt (buf, PBUFSIZ, 0); - if (packet_ok (buf, &remote_protocol_e) == PACKET_OK) + if (packet_ok(buf, &remote_protocol_e) == PACKET_OK) return; } } @@ -2596,7 +2491,7 @@ remote_async_resume (ptid_t ptid, int step, enum target_signal siggnal) putpkt (buf); getpkt (buf, PBUFSIZ, 0); - if (packet_ok (buf, &remote_protocol_E) == PACKET_OK) + if (packet_ok(buf, &remote_protocol_E) == PACKET_OK) goto register_event_loop; } } @@ -2614,7 +2509,7 @@ remote_async_resume (ptid_t ptid, int step, enum target_signal siggnal) putpkt (buf); getpkt (buf, PBUFSIZ, 0); - if (packet_ok (buf, &remote_protocol_e) == PACKET_OK) + if (packet_ok(buf, &remote_protocol_e) == PACKET_OK) goto register_event_loop; } } @@ -2902,7 +2797,6 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status) { unsigned char *p1; char *p_temp; - int fieldsize; /* Read the register number */ regno = strtol ((const char *) p, &p_temp, 16); @@ -2936,10 +2830,13 @@ Packet: '%s'\n", Packet: '%s'\n", regno, p, buf); - fieldsize = hex2bin (p, regs, REGISTER_RAW_SIZE (regno)); - p += 2 * fieldsize; - if (fieldsize < REGISTER_RAW_SIZE (regno)) - warning ("Remote reply is too short: %s", buf); + for (i = 0; i < REGISTER_RAW_SIZE (regno); i++) + { + if (p[0] == 0 || p[1] == 0) + warning ("Remote reply is too short: %s", buf); + regs[i] = fromhex (p[0]) * 16 + fromhex (p[1]); + p += 2; + } supply_register (regno, regs); } @@ -3121,7 +3018,6 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status) { unsigned char *p1; char *p_temp; - int fieldsize; /* Read the register number */ regno = strtol ((const char *) p, &p_temp, 16); @@ -3155,10 +3051,13 @@ Packet: '%s'\n", Packet: '%s'\n", regno, p, buf); - fieldsize = hex2bin (p, regs, REGISTER_RAW_SIZE (regno)); - p += 2 * fieldsize; - if (fieldsize < REGISTER_RAW_SIZE (regno)) - warning ("Remote reply is too short: %s", buf); + for (i = 0; i < REGISTER_RAW_SIZE (regno); i++) + { + if (p[0] == 0 || p[1] == 0) + warning ("Remote reply is too short: %s", buf); + regs[i] = fromhex (p[0]) * 16 + fromhex (p[1]); + p += 2; + } supply_register (regno, regs); } @@ -3408,7 +3307,12 @@ store_register_using_P (int regno) sprintf (buf, "P%x=", regno); p = buf + strlen (buf); regp = register_buffer (regno); - bin2hex (regp, p, REGISTER_RAW_SIZE (regno)); + for (i = 0; i < REGISTER_RAW_SIZE (regno); ++i) + { + *p++ = tohex ((regp[i] >> 4) & 0xf); + *p++ = tohex (regp[i] & 0xf); + } + *p = '\0'; remote_send (buf, PBUFSIZ); return buf[0] != '\0'; @@ -3465,7 +3369,13 @@ remote_store_registers (int regno) regs = register_buffer (-1); p = buf + 1; /* remote_prepare_to_store insures that register_bytes_found gets set. */ - bin2hex (regs, p, register_bytes_found); + for (i = 0; i < register_bytes_found; i++) + { + *p++ = tohex ((regs[i] >> 4) & 0xf); + *p++ = tohex (regs[i] & 0xf); + } + *p = '\0'; + remote_send (buf, PBUFSIZ); } @@ -3692,8 +3602,12 @@ remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len) /* Normal mode: Send target system values byte by byte, in increasing byte addresses. Each byte is encoded as a two hex value. */ - nr_bytes = bin2hex (myaddr, p, todo); - p += 2 * nr_bytes; + for (nr_bytes = 0; nr_bytes < todo; nr_bytes++) + { + *p++ = tohex ((myaddr[nr_bytes] >> 4) & 0xf); + *p++ = tohex (myaddr[nr_bytes] & 0xf); + } + *p = '\0'; break; case PACKET_SUPPORT_UNKNOWN: internal_error (__FILE__, __LINE__, @@ -3784,11 +3698,14 @@ remote_read_bytes (CORE_ADDR memaddr, char *myaddr, int len) each byte encoded as two hex characters. */ p = buf; - if ((i = hex2bin (p, myaddr, todo)) < todo) + for (i = 0; i < todo; i++) { - /* Reply is short. This means that we were able to read - only part of what we wanted to. */ - return i + (origlen - len); + if (p[0] == 0 || p[1] == 0) + /* Reply is short. This means that we were able to read + only part of what we wanted to. */ + return i + (origlen - len); + myaddr[i] = fromhex (p[0]) * 16 + fromhex (p[1]); + p += 2; } myaddr += todo; memaddr += todo; @@ -4988,7 +4905,12 @@ remote_rcmd (char *command, error ("\"monitor\" command ``%s'' is too long\n", command); /* Encode the actual command */ - bin2hex (command, p, 0); + for (i = 0; command[i]; i++) + { + *p++ = tohex ((command[i] >> 4) & 0xf); + *p++ = tohex (command[i] & 0xf); + } + *p = '\0'; if (putpkt (buf) < 0) error ("Communication problem with target\n"); @@ -5766,6 +5688,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).", static void set_remote_cmd (char *args, int from_tty) { + } static void @@ -5776,7 +5699,6 @@ show_remote_cmd (char *args, int from_tty) show_remote_protocol_e_packet_cmd (args, from_tty); show_remote_protocol_E_packet_cmd (args, from_tty); show_remote_protocol_P_packet_cmd (args, from_tty); - show_remote_protocol_qSymbol_packet_cmd (args, from_tty); show_remote_protocol_binary_download_cmd (args, from_tty); } @@ -5790,23 +5712,6 @@ build_remote_gdbarch_data (void) remote_address_size = TARGET_ADDR_BIT; } -/* Saved pointer to previous owner of the new_objfile event. */ -static void (*remote_new_objfile_chain) (struct objfile *); - -/* Function to be called whenever a new objfile (shlib) is detected. */ -static void -remote_new_objfile (struct objfile *objfile) -{ - if (remote_desc != 0) /* Have a remote connection */ - { - remote_check_symbols (objfile); - } - /* Call predecessor on chain, if any. */ - if (remote_new_objfile_chain != 0 && - remote_desc == 0) - remote_new_objfile_chain (objfile); -} - void _initialize_remote (void) { @@ -5837,10 +5742,6 @@ _initialize_remote (void) init_remote_cisco_ops (); add_target (&remote_cisco_ops); - /* Hook into new objfile notification. */ - remote_new_objfile_chain = target_new_objfile_hook; - target_new_objfile_hook = remote_new_objfile; - #if 0 init_remote_threadtests (); #endif @@ -5941,13 +5842,6 @@ in a memory packet.\n", add_info ("remote-process", remote_info_process, "Query the remote system for process info."); - add_packet_config_cmd (&remote_protocol_qSymbol, - "qSymbol", "symbol-lookup", - set_remote_protocol_qSymbol_packet_cmd, - show_remote_protocol_qSymbol_packet_cmd, - &remote_set_cmdlist, &remote_show_cmdlist, - 0); - add_packet_config_cmd (&remote_protocol_e, "e", "step-over-range", set_remote_protocol_e_packet_cmd, diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 864345dd177..3c0a7b9ad5a 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -2210,7 +2210,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (!from_xcoff_exec) { - arch = info.bfd_arch_info->arch; + arch = info.bfd_architecture; mach = info.bfd_arch_info->mach; } else diff --git a/gdb/ser-e7kpc.c b/gdb/ser-e7kpc.c index 209765ef400..c529c141f6c 100644 --- a/gdb/ser-e7kpc.c +++ b/gdb/ser-e7kpc.c @@ -24,8 +24,13 @@ #include "serial.h" #include "gdb_string.h" -#ifdef _WIN32 +/* MSVC uses strnicmp instead of strncasecmp */ +#ifdef _MSC_VER +#define strncasecmp strnicmp #define WIN32_LEAN_AND_MEAN +#endif + +#ifdef _WIN32 #include #endif @@ -124,7 +129,36 @@ sigs[] = 0 }; +#ifdef _MSC_VER +/* Get the base of the data segment. This is needed to calculate the offset + between data segment addresses and the base of linear memory, which is where + device registers reside. Note that this is really only necessary for + Win32s, since Win95 and NT keep the data segment at linear 0. */ + +static unsigned long +get_ds_base (void) +{ + unsigned short dsval; + LDT_ENTRY ldt; + unsigned long dsbase; + + __asm + { + mov dsval, ds + } + + dsbase = 0; + + GetThreadSelectorEntry (GetCurrentThread (), dsval, &ldt); + + dsbase = ldt.HighWord.Bits.BaseHi << 24 | ldt.HighWord.Bits.BaseMid << 16 + | ldt.BaseLow; + + return dsbase; +} +#else /* !_MSC_VER */ #define get_ds_base() 0 +#endif /* _MSC_VER */ static int e7000pc_init (void) diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c index a8521f2a0e6..3d336f77c3b 100644 --- a/gdb/ser-go32.c +++ b/gdb/ser-go32.c @@ -623,6 +623,7 @@ dos_readchar (serial_t scb, int timeout) { if (timeout >= 0 && (rawclock () - then) >= 0) return SERIAL_TIMEOUT; + notice_quit (); } return c; diff --git a/gdb/ser-ocd.c b/gdb/ser-ocd.c new file mode 100644 index 00000000000..88ba1d1fedf --- /dev/null +++ b/gdb/ser-ocd.c @@ -0,0 +1,186 @@ +/* Remote serial interface for Macraigor Systems implementation of + On-Chip Debugging using serial target box or serial wiggler + + Copyright 1994, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "serial.h" + +#ifdef _WIN32 +#include +#endif + +#ifdef _WIN32 +/* On Windows, this function pointer is initialized to a function in + the wiggler DLL. */ +static int (*dll_do_command) (const char *, char *); +#endif + +static int +ocd_open (serial_t scb, const char *name) +{ +#ifdef _WIN32 + /* Find the wiggler DLL which talks to the board. */ + if (dll_do_command == NULL) + { + HINSTANCE handle; + + /* FIXME: Should the user be able to configure this? */ + handle = LoadLibrary ("Wigglers.dll"); + if (handle == NULL) + error ("Can't load Wigglers.dll"); + + dll_do_command = ((int (*) (const char *, char *)) + GetProcAddress (handle, "do_command")); + if (dll_do_command == NULL) + error ("Can't find do_command function in Wigglers.dll"); + } +#else + /* No wiggler DLLs on Unix yet, fail. */ + error ("Wiggler library not available for this type of host."); +#endif /* _WIN32 */ + return 0; +} + +static int +ocd_noop (serial_t scb) +{ + return 0; +} + +static void +ocd_raw (serial_t scb) +{ + /* Always in raw mode */ +} + +/* We need a buffer to store responses from the Wigglers.dll */ +#define WIGGLER_BUFF_SIZE 512 +unsigned char from_wiggler_buffer[WIGGLER_BUFF_SIZE]; +unsigned char *wiggler_buffer_ptr; /* curr spot in buffer */ + +static int +ocd_readchar (serial_t scb, int timeout) +{ + /* Catch attempts at reading past the end of the buffer */ + if (wiggler_buffer_ptr > + (from_wiggler_buffer + (sizeof (char *) * WIGGLER_BUFF_SIZE))) + error ("ocd_readchar asked to read past the end of the buffer!"); + + return (int) *wiggler_buffer_ptr++; /* return curr char and increment ptr */ +} + +struct ocd_ttystate +{ + int dummy; +}; + +/* ocd_{get set}_tty_state() are both dummys to fill out the function + vector. Someday, they may do something real... */ + +static serial_ttystate +ocd_get_tty_state (serial_t scb) +{ + struct ocd_ttystate *state; + + state = (struct ocd_ttystate *) xmalloc (sizeof *state); + + return (serial_ttystate) state; +} + +static int +ocd_set_tty_state (serial_t scb, serial_ttystate ttystate) +{ + return 0; +} + +static int +ocd_noflush_set_tty_state (serial_t scb, serial_ttystate new_ttystate, + serial_ttystate old_ttystate) +{ + return 0; +} + +static void +ocd_print_tty_state (serial_t scb, + serial_ttystate ttystate, + struct ui_file *stream) +{ + /* Nothing to print. */ + return; +} + +static int +ocd_setbaudrate (serial_t scb, int rate) +{ + return 0; +} + +static int +ocd_setstopbits (serial_t scb, int rate) +{ + return 0; +} + +static int +ocd_write (serial_t scb, const char *str, int len) +{ +#ifdef _WIN32 + /* send packet to Wigglers.dll and store response so we can give it to + remote-wiggler.c when get_packet is run */ + dll_do_command (str, from_wiggler_buffer); + wiggler_buffer_ptr = from_wiggler_buffer; +#endif + + return 0; +} + +static void +ocd_close (serial_t scb) +{ +} + +static struct serial_ops ocd_ops = +{ + "ocd", + 0, + ocd_open, + ocd_close, + ocd_readchar, + ocd_write, + ocd_noop, /* flush output */ + ocd_noop, /* flush input */ + ocd_noop, /* send break -- currently used only for nindy */ + ocd_raw, + ocd_get_tty_state, + ocd_set_tty_state, + ocd_print_tty_state, + ocd_noflush_set_tty_state, + ocd_setbaudrate, + ocd_setstopbits, + ocd_noop, /* wait for output to drain */ +}; + +void +_initialize_ser_ocd_bdm (void) +{ + serial_add_interface (&ocd_ops); +} diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index 30281cde1ee..d7eb9cbd7df 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -29,7 +29,9 @@ #include #include #include +#ifndef __CYGWIN__ #include +#endif #include #include "gdb_string.h" diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c index ee17c122c78..4daf11f4973 100644 --- a/gdb/ser-unix.c +++ b/gdb/ser-unix.c @@ -741,33 +741,9 @@ rate_to_code (int rate) int i; for (i = 0; baudtab[i].rate != -1; i++) - { - /* test for perfect macth. */ - if (rate == baudtab[i].rate) - return baudtab[i].code; - else - { - /* check if it is in between valid values. */ - if (rate < baudtab[i].rate) - { - if (i) - { - warning ("Invalid baud rate %d. Closest values are %d and %d.", - rate, baudtab[i - 1].rate, baudtab[i].rate); - } - else - { - warning ("Invalid baud rate %d. Minimum value is %d.", - rate, baudtab[0].rate); - } - return -1; - } - } - } - - /* The requested speed was too large. */ - warning ("Invalid baud rate %d. Maximum value is %d.", - rate, baudtab[i - 1].rate); + if (rate == baudtab[i].rate) + return baudtab[i].code; + return -1; } @@ -775,22 +751,13 @@ static int hardwire_setbaudrate (serial_t scb, int rate) { struct hardwire_ttystate state; - int baud_code = rate_to_code (rate); - - if (baud_code < 0) - { - /* The baud rate was not valid. - A warning has already been issued. */ - errno = EINVAL; - return -1; - } if (get_tty_state (scb, &state)) return -1; #ifdef HAVE_TERMIOS - cfsetospeed (&state.termios, baud_code); - cfsetispeed (&state.termios, baud_code); + cfsetospeed (&state.termios, rate_to_code (rate)); + cfsetispeed (&state.termios, rate_to_code (rate)); #endif #ifdef HAVE_TERMIO @@ -799,12 +766,12 @@ hardwire_setbaudrate (serial_t scb, int rate) #endif state.termio.c_cflag &= ~(CBAUD | CIBAUD); - state.termio.c_cflag |= baud_code; + state.termio.c_cflag |= rate_to_code (rate); #endif #ifdef HAVE_SGTTY - state.sgttyb.sg_ispeed = baud_code; - state.sgttyb.sg_ospeed = baud_code; + state.sgttyb.sg_ispeed = rate_to_code (rate); + state.sgttyb.sg_ospeed = rate_to_code (rate); #endif return set_tty_state (scb, &state); diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 78a4a25d463..0475b4396c5 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -59,6 +59,14 @@ struct frame_extra_info int f_offset; }; +#if 0 +#ifdef _WIN32_WCE +char **sh_register_names = sh3_reg_names; +#else +char **sh_register_names = sh_generic_reg_names; +#endif +#endif + static char * sh_generic_register_name (int reg_nr) { diff --git a/gdb/sh3-rom.c b/gdb/sh3-rom.c index c0f26df38a6..fc3b7b8b97f 100644 --- a/gdb/sh3-rom.c +++ b/gdb/sh3-rom.c @@ -350,11 +350,16 @@ _initialize_sh3_rom (void) sh3_ops.to_longname = "Hitachi SH-3 rom monitor"; sh3_ops.to_doc = - /* We can download through the parallel port too. */ - "Debug on a Hitachi eval board running the SH-3E rom monitor.\n" - "Specify the serial device it is connected to.\n" +#ifdef _WINDOWS + /* On windows we can talk through the parallel port too. */ + "Debug on a Hitachi eval board running the SH-3 rom monitor.\n" + "Specify the serial device it is connected to (e.g. com2).\n" "If you want to use the parallel port to download to it, specify that\n" - "as an additional second argument."; + "as the second argument. (e.g. lpt1)"; +#else + "Debug on a Hitachi eval board running the SH-3 rom monitor.\n\ +Specify the serial device it is connected to (e.g. /dev/ttya)."; +#endif sh3_ops.to_open = sh3_open; sh3_ops.to_close = sh3_close; @@ -369,11 +374,16 @@ _initialize_sh3_rom (void) sh3e_ops.to_longname = "Hitachi SH-3E rom monitor"; sh3e_ops.to_doc = - /* We can download through the parallel port too. */ +#ifdef _WINDOWS + /* On windows we can talk through the parallel port too. */ "Debug on a Hitachi eval board running the SH-3E rom monitor.\n" - "Specify the serial device it is connected to.\n" + "Specify the serial device it is connected to (e.g. com2).\n" "If you want to use the parallel port to download to it, specify that\n" - "as an additional second argument."; + "as the second argument. (e.g. lpt1)"; +#else + "Debug on a Hitachi eval board running the SH-3E rom monitor.\n\ +Specify the serial device it is connected to (e.g. /dev/ttya)."; +#endif sh3e_ops.to_open = sh3e_open; sh3e_ops.to_close = sh3_close; diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index f92c49e4b3f..97f3e2426a9 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -97,6 +97,8 @@ static struct ps_prochandle main_ph; static td_thragent_t *main_ta; static int sol_thread_active = 0; +static struct cleanup *save_inferior_ptid (void); +static void restore_inferior_ptid (void *pid); static char *td_err_string (td_err_e errcode); static char *td_state_string (td_thr_state_e statecode); static ptid_t thread_to_lwp (ptid_t thread_id, int default_lwp); @@ -111,15 +113,14 @@ static void init_sol_core_ops (void); /* Default definitions: These must be defined in tm.h if they are to be shared with a process module such as procfs. */ -#define GET_PID(ptid) ptid_get_pid (ptid) -#define GET_LWP(ptid) ptid_get_lwp (ptid) -#define GET_THREAD(ptid) ptid_get_tid (ptid) +#define THREAD_FLAG 0x80000000 +#define is_thread(ARG) (((ARG) & THREAD_FLAG) != 0) +#define is_lwp(ARG) (((ARG) & THREAD_FLAG) == 0) +#define GET_LWP(PID) TIDGET (PID) +#define GET_THREAD(PID) TIDGET (PID) +#define BUILD_LWP(TID, PID) MERGEPID (PID, TID) -#define is_lwp(ptid) (GET_LWP (ptid) != 0) -#define is_thread(ptid) (GET_THREAD (ptid) != 0) - -#define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0) -#define BUILD_THREAD(tid, pid) ptid_build (pid, 0, tid) +#define BUILD_THREAD(TID, PID) (MERGEPID (PID, TID) | THREAD_FLAG) /* Pointers to routines from lithread_db resolved by dlopen() */ @@ -394,6 +395,50 @@ lwp_to_thread (ptid_t lwp) return BUILD_THREAD (ti.ti_tid, PIDGET (lwp)); } +/* + + LOCAL FUNCTION + + save_inferior_ptid - Save inferior_ptid on the cleanup list + restore_inferior_ptid - Restore inferior_ptid from the cleanup list + + SYNOPSIS + + struct cleanup *save_inferior_ptid () + void restore_inferior_ptid (int pid) + + DESCRIPTION + + These two functions act in unison to restore inferior_ptid in + case of an error. + + NOTES + + inferior_ptid is a global variable that needs to be changed by many of + these routines before calling functions in procfs.c. In order to + guarantee that inferior_ptid gets restored (in case of errors), you + need to call save_inferior_ptid before changing it. At the end of the + function, you should invoke do_cleanups to restore it. + + */ + + +static struct cleanup * +save_inferior_ptid (void) +{ + ptid_t *saved_ptid = xmalloc (sizeof (ptid_t)); + *saved_ptid = inferior_ptid; + return make_cleanup (restore_inferior_ptid, saved_ptid); +} + +static void +restore_inferior_ptid (void *data) +{ + ptid_t *saved_ptid = data; + inferior_ptid = *saved_ptid; + xfree (saved_ptid); +} + /* Most target vector functions from here on actually just pass through to procfs.c, as they don't need to do anything specific for threads. */ diff --git a/gdb/solib-osf.c b/gdb/solib-osf.c deleted file mode 100644 index eb78a419a2d..00000000000 --- a/gdb/solib-osf.c +++ /dev/null @@ -1,617 +0,0 @@ -/* Handle OSF/1, Digital UNIX, and Tru64 shared libraries - for GDB, the GNU Debugger. - Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 - 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. */ - -/* When handling shared libraries, GDB has to find out the pathnames - of all shared libraries that are currently loaded (to read in their - symbols) and where the shared libraries are loaded in memory - (to relocate them properly from their prelinked addresses to the - current load address). - - Under OSF/1 there are two possibilities to get at this information: - - 1) Peek around in the runtime loader structures. - These are not documented, and they are not defined in the system - header files. The definitions below were obtained by experimentation, - but they seem stable enough. - - 2) Use the libxproc.a library, which contains the equivalent ldr_* - routines. The library is documented in Tru64 5.x, but as of 5.1, it - only allows a process to examine itself. On earlier versions, it - may require that the GDB executable be dynamically linked and that - NAT_CLIBS include -lxproc -Wl,-expect_unresolved,ldr_process_context - for GDB and all applications that are using libgdb. - - We will use the peeking approach until libxproc.a works for other - processes. */ - -#include "defs.h" - -#include -#include -#include "gdb_string.h" - -#include "bfd.h" -#include "symtab.h" -#include "symfile.h" -#include "objfiles.h" -#include "target.h" -#include "inferior.h" -#include "solist.h" - -#ifdef USE_LDR_ROUTINES -# include -#endif - -#ifndef USE_LDR_ROUTINES -/* Definition of runtime loader structures, found by experimentation. */ -#define RLD_CONTEXT_ADDRESS 0x3ffc0000000 - -/* Per-module information structure referenced by ldr_context_t.head. */ - -typedef struct - { - CORE_ADDR next; - CORE_ADDR previous; - CORE_ADDR unknown1; - CORE_ADDR module_name; - CORE_ADDR modinfo_addr; /* used by next_link_map_member() to detect - the end of the shared module list */ - long module_id; - CORE_ADDR unknown2; - CORE_ADDR unknown3; - long region_count; - CORE_ADDR regioninfo_addr; - } -ldr_module_info_t; - -/* Per-region structure referenced by ldr_module_info_t.regioninfo_addr. */ - -typedef struct - { - long unknown1; - CORE_ADDR regionname_addr; - long protection; - CORE_ADDR vaddr; - CORE_ADDR mapaddr; - long size; - long unknown2[5]; - } -ldr_region_info_t; - -/* Structure at RLD_CONTEXT_ADDRESS specifying the start and finish addresses - of the shared module list. */ - -typedef struct - { - CORE_ADDR unknown1; - CORE_ADDR unknown2; - CORE_ADDR head; - CORE_ADDR tail; - } -ldr_context_t; -#endif /* !USE_LDR_ROUTINES */ - -/* Per-section information, stored in struct lm_info.secs. */ - -struct lm_sec - { - CORE_ADDR offset; /* difference between default and actual - virtual addresses of section .name */ - CORE_ADDR nameaddr; /* address in inferior of section name */ - const char *name; /* name of section, null if not fetched */ - }; - -/* Per-module information, stored in struct so_list.lm_info. */ - -struct lm_info - { - int isloader; /* whether the module is /sbin/loader */ - int nsecs; /* length of .secs */ - struct lm_sec secs[1]; /* variable-length array of sections, sorted - by name */ - }; - -/* Context for iterating through the inferior's shared module list. */ - -struct read_map_ctxt - { -#ifdef USE_LDR_ROUTINES - ldr_process_t proc; - ldr_module_t next; -#else - CORE_ADDR next; /* next element in module list */ - CORE_ADDR tail; /* last element in module list */ -#endif - }; - -/* Forward declaration for this module's autoinit function. */ - -extern void _initialize_osf_solib (void); - -#ifdef USE_LDR_ROUTINES -# if 0 -/* This routine is intended to be called by ldr_* routines to read memory from - the current target. Usage: - - ldr_process = ldr_core_process (); - ldr_set_core_reader (ldr_read_memory); - ldr_xdetach (ldr_process); - ldr_xattach (ldr_process); - - ldr_core_process() and ldr_read_memory() are neither documented nor - declared in system header files. They work with OSF/1 2.x, and they might - work with later versions as well. */ - -static int -ldr_read_memory (CORE_ADDR memaddr, char *myaddr, int len, int readstring) -{ - int result; - char *buffer; - - if (readstring) - { - target_read_string (memaddr, &buffer, len, &result); - if (result == 0) - strcpy (myaddr, buffer); - xfree (buffer); - } - else - result = target_read_memory (memaddr, myaddr, len); - - if (result != 0) - result = -result; - return result; -} -# endif /* 0 */ -#endif /* USE_LDR_ROUTINES */ - -/* Comparison for qsort() and bsearch(): return -1, 0, or 1 according to - whether lm_sec *P1's name is lexically less than, equal to, or greater - than that of *P2. */ - -static int -lm_sec_cmp (const void *p1, const void *p2) -{ - const struct lm_sec *lms1 = p1, *lms2 = p2; - return strcmp (lms1->name, lms2->name); -} - -/* Sort LMI->secs so that osf_relocate_section_addresses() can binary-search - it. */ - -static void -lm_secs_sort (struct lm_info *lmi) -{ - qsort (lmi->secs, lmi->nsecs, sizeof *lmi->secs, lm_sec_cmp); -} - -/* Populate name fields of LMI->secs. */ - -static void -fetch_sec_names (struct lm_info *lmi) -{ -#ifndef USE_LDR_ROUTINES - int i, errcode; - struct lm_sec *lms; - char *name; - - for (i = 0; i < lmi->nsecs; i++) - { - lms = lmi->secs + i; - target_read_string (lms->nameaddr, &name, PATH_MAX, &errcode); - if (errcode != 0) - { - warning ("unable to read shared sec name at 0x%lx", lms->nameaddr); - name = xstrdup (""); - } - lms->name = name; - } - lm_secs_sort (lmi); -#endif -} - -/* target_so_ops callback. Adjust SEC's addresses after it's been mapped into - the process. */ - -static void -osf_relocate_section_addresses (struct so_list *so, - struct section_table *sec) -{ - struct lm_info *lmi; - struct lm_sec lms_key, *lms; - - /* Fetch SO's section names if we haven't done so already. */ - lmi = so->lm_info; - if (lmi->nsecs && !lmi->secs[0].name) - fetch_sec_names (lmi); - - /* Binary-search for offset information corresponding to SEC. */ - lms_key.name = sec->the_bfd_section->name; - lms = bsearch (&lms_key, lmi->secs, lmi->nsecs, sizeof *lms, lm_sec_cmp); - if (lms) - { - sec->addr += lms->offset; - sec->endaddr += lms->offset; - } -} - -/* target_so_ops callback. Free parts of SO allocated by this file. */ - -static void -osf_free_so (struct so_list *so) -{ - int i; - const char *name; - - for (i = 0; i < so->lm_info->nsecs; i++) - { - name = so->lm_info->secs[i].name; - if (name) - xfree ((void *) name); - } - xfree (so->lm_info); -} - -/* target_so_ops callback. Discard information accumulated by this file and - not freed by osf_free_so(). */ - -static void -osf_clear_solib (void) -{ - return; -} - -/* target_so_ops callback. Prepare to handle shared libraries after the - inferior process has been created but before it's executed any - instructions. - - For a statically bound executable, the inferior's first instruction is the - one at "_start", or a similar text label. No further processing is needed - in that case. - - For a dynamically bound executable, this first instruction is somewhere - in the rld, and the actual user executable is not yet mapped in. - We continue the inferior again, rld then maps in the actual user - executable and any needed shared libraries and then sends - itself a SIGTRAP. - - At that point we discover the names of all shared libraries and - read their symbols in. - - FIXME - - This code does not properly handle hitting breakpoints which the - user might have set in the rld itself. Proper handling would have - to check if the SIGTRAP happened due to a kill call. - - Also, what if child has exit()ed? Must exit loop somehow. */ - -static void -osf_solib_create_inferior_hook (void) -{ - /* Nothing to do for statically bound executables. */ - - if (symfile_objfile == NULL - || symfile_objfile->obfd == NULL - || ((bfd_get_file_flags (symfile_objfile->obfd) & DYNAMIC) == 0)) - return; - - /* Now run the target. It will eventually get a SIGTRAP, at - which point all of the libraries will have been mapped in and we - can go groveling around in the rld structures to find - out what we need to know about them. */ - - clear_proceed_status (); - stop_soon_quietly = 1; - stop_signal = TARGET_SIGNAL_0; - do - { - target_resume (minus_one_ptid, 0, stop_signal); - wait_for_inferior (); - } - while (stop_signal != TARGET_SIGNAL_TRAP); - - /* solib_add will call reinit_frame_cache. - But we are stopped in the runtime loader and we do not have symbols - for the runtime loader. So heuristic_proc_start will be called - and will put out an annoying warning. - Delaying the resetting of stop_soon_quietly until after symbol loading - suppresses the warning. */ - if (auto_solib_add) - solib_add ((char *) 0, 0, (struct target_ops *) 0); - stop_soon_quietly = 0; - - /* Enable breakpoints disabled (unnecessarily) by clear_solib(). */ - re_enable_breakpoints_in_shlibs (); -} - -/* target_so_ops callback. Do additional symbol handling, lookup, etc. after - symbols for a shared object have been loaded. */ - -static void -osf_special_symbol_handling (void) -{ - return; -} - -/* Initialize CTXT in preparation for iterating through the inferior's module - list using read_map(). Return success. */ - -static int -open_map (struct read_map_ctxt *ctxt) -{ -#ifdef USE_LDR_ROUTINES - ctxt->proc = ldr_my_process (); - if (ldr_xattach (ctxt->proc) != 0) - return 0; - ctxt->next = LDR_NULL_MODULE; -#else - CORE_ADDR ldr_context_addr, prev, next; - ldr_context_t ldr_context; - - if (target_read_memory ((CORE_ADDR) RLD_CONTEXT_ADDRESS, - (char *) &ldr_context_addr, - sizeof (CORE_ADDR)) != 0) - return 0; - if (target_read_memory (ldr_context_addr, - (char *) &ldr_context, - sizeof (ldr_context_t)) != 0) - return 0; - ctxt->next = ldr_context.head; - ctxt->tail = ldr_context.tail; -#endif - return 1; -} - -/* Initialize SO to have module NAME, /sbin/loader indicator ISLOADR, and - space for NSECS sections. */ - -static void -init_so (struct so_list *so, char *name, int isloader, int nsecs) -{ - int namelen, i; - - /* solib.c requires various fields to be initialized to 0. */ - memset (so, 0, sizeof *so); - - /* Copy the name. */ - namelen = strlen (name); - if (namelen >= SO_NAME_MAX_PATH_SIZE) - namelen = SO_NAME_MAX_PATH_SIZE - 1; - - memcpy (so->so_original_name, name, namelen); - so->so_original_name[namelen] = '\0'; - memcpy (so->so_name, so->so_original_name, namelen + 1); - - /* Allocate section space. */ - so->lm_info = xmalloc ((unsigned) &(((struct lm_info *)0)->secs) + - nsecs * sizeof *so->lm_info); - so->lm_info->isloader = isloader; - so->lm_info->nsecs = nsecs; - for (i = 0; i < nsecs; i++) - so->lm_info->secs[i].name = NULL; -} - -/* Initialize SO's section SECIDX with name address NAMEADDR, name string - NAME, default virtual address VADDR, and actual virtual address - MAPADDR. */ - -static void -init_sec (struct so_list *so, int secidx, CORE_ADDR nameaddr, - const char *name, CORE_ADDR vaddr, CORE_ADDR mapaddr) -{ - struct lm_sec *lms; - - lms = so->lm_info->secs + secidx; - lms->nameaddr = nameaddr; - lms->name = name; - lms->offset = mapaddr - vaddr; -} - -/* If there are more elements starting at CTXT in inferior's module list, - store the next element in SO, advance CTXT to the next element, and return - 1, else return 0. */ - -static int -read_map (struct read_map_ctxt *ctxt, struct so_list *so) -{ - ldr_module_info_t minf; - ldr_region_info_t rinf; - -#ifdef USE_LDR_ROUTINES - size_t size; - ldr_region_t i; - - /* Retrieve the next element. */ - if (ldr_next_module (ctxt->proc, &ctxt->next) != 0) - return 0; - if (ctxt->next == LDR_NULL_MODULE) - return 0; - if (ldr_inq_module (ctxt->proc, ctxt->next, &minf, sizeof minf, &size) != 0) - return 0; - - /* Initialize the module name and section count. */ - init_so (so, minf.lmi_name, 0, minf.lmi_nregion); - - /* Retrieve section names and offsets. */ - for (i = 0; i < minf.lmi_nregion; i++) - { - if (ldr_inq_region (ctxt->proc, ctxt->next, i, &rinf, - sizeof rinf, &size) != 0) - goto err; - init_sec (so, (int) i, 0, xstrdup (rinf.lri_name), - (CORE_ADDR) rinf.lri_vaddr, (CORE_ADDR) rinf.lri_mapaddr); - } - lm_secs_sort (so->lm_info); -#else - char *name; - int errcode, i; - - /* Retrieve the next element. */ - if (!ctxt->next) - return 0; - if (target_read_memory (ctxt->next, (char *) &minf, sizeof minf) != 0) - return 0; - if (ctxt->next == ctxt->tail) - ctxt->next = 0; - else - ctxt->next = minf.next; - - /* Initialize the module name and section count. */ - target_read_string (minf.module_name, &name, PATH_MAX, &errcode); - if (errcode != 0) - return 0; - init_so (so, name, !minf.modinfo_addr, minf.region_count); - xfree (name); - - /* Retrieve section names and offsets. */ - for (i = 0; i < minf.region_count; i++) - { - if (target_read_memory (minf.regioninfo_addr + i * sizeof rinf, - (char *) &rinf, sizeof rinf) != 0) - goto err; - init_sec (so, i, rinf.regionname_addr, NULL, rinf.vaddr, rinf.mapaddr); - } -#endif /* !USE_LDR_ROUTINES */ - return 1; - - err: - osf_free_so (so); - return 0; -} - -/* Free resources allocated by open_map (CTXT). */ - -static void -close_map (struct read_map_ctxt *ctxt) -{ -#ifdef USE_LDR_ROUTINES - ldr_xdetach (ctxt->proc); -#endif -} - -/* target_so_ops callback. Return a list of shared objects currently loaded - in the inferior. */ - -static struct so_list * -osf_current_sos (void) -{ - struct so_list *head = NULL, *tail, *newtail, so; - struct read_map_ctxt ctxt; - int skipped_main; - - if (!open_map (&ctxt)) - return NULL; - - /* Read subsequent elements. */ - for (skipped_main = 0;;) - { - if (!read_map (&ctxt, &so)) - break; - - /* Skip the main program module, which is first in the list after - /sbin/loader. */ - if (!so.lm_info->isloader && !skipped_main) - { - osf_free_so (&so); - skipped_main = 1; - continue; - } - - newtail = xmalloc (sizeof *newtail); - if (!head) - head = newtail; - else - tail->next = newtail; - tail = newtail; - - memcpy (tail, &so, sizeof so); - tail->next = NULL; - } - - done: - close_map (&ctxt); - return head; -} - -/* target_so_ops callback. Attempt to locate and open the main symbol - file. */ - -static int -osf_open_symbol_file_object (void *from_ttyp) -{ - struct read_map_ctxt ctxt; - struct so_list so; - int found; - - if (symfile_objfile) - if (!query ("Attempt to reload symbols from process? ")) - return 0; - - /* The first module after /sbin/loader is the main program. */ - if (!open_map (&ctxt)) - return 0; - for (found = 0; !found;) - { - if (!read_map (&ctxt, &so)) - break; - found = !so.lm_info->isloader; - osf_free_so (&so); - } - close_map (&ctxt); - - if (found) - symbol_file_add_main (so.so_name, *(int *) from_ttyp); - return found; -} - -/* target_so_ops callback. Return whether PC is in the dynamic linker. */ - -static int -osf_in_dynsym_resolve_code (CORE_ADDR pc) -{ - /* This function currently always return False. This is a temporary - solution which only consequence is to introduce a minor incovenience - for the user: When stepping inside a subprogram located in a shared - library, gdb might stop inside the dynamic loader code instead of - inside the subprogram itself. See the explanations in infrun.c about - the IN_SOLIB_DYNSYM_RESOLVE_CODE macro for more details. */ - return 0; -} - -static struct target_so_ops osf_so_ops; - -void -_initialize_osf_solib (void) -{ - osf_so_ops.relocate_section_addresses = osf_relocate_section_addresses; - osf_so_ops.free_so = osf_free_so; - osf_so_ops.clear_solib = osf_clear_solib; - osf_so_ops.solib_create_inferior_hook = osf_solib_create_inferior_hook; - osf_so_ops.special_symbol_handling = osf_special_symbol_handling; - osf_so_ops.current_sos = osf_current_sos; - osf_so_ops.open_symbol_file_object = osf_open_symbol_file_object; - osf_so_ops.in_dynsym_resolve_code = osf_in_dynsym_resolve_code; - - /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */ - current_target_so_ops = &osf_so_ops; -} diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 7da14815d11..1112e299127 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -37,7 +37,6 @@ #else #include "elf/external.h" #include "elf/common.h" -#include "elf/mips.h" #endif #include "symtab.h" @@ -624,6 +623,7 @@ elf_locate_base (void) (bfd_byte *) x_dynp->d_un.d_ptr); return dyn_ptr; } +#ifdef DT_MIPS_RLD_MAP else if (dyn_tag == DT_MIPS_RLD_MAP) { char *pbuf; @@ -637,6 +637,7 @@ elf_locate_base (void) return 0; return extract_unsigned_integer (pbuf, sizeof (pbuf)); } +#endif } } else /* 64-bit elf */ diff --git a/gdb/solib.c b/gdb/solib.c index dfcca0cc47b..8da44df11a9 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -39,7 +39,6 @@ #include "language.h" #include "gdbcmd.h" #include "completer.h" -#include "filenames.h" /* for DOSish file names */ #include "solist.h" @@ -102,14 +101,10 @@ solib_open (char *in_pathname, char **found_pathname) { int found_file = -1; char *temp_pathname = NULL; - char *p = in_pathname; - while (*p && !IS_DIR_SEPARATOR (*p)) - p++; - - if (*p) + if (strchr (in_pathname, SLASH_CHAR)) { - if (! IS_ABSOLUTE_PATH (in_pathname) || solib_absolute_prefix == NULL) + if (! ROOTED_P (in_pathname) || solib_absolute_prefix == NULL) temp_pathname = in_pathname; else { @@ -117,7 +112,7 @@ solib_open (char *in_pathname, char **found_pathname) /* Remove trailing slashes from absolute prefix. */ while (prefix_len > 0 - && IS_DIR_SEPARATOR (solib_absolute_prefix[prefix_len - 1])) + && SLASH_P (solib_absolute_prefix[prefix_len - 1])) prefix_len--; /* Cat the prefixed pathname together. */ @@ -466,20 +461,30 @@ update_solib_list (int from_tty, struct target_ops *target) catch_errors (solib_map_sections, i, "Error while mapping shared library sections:\n", RETURN_MASK_ALL); + } + + /* If requested, add the shared objects' sections to the the + TARGET's section table. */ + if (target) + { + int new_sections; - /* If requested, add the shared object's sections to the TARGET's - section table. Do this immediately after mapping the object so - that later nodes in the list can query this object, as is needed - in solib-osf.c. */ - if (target) + /* Figure out how many sections we'll need to add in total. */ + new_sections = 0; + for (i = inferior; i; i = i->next) + new_sections += (i->sections_end - i->sections); + + if (new_sections > 0) { - int count = (i->sections_end - i->sections); - if (count > 0) + int space = target_resize_to_sections (target, new_sections); + + for (i = inferior; i; i = i->next) { - int space = target_resize_to_sections (target, count); + int count = (i->sections_end - i->sections); memcpy (target->to_sections + space, i->sections, count * sizeof (i->sections[0])); + space += count; } } } @@ -600,10 +605,7 @@ info_sharedlibrary_command (char *ignore, int from_tty) } arch_size = bfd_get_arch_size (exec_bfd); - if (arch_size == -1) - arch_size = bfd_arch_bits_per_address(exec_bfd); - - /* Default to 32-bit in case of failure. */ + /* Default to 32-bit in case of failure (non-elf). */ if (arch_size == 32 || arch_size == -1) { addr_width = 8 + 4; @@ -807,18 +809,6 @@ sharedlibrary_command (char *args, int from_tty) solib_add (args, from_tty, (struct target_ops *) 0); } -/* LOCAL FUNCTION - - no_shared_libraries -- handle command to explicitly discard symbols - from shared libraries. - - DESCRIPTION - - Implements the command "nosharedlibrary", which discards symbols - that have been auto-loaded from shared libraries. Symbols from - shared libraries that were added by explicit request of the user - are not discarded. Also called from remote.c. */ - void no_shared_libraries (char *ignored, int from_tty) { diff --git a/gdb/solib.h b/gdb/solib.h index 56a4a400cf8..e99aba98c96 100644 --- a/gdb/solib.h +++ b/gdb/solib.h @@ -193,7 +193,3 @@ extern char *solib_address (CORE_ADDR); /* solib.c */ #define IN_SOLIB_DYNSYM_RESOLVE_CODE(pc) in_solib_dynsym_resolve_code (pc) extern int in_solib_dynsym_resolve_code (CORE_ADDR); /* solib.c */ - -/* Discard symbols that were auto-loaded from shared libraries. */ - -extern void no_shared_libraries (char *ignored, int from_tty); diff --git a/gdb/solist.h b/gdb/solist.h index fa00aaff3d4..52fe9a8b317 100644 --- a/gdb/solist.h +++ b/gdb/solist.h @@ -52,9 +52,7 @@ struct so_list /* The following fields of the structure are built from information gathered from the shared object file itself, and - are set when we actually add it to our symbol tables. - - current_sos must initialize these fields to 0. */ + are initialized when we actually add it to our symbol tables. */ bfd *abfd; char symbols_loaded; /* flag: symbols read in yet? */ diff --git a/gdb/somsolib.c b/gdb/somsolib.c index fe188ca460a..6838fdd3c08 100644 --- a/gdb/somsolib.c +++ b/gdb/somsolib.c @@ -1031,6 +1031,14 @@ keep_going: clear_symtab_users (); } + +static void +reset_inferior_ptid (int saved_inferior_ptid) +{ + inferior_ptid = saved_inferior_ptid; +} + + /* This operation removes the "hook" between GDB and the dynamic linker, which causes the dld to notify GDB of shared library events. @@ -1049,7 +1057,8 @@ som_solib_remove_inferior_hook (int pid) int status; char dld_flags_buffer[TARGET_INT_BIT / TARGET_CHAR_BIT]; unsigned int dld_flags_value; - struct cleanup *old_cleanups = save_inferior_ptid (); + int saved_inferior_ptid = inferior_ptid; + struct cleanup *old_cleanups = make_cleanup (reset_inferior_ptid, saved_inferior_ptid); /* Ensure that we're really operating on the specified process. */ inferior_ptid = pid_to_ptid (pid); diff --git a/gdb/source.c b/gdb/source.c index 2895dd388f6..c96202a85ce 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -40,7 +40,6 @@ #include "annotate.h" #include "gdbtypes.h" #include "linespec.h" -#include "filenames.h" /* for DOSish file names */ #ifdef UI_OUT #include "ui-out.h" #endif @@ -331,12 +330,12 @@ mod_path (char *dirname, char **which_path) } } - if (!(IS_DIR_SEPARATOR (*name) && p <= name + 1) /* "/" */ -#ifdef HAVE_DOS_BASED_FILE_SYSTEM + if (!(SLASH_P (*name) && p <= name + 1) /* "/" */ +#if defined(_WIN32) || defined(__MSDOS__) || defined(__CYGWIN__) /* On MS-DOS and MS-Windows, h:\ is different from h: */ - && !(p == name + 3 && name[1] == ':') /* "d:/" */ + && !(!SLASH_P (*name) && ROOTED_P (name) && p <= name + 3) /* d:/ */ #endif - && IS_DIR_SEPARATOR (p[-1])) + && SLASH_P (p[-1])) /* Sigh. "foo/" => "foo" */ --p; *p = '\0'; @@ -349,7 +348,7 @@ mod_path (char *dirname, char **which_path) name = current_directory; goto append; } - else if (p > name + 1 && IS_DIR_SEPARATOR (p[-2])) + else if (p > name + 1 && SLASH_P (p[-2])) { if (p - name == 2) { @@ -371,11 +370,11 @@ mod_path (char *dirname, char **which_path) if (name[0] == '~') name = tilde_expand (name); -#ifdef HAVE_DOS_BASED_FILE_SYSTEM - else if (IS_ABSOLUTE_PATH (name) && p == name + 2) /* "d:" => "d:." */ +#if defined(_WIN32) || defined(__MSDOS__) || defined(__CYGWIN__) + else if (ROOTED_P (name) && p == name + 2) /* "d:" => "d:." */ name = concat (name, ".", NULL); #endif - else if (!IS_ABSOLUTE_PATH (name) && name[0] != '$') + else if (!ROOTED_P (name) && name[0] != '$') name = concat (current_directory, SLASH_STRING, name, NULL); else name = savestring (name, p - name); @@ -515,14 +514,12 @@ source_info (char *ignore, int from_tty) /* >>>> This should only allow files of certain types, >>>> eg executable, non-directory */ int -openp (const char *path, int try_cwd_first, const char *string, - int mode, int prot, +openp (char *path, int try_cwd_first, char *string, int mode, int prot, char **filename_opened) { register int fd; register char *filename; - const char *p; - const char *p1; + register char *p, *p1; register int len; int alloclen; @@ -533,29 +530,28 @@ openp (const char *path, int try_cwd_first, const char *string, mode |= O_BINARY; #endif - if (try_cwd_first || IS_ABSOLUTE_PATH (string)) + if (try_cwd_first || ROOTED_P (string)) { int i; - filename = alloca (strlen (string) + 1); - strcpy (filename, string); + filename = string; fd = open (filename, mode, prot); if (fd >= 0) goto done; for (i = 0; string[i]; i++) - if (IS_DIR_SEPARATOR (string[i])) + if (SLASH_P (string[i])) goto done; } /* ./foo => foo */ - while (string[0] == '.' && IS_DIR_SEPARATOR (string[1])) + while (string[0] == '.' && SLASH_P (string[1])) string += 2; alloclen = strlen (path) + strlen (string) + 2; - filename = alloca (alloclen); + filename = (char *) alloca (alloclen); fd = -1; for (p = path; p; p = p1 ? p1 + 1 : 0) { - p1 = strchr (p, DIRNAME_SEPARATOR); + p1 = (char *) strchr (p, DIRNAME_SEPARATOR); if (p1) len = p1 - p; else @@ -573,7 +569,7 @@ openp (const char *path, int try_cwd_first, const char *string, if (newlen > alloclen) { alloclen = newlen; - filename = alloca (alloclen); + filename = (char *) alloca (alloclen); } strcpy (filename, current_directory); } @@ -585,7 +581,7 @@ openp (const char *path, int try_cwd_first, const char *string, } /* Remove trailing slashes */ - while (len > 0 && IS_DIR_SEPARATOR (filename[len - 1])) + while (len > 0 && SLASH_P (filename[len - 1])) filename[--len] = 0; strcat (filename + len, SLASH_STRING); @@ -600,15 +596,15 @@ done: if (filename_opened) { if (fd < 0) - *filename_opened = NULL; - else if (IS_ABSOLUTE_PATH (filename)) + *filename_opened = (char *) 0; + else if (ROOTED_P (filename)) *filename_opened = savestring (filename, strlen (filename)); else { /* Beware the // my son, the Emacs barfs, the botch that catch... */ *filename_opened = concat (current_directory, - IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1]) + SLASH_P (current_directory[strlen (current_directory) - 1]) ? "" : SLASH_STRING, filename, NULL); } @@ -670,7 +666,7 @@ int open_source_file (struct symtab *s) { char *path = source_path; - const char *p; + char *p; int result; char *fullname; @@ -710,7 +706,7 @@ open_source_file (struct symtab *s) if (result < 0) { /* Didn't work. Try using just the basename. */ - p = lbasename (s->filename); + p = basename (s->filename); if (p != s->filename) result = openp (path, 0, p, OPEN_MODE, 0, &s->fullname); } diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index ef9ae07f0ee..2cb27dbb8a5 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -2931,7 +2931,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return arches->gdbarch; /* None found: is the request for a sparc architecture? */ - if (info.bfd_arch_info->arch != bfd_arch_sparc) + if (info.bfd_architecture != bfd_arch_sparc) return NULL; /* No; then it's not for us. */ /* Yes: create a new gdbarch for the specified machine type. */ diff --git a/gdb/stack.c b/gdb/stack.c index 7426e0a44a4..07bea73a54f 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -531,7 +531,8 @@ print_frame (struct frame_info *fi, annotate_frame_begin (level == -1 ? 0 : level, fi->pc); #ifdef UI_OUT - list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "frame"); + ui_out_list_begin (uiout, "frame"); + list_chain = make_cleanup_ui_out_list_end (uiout); #endif if (level >= 0) @@ -586,11 +587,12 @@ print_frame (struct frame_info *fi, args.func = func; args.stream = gdb_stdout; #ifdef UI_OUT - args_list_chain = make_cleanup_ui_out_list_begin_end (uiout, "args"); + ui_out_list_begin (uiout, "args"); + args_list_chain = make_cleanup_ui_out_list_end (uiout); catch_errors (print_args_stub, &args, "", RETURN_MASK_ALL); /* FIXME: args must be a list. If one argument is a string it will have " that will not be properly escaped. */ - /* Invoke ui_out_tuple_end. */ + /* Invoke ui_out_list_end. */ do_cleanups (args_list_chain); #else catch_errors (print_args_stub, &args, "", RETURN_MASK_ALL); @@ -647,7 +649,7 @@ print_frame (struct frame_info *fi, #endif /* PC_SOLIB */ #ifdef UI_OUT - /* do_cleanups will call ui_out_tuple_end() for us. */ + /* do_cleanups will call ui_out_list_end() for us. */ do_cleanups (list_chain); ui_out_text (uiout, "\n"); do_cleanups (old_chain); diff --git a/gdb/symfile.c b/gdb/symfile.c index ee4d65cf962..b644af8df26 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -109,14 +109,16 @@ static void set_initial_language (void); static void load_command (char *, int); -static void symbol_file_add_main_1 (char *args, int from_tty, int flags); - static void add_symbol_file_command (char *, int); static void add_shared_symbol_files_command (char *, int); static void cashier_psymtab (struct partial_symtab *); +static int compare_psymbols (const void *, const void *); + +static int compare_symbols (const void *, const void *); + bfd *symfile_bfd_open (char *); static void find_sym_fns (struct objfile *); @@ -204,7 +206,7 @@ int auto_solib_add = 1; comparison function takes two "void *" pointers. */ static int -compare_symbols (const void *s1p, const void *s2p) +compare_symbols (const PTR s1p, const PTR s2p) { register struct symbol **s1, **s2; @@ -236,7 +238,7 @@ compare_symbols (const void *s1p, const void *s2p) */ static int -compare_psymbols (const void *s1p, const void *s2p) +compare_psymbols (const PTR s1p, const PTR s2p) { register struct partial_symbol **s1, **s2; register char *st1, *st2; @@ -894,34 +896,13 @@ symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs, return (objfile); } -/* Call symbol_file_add() with default values and update whatever is - affected by the loading of a new main(). - Used when the file is supplied in the gdb command line - and by some targets with special loading requirements. - The auxiliary function, symbol_file_add_main_1(), has the flags - argument for the switches that can only be specified in the symbol_file - command itself. */ +/* Just call the above with default values. + Used when the file is supplied in the gdb command line. */ void symbol_file_add_main (char *args, int from_tty) { - symbol_file_add_main_1 (args, from_tty, 0); -} - -static void -symbol_file_add_main_1 (char *args, int from_tty, int flags) -{ - symbol_file_add (args, from_tty, NULL, 1, flags); - -#ifdef HPUXHPPA - RESET_HP_UX_GLOBALS (); -#endif - - /* Getting new symbols may change our opinion about - what is frameless. */ - reinit_frame_cache (); - - set_initial_language (); + symbol_file_add (args, from_tty, NULL, 1, 0); } void @@ -998,8 +979,15 @@ symbol_file_command (char *args, int from_tty) else { name = *argv; + symbol_file_add (name, from_tty, NULL, 1, flags); +#ifdef HPUXHPPA + RESET_HP_UX_GLOBALS (); +#endif + /* Getting new symbols may change our opinion about + what is frameless. */ + reinit_frame_cache (); - symbol_file_add_main_1 (name, from_tty, flags); + set_initial_language (); } argv++; } diff --git a/gdb/symtab.c b/gdb/symtab.c index a16393e81a7..aecf362d472 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -37,7 +37,6 @@ #include "demangle.h" #include "inferior.h" #include "linespec.h" -#include "filenames.h" /* for FILENAME_CMP */ #include "obstack.h" @@ -79,7 +78,7 @@ static struct partial_symbol *lookup_partial_symbol (struct partial_symtab *, const char *, int, namespace_enum); -static struct symtab *lookup_symtab_1 (const char *); +static struct symtab *lookup_symtab_1 (char *); static struct symbol *lookup_symbol_aux (const char *name, const struct block *block, const @@ -138,10 +137,11 @@ cplusplus_hint (char *name) in the symtab filename will also work. */ static struct symtab * -lookup_symtab_1 (const char *name) +lookup_symtab_1 (char *name) { register struct symtab *s; register struct partial_symtab *ps; + register char *slash; register struct objfile *objfile; got_symtab: @@ -149,15 +149,23 @@ got_symtab: /* First, search for an exact match */ ALL_SYMTABS (objfile, s) - if (FILENAME_CMP (name, s->filename) == 0) - return s; + if (STREQ (name, s->filename)) + return s; + + slash = strchr (name, '/'); /* Now, search for a matching tail (only if name doesn't have any dirs) */ - if (lbasename (name) == name) + if (!slash) ALL_SYMTABS (objfile, s) { - if (FILENAME_CMP (lbasename (s->filename), name) == 0) + char *p = s->filename; + char *tail = strrchr (p, '/'); + + if (tail) + p = tail + 1; + + if (STREQ (p, name)) return s; } @@ -192,7 +200,7 @@ got_symtab: of variations if the first lookup doesn't work. */ struct symtab * -lookup_symtab (const char *name) +lookup_symtab (char *name) { register struct symtab *s; #if 0 @@ -229,14 +237,14 @@ lookup_symtab (const char *name) in the psymtab filename will also work. */ struct partial_symtab * -lookup_partial_symtab (const char *name) +lookup_partial_symtab (char *name) { register struct partial_symtab *pst; register struct objfile *objfile; ALL_PSYMTABS (objfile, pst) { - if (FILENAME_CMP (name, pst->filename) == 0) + if (STREQ (name, pst->filename)) { return (pst); } @@ -244,10 +252,16 @@ lookup_partial_symtab (const char *name) /* Now, search for a matching tail (only if name doesn't have any dirs) */ - if (lbasename (name) == name) + if (!strchr (name, '/')) ALL_PSYMTABS (objfile, pst) { - if (FILENAME_CMP (lbasename (pst->filename), name) == 0) + char *p = pst->filename; + char *tail = strrchr (p, '/'); + + if (tail) + p = tail + 1; + + if (STREQ (p, name)) return (pst); } @@ -2153,72 +2167,50 @@ operator_chars (char *p, char **end) } -/* If FILE is not already in the table of files, return zero; - otherwise return non-zero. Optionally add FILE to the table if ADD - is non-zero. If *FIRST is non-zero, forget the old table - contents. */ -static int -filename_seen (const char *file, int add, int *first) +/* Slave routine for sources_info. Force line breaks at ,'s. + NAME is the name to print and *FIRST is nonzero if this is the first + name printed. Set *FIRST to zero. */ +static void +output_source_filename (char *name, int *first) { - /* Table of files seen so far. */ - static const char **tab = NULL; + /* Table of files printed so far. Since a single source file can + result in several partial symbol tables, we need to avoid printing + it more than once. Note: if some of the psymtabs are read in and + some are not, it gets printed both under "Source files for which + symbols have been read" and "Source files for which symbols will + be read in on demand". I consider this a reasonable way to deal + with the situation. I'm not sure whether this can also happen for + symtabs; it doesn't hurt to check. */ + static char **tab = NULL; /* Allocated size of tab in elements. Start with one 256-byte block (when using GNU malloc.c). 24 is the malloc overhead when range checking is in effect. */ static int tab_alloc_size = (256 - 24) / sizeof (char *); /* Current size of tab in elements. */ static int tab_cur_size; - const char **p; + + char **p; if (*first) { if (tab == NULL) - tab = (const char **) xmalloc (tab_alloc_size * sizeof (*tab)); + tab = (char **) xmalloc (tab_alloc_size * sizeof (*tab)); tab_cur_size = 0; } - /* Is FILE in tab? */ + /* Is NAME in tab? */ for (p = tab; p < tab + tab_cur_size; p++) - if (strcmp (*p, file) == 0) - return 1; - - /* No; maybe add it to tab. */ - if (add) - { - if (tab_cur_size == tab_alloc_size) - { - tab_alloc_size *= 2; - tab = (const char **) xrealloc ((char *) tab, - tab_alloc_size * sizeof (*tab)); - } - tab[tab_cur_size++] = file; - } - - return 0; -} - -/* Slave routine for sources_info. Force line breaks at ,'s. - NAME is the name to print and *FIRST is nonzero if this is the first - name printed. Set *FIRST to zero. */ -static void -output_source_filename (char *name, int *first) -{ - /* Since a single source file can result in several partial symbol - tables, we need to avoid printing it more than once. Note: if - some of the psymtabs are read in and some are not, it gets - printed both under "Source files for which symbols have been - read" and "Source files for which symbols will be read in on - demand". I consider this a reasonable way to deal with the - situation. I'm not sure whether this can also happen for - symtabs; it doesn't hurt to check. */ - - /* Was NAME already seen? */ - if (filename_seen (name, 1, first)) - { + if (STREQ (*p, name)) /* Yes; don't print it again. */ return; + /* No; add it to tab. */ + if (tab_cur_size == tab_alloc_size) + { + tab_alloc_size *= 2; + tab = (char **) xrealloc ((char *) tab, tab_alloc_size * sizeof (*tab)); } - /* No; print it and reset *FIRST. */ + tab[tab_cur_size++] = name; + if (*first) { *first = 0; @@ -2276,7 +2268,7 @@ file_matches (char *file, char *files[], int nfiles) { for (i = 0; i < nfiles; i++) { - if (strcmp (files[i], lbasename (file)) == 0) + if (strcmp (files[i], basename (file)) == 0) return 1; } } @@ -2666,17 +2658,9 @@ print_symbol_info (namespace_enum kind, struct symtab *s, struct symbol *sym, static void print_msymbol_info (struct minimal_symbol *msymbol) { - char *tmp; - - if (TARGET_ADDR_BIT <= 32) - tmp = longest_local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol) - & (CORE_ADDR) 0xffffffff, - "08l"); - else - tmp = longest_local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol), - "016l"); - printf_filtered ("%s %s\n", - tmp, SYMBOL_SOURCE_NAME (msymbol)); + printf_filtered (" %08lx %s\n", + (unsigned long) SYMBOL_VALUE_ADDRESS (msymbol), + SYMBOL_SOURCE_NAME (msymbol)); } /* This is the guts of the commands "info functions", "info types", and @@ -2893,9 +2877,9 @@ completion_list_add_name (char *symname, char *sym_text, int sym_text_len, } } -/* Return a NULL terminated array of all symbols (regardless of class) - which begin by matching TEXT. If the answer is no symbols, then - the return value is an array which contains only a NULL pointer. +/* Return a NULL terminated array of all symbols (regardless of class) which + begin by matching TEXT. If the answer is no symbols, then the return value + is an array which contains only a NULL pointer. Problem: All of the symbols have to be copied because readline frees them. I'm not going to worry about this; hopefully there won't be that many. */ @@ -2949,11 +2933,7 @@ make_symbol_completion_list (char *text, char *word) else if (quote_found == '"') /* A double-quoted string is never a symbol, nor does it make sense to complete it any other way. */ - { - return_val = (char **) xmalloc (sizeof (char *)); - return_val[0] = NULL; - return return_val; - } + return NULL; else { /* It is not a quoted string. Break it based on the characters @@ -3085,277 +3065,6 @@ make_symbol_completion_list (char *text, char *word) return (return_val); } -/* Like make_symbol_completion_list, but returns a list of symbols - defined in a source file FILE. */ - -char ** -make_file_symbol_completion_list (char *text, char *word, char *srcfile) -{ - register struct symbol *sym; - register struct symtab *s; - register struct block *b; - register int i; - /* The symbol we are completing on. Points in same buffer as text. */ - char *sym_text; - /* Length of sym_text. */ - int sym_text_len; - - /* Now look for the symbol we are supposed to complete on. - FIXME: This should be language-specific. */ - { - char *p; - char quote_found; - char *quote_pos = NULL; - - /* First see if this is a quoted string. */ - quote_found = '\0'; - for (p = text; *p != '\0'; ++p) - { - if (quote_found != '\0') - { - if (*p == quote_found) - /* Found close quote. */ - quote_found = '\0'; - else if (*p == '\\' && p[1] == quote_found) - /* A backslash followed by the quote character - doesn't end the string. */ - ++p; - } - else if (*p == '\'' || *p == '"') - { - quote_found = *p; - quote_pos = p; - } - } - if (quote_found == '\'') - /* A string within single quotes can be a symbol, so complete on it. */ - sym_text = quote_pos + 1; - else if (quote_found == '"') - /* A double-quoted string is never a symbol, nor does it make sense - to complete it any other way. */ - { - return_val = (char **) xmalloc (sizeof (char *)); - return_val[0] = NULL; - return return_val; - } - else - { - /* It is not a quoted string. Break it based on the characters - which are in symbols. */ - while (p > text) - { - if (isalnum (p[-1]) || p[-1] == '_' || p[-1] == '\0') - --p; - else - break; - } - sym_text = p; - } - } - - sym_text_len = strlen (sym_text); - - return_val_size = 10; - return_val_index = 0; - return_val = (char **) xmalloc ((return_val_size + 1) * sizeof (char *)); - return_val[0] = NULL; - - /* Find the symtab for SRCFILE (this loads it if it was not yet read - in). */ - s = lookup_symtab (srcfile); - if (s == NULL) - { - /* Maybe they typed the file with leading directories, while the - symbol tables record only its basename. */ - const char *tail = lbasename (srcfile); - - if (tail > srcfile) - s = lookup_symtab (tail); - } - - /* If we have no symtab for that file, return an empty list. */ - if (s == NULL) - return (return_val); - - /* Go through this symtab and check the externs and statics for - symbols which match. */ - - b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK); - for (i = 0; i < BLOCK_NSYMS (b); i++) - { - sym = BLOCK_SYM (b, i); - COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word); - } - - b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK); - for (i = 0; i < BLOCK_NSYMS (b); i++) - { - sym = BLOCK_SYM (b, i); - COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word); - } - - return (return_val); -} - -/* A helper function for make_source_files_completion_list. It adds - another file name to a list of possible completions, growing the - list as necessary. */ - -static void -add_filename_to_list (const char *fname, char *text, char *word, - char ***list, int *list_used, int *list_alloced) -{ - char *new; - size_t fnlen = strlen (fname); - - if (*list_used + 1 >= *list_alloced) - { - *list_alloced *= 2; - *list = (char **) xrealloc ((char *) *list, - *list_alloced * sizeof (char *)); - } - - if (word == text) - { - /* Return exactly fname. */ - new = xmalloc (fnlen + 5); - strcpy (new, fname); - } - else if (word > text) - { - /* Return some portion of fname. */ - new = xmalloc (fnlen + 5); - strcpy (new, fname + (word - text)); - } - else - { - /* Return some of TEXT plus fname. */ - new = xmalloc (fnlen + (text - word) + 5); - strncpy (new, word, text - word); - new[text - word] = '\0'; - strcat (new, fname); - } - (*list)[*list_used] = new; - (*list)[++*list_used] = NULL; -} - -static int -not_interesting_fname (const char *fname) -{ - static const char *illegal_aliens[] = { - "_globals_", /* inserted by coff_symtab_read */ - NULL - }; - int i; - - for (i = 0; illegal_aliens[i]; i++) - { - if (strcmp (fname, illegal_aliens[i]) == 0) - return 1; - } - return 0; -} - -/* Return a NULL terminated array of all source files whose names - begin with matching TEXT. The file names are looked up in the - symbol tables of this program. If the answer is no matchess, then - the return value is an array which contains only a NULL pointer. */ - -char ** -make_source_files_completion_list (char *text, char *word) -{ - register struct symtab *s; - register struct partial_symtab *ps; - register struct objfile *objfile; - int first = 1; - int list_alloced = 1; - int list_used = 0; - size_t text_len = strlen (text); - char **list = (char **) xmalloc (list_alloced * sizeof (char *)); - const char *base_name; - - list[0] = NULL; - - if (!have_full_symbols () && !have_partial_symbols ()) - return list; - - ALL_SYMTABS (objfile, s) - { - if (not_interesting_fname (s->filename)) - continue; - if (!filename_seen (s->filename, 1, &first) -#if HAVE_DOS_BASED_FILE_SYSTEM - && strncasecmp (s->filename, text, text_len) == 0 -#else - && strncmp (s->filename, text, text_len) == 0 -#endif - ) - { - /* This file matches for a completion; add it to the current - list of matches. */ - add_filename_to_list (s->filename, text, word, - &list, &list_used, &list_alloced); - } - else - { - /* NOTE: We allow the user to type a base name when the - debug info records leading directories, but not the other - way around. This is what subroutines of breakpoint - command do when they parse file names. */ - base_name = lbasename (s->filename); - if (base_name != s->filename - && !filename_seen (base_name, 1, &first) -#if HAVE_DOS_BASED_FILE_SYSTEM - && strncasecmp (base_name, text, text_len) == 0 -#else - && strncmp (base_name, text, text_len) == 0 -#endif - ) - add_filename_to_list (base_name, text, word, - &list, &list_used, &list_alloced); - } - } - - ALL_PSYMTABS (objfile, ps) - { - if (not_interesting_fname (ps->filename)) - continue; - if (!ps->readin) - { - if (!filename_seen (ps->filename, 1, &first) -#if HAVE_DOS_BASED_FILE_SYSTEM - && strncasecmp (ps->filename, text, text_len) == 0 -#else - && strncmp (ps->filename, text, text_len) == 0 -#endif - ) - { - /* This file matches for a completion; add it to the - current list of matches. */ - add_filename_to_list (ps->filename, text, word, - &list, &list_used, &list_alloced); - - } - else - { - base_name = lbasename (ps->filename); - if (base_name != ps->filename - && !filename_seen (base_name, 1, &first) -#if HAVE_DOS_BASED_FILE_SYSTEM - && strncasecmp (base_name, text, text_len) == 0 -#else - && strncmp (base_name, text, text_len) == 0 -#endif - ) - add_filename_to_list (base_name, text, word, - &list, &list_used, &list_alloced); - } - } - } - - return list; -} - /* Determine if PC is in the prologue of a function. The prologue is the area between the first instruction of a function, and the first executable line. Returns 1 if PC *might* be in prologue, 0 if definately *not* in prologue. diff --git a/gdb/symtab.h b/gdb/symtab.h index d85add3b3e8..bbde658f091 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1072,7 +1072,7 @@ extern int asm_demangle; /* lookup a symbol table by source file name */ -extern struct symtab *lookup_symtab (const char *); +extern struct symtab *lookup_symtab (char *); /* lookup a symbol by name (optional block, optional symtab) */ @@ -1122,7 +1122,7 @@ find_pc_sect_partial_function (CORE_ADDR, asection *, /* lookup partial symbol table by filename */ -extern struct partial_symtab *lookup_partial_symtab (const char *); +extern struct partial_symtab *lookup_partial_symtab (char *); /* lookup partial symbol table by address */ @@ -1359,12 +1359,8 @@ extern void select_source_symtab (struct symtab *); extern char **make_symbol_completion_list (char *, char *); -extern char **make_file_symbol_completion_list (char *, char *, char *); - extern struct symbol **make_symbol_overload_list (struct symbol *); -extern char **make_source_files_completion_list (char *, char *); - /* symtab.c */ extern struct partial_symtab *find_main_psymtab (void); diff --git a/gdb/target.c b/gdb/target.c index 3430a5ff08b..cdccd7f65ae 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1487,69 +1487,6 @@ static struct { {"SIGCANCEL", "LWP internal signal"}, {"SIG32", "Real-time event 32"}, {"SIG64", "Real-time event 64"}, - {"SIG65", "Real-time event 65"}, - {"SIG66", "Real-time event 66"}, - {"SIG67", "Real-time event 67"}, - {"SIG68", "Real-time event 68"}, - {"SIG69", "Real-time event 69"}, - {"SIG70", "Real-time event 70"}, - {"SIG71", "Real-time event 71"}, - {"SIG72", "Real-time event 72"}, - {"SIG73", "Real-time event 73"}, - {"SIG74", "Real-time event 74"}, - {"SIG75", "Real-time event 75"}, - {"SIG76", "Real-time event 76"}, - {"SIG77", "Real-time event 77"}, - {"SIG78", "Real-time event 78"}, - {"SIG79", "Real-time event 79"}, - {"SIG80", "Real-time event 80"}, - {"SIG81", "Real-time event 81"}, - {"SIG82", "Real-time event 82"}, - {"SIG83", "Real-time event 83"}, - {"SIG84", "Real-time event 84"}, - {"SIG85", "Real-time event 85"}, - {"SIG86", "Real-time event 86"}, - {"SIG87", "Real-time event 87"}, - {"SIG88", "Real-time event 88"}, - {"SIG89", "Real-time event 89"}, - {"SIG90", "Real-time event 90"}, - {"SIG91", "Real-time event 91"}, - {"SIG92", "Real-time event 92"}, - {"SIG93", "Real-time event 93"}, - {"SIG94", "Real-time event 94"}, - {"SIG95", "Real-time event 95"}, - {"SIG96", "Real-time event 96"}, - {"SIG97", "Real-time event 97"}, - {"SIG98", "Real-time event 98"}, - {"SIG99", "Real-time event 99"}, - {"SIG100", "Real-time event 100"}, - {"SIG101", "Real-time event 101"}, - {"SIG102", "Real-time event 102"}, - {"SIG103", "Real-time event 103"}, - {"SIG104", "Real-time event 104"}, - {"SIG105", "Real-time event 105"}, - {"SIG106", "Real-time event 106"}, - {"SIG107", "Real-time event 107"}, - {"SIG108", "Real-time event 108"}, - {"SIG109", "Real-time event 109"}, - {"SIG110", "Real-time event 110"}, - {"SIG111", "Real-time event 111"}, - {"SIG112", "Real-time event 112"}, - {"SIG113", "Real-time event 113"}, - {"SIG114", "Real-time event 114"}, - {"SIG115", "Real-time event 115"}, - {"SIG116", "Real-time event 116"}, - {"SIG117", "Real-time event 117"}, - {"SIG118", "Real-time event 118"}, - {"SIG119", "Real-time event 119"}, - {"SIG120", "Real-time event 120"}, - {"SIG121", "Real-time event 121"}, - {"SIG122", "Real-time event 122"}, - {"SIG123", "Real-time event 123"}, - {"SIG124", "Real-time event 124"}, - {"SIG125", "Real-time event 125"}, - {"SIG126", "Real-time event 126"}, - {"SIG127", "Real-time event 127"}, #if defined(MACH) || defined(__MACH__) /* Mach exceptions */ @@ -1852,9 +1789,6 @@ target_signal_from_host (int hostsig) (hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33); else if (hostsig == 32) return TARGET_SIGNAL_REALTIME_32; - else if (64 <= hostsig && hostsig <= 127) - return (enum target_signal) - (hostsig - 64 + (int) TARGET_SIGNAL_REALTIME_64); else error ("GDB bug: target.c (target_signal_from_host): unrecognized real-time signal"); } @@ -2127,19 +2061,6 @@ do_target_signal_to_host (enum target_signal oursig, return 32; } #endif -#if (REALTIME_HI > 64) - 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; - if (retsig >= REALTIME_LO && retsig < REALTIME_HI) - return retsig; - } - -#endif #endif #if defined (SIGRTMIN) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 40eef964408..06676823171 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,186 +1,3 @@ -2001-07-03 Michael Snyder - - * gdb.c++/classes.exp: Accept both "foo(void)" and "foo()" in - the output of the ptype command. - -2001-07-02 Michael Snyder - - * gdb.base/corefile.exp: Quote the curly braces in regexp. - -2001-06-28 Andrew Cagney - - * gdb.disasm/Makefile.in (clean mostlyclean): Add h8300s to list - of files to delete. - - From 2000-06-15 Kazu Hirata : - * gdb.disasm/h8300s.exp: New file. - gdb.disasm/h8300s.s: Likewise. - -2001-06-27 Andrew Cagney - - * lib/mi-support.exp (mi_delete_breakpoints): Accept mi1 format - empty breakpoint tables. - -2001-06-25 Andrew Cagney - - * lib/mi-support.exp: Update args=... part of stop-reason - patterns. Accept either a list or a tuple. - -2001-06-23 Andrew Cagney - - * lib/mi-support.exp: Remove local emacs variable defining - change-log-default-name. - -2001-06-22 Michael Chastain - - * gdb.base/arithmet.exp: Use gdb_test instead of send_gdb/gdb_expect. - This is operationally compatible with the previous version. - -2001-06-13 Jim Blandy - - * lib/gdb.exp (gdb_test): Doc fix. - -2001-06-10 Michael Chastain - - * gdb.base/exprs.exp: Remove a duplicate test. - -2001-06-06 Jim Blandy - - * gdb.base/return2.exp (main): Use values to test float and double - returns that are not NaN's, to avoid being confused by IEEE - comparison rules. - -2001-06-04 Michael Snyder - - * gdb.threads/pthreads.exp (check_control_c): Return 0 for success, - non-zero if control_c fails. Terminate the test on failure, - rather than wait for 12 more tests to time out. - -2001-06-06 Jim Blandy - - * gdb.base/exprs.exp ("sizeof (long long) > sizeof (long) (true)"): - Don't forget to match the GDB prompt. - - * gdb.trace/gdb_c_test.c, actions.c: Fix misspellings. - -2001-06-04 Jim Blandy - - * gdb.base/help.exp: Update pattern to exclude `print-load-map' - command. - -2001-05-31 Kevin Buettner - - * gdb.base/annota1.exp (info break): Match four or more spaces - after "Address". - -2001-05-31 Michael Chastain - - * gdb.c++/cplusfuncs.cc (dm_type_char_star): Remove superfluous cast. - (dm_type_int_star): Likewise. - (dm_type_long_star): Likewise. - (dm_type_void_star): Likewise. - -2001-05-29 Kevin Buettner - - * gdb.base/completion.exp (INPUTRC): Set this environment variable - to a known value in order to get consistent results regardless - of the setting of INPUTRC or the presence or contents of .inputrc. - -2001-05-24 Michael Snyder - - * gdb.threads/linux-dp.exp: Remove assumptions about thread ordering. - Don't require that the main thread and the manager thread are the - first in the list. - - * gdb.threads/pthreads.exp (test_startup): Relax test for thread - debugging. If test fails, issue an "unsupported" not a "fail". - -2001-05-24 Jim Blandy - - Don't assume that short is shorter than int. - * gdb.base/exprs.exp ("print unsigned short == (~0)"): Don't - assume that shorts are smaller than ints. On a 16-bit machine, - this isn't true. - ("print unsigned char == (~0)"): Add test that verifies that ~0, - an int, is not equal to ~0 stored in an unsigned char. This tests - the same thing that the previous test meant to, but works on - 16-bit machines, too. - ("print unsigned char != (~0)"): Same test, complemented. - -2001-05-24 Michael Snyder - - * gdb.threads/pthreads.exp (all_threads_running): Add an explicit - test for (full_coverage == 0). This makes the test run faster, - and prevents dejagnu getting out of step. - -2001-05-23 Kevin Buettner - - * gdb.base/finish.exp (finish_void): Revise pattern for - stopping on the call statement to not permit stopping at - the start of the instructions comprising the call sequence. - -2001-05-19 Michael Chastain - - * gdb.base/callfuncs.exp: Make all test names unique. - * gdb.base/commands.exp: Make all test names unique. - * gdb.base/condbreak.exp: Make all test names unique. - * gdb.base/dbx.exp: Make all test names unique. - * gdb.base/default.exp: Make all test names unique. - * gdb.base/define.exp: Make all test names unique. Conform some FAIL - and TIMEOUT messages to their corresponding PASS message. - * gdb.base/ending-run.exp: Make all test names unique. - * gdb.base/long_long.exp: Remove duplicate test. - -2001-05-21 Kevin Buettner - - * gdb.base/finish.exp (finish_void): Allow "finish" command to - stop on the call statement as well as the statement after the - call. - -2001-05-21 Michael Snyder - - * gdb.base/long_long.exp: Allow for targets with 4-byte short. - -2001-05-10 Elena Zannoni - - * gdb.base/completion.exp: Revamp test. Make it execute on all - platforms. - -2001-05-10 Elena Zannoni - - * config/gdbserver.exp (gdb_load): Handle the case - in which the arguments to gdbserver are given in the - baseboard configuration file. - Also handle the case in which the server needs to do a - load. - -2001-05-07 Keith Seitz - - * lib/gdb.exp (gdbtk_initialize_display): New proc which will - set up the display for testing. - (gdbtk_start): Convert all paths to paths that tcl will like. - Export target information to environment. - (_gdbtk_xvfb_init): New proc to start Xvfb if available and - necessary. - (_gdbtk_xvfb_exit): New proc to kill Xvfb if necessary. - (to_tcl_path): New proc to convert a given pathname into - a path acceptible as an argument to a tcl command. - (_gdbtk_export_target_info): New proc to export target info - into the environment for gdbtk testing. - (gdbtk_done): New proc to signal end-of-test. - -2001-05-06 Jim Blandy - - * restore.c: Make the code of caller0 correspond to its comment. - -2001-05-03 Michael Snyder - - * config/sid.exp (gdb_target_sid): Check for error messages. - On error or timeout, don't make expect exit (which will terminate - all subsequent tests); instead just make gdb exit. - (gdb_load): Check for error messages. On error or timeout, - return a negative value. - 2001-04-24 Jim Blandy * gdb.c++/templates.exp: If we see the prompt for the overload @@ -411,48 +228,6 @@ Sun Feb 4 17:32:21 2001 Andrew Cagney * gdb.c++/templates.cc (printf): Remove unused function definition. -2001-01-26 Felix Lee - - * sid.exp (sid_exit): Pass host, not target, to remote_close. - -2001-01-25 matthew green - - * config/sid.exp (sid_start): Call `remote_push_conn' after firing - up sid. - (sid_exit): Call `remote_pop_conn' after GDB is gone. - -2001-01-25 matthew green - - * config/sid.exp (sid_start): Use `remote_spawn' instead of `spawn.' - Deprecate $sid_spawn_id. - (sid_exit): Remove code necessary only for `spawn.' - -2001-01-25 matthew green - - * config/sid.exp (sid_start): Handle sim,protocol of `sid.' - -2001-01-28 Michael Chastain - - * gdb.c++/ovldbreak.exp (take_gdb_out_of_choice_menu): New proc - to call when tests fail. It takes gdb out of the overloaded - function choice menu back to the main prompt, so that the test - program stays synchronized. - (set_bp_overloaded): New proc to collect all the common - code for setting a breakpoint on an overloaded name. Calls - take_gdb_out_of_choice_menu when needed. - (menu_overload1arg): New variable to collect the repeated - instances of the expected menu for an overloaded name. Change - the regular expression to handle changes in g++ type encoding: - "void" can be either "void" or "", and "unsigned int" can be - either "unsigned int" or "unsigned". - (continue_to_bp_overloaded): Change regular expressions to handle - changes in g++ type encoding. - (no proc): Call take_gdb_out_of_choice_menu when needed. - Remove redundant calls to "info break". Accept either "canceled" - or "cancelled". Change regular expressions in "info break" - calls to handle changes in g++ type encoding. Give all tests - unique strings. - 2001-01-17 Ben Elliston * config/sid.exp: New file. @@ -1877,18 +1652,79 @@ Fri Mar 12 18:06:21 1999 Stan Shebs commands. They're not germane to this test, and they don't work that way on remote targets. +1999-03-03 James Ingham + + * browser.test: Fixed up to match the new function browser. + This is not done yet... + + * srcwin.test: Check for errors when the bbox is called for a text + item that is not on screen (so bbox is ""). Return something more + useful. + 1999-03-01 James Ingham * Changelog entries merged over from gdb development branch. + 1999-01-12 Martin Hunt + + * gdb.gdbtk/srcwin.test: Add a bunch of tests for the source + window filename and function comboboxes. Add in stack tests. + + 1999-01-11 Martin Hunt + + * gdb.gdbtk/srcwin.test: New file. Source Window tests. + * gdb.gdbtk/srcwin.exp: New file. Source Window tests. + + Wed Jan 6 09:22:52 1999 Keith Seitz + + * gdb.gdbtk/c_variable.test (c_variable-1.9): Add new + test to check for creation of a variable that is really a type. + (c_variable-7.81): Use "output" instead of "print" to get PC. + Include missing bits of test. + + * gdb.gdbtk/cpp_variable.test (cpp_variable-1.6): Default format + is now "natural", not "hexadecimal" + (cpp_variable-2.22): Ditto. + (cpp_variable-2.24): Force format to hex before getting value. + + * gdb.gdbtk/cpp_variable.exp: Supply missing arg to gdbtk_analyze_results. + + Tue Jan 5 12:40:52 1999 Keith Seitz + + * gdb.gdbtk/c_variable.c, c_variable.test, c_variable.exp: New C + language tests for variable object interface. + + * gdb.gdbtk/cpp_variable.h, cpp_variable.cc, cpp_variable.test, + cpp_variable.exp: New C++ language tests for variable object + interface. + + * gdb.gdbtk/Makefile.in (EXECUTABLES): Add c_variable and cpp_variable. + Tue Jan 5 12:33:47 1999 Keith Seitz * lib/gdb.exp (gdbtk_analyze_results): Generic function for outputting results of test run. - 1998-12-07 Martin M. Hunt + * gdb.gdbtk/defs (gdbtk_test): Handle xpass and xfail. + (gdbtk_test_error): New proc which handles error aborts. + + * gdb.gdbtk/console.exp: Use gdbtk_analyze_results. + Check if we have a valid DISPLAY before running. + * gdb.gdbtk/browser.exp: Ditto. + + 1998-12-07 Martin M. Hunt * lib/gdb.exp (gdbtk_start): Fix path for itcl library. + * gdb.gdbtk/browser.test: Change "manage open" to ManagedWin::open. + * gdb.gdbtk/console.test: Same. + * gdb.gdbtk/*: Update from devo. + + Fri Jul 24 14:57:19 1998 Keith Seitz + + * gdb.gdbtk/Makefile.in: Add new example program "stack". + * gdb.gdbtk/browser.test,browser.exp: Add browser window + tests. + * gdb.gdbtk/stack1.c,stack2.c: Test case for browser window. 1999-02-25 Felix Lee @@ -2418,6 +2254,11 @@ Thurs Jul 9 11:08:31 1998 Dawn Perchik * gdb.base/commands.exp: Break up infrun_breakpoint_command_test into two parts to get around a synchronization problem in expect. +Sun Jun 28 22:34:34 1998 Martin M. Hunt + + * gdb.gdbtk/simple.c (main): Make main return an + int so compiler will stop complaining. + Fri Jun 26 14:27:13 1998 Keith Seitz * lib/gdb.exp (gdbtk_start): Add startup for gdbtk. @@ -2428,6 +2269,9 @@ Fri Jun 26 14:27:13 1998 Keith Seitz * gdb.gdbtk: New directory to hold gdbtk tests. + * gdb.gdbtk/console.{exp, test}: New console window tests. + + Fri Jun 26 14:52:47 1998 Peter Schauer * gdb.fortran/types.exp: Escape brackets in expect patterns diff --git a/gdb/testsuite/config/gdbserver.exp b/gdb/testsuite/config/gdbserver.exp index 2c63729d72e..e4dabca537d 100644 --- a/gdb/testsuite/config/gdbserver.exp +++ b/gdb/testsuite/config/gdbserver.exp @@ -92,8 +92,6 @@ set portnum "2345"; proc gdb_load { args } { global server_exec; global portnum; - global verbose; - global gdb_prompt; # Port id -- either specified in baseboard file, or managed here. if [target_info exists gdb,socketport] { @@ -156,20 +154,10 @@ proc gdb_load { args } { set server_exec $args; # Fire off the debug agent - if [target_info exists gdb_server_args] { - # This flavour of gdbserver takes as arguments those specified - # in the board configuration file - set custom_args [target_info gdb_server_args]; - remote_spawn host \ - "$gdbserver $custom_args >& /dev/null < /dev/null &" \ - writeonly - } else { - # This flavour of gdbserver takes as arguments the port information - # and the name of the executable file to be debugged. - remote_spawn host \ + remote_spawn host \ "$gdbserver $sockethost$portnum $args >& /dev/null < /dev/null &" \ writeonly - } + # Give it a little time to establish sleep 2 @@ -181,32 +169,6 @@ proc gdb_load { args } { # attach to the "serial port" gdb_target_cmd $protocol $gdbport; - # do the real load if needed - if [target_info exists gdb_server_do_load] { - send_gdb "load\n" - set timeout 2400 - verbose "Timeout is now $timeout seconds" 2 - gdb_expect { - -re ".*$gdb_prompt $" { - if $verbose>1 then { - send_user "Loaded $arg into $GDB\n" - } - set timeout 30 - verbose "Timeout is now $timeout seconds" 2 - return 1 - } - -re "$gdb_prompt $" { - if $verbose>1 then { - perror "GDB couldn't load." - } - } - timeout { - if $verbose>1 then { - perror "Timed out trying to load $arg." - } - } - } - } - return 0; } + diff --git a/gdb/testsuite/config/sid.exp b/gdb/testsuite/config/sid.exp index 7a73162fca0..60cb0c9b7e1 100644 --- a/gdb/testsuite/config/sid.exp +++ b/gdb/testsuite/config/sid.exp @@ -18,6 +18,7 @@ load_lib gdb.exp proc sid_start {} { + global sid_spawn_id global verbose set port [lindex [split [target_info netport] ":"] 1] @@ -49,11 +50,7 @@ proc sid_start {} { set env(MKSID) "../../sid/main/static/mksid" if {! [file exists $env(SID)]} then { error "Cannot find sid in build tree" } } - if { [board_info target sim,protocol] == "sid" } { - set spawncmd "[target_info sim] [target_info sim,options] -e \"set gdb-socket sockaddr-local 0.0.0.0:$port\"" - } else { - set spawncmd "../../sid/bsp/[target_info sim] $sidverbose $sidendian --gdb=$port [target_info sim,options]" - } + set spawncmd "../../sid/bsp/[target_info sim] $sidverbose $sidendian --persistent --gdb=$port [target_info sim,options]" set post_spawn { global env unset env(SID_LIBRARY_PATH) @@ -61,21 +58,13 @@ proc sid_start {} { unset env(SID) } } else { - global find_rawsid; - set pre_spawn {} - if { [board_info target sim,protocol] == "sid" } { - # FIXME: sim,options may be from the build tree, should find - # it in the install tree. - set spawncmd "sid [target_info sim,options] -e \"set gdb-socket sockaddr-local 0.0.0.0:$port\"" - } else { - set spawncmd "[target_info sim] $sidverbose $sidendian --gdb=$port [target_info sim,options]" - } + set spawncmd "[target_info sim] $sidverbose $sidendian --persistent --gdb=$port [target_info sim,options]" set post_spawn {} } eval $pre_spawn - if {[catch [list remote_spawn host $spawncmd] msg]} { + if {[catch "spawn $spawncmd" msg]} { perror $msg exit 1 } @@ -92,9 +81,7 @@ proc sid_start {} { # GDB would wait for a fair while for the stub to respond. sleep 4 - if ![target_info exists gdb,no_push_conn] { - remote_push_conn host; - } + set sid_spawn_id $spawn_id } # @@ -107,9 +94,12 @@ proc gdb_start {} { } proc sid_exit {} { - if ![target_info exists gdb,no_push_conn] { - remote_close host; - remote_pop_conn host; + global sid_spawn_id + if {[info exists sid_spawn_id]} { + catch {exec kill [exp_pid -i $sid_spawn_id]} + catch {wait -i $sid_spawn_id} + unset sid_spawn_id + sleep 4 } } @@ -141,18 +131,13 @@ proc gdb_target_sid { } { set timeout 60 verbose "Timeout is now $timeout seconds" 2 gdb_expect { - -re ".*\[Ee\]rror.*$gdb_prompt $" { - perror "Couldn't set target for remote simulator." - cleanup - gdb_exit - } -re "Remote debugging using.*$gdb_prompt" { verbose "Set target to sid" } timeout { perror "Couldn't set target for remote simulator." cleanup - gdb_exit + exit $exit_status } } set timeout $prev_timeout @@ -169,7 +154,6 @@ proc gdb_load { arg } { global loadfile global GDB global gdb_prompt - global retval gdb_unload if [gdb_file_cmd $arg] then { return -1 } @@ -181,32 +165,24 @@ proc gdb_load { arg } { set timeout 2400 verbose "Timeout is now $timeout seconds" 2 gdb_expect { - -re ".*\[Ee\]rror.*$gdb_prompt $" { - if $verbose>1 then { - perror "Error during download." - } - set retval -1; - } -re ".*$gdb_prompt $" { if $verbose>1 then { send_user "Loaded $arg into $GDB\n" } - set retval 1; + set timeout 30 + verbose "Timeout is now $timeout seconds" 2 + return 1 } -re "$gdb_prompt $" { if $verbose>1 then { perror "GDB couldn't load." } - set retval -1; } timeout { if $verbose>1 then { perror "Timed out trying to load $arg." } - set retval -1; } } set timeout $prev_timeout - verbose "Timeout is now $timeout seconds" 2 - return $retval; } diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp index 3b297e45a94..4848c67be1a 100644 --- a/gdb/testsuite/gdb.base/annota1.exp +++ b/gdb/testsuite/gdb.base/annota1.exp @@ -115,7 +115,7 @@ gdb_expect { # send_gdb "info break\n" gdb_expect { - -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-headers\r\n\r\n\032\032field 0\r\nNum \r\n\032\032field 1\r\nType \r\n\032\032field 2\r\nDisp \r\n\032\032field 3\r\nEnb \r\n\032\032field 4\r\nAddress +\r\n\032\032field 5\r\nWhat\r\n\r\n\032\032breakpoints-table\r\n\r\n\032\032record\r\n\r\n\032\032field 0\r\n1 \r\n\032\032field 1\r\nbreakpoint \r\n\032\032field 2\r\nkeep \r\n\032\032field 3\r\ny \r\n\032\032field 4\r\n$hex \r\n\032\032field 5\r\nin main at ${srcdir}/${subdir}/${srcfile}:$main_line\r\n\r\n\032\032breakpoints-table-end\r\n$gdb_prompt$" \ + -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-headers\r\n\r\n\032\032field 0\r\nNum \r\n\032\032field 1\r\nType \r\n\032\032field 2\r\nDisp \r\n\032\032field 3\r\nEnb \r\n\032\032field 4\r\nAddress \r\n\032\032field 5\r\nWhat\r\n\r\n\032\032breakpoints-table\r\n\r\n\032\032record\r\n\r\n\032\032field 0\r\n1 \r\n\032\032field 1\r\nbreakpoint \r\n\032\032field 2\r\nkeep \r\n\032\032field 3\r\ny \r\n\032\032field 4\r\n$hex \r\n\032\032field 5\r\nin main at ${srcdir}/${subdir}/${srcfile}:$main_line\r\n\r\n\032\032breakpoints-table-end\r\n$gdb_prompt$" \ {pass "breakpoint info"} -re ".*$gdb_prompt$" { fail "breakpoint info" } timeout { fail "breakpoint info (timeout)" } diff --git a/gdb/testsuite/gdb.base/arithmet.exp b/gdb/testsuite/gdb.base/arithmet.exp index 57afc8d7cf2..16f2cda7f42 100644 --- a/gdb/testsuite/gdb.base/arithmet.exp +++ b/gdb/testsuite/gdb.base/arithmet.exp @@ -1,4 +1,4 @@ -# Copyright 1998, 1999, 2001 Free Software Foundation, Inc. +# Copyright 1998, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,7 +18,6 @@ # bug-gdb@prep.ai.mit.edu # This file was written by Elena Zannoni (ezannoni@cygnus.com) -# Rewritten to use gdb_test by Michael Chastain (chastain@redhat.com) # This file is part of the gdb testsuite # @@ -63,71 +62,314 @@ if ![runto_main] then { # test expressions with "int" types # -gdb_test "set variable x=14" "" -gdb_test "set variable y=2" "" -gdb_test "set variable z=2" "" -gdb_test "set variable w=3" "" - -gdb_test "print x" "14" -gdb_test "print y" "2" -gdb_test "print z" "2" -gdb_test "print w" "3" - -gdb_test "print x+y" "16" -gdb_test "print x-y" "12" -gdb_test "print x*y" "28" -gdb_test "print x/y" "7" -gdb_test "print x%y" "0" - -# x y z w -# 14 2 2 3 +gdb_test "set variable x=14" "" "set variable x=14" +gdb_test "set variable y=2" "" "set variable y=2" +gdb_test "set variable z=2" "" "set variable z=2" +gdb_test "set variable w=3" "" "set variable w=3" + +send_gdb "print x\n" +gdb_expect { + -re ".*14.*$gdb_prompt $" { + pass "print value of x" + } + -re ".*$gdb_prompt $" { fail "print value of x" } + timeout { fail "(timeout) print value of x" } + } + + +send_gdb "print y\n" +gdb_expect { + -re ".*2.*$gdb_prompt $" { + pass "print value of y" + } + -re ".*$gdb_prompt $" { fail "print value of y" } + timeout { fail "(timeout) print value of y" } + } + +send_gdb "print z\n" +gdb_expect { + -re ".*2.*$gdb_prompt $" { + pass "print value of z" + } + -re ".*$gdb_prompt $" { fail "print value of z" } + timeout { fail "(timeout) print value of z" } + } + +send_gdb "print w\n" +gdb_expect { + -re ".*3.*$gdb_prompt $" { + pass "print value of w" + } + -re ".*$gdb_prompt $" { fail "print value of w" } + timeout { fail "(timeout) print value of w" } + } + + + +send_gdb "print x+y\n" +gdb_expect { + -re ".*16.*$gdb_prompt $" { + pass "print value of x+y" + } + -re ".*$gdb_prompt $" { fail "print value of x+y" } + timeout { fail "(timeout) print value of x+y" } + } + +send_gdb "print x-y\n" +gdb_expect { + -re ".*12.*$gdb_prompt $" { + pass "print value of x-y" + } + -re ".*$gdb_prompt $" { fail "print value of x-y" } + timeout { fail "(timeout) print value of x-y" } + } + +send_gdb "print x*y\n" +gdb_expect { + -re ".*28.*$gdb_prompt $" { + pass "print value of x*y" + } + -re ".*$gdb_prompt $" { fail "print value of x*y" } + timeout { fail "(timeout) print value of x*y" } + } + +send_gdb "print x/y\n" +gdb_expect { + -re ".*7.*$gdb_prompt $" { + pass "print value of x/y" + } + -re ".*$gdb_prompt $" { fail "print value of x/y" } + timeout { fail "(timeout) print value of x/y" } + } + +send_gdb "print x%y\n" +gdb_expect { + -re ".*0.*$gdb_prompt $" { + pass "print value of x%y" + } + -re ".*$gdb_prompt $" { fail "print value of x%y" } + timeout { fail "(timeout) print value of x%y" } + } + + # Test associativity of +, -, *, % ,/ -gdb_test "print x+y+z" "18" -gdb_test "print x-y-z" "10" -gdb_test "print x*y*z" "56" -gdb_test "print x/y/z" "3" -gdb_test "print x%y%z" "0" + +send_gdb "print x+y+z\n" +gdb_expect { + -re ".*18.*$gdb_prompt $" { + pass "print value of x+y" + } + -re ".*$gdb_prompt $" { fail "print value of x+y" } + timeout { fail "(timeout) print value of x+y" } + } + +send_gdb "print x-y-z\n" +gdb_expect { + -re ".*10.*$gdb_prompt $" { + pass "print value of x-y" + } + -re ".*$gdb_prompt $" { fail "print value of x-y" } + timeout { fail "(timeout) print value of x-y" } + } + +send_gdb "print x*y*z\n" +gdb_expect { + -re ".*56.*$gdb_prompt $" { + pass "print value of x*y" + } + -re 8".*$gdb_prompt $" { fail "print value of x*y" } + timeout { fail "(timeout) print value of x*y" } + } + +send_gdb "print x/y/z\n" +gdb_expect { + -re ".*3.*$gdb_prompt $" { + pass "print value of x/y" + } + -re ".*$gdb_prompt $" { fail "print value of x/y" } + timeout { fail "(timeout) print value of x/y" } + } + +send_gdb "print x%y%z\n" +gdb_expect { + -re ".*0.*$gdb_prompt $" { + pass "print value of x%y" + } + -re ".*$gdb_prompt $" { fail "print value of x%y" } + timeout { fail "(timeout) print value of x%y" } + } + # test precedence rules on pairs of arithmetic operators -gdb_test "set variable x=10" "" -gdb_test "set variable y=4" "" -gdb_test "set variable z=2" "" +gdb_test "set variable x=10" "" "set variable x" +gdb_test "set variable y=4" "" "set variable y" +gdb_test "set variable z=2" "" "set variable z" + + + +# x y z +# 10 4 2 +send_gdb "print x+y-z\n" +gdb_expect { + -re ".*12.*$gdb_prompt $" { + pass "print value of x+y-z" + } + -re ".*$gdb_prompt $" { fail "print value of x+y-z" } + timeout { fail "(timeout) print value of x+y-z" } + } + +# 10 4 2 +send_gdb "print x+y*z\n" +gdb_expect { + -re ".*18.*$gdb_prompt $" { + pass "print value of x+y*z" + } + -re ".*$gdb_prompt $" { fail "print value of x+y*z" } + timeout { fail "(timeout) print value of x+y*z" } + } + + +gdb_test "set variable z=3" "" "set variable z" + + +# 10 4 3 +send_gdb "print x+y%z\n" +gdb_expect { + -re ".*11.*$gdb_prompt $" { + pass "print value of x+y%z" + } + -re ".*$gdb_prompt $" { fail "print value of x+y%z" } + timeout { fail "(timeout) print value of x+y%z" } + } + + +# 10 4 3 +send_gdb "print x+y/z\n" +gdb_expect { + -re ".*11.*$gdb_prompt $" { + pass "print value of x+y/z" + } + -re ".*$gdb_prompt $" { fail "print value of x+y/z" } + timeout { fail "(timeout) print value of x+y/z" } + } + +gdb_test "set variable z=2" "" " set variable z" + + +# 10 4 2 +send_gdb "print x-y*z\n" +gdb_expect { + -re ".*2.*$gdb_prompt $" { + pass "print value of x-y*z" + } + -re ".*$gdb_prompt $" { fail "print value of x-y*z" } + timeout { fail "(timeout) print value of x-y*z" } + } + +# 10 4 2 +send_gdb "print x-y%z\n" +gdb_expect { + -re ".*10.*$gdb_prompt $" { + pass "print value of x-y%z" + } + -re ".*$gdb_prompt $" { fail "print value of x-y%z" } + timeout { fail "(timeout) print value of x-y%z" } + } + + +# 10 4 2 +send_gdb "print x-y/z\n" +gdb_expect { + -re ".*8.*$gdb_prompt $" { + pass "print value of x-y/z" + } + -re ".*$gdb_prompt $" { fail "print value of x-y/z" } + timeout { fail "(timeout) print value of x-y/z" } + } + +# 10 4 2 +send_gdb "print x*y/z\n" +gdb_expect { + -re ".*20.*$gdb_prompt $" { + pass "print value of x*y/z" + } + -re ".*$gdb_prompt $" { fail "print value of x*y/z" } + timeout { fail "(timeout) print value of x*y/z" } + } + +gdb_test "set variable z=3" "" "set z to 3" + +# 10 4 3 +send_gdb "print x*y%z\n" +gdb_expect { + -re ".*1.*$gdb_prompt $" { + pass "print value of x*y%z" + } + -re ".*$gdb_prompt $" { fail "print value of x*y%z" } + timeout { fail "(timeout) print value of x*y%z" } + } + +# 10 4 3 +send_gdb "print x/y%z\n" +gdb_expect { + -re ".*2\r\n$gdb_prompt $" { + pass "print value of x/y%z" + } + -re ".*$gdb_prompt $" { fail "print value of x/y%z" } + timeout { fail "(timeout) print value of x/y%z" } + } + + + +# test use of parenthesis to enforce different order of evaluation + +# 10 4 3 +send_gdb "print x-(y+z)\n" +gdb_expect { + -re ".*3\r\n$gdb_prompt $" { + pass "print value of x-(y+z)" + } + -re ".*$gdb_prompt $" { fail "print value of x-(y+z)" } + timeout { fail "(timeout) print value of x-(y+z)" } + } + -# x y z w -# 10 4 2 3 +# 10 4 3 +send_gdb "print x/(y*z)\n" +gdb_expect { + -re ".*0\r\n$gdb_prompt $" { + pass "print value of x/(y*z)" + } + -re ".*$gdb_prompt $" { fail "print value of x/(y*z)" } + timeout { fail "(timeout) print value of x/(y*z)" } + } -gdb_test "print x+y-z" "12" -gdb_test "print x+y*z" "18" +# 10 4 3 +send_gdb "print x-(y/z)\n" +gdb_expect { + -re ".*9\r\n$gdb_prompt $" { + pass "print value of x-(y/z)" + } + -re ".*$gdb_prompt $" { fail "print value of x-(y/z)" } + timeout { fail "(timeout) print value of x-(y/z)" } + } -# x y z w -# 10 4 3 3 -gdb_test "set variable z=3" "" -gdb_test "print x+y%z" "11" -gdb_test "print x+y/z" "11" +# 10 4 3 +send_gdb "print (x+y)*z\n" +gdb_expect { + -re ".*42\r\n$gdb_prompt $" { + pass "print value of (x+y)*z" + } + -re ".*$gdb_prompt $" { fail "print value of (x+y)*z" } + timeout { fail "(timeout) print value of (x+y)*z" } + } -# x y z w -# 10 4 2 3 -gdb_test "set variable z=2" "" -gdb_test "print x-y*z" "2" -gdb_test "print x-y%z" "10" -gdb_test "print x-y/z" "8" -gdb_test "print x*y/z" "20" -# x y z w -# 10 4 3 3 -gdb_test "set variable z=3" "" -gdb_test "print x*y%z" "1" -gdb_test "print x/y%z" "2" -# test use of parentheses to enforce different order of evaluation -gdb_test "print x-(y+z)" "3" -gdb_test "print x/(y*z)" "0" -gdb_test "print x-(y/z)" "9" -gdb_test "print (x+y)*z" "42" diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp index e66f9fdaa4b..dd7897d3aa8 100644 --- a/gdb/testsuite/gdb.base/callfuncs.exp +++ b/gdb/testsuite/gdb.base/callfuncs.exp @@ -292,10 +292,8 @@ if { $hp_aCC_compiler } { # Make sure that malloc gets called and that the floating point unit # is initialized via a call to t_double_values. -gdb_test "next" "t_double_values\\(double_val1, double_val2\\);.*" \ - "next to t_double_values" -gdb_test "next" "t_structs_c\\(struct_val1\\);.*" \ - "next to t_structs_c" +gdb_test "next" "t_double_values\\(double_val1, double_val2\\);.*" +gdb_test "next" "t_structs_c\\(struct_val1\\);.*" # Save all register contents. do_get_all_registers diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp index 266948c7803..31e85f649ed 100644 --- a/gdb/testsuite/gdb.base/commands.exp +++ b/gdb/testsuite/gdb.base/commands.exp @@ -184,7 +184,7 @@ proc infrun_breakpoint_command_test {} { return } - gdb_test "set args 6" "" "set args in infrun_breakpoint_command_test" + gdb_test "set args 6" "" "set args in progvar_simple_while_test" if { ![runto factorial] } then { gdb_suppress_tests } # Don't depend upon argument passing, since most simulators don't # currently support it. Bash value variable to be what we want. @@ -326,8 +326,8 @@ proc watchpoint_command_test {} { } send_gdb "end\n" gdb_expect { - -re "$gdb_prompt $" {pass "end commands on watch"} - timeout {fail "(timeout) end commands on watch"} + -re "$gdb_prompt $" {pass "begin commands on watch"} + timeout {fail "(timeout) begin commands on watch"} } send_gdb "continue\n" gdb_expect { @@ -351,7 +351,7 @@ proc test_command_prompt_position {} { # Don't depend upon argument passing, since most simulators don't # currently support it. Bash value variable to be what we want. delete_breakpoints - gdb_test "break factorial" "Breakpoint.*at.*" "break factorial #3" + gdb_test "break factorial" "Breakpoint.*at.*" "break factorial #2" gdb_test "p value=5" "" "set value to 5 in test_command_prompt_position" # All this test should do is print 0xdeadbeef once. gdb_test "if value == 1\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" \ @@ -406,34 +406,34 @@ proc test_command_prompt_position {} { proc deprecated_command_test {} { gdb_test "maintenance deprecate blah" "Can't find command.*" \ - "tried to deprecate non-existing command" + "tried to deprecate non-existsing command" - gdb_test "maintenance deprecate p \"new_p\"" "" "maintenance deprecate p \"new_p\" /1/" + gdb_test "maintenance deprecate p \"new_p\"" "" gdb_test "p 5" \ "Warning: 'p', an alias for the command 'print' is deprecated.*Use 'new_p'.*" \ "p deprecated warning, with replacement" - gdb_test "p 5" ".\[0-9\]* = 5.*" "Deprecated warning goes away /1/" + gdb_test "p 5" ".\[0-9\]* = 5.*" "Deprecated warning goes away" - gdb_test "maintenance deprecate p \"new_p\"" "" "maintenance deprecate p \"new_p\" /2/" + gdb_test "maintenance deprecate p \"new_p\"" "" gdb_test "maintenance deprecate print \"new_print\"" "" gdb_test "p 5" \ "Warning: command 'print' \\(p\\) is deprecated.*Use 'new_print'.*" \ "both alias and command are deprecated" - gdb_test "p 5" ".\[0-9\]* = 5.*" "Deprecated warning goes away /2/" + gdb_test "p 5" ".\[0-9\]* = 5.*" "Deprecated warning goes away" gdb_test "maintenance deprecate set remote memory-read-packet-size \"srm\" " \ "" \ - "deprecate long command /1/" + "deprecate long comamnd" gdb_test "set remote memory-read-packet-size" \ "Warning: command 'set remote memory-read-packet-size' is deprecated.*Use 'srm'.*" \ - "long command deprecated /1/" + "long command deprecated" gdb_test "maintenance deprecate set remote memory-read-packet-size" \ "" \ - "deprecate long command /2/" + "deprecate long comamnd" gdb_test "set remote memory-read-packet-size" \ "Warning: command 'set remote memory-read-packet-size' is deprecated.*No alternative known.*" \ - "long command deprecated with no alternative /2/" + "long command deprecated with no alternative." gdb_test "maintenance deprecate" \ "\"maintenance deprecate\".*" \ diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp index 8c8f676d8da..b08c8a09970 100644 --- a/gdb/testsuite/gdb.base/completion.exp +++ b/gdb/testsuite/gdb.base/completion.exp @@ -52,6 +52,11 @@ if $tracelevel then { } +if { ![istarget "hppa*-hp-hpux*"] } { + #skip all these tests for now (FIXME) + continue +} + global usestubs # @@ -72,19 +77,6 @@ if [get_compiler_info ${binfile}] { } gdb_exit - -# Don't let a .inputrc file or an existing setting of INPUTRC mess up -# the test results. Even if /dev/null doesn't exist on the particular -# platform, the readline library will use the default setting just by -# failing to open the file. OTOH, opening /dev/null successfully will -# also result in the default settings being used since nothing will be -# read from this file. -global env -if [info exists env(INPUTRC)] { - set old_inputrc $env(INPUTRC) -} -set env(INPUTRC) "/dev/null" - gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} @@ -387,7 +379,7 @@ gdb_expect { -re "^p 'a\\\x07$" { send_gdb "\t" gdb_expect { - -re "a64l.*argv.*$gdb_prompt p .a$" { + -re "a64l.*atol.*$gdb_prompt p .a$" { send_gdb "\n" gdb_expect { -re "Invalid character constant\\..*$gdb_prompt $" { @@ -447,7 +439,7 @@ gdb_expect { -re "^p b-a\\\x07$" { send_gdb "\t" gdb_expect { - -re "a64l.*argv.*$gdb_prompt p b-a$" { + -re "a64l.*atol.*$gdb_prompt p b-a$" { send_gdb "\n" gdb_expect { -re "No symbol \"b\" in current context\\..*$gdb_prompt $" { @@ -541,10 +533,10 @@ gdb_expect { } -send_gdb "file ${srcdir}/gdb.base/compl\t" +send_gdb "file ${srcdir}/gdb.base/self\t" sleep 1 gdb_expect { - -re "^file ${srcdir}/gdb.base/completion\\.exp $"\ + -re "^file ${srcdir}/gdb.base/.*'selftest\\.exp' $"\ { send_gdb "\n" gdb_expect { -re "\r\nA program is being debugged already\\. Kill it\\? \\(y or n\\) $" @@ -552,19 +544,20 @@ gdb_expect { { send_gdb "n\n" gdb_expect { -re "\r\nProgram not killed\\.\r\n$gdb_prompt $"\ - { pass "complete 'file gdb.base/compl'"} - -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/compl'"} - timeout {fail "(timeout) complete 'file gdb.base/compl'"} + { pass "complete 'file gdb.base/self'"} + -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/self'"} + timeout {fail "(timeout) complete 'file gdb.base/self'"} } } - -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/compl'"} - timeout {fail "(timeout) complete 'file gdb.base/compl'"} + -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/self'"} + timeout {fail "(timeout) complete 'file gdb.base/self'"} } } - -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/compl'" } - timeout { fail "(timeout) complete 'file gdb.base/compl'" } + -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/self'" } + timeout { fail "(timeout) complete 'file gdb.base/self'" } } + send_gdb "info func mark\t" sleep 1 gdb_expect { @@ -576,7 +569,7 @@ gdb_expect { -re "marker1.*$gdb_prompt info func marker$"\ { send_gdb "\n" gdb_expect { - -re "All functions matching regular expression \"marker\":\r\n\r\nFile.*break.c:\r\nint marker1\\(\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long int\\);\r\n$gdb_prompt $"\ + -re "All functions matching regular expression \"marker\":\r\n\r\nFile.*break.c:\r\nint marker1\\(.*\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long\\);\r\n$gdb_prompt $"\ { pass "complete 'info func mar'"} -re ".*$gdb_prompt $" { fail "complete 'info func mar'"} timeout {fail "(timeout) complete 'info func mar'"} @@ -597,7 +590,7 @@ gdb_expect { -re "ask.*child.*parent.*$gdb_prompt set follow-fork-mode $"\ { send_gdb "\n" gdb_expect { - -re "Requires an argument.*ask.*child.*parent.*$gdb_prompt $"\ + -re "Requires an argument.*parent.*child.*ask.*$gdb_prompt $"\ { pass "complete 'set follow-fork-mode'"} -re "Ambiguous item \"\"\\..*$gdb_prompt $"\ { pass "complete 'set follow-fork-mode'"} @@ -609,12 +602,19 @@ gdb_expect { timeout { fail "(timeout) complete 'set follow-fork-mode'" } } -# Restore globals modified in this test... -if [info exists old_inputrc] { - set env(INPUTRC) $old_inputrc -} else { - unset env(INPUTRC) -} set timeout $oldtimeout1 - return 0 + + + + + + + + + + + + + + diff --git a/gdb/testsuite/gdb.base/condbreak.exp b/gdb/testsuite/gdb.base/condbreak.exp index c234431f15f..92d6880cccc 100644 --- a/gdb/testsuite/gdb.base/condbreak.exp +++ b/gdb/testsuite/gdb.base/condbreak.exp @@ -1,4 +1,4 @@ -# Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +# Copyright 1997, 1998, 1999, 2000 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 @@ -66,32 +66,41 @@ gdb_test "break main" \ # test conditional break at function # gdb_test "break marker1 if 1==1" \ - "Breakpoint.*at.* file .*$srcfile, line.*" + "Breakpoint.*at.* file .*$srcfile, line.*" \ + "break function if condition" -gdb_test "delete 2" "" +gdb_test "delete 2" \ + "" \ + "delete break" # # test conditional break at line number # gdb_test "break 79 if 1==1" \ - "Breakpoint.*at.* file .*$srcfile, line 79\\." + "Breakpoint.*at.* file .*$srcfile, line 79\\." \ + "break line if condition" -gdb_test "delete 3" "" +gdb_test "delete 3" \ + "" \ + "delete break" # # test conditional break at function # gdb_test "break marker1 if (1==1)" \ - "Breakpoint.*at.* file .*$srcfile, line.*" + "Breakpoint.*at.* file .*$srcfile, line.*" \ + "break function if (condition)" # # test conditional break at line number # gdb_test "break 79 if (1==1)" \ - "Breakpoint.*at.* file .*$srcfile, line 79\\." + "Breakpoint.*at.* file .*$srcfile, line 79\\." \ + "break line if (condition)" gdb_test "break marker2 if (a==43)" \ - "Breakpoint.*at.* file .*$srcfile, line.*" + "Breakpoint.*at.* file .*$srcfile, line.*" \ + "break function if (condition)" # # check to see what breakpoints are set diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp index 3d6bf5b9252..97ecd9bc7d2 100644 --- a/gdb/testsuite/gdb.base/corefile.exp +++ b/gdb/testsuite/gdb.base/corefile.exp @@ -189,7 +189,7 @@ gdb_test "print coremaker_data" "\\\$$decimal = 202" gdb_test "print coremaker_bss" "\\\$$decimal = 10" gdb_test "print coremaker_ro" "\\\$$decimal = 201" -gdb_test "print func2::coremaker_local" "\\\$$decimal = \\{0, 1, 2, 3, 4\\}" +gdb_test "print func2::coremaker_local" "\\\$$decimal = {0, 1, 2, 3, 4}" # Somehow we better test the ability to read the registers out of the core # file correctly. I don't think the other tests do this. diff --git a/gdb/testsuite/gdb.base/dbx.exp b/gdb/testsuite/gdb.base/dbx.exp index 9df3bda806e..08c3cd4f2e2 100644 --- a/gdb/testsuite/gdb.base/dbx.exp +++ b/gdb/testsuite/gdb.base/dbx.exp @@ -1,4 +1,4 @@ -# Copyright 1998, 1999, 2001 Free Software Foundation, Inc. +# Copyright 1998, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -306,13 +306,13 @@ proc test_whereis { } { #test_func # proc test_func { } { - gdb_test "cont" "" "cont 1" + gdb_test "cont" "" gdb_test "step" "" # This always fails, but it's not clear why. -sts 1999-08-17 setup_xfail "*-*-*" gdb_test "func sum" "'sum' not within current stack frame\." gdb_test "stop in sum" "Breakpoint.*at.*: file.*sum\.c, line 11\." - gdb_test "cont" "" "cont 2" + gdb_test "cont" # This always fails, but it's not clear why. -sts 1999-08-17 setup_xfail "*-*-*" gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:24\r\n24\[ \t\]+total = sum\\(list, low, high\\);" diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp index bc43143ac90..3df03684252 100644 --- a/gdb/testsuite/gdb.base/default.exp +++ b/gdb/testsuite/gdb.base/default.exp @@ -1,5 +1,5 @@ # Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001 +# 2000 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -328,8 +328,6 @@ setup_xfail "a29k-*-udi" gdb_test "info stack" "No stack." "info stack" #test info set # FIXME -- needs to match the entire output -# FIXME -- on native solaris 2.8, this test fails due to this line: -# prompt: Gdb's prompt is "(gdb) ".^M gdb_test "info set" "confirm: Whether to confirm potentially dangerous operations is o\[a-z\]*..*\[\r\n\]+history filename: The filename in which to record the command history is .*\[\r\n\]+listsize: Number of source lines gdb will list by default is 10.*" "info set" gdb_test "info symbol" "Argument required .address.." #test info source @@ -389,7 +387,7 @@ gdb_test "overlay auto" "" gdb_test "overlay off" "" gdb_test "overlay list" "No sections are mapped." gdb_test "overlay map" "Overlay debugging not enabled.*" "overlay map #1" -gdb_test "overlay unmap" "Overlay debugging not enabled.*" "overlay unmap #1" +gdb_test "overlay unmap" "Overlay debugging not enabled.*" "overlay unmap #2" gdb_test "overlay manual" "" "overlay manual #2" gdb_test "overlay map" "Argument required: name of an overlay section." "overlay map #2" gdb_test "overlay unmap" "Argument required: name of an overlay section." "overlay unmap #2" diff --git a/gdb/testsuite/gdb.base/define.exp b/gdb/testsuite/gdb.base/define.exp index 06ea1c0f4f8..2793c4b4135 100644 --- a/gdb/testsuite/gdb.base/define.exp +++ b/gdb/testsuite/gdb.base/define.exp @@ -1,4 +1,4 @@ -# Copyright 1998, 1999, 2001 Free Software Foundation, Inc. +# Copyright 1998, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -160,8 +160,8 @@ gdb_expect { } } -re "$gdb_prompt $"\ - {fail "document user command: nextwhere"} - timeout {fail "(timeout) document user command: nextwhere"} + {fail "documenting user command: nextwhere"} + timeout {fail "(timeout) documenting user command: nextwhere"} } send_gdb "document nextwhere\n" @@ -170,13 +170,13 @@ gdb_expect { {send_gdb "A next command that first shows you where you're stepping from.\nend\n" gdb_expect { -re "$gdb_prompt $"\ - {pass "re-document user command: nextwhere"} - timeout {fail "(timeout) re-document user command: nextwhere"} + {pass "document user command: nextwhere"} + timeout {fail "(timeout) document user command: nextwhere"} } } -re "$gdb_prompt $"\ - {fail "re-document user command: nextwhere"} - timeout {fail "(timeout) re-document user command: nextwhere"} + {fail "documenting user command: nextwhere"} + timeout {fail "(timeout) documenting user command: nextwhere"} } send_gdb "help nextwhere\n" diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp index 1552d364faf..714c0eddde4 100644 --- a/gdb/testsuite/gdb.base/ending-run.exp +++ b/gdb/testsuite/gdb.base/ending-run.exp @@ -56,8 +56,7 @@ gdb_test "b ending-run.c:1" ".*Breakpoint.*ending-run.c, line 1.*" \ "bpt at line before routine" gdb_test "b ending-run.c:13" \ - ".*Note.*also.*Breakpoint 2.*ending-run.c, line 13.*" \ - "b ending-run.c:13, one" + ".*Note.*also.*Breakpoint 2.*ending-run.c, line 13.*" # Set up to go to the next-to-last line of the program # @@ -82,7 +81,7 @@ gdb_expect { # Test some other "clear" combinations # gdb_test "b ending-run.c:1" ".*Breakpoint.*4.*" -gdb_test "b ending-run.c:13" ".*Note.*also.*Breakpoint.*5.*" "b ending-run.c:13, two" +gdb_test "b ending-run.c:13" ".*Note.*also.*Breakpoint.*5.*" gdb_test "cle ending-run.c:13" \ ".*Deleted breakpoint 5.*" "Only cleared 1 by line" diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp index 49df15a2f60..1bffd0a12f2 100644 --- a/gdb/testsuite/gdb.base/exprs.exp +++ b/gdb/testsuite/gdb.base/exprs.exp @@ -1,4 +1,4 @@ -# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2001 +# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -101,11 +101,11 @@ test_expr "set variable v_unsigned_char=127" "print v_unsigned_char > 0" "\\$\[0 # FIXME: gdb mishandles the cast (unsigned char) on the i960, so I've # set up an expected failure for this case. setup_xfail "i960-*-*" 1821 -test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char == 0" "\\$\[0-9\]* = $false" "print v_unsigned_char == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_char == (unsigned char)~0" "\\$\[0-9\]* = $true" "print unsigned char == (~0)" +test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char == 0" "\\$\[0-9\]* = $false" "print v_unsigned_char == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_char == (unsigned char)~0" "\\$\[0-9\]* = $true" "print unsigned char == (~0)" # FIXME: gdb mishandles the cast (unsigned char) on the i960, so I've # set up an expected failure for this case. setup_xfail "i960-*-*" 1821 -test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char != 0" "\\$\[0-9\]* = $true" "print v_unsigned_char != (unsigned char)~0" "\\$\[0-9\]* = $false" "print v_unsigned_char != ~0" "\\$\[0-9\]* = $true" "print unsigned char != (~0)" +test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char != 0" "\\$\[0-9\]* = $true" "print v_unsigned_char != (unsigned char)~0" "\\$\[0-9\]* = $false" "print unsigned char != (~0)" test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char < 0" "\\$\[0-9\]* = $false" "print v_unsigned_char < 127" "\\$\[0-9\]* = $false" "print unsigned char < (~0)" test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char > 0" "\\$\[0-9\]* = $true" "print v_unsigned_char > 127" "\\$\[0-9\]* = $true" "print unsigned char > (~0)" # @@ -140,7 +140,7 @@ test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short != 0" " test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short < 0" "\\$\[0-9\]* = $false" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short <" test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short > 0" "\\$\[0-9\]* = $true" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short >" # make short a minus -test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short == 0" "\\$\[0-9\]* = $false" "print sizeof (v_unsigned_short) < sizeof (~0) && v_unsigned_short == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_short == (unsigned short)~0" "\\$\[0-9\]* = $true" "print unsigned short == (~0)" +test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short == 0" "\\$\[0-9\]* = $false" "print v_unsigned_short == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_short == (unsigned short)~0" "\\$\[0-9\]* = $true" "print unsigned short == (~0)" test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short != 0" "\\$\[0-9\]* = $true" "print v_unsigned_short != (unsigned short)~0" "\\$\[0-9\]* = $false" "print unsigned short != (~0)" test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short < 0" "\\$\[0-9\]* = $false" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short < (~0)" test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short > 0" "\\$\[0-9\]* = $true" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned short > (~0)" @@ -238,11 +238,11 @@ test_expr "set variable v_unsigned_long = 0" "print (void*)v_unsigned_long" "\\$ # send_gdb "print sizeof (long long) > sizeof (long)\n" gdb_expect { - -re "\\$\[0-9\]* = $true.*$gdb_prompt" { + -re "\\$\[0-9\]* = $true" { set ok 1 pass "sizeof (long long) > sizeof (long) (true)" } - -re "\\$\[0-9\]* = $false.*$gdb_prompt" { + -re "\\$\[0-9\]* = $false" { set ok 0 pass "sizeof (long long) > sizeof (long) (false)" } diff --git a/gdb/testsuite/gdb.base/finish.exp b/gdb/testsuite/gdb.base/finish.exp index 064f26e39dc..abb35ed95f8 100644 --- a/gdb/testsuite/gdb.base/finish.exp +++ b/gdb/testsuite/gdb.base/finish.exp @@ -77,17 +77,10 @@ proc finish_void { } { gdb_test "continue" "Breakpoint.* void_func.*" \ "continue to void_func" send_gdb "finish\n" - # Some architectures will have one or more instructions after the - # call instruction which still is part of the call sequence, so we - # must be prepared for a "finish" to show us the void_func call - # again as well as the statement after. gdb_expect { -re ".*void_checkpoint.*$gdb_prompt $" { pass "finish from void_func" } - -re "0x\[0-9a-fA-F\]+ in main.*call to void_func.*$gdb_prompt $" { - pass "finish from void_func" - } -re ".*$gdb_prompt $" { fail "finish from void_func" } diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp index a09f8da69ad..e3c94c6b952 100644 --- a/gdb/testsuite/gdb.base/help.exp +++ b/gdb/testsuite/gdb.base/help.exp @@ -542,7 +542,7 @@ gdb_test "help info bogus-gdb-command" "Undefined info command: \"bogus-gdb-comm # test help gotcha gdb_test "help gotcha" "Undefined command: \"gotcha\". Try \"help\"." "help gotcha" # test apropos regex -gdb_test "apropos \\\(print\[\^ bsiedf\\\".-\]\\\)" "handle -- Specify how to handle a signal" +gdb_test "apropos \\\(print\[\^ bsiedf\\\".\]\\\)" "handle -- Specify how to handle a signal" # test apropos >1 word string gdb_test "apropos handle a signal" "handle -- Specify how to handle a signal" # test apropos apropos diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp index 69a456bfd46..a7f9af96397 100644 --- a/gdb/testsuite/gdb.base/long_long.exp +++ b/gdb/testsuite/gdb.base/long_long.exp @@ -85,16 +85,6 @@ gdb_expect { default { } } -# Detect targets with 4-byte shorts. Assume all others use 2-bytes. - -set sizeof_short 2 -send_gdb "print sizeof(short)\n" -gdb_expect { - -re ".* = 4.*$gdb_prompt $" { set sizeof_short 4 } - -re ".*$gdb_prompt $" { } - default { } -} - # Detect targets with 4-byte doubles. set sizeof_double 8 @@ -182,23 +172,14 @@ if { $target_bigendian_p } { } - if { $sizeof_short == 2 } { - gdb_test "p/d *(short *)&oct" ".*-22738.*" - gdb_test "p/u *(short *)&oct" ".*42798.*" - gdb_test "p/o *(short *)&oct" ".*0123456.*" - gdb_test "p/t *(short *)&oct" ".*1010011100101110.*" - gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*" - gdb_test "p/c *(short *)&oct" ".* 46 '.'.*" - gdb_test "p/f *(short *)&oct" ".*-22738.*" - } else { - gdb_test "p/d *(short *)&oct" ".*-1490098887.*" - gdb_test "p/u *(short *)&oct" ".*2804868409.*" - gdb_test "p/o *(short *)&oct" ".*024713562471.*" - gdb_test "p/t *(short *)&oct" ".*10100111001011101110010100111001.*" - gdb_test "p/a *(short *)&oct" ".*0xf*a72ee539.*" - gdb_test "p/c *(short *)&oct" ".* 57 '9'.*" - gdb_test "p/f *(short *)&oct" ".*-2.42716126e-15.*" - } + gdb_test "p/d *(short *)&oct" ".*-22738.*" + gdb_test "p/u *(short *)&oct" ".*42798.*" + gdb_test "p/o *(short *)&oct" ".*0123456.*" + gdb_test "p/t *(short *)&oct" ".*1010011100101110.*" + gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*" + gdb_test "p/c *(short *)&oct" ".* 46 '.'.*" + gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*" + gdb_test "p/f *(short *)&oct" ".*-22738.*" gdb_test "x/x &oct" ".*0xa72ee539.*" gdb_test "x/d &oct" ".*.-1490098887*" diff --git a/gdb/testsuite/gdb.base/restore.c b/gdb/testsuite/gdb.base/restore.c index e05d68c2145..974e94486cc 100644 --- a/gdb/testsuite/gdb.base/restore.c +++ b/gdb/testsuite/gdb.base/restore.c @@ -14,12 +14,11 @@ (defun caller (n) (format "caller%d" n)) (defun local (n) (format "l%d" n)) (defun local-sum (n) - (if (zerop n) (insert "0") - (let ((j 1)) - (while (<= j n) - (insert (local j)) - (if (< j n) (insert "+")) - (setq j (1+ j)))))) + (let ((j 1)) + (while (<= j n) + (insert (local j)) + (if (< j n) (insert "+")) + (setq j (1+ j))))) (defun local-chain (n previous first-end) (let ((j 1)) (while (<= j n) @@ -54,7 +53,8 @@ (insert "{\n") (local-chain i "n" (callee i)) (insert " return ") - (local-sum i) + (if (<= i 0) (insert "n") + (local-sum i)) (insert ";\n") (insert "}\n\n") (setq i (1+ i)))) @@ -103,7 +103,7 @@ increment (int n) int callee0 (int n) { - return 0; + return n; } /* Returns n * 1 + 1 */ diff --git a/gdb/testsuite/gdb.base/return2.c b/gdb/testsuite/gdb.base/return2.c index 58d85eca113..cddbb974cd6 100644 --- a/gdb/testsuite/gdb.base/return2.c +++ b/gdb/testsuite/gdb.base/return2.c @@ -84,27 +84,8 @@ int main (int argc, char **argv) int_resultval = int_func (); /* short_checkpoint */ long_resultval = long_func (); /* int_checkpoint */ long_long_resultval = long_long_func (); /* long_checkpoint */ - - /* On machines using IEEE floating point, the test pattern of all - 1-bits established above turns out to be a floating-point NaN - ("Not a Number"). According to the IEEE rules, NaN's aren't even - equal to themselves. This can lead to stupid conversations with - GDB like: - - (gdb) p testval.float_testval == testval.float_testval - $7 = 0 - (gdb) - - This is the correct answer, but it's not the sort of thing - return2.exp wants to see. So to make things work the way they - ought, we'll set aside the `union' cleverness and initialize the - test values explicitly here. These values have interesting bits - throughout the value, so we'll still detect truncated values. */ - - testval.float_testval = 2.7182818284590452354;/* long_long_checkpoint */ - float_resultval = float_func (); - testval.double_testval = 3.14159265358979323846; /* float_checkpoint */ - double_resultval = double_func (); + float_resultval = float_func (); /* long_long_checkpoint */ + double_resultval = double_func (); /* float_checkpoint */ main_test = 1; /* double_checkpoint */ return 0; } diff --git a/gdb/testsuite/gdb.c++/classes.exp b/gdb/testsuite/gdb.c++/classes.exp index 5b559d728d6..2e2e89cf8f5 100644 --- a/gdb/testsuite/gdb.c++/classes.exp +++ b/gdb/testsuite/gdb.c++/classes.exp @@ -224,7 +224,7 @@ proc test_ptype_class_objects {} { # it to print as "struct". send_gdb "ptype class A\n" gdb_expect { - -re "type = (class|struct) A \{(${ws}public:|)${ws}int a;${ws}int x;((${ws}A & operator=\\(A const ?&\\);)|(${ws}A\\(A const ?&\\);)|(${ws}A\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" { + -re "type = (class|struct) A \{(${ws}public:|)${ws}int a;${ws}int x;((${ws}A & operator=\\(A const ?&\\);)|(${ws}A\\(A const ?&\\);)|(${ws}A\\(void\\);))*${ws}\}$nl$gdb_prompt $" { pass "ptype class A" } -re ".*$gdb_prompt $" { @@ -239,10 +239,10 @@ proc test_ptype_class_objects {} { setup_xfail_format "DWARF 1" send_gdb "ptype class B\n" gdb_expect { - -re "type = class B : public A \{${ws}public:${ws}int b;${ws}int x;${ws}B & operator=\\(B const &\\);${ws}B\\(B const &\\);${ws}B\\((void|)\\);${ws}\}$nl$gdb_prompt $" { + -re "type = class B : public A \{${ws}public:${ws}int b;${ws}int x;${ws}B & operator=\\(B const &\\);${ws}B\\(B const &\\);${ws}B\\(void\\);${ws}\}$nl$gdb_prompt $" { pass "ptype class B" } - -re "type = class B : public A \{${ws}public:${ws}int b;${ws}int x;((${ws}B & operator=\\(B const &\\);)|(${ws}B\\(B const &\\);)|(${ws}B\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" { + -re "type = class B : public A \{${ws}public:${ws}int b;${ws}int x;((${ws}B & operator=\\(B const &\\);)|(${ws}B\\(B const &\\);)|(${ws}B\\(void\\);))*${ws}\}$nl$gdb_prompt $" { pass "ptype class B (obsolescent gcc or gdb)" } -re ".*$gdb_prompt $" { @@ -257,10 +257,10 @@ proc test_ptype_class_objects {} { setup_xfail_format "DWARF 1" send_gdb "ptype class C\n" gdb_expect { - -re "type = class C : public A \{${ws}public:${ws}int c;${ws}int x;${ws}C & operator=\\(C const &\\);${ws}C\\(C const &\\);${ws}C\\((void|)\\);${ws}\}$nl$gdb_prompt $" { + -re "type = class C : public A \{${ws}public:${ws}int c;${ws}int x;${ws}C & operator=\\(C const &\\);${ws}C\\(C const &\\);${ws}C\\(void\\);${ws}\}$nl$gdb_prompt $" { pass "ptype class C" } - -re "type = class C : public A \{${ws}public:${ws}int c;${ws}int x;((${ws}C & operator=\\(C const &\\);)|(${ws}C\\(C const &\\);)|(${ws}C\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" { + -re "type = class C : public A \{${ws}public:${ws}int c;${ws}int x;((${ws}C & operator=\\(C const &\\);)|(${ws}C\\(C const &\\);)|(${ws}C\\(void\\);))*${ws}\}$nl$gdb_prompt $" { pass "ptype class C (obsolescent gcc or gdb)" } -re ".*$gdb_prompt $" { @@ -275,10 +275,10 @@ proc test_ptype_class_objects {} { setup_xfail_format "DWARF 1" send_gdb "ptype class D\n" gdb_expect { - -re "type = class D : public B, public C \{${ws}public:${ws}int d;${ws}int x;${ws}D & operator=\\(D const &\\);${ws}D\\(D const &\\);${ws}D\\((void|)\\);${ws}\}$nl$gdb_prompt $" { + -re "type = class D : public B, public C \{${ws}public:${ws}int d;${ws}int x;${ws}D & operator=\\(D const &\\);${ws}D\\(D const &\\);${ws}D\\(void\\);${ws}\}$nl$gdb_prompt $" { pass "ptype class D" } - -re "type = class D : public B, public C \{${ws}public:${ws}int d;${ws}int x;((${ws}D & operator=\\(D const &\\);)|(${ws}D\\(D const &\\);)|(${ws}D\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" { + -re "type = class D : public B, public C \{${ws}public:${ws}int d;${ws}int x;((${ws}D & operator=\\(D const &\\);)|(${ws}D\\(D const &\\);)|(${ws}D\\(void\\);))*${ws}\}$nl$gdb_prompt $" { pass "ptype class D (obsolescent gcc or gdb)" } -re ".*$gdb_prompt $" { @@ -293,10 +293,10 @@ proc test_ptype_class_objects {} { setup_xfail_format "DWARF 1" send_gdb "ptype class E\n" gdb_expect { - -re "type = class E : public D \{${ws}public:${ws}int e;${ws}int x;${ws}E & operator=\\(E const &\\);${ws}E\\(E const &\\);${ws}E\\((void|)\\);${ws}\}$nl$gdb_prompt $" { + -re "type = class E : public D \{${ws}public:${ws}int e;${ws}int x;${ws}E & operator=\\(E const &\\);${ws}E\\(E const &\\);${ws}E\\(void\\);${ws}\}$nl$gdb_prompt $" { pass "ptype class E" } - -re "type = class E : public D \{${ws}public:${ws}int e;${ws}int x;((${ws}E & operator=\\(E const &\\);)|(${ws}E\\(E const &\\);)|(${ws}E\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" { + -re "type = class E : public D \{${ws}public:${ws}int e;${ws}int x;((${ws}E & operator=\\(E const &\\);)|(${ws}E\\(E const &\\);)|(${ws}E\\(void\\);))*${ws}\}$nl$gdb_prompt $" { pass "ptype class E" } -re ".*$gdb_prompt $" { @@ -310,10 +310,10 @@ proc test_ptype_class_objects {} { send_gdb "ptype class vA\n" gdb_expect { - -re "type = (class|struct) vA \{(${ws}public:|)${ws}int va;${ws}int vx;${ws}vA & operator=\\(vA const &\\);${ws}vA\\(vA const &\\);${ws}vA\\((void|)\\);${ws}\}$nl$gdb_prompt $" { + -re "type = (class|struct) vA \{(${ws}public:|)${ws}int va;${ws}int vx;${ws}vA & operator=\\(vA const &\\);${ws}vA\\(vA const &\\);${ws}vA\\(void\\);${ws}\}$nl$gdb_prompt $" { pass "ptype class vA" } - -re "type = (class|struct) vA \{(${ws}public:|)${ws}int va;${ws}int vx;((${ws}vA & operator=\\(vA const &\\);)|(${ws}vA\\(vA const &\\);)|(${ws}vA\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" { + -re "type = (class|struct) vA \{(${ws}public:|)${ws}int va;${ws}int vx;((${ws}vA & operator=\\(vA const &\\);)|(${ws}vA\\(vA const &\\);)|(${ws}vA\\(void\\);))*${ws}\}$nl$gdb_prompt $" { pass "ptype class vA (obsolescent gcc or gdb)" } -re ".*$gdb_prompt $" { @@ -460,10 +460,10 @@ proc test_ptype_class_objects {} { -re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;\r\n${ws}Foo\\(int, int\\);${ws}int operator!.void.;${ws}operator int.void.;${ws}int times.int.;$nl\}$nl$gdb_prompt $" { pass "ptype class Foo(aCC)" } - -re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;${ws}Foo & operator=\\(Foo const &\\);${ws}Foo\\(Foo const &\\);${ws}Foo\\(int, int\\);${ws}int operator!\\((void|)\\);${ws}operator int\\((void|)\\);${ws}int times\\(int\\);${ws}\}$nl$gdb_prompt $" { + -re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;${ws}Foo & operator=\\(Foo const &\\);${ws}Foo\\(Foo const &\\);${ws}Foo\\(int, int\\);${ws}int operator!\\(void\\);${ws}operator int\\(void\\);${ws}int times\\(int\\);${ws}\}$nl$gdb_prompt $" { pass "ptype class Foo" } - -re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;((${ws}Foo & operator=\\(Foo const &\\);)|(${ws}Foo\\(Foo const &\\);)|(${ws}Foo\\(int, int\\);)|(${ws}int operator!\\((void|)\\);)|(${ws}int operator int\\((void|)\\);)|(${ws}int times\\(int\\);))*${ws}\}$nl$gdb_prompt $" { + -re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;((${ws}Foo & operator=\\(Foo const &\\);)|(${ws}Foo\\(Foo const &\\);)|(${ws}Foo\\(int, int\\);)|(${ws}int operator!\\(void\\);)|(${ws}int operator int\\(void\\);)|(${ws}int times\\(int\\);))*${ws}\}$nl$gdb_prompt $" { pass "ptype class Foo (obsolescent gcc or gdb)" } -re ".*$gdb_prompt $" { diff --git a/gdb/testsuite/gdb.c++/cplusfuncs.cc b/gdb/testsuite/gdb.c++/cplusfuncs.cc index 7f033d6d90c..ed555aa2db3 100644 --- a/gdb/testsuite/gdb.c++/cplusfuncs.cc +++ b/gdb/testsuite/gdb.c++/cplusfuncs.cc @@ -187,10 +187,10 @@ int hairyfunc7 (PFPFPc_i_PFl_i arg) { arg = 0; return 0; } /* gdb has two demanglers (one for g++ 2.95, one for g++ 3). These marker functions help me figure out which demangler is in use. */ -char * dm_type_char_star (char * p) { return p; } +int dm_type_char_star (char * p) { return (int) p; } int dm_type_foo_ref (foo & foo) { return foo.ifoo; } -int * dm_type_int_star (int * p) { return p; } -long * dm_type_long_star (long * p) { return p; } +int dm_type_int_star (int * p) { return (int) p; } +int dm_type_long_star (long * p) { return (int) p; } int dm_type_unsigned_int (unsigned int i) { return i; } int dm_type_void (void) { return 0; } -void * dm_type_void_star (void * p) { return p; } +int dm_type_void_star (void * p) { return (int) p; } diff --git a/gdb/testsuite/gdb.disasm/Makefile.in b/gdb/testsuite/gdb.disasm/Makefile.in index 7bb5eef69c4..ab228ddf935 100644 --- a/gdb/testsuite/gdb.disasm/Makefile.in +++ b/gdb/testsuite/gdb.disasm/Makefile.in @@ -9,10 +9,12 @@ all: @echo "Nothing to be done for all..." clean mostlyclean: - -rm -f *.o *.diff *~ *.bad core h8300s hppa mn10200 mn10300 sh3 + -rm -f *.o *.diff *~ *.bad core sh3 hppa mn10200 mn10300 distclean maintainer-clean realclean: clean -rm -f Makefile config.status config.log Makefile: $(srcdir)/Makefile.in $(srcdir)/configure.in $(SHELL) ./config.status --recheck + + diff --git a/gdb/testsuite/gdb.disasm/h8300s.exp b/gdb/testsuite/gdb.disasm/h8300s.exp deleted file mode 100644 index eeaf23bfdd0..00000000000 --- a/gdb/testsuite/gdb.disasm/h8300s.exp +++ /dev/null @@ -1,698 +0,0 @@ -# Copyright (C) 2000 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 -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# This file was written by Kazu Hirata. (kazu@hxi.com) - -if $tracelevel then { - strace $tracelevel -} - -if ![istarget "h8300*-*-*"] { - verbose "Tests ignored for all but h8300s based targets." - return -} - -set prms_id 0 -set bug_id 0 - -set testfile "h8300s" -set srcfile ${srcdir}/${subdir}/${testfile}.s -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-ms}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -proc all_set_machine_h8300s { } { - global gdb_prompt - global hex - global decimal - - send_gdb "set machine h8300s\n" - gdb_expect { - -re "$gdb_prompt $" {} - } -} - -proc all_movb_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/9i movb_tests\n" - gdb_expect { - -re " -.*mov.b\tr0l,r0h.* -.*mov.b\t#0x12,r1l.* -.*mov.b\t@er0,r1h.* -.*mov.b\t@\\(0x1234:16,er0\\),r2l.* -.*mov.b\t@\\(0x12345678:32,er0\\),r2h.* -.*mov.b\t@er0\\+,r3l.* -.*mov.b\t@0x12:8,r3h.* -.*mov.b\t@0x1234:16,r4l.* -.*mov.b\t@0x12345678:32,r4h.* -.*$gdb_prompt $" { pass "movb_tests" } - -re "$gdb_prompt $" { fail "movb_tests" } - timeout { fail "(timeout) movb_tests" } - } -} - -proc all_movw_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/8i movw_tests\n" - gdb_expect { - -re " -.*mov.w\te0,r0.* -.*mov.w\t#0x1234,r1.* -.*mov.w\t@er0,r2.* -.*mov.w\t@\\(0x1234:16,er0\\),r3.* -.*mov.w\t@\\(0x12345678:32,er0\\),r4.* -.*mov.w\t@er0\\+,r5.* -.*mov.w\t@0x1234:16,r6.* -.*mov.w\t@0x12345678:32,r7.* -.*$gdb_prompt $" { pass "movw_tests" } - -re "$gdb_prompt $" { fail "movw_tests" } - timeout { fail "(timeout) movw_tests" } - } -} - -proc all_movl_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/8i movl_tests\n" - gdb_expect { - -re " -.*mov.l\ter0,er1.* -.*mov.l\t#0x12345678,er1.* -.*mov.l\t@er0,er2.* -.*mov.l\t@\\(0x1234:16,er0\\),er3.* -.*mov.l\t@\\(0x12345678:32,er0\\),er4.* -.*mov.l\t@er0\\+,er5.* -.*mov.l\t@0x1234:16,er6.* -.*mov.l\t@0x12345678:32,er7.* -.*$gdb_prompt $" { pass "movl_tests" } - -re "$gdb_prompt $" { fail "movl_tests" } - timeout { fail "(timeout) movl_tests" } - } -} - -proc all_ldm_stm_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/6i ldm_stm_tests\n" - gdb_expect { - -re " -.*ldm.l\t@sp\\+,er0-er1.* -.*ldm.l\t@sp\\+,er0-er2.* -.*ldm.l\t@sp\\+,er0-er3.* -.*stm.l\ter0\\-er1,@-sp.* -.*stm.l\ter0\\-er2,@-sp.* -.*stm.l\ter0\\-er3,@-sp.* -.*$gdb_prompt $" { pass "ldm_stm_tests" } - -re "$gdb_prompt $" { fail "ldm_stm_tests" } - timeout { fail "(timeout) ldm_stm_tests" } - } -} - -proc all_movfpe_movtpe_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/2i movfpe_movtpe_tests\n" - gdb_expect { - -re " -.*movfpe\t@0x1234:16,r2l.* -.*movtpe\tr2l,@0x1234:16.* -.*$gdb_prompt $" { pass "movfpe_movtpe_tests" } - -re "$gdb_prompt $" { fail "movfpe_movtpe_tests" } - timeout { fail "(timeout) movfpe_movtpe_tests" } - } -} - -proc all_add_sub_addx_subx_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/15i add_sub_addx_subx_tests\n" - gdb_expect { - -re " -.*add.b\t#0x12,r0l.* -.*add.b\tr1l,r1h.* -.*add.w\t#0x1234,r2.* -.*add.w\tr3,r4.* -.*add.l\t#0x12345678,er5.* -.*add.l\ter6,er7.* -.*sub.b\tr1l,r1h.* -.*sub.w\t#0x1234,r2.* -.*sub.w\tr3,r4.* -.*sub.l\t#0x12345678,er5.* -.*sub.l\ter6,er7.* -.*addx\t#0x12,r0l.* -.*addx\tr1l,r1h.* -.*subx\t#0x12,r0l.* -.*subx\tr1l,r1h.* -.*$gdb_prompt $" { pass "add_sub_addx_subx_tests" } - -re "$gdb_prompt $" { fail "add_sub_addx_subx_tests" } - timeout { fail "(timeout) add_sub_addx_subx_tests" } - } -} - -proc all_inc_dec_adds_subs_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/16i inc_dec_adds_subs_tests\n" - gdb_expect { - -re " -.*inc.b\tr0l.* -.*inc.w\t#0x1,r4.* -.*inc.w\t#0x2,r3.* -.*inc.l\t#0x1,er2.* -.*inc.l\t#0x2,er1.* -.*dec.b\tr0l.* -.*dec.w\t#0x1,r4.* -.*dec.w\t#0x2,r3.* -.*dec.l\t#0x1,er2.* -.*dec.l\t#0x2,er1.* -.*adds\t#0x1,er7.* -.*adds\t#0x2,er6.* -.*adds\t#0x4,er5.* -.*subs\t#0x1,er7.* -.*subs\t#0x2,er6.* -.*subs\t#0x4,er5.* -.*$gdb_prompt $" { pass "inc_dec_adds_subs_tests" } - -re "$gdb_prompt $" { fail "inc_dec_adds_subs_tests" } - timeout { fail "(timeout) inc_dec_adds_subs_tests" } - } -} - -proc all_daa_das_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/2i daa_das_tests\n" - gdb_expect { - -re " -.*daa\tr0l.* -.*das\tr0h.* -.*$gdb_prompt $" { pass "daa_das_tests" } - -re "$gdb_prompt $" { fail "daa_das_tests" } - timeout { fail "(timeout) daa_das_tests" } - } -} - -proc all_mul_div_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/8i mul_div_tests\n" - gdb_expect { - -re " -.*mulxs.b\tr0l,r1.* -.*mulxs.w\tr2,er3.* -.*mulxu.b\tr0l,e1.* -.*mulxu.w\te2,er3.* -.*divxs.b\tr0l,r1.* -.*divxs.w\tr2,er3.* -.*divxu.b\tr0l,e1.* -.*divxu.w\te2,er3.* -.*$gdb_prompt $" { pass "mul_div_tests" } - -re "$gdb_prompt $" { fail "mul_div_tests" } - timeout { fail "(timeout) mul_div_tests" } - } -} - -proc all_cmp_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/8i cmp_tests\n" - gdb_expect { - -re " -.*cmp.b\t#0x12,r0l.* -.*cmp.b\tr1l,r1h.* -.*cmp.w\t#0x1234,r2.* -.*cmp.w\tr3,e3.* -.*cmp.l\t#0x12345678,er4.* -.*cmp.l\ter5,er6.* -.*$gdb_prompt $" { pass "cmp_tests" } - -re "$gdb_prompt $" { fail "cmp_tests" } - timeout { fail "(timeout) cmp_tests" } - } -} - -proc all_neg_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/3i neg_tests\n" - gdb_expect { - -re " -.*neg.b\tr0l.* -.*neg.w\tr2.* -.*neg.l\ter3.* -.*$gdb_prompt $" { pass "neg_tests" } - -re "$gdb_prompt $" { fail "neg_tests" } - timeout { fail "(timeout) neg_tests" } - } -} - -proc all_ext_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/4i ext_tests\n" - gdb_expect { - -re " -.*exts.w\tr0.* -.*exts.l\ter1.* -.*extu.w\tr2.* -.*extu.l\ter3.* -.*$gdb_prompt $" { pass "ext_tests" } - -re "$gdb_prompt $" { fail "ext_tests" } - timeout { fail "(timeout) ext_tests" } - } -} - -proc all_tas_mac_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/7i tas_mac_tests\n" - gdb_expect { - -re " -.*tas\t@er0.* -.*mac\t@er1+,@er2+.* -.*clrmac.* -.*ldmac\ter4,mach.* -.*ldmac\ter5,macl.* -.*stmac\tmach,er6.* -.*stmac\tmacl,er7.* -.*$gdb_prompt $" { pass "tas_mac_tests" } - -re "$gdb_prompt $" { fail "tas_mac_tests" } - timeout { fail "(timeout) tas_mac_tests" } - } -} - -proc all_logic_operations_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/21i logic_operations_tests\n" - gdb_expect { - -re " -.*and.b\t#0x12,r0l.* -.*and.b\tr1l,r2h.* -.*and.w\t#0x1234,r0.* -.*and.w\tr1,r2.* -.*and.l\t#0x12345678,er0.* -.*and.l\ter1,er2.* -.*or.b\t#0x12,r0l.* -.*or.b\tr1l,r2h.* -.*or.w\t#0x1234,r0.* -.*or.w\tr1,r2.* -.*or.l\t#0x12345678,er0.* -.*or.l\ter1,er2.* -.*xor.b\t#0x12,r0l.* -.*xor.b\tr1l,r2h.* -.*xor.w\t#0x1234,r0.* -.*xor.w\tr1,r2.* -.*xor.l\t#0x12345678,er0.* -.*xor.l\ter1,er2.* -.*not.b\tr0l.* -.*not.w\tr1.* -.*not.l\ter2.* -.*$gdb_prompt $" { pass "logic_operations_tests" } - -re "$gdb_prompt $" { fail "logic_operations_tests" } - timeout { fail "(timeout) logic_operations_tests" } - } -} - -proc all_sha_shl_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/12i sha_shl_tests\n" - gdb_expect { - -re " -.*shal\tr0l.* -.*shal\tr1.* -.*shal\ter2.* -.*shar\tr3l.* -.*shar\tr4.* -.*shar\ter5.* -.*shll\tr0l.* -.*shll\tr1.* -.*shll\ter2.* -.*shlr\tr3l.* -.*shlr\tr4.* -.*shlr\ter5.* -.*$gdb_prompt $" { pass "sha_shl_tests" } - -re "$gdb_prompt $" { fail "sha_shl_tests" } - timeout { fail "(timeout) sha_shl_tests" } - } -} - -proc all_rot_rotx_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/12i rot_rotx_tests\n" - gdb_expect { - -re " -.*rotl\tr0l.* -.*rotl\tr1.* -.*rotl\ter2.* -.*rotr\tr3l.* -.*rotr\tr4.* -.*rotr\ter5.* -.*rotxl\tr0l.* -.*rotxl\tr1.* -.*rotxl\ter2.* -.*rotxr\tr3l.* -.*rotxr\tr4.* -.*rotxr\ter5.* -.*$gdb_prompt $" { pass "rot_rotx_tests" } - -re "$gdb_prompt $" { fail "rot_rotx_tests" } - timeout { fail "(timeout) rot_rotx_tests" } - } -} - -proc all_bset_bclr_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/20i bset_bclr_tests\n" - gdb_expect { - -re " -.*bset\t#0x7,r0l.* -.*bset\t#0x6,@er1.* -.*bset\t#0x5,@0x12:8.* -.*bset\t#0x4,@0x1234:16.* -.*bset\t#0x3,@0x12345678:32.* -.*bset\tr7l,r0h.* -.*bset\tr6l,@er1.* -.*bset\tr5l,@0x12:8.* -.*bset\tr4l,@0x1234:16.* -.*bset\tr3l,@0x12345678:32.* -.*bclr\t#0x7,r0l.* -.*bclr\t#0x6,@er1.* -.*bclr\t#0x5,@0x12:8.* -.*bclr\t#0x4,@0x1234:16.* -.*bclr\t#0x3,@0x12345678:32.* -.*bclr\tr7h,r0h.* -.*bclr\tr6h,@er1.* -.*bclr\tr5h,@0x12:8.* -.*bclr\tr4h,@0x1234:16.* -.*bclr\tr3h,@0x12345678:32.* -.*$gdb_prompt $" { pass "bset_bclr_tests" } - -re "$gdb_prompt $" { fail "bset_bclr_tests" } - timeout { fail "(timeout) bset_bclr_tests" } - } -} - -proc all_bnot_btst_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/20i bnot_btst_tests\n" - gdb_expect { - -re " -.*bnot\t#0x7,r0l.* -.*bnot\t#0x6,@er1.* -.*bnot\t#0x5,@0x12:8.* -.*bnot\t#0x4,@0x1234:16.* -.*bnot\t#0x3,@0x12345678:32.* -.*bnot\tr7l,r0h.* -.*bnot\tr6l,@er1.* -.*bnot\tr5l,@0x12:8.* -.*bnot\tr4l,@0x1234:16.* -.*bnot\tr3l,@0x12345678:32.* -.*btst\t#0x7,r0l.* -.*btst\t#0x6,@er1.* -.*btst\t#0x5,@0x12:8.* -.*btst\t#0x4,@0x1234:16.* -.*btst\t#0x3,@0x12345678:32.* -.*btst\tr7h,r0h.* -.*btst\tr6h,@er1.* -.*btst\tr5h,@0x12:8.* -.*btst\tr4h,@0x1234:16.* -.*btst\tr3h,@0x12345678:32.* -.*$gdb_prompt $" { pass "bnot_btst_tests" } - -re "$gdb_prompt $" { fail "bnot_btst_tests" } - timeout { fail "(timeout) bnot_btst_tests" } - } -} - -proc all_band_bor_bxor_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/15i band_bor_bxor_tests\n" - gdb_expect { - -re " -.*band\t#0x7,r0l.* -.*band\t#0x6,@er1.* -.*band\t#0x5,@0x12:8.* -.*band\t#0x4,@0x1234:16.* -.*band\t#0x3,@0x12345678:32.* -.*bor\t#0x7,r0l.* -.*bor\t#0x6,@er1.* -.*bor\t#0x5,@0x12:8.* -.*bor\t#0x4,@0x1234:16.* -.*bor\t#0x3,@0x12345678:32.* -.*bxor\t#0x7,r0l.* -.*bxor\t#0x6,@er1.* -.*bxor\t#0x5,@0x12:8.* -.*bxor\t#0x4,@0x1234:16.* -.*bxor\t#0x3,@0x12345678:32.* -.*$gdb_prompt $" { pass "band_bor_bxor_tests" } - -re "$gdb_prompt $" { fail "band_bor_bxor_tests" } - timeout { fail "(timeout) band_bor_bxor_tests" } - } -} - -proc all_bld_bst_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/20i bld_bst_tests\n" - gdb_expect { - -re " -.*bld\t#0x7,r0l.* -.*bld\t#0x6,@er1.* -.*bld\t#0x5,@0x12:8.* -.*bld\t#0x4,@0x1234:16.* -.*bld\t#0x3,@0x12345678:32.* -.*bild\t#0x7,r0l.* -.*bild\t#0x6,@er1.* -.*bild\t#0x5,@0x12:8.* -.*bild\t#0x4,@0x1234:16.* -.*bild\t#0x3,@0x12345678:32.* -.*bst\t#0x7,r0l.* -.*bst\t#0x6,@er1.* -.*bst\t#0x5,@0x12:8.* -.*bst\t#0x4,@0x1234:16.* -.*bst\t#0x3,@0x12345678:32.* -.*bist\t#0x7,r0l.* -.*bist\t#0x6,@er1.* -.*bist\t#0x5,@0x12:8.* -.*bist\t#0x4,@0x1234:16.* -.*bist\t#0x3,@0x12345678:32.* -.*$gdb_prompt $" { pass "bld_bst_tests" } - -re "$gdb_prompt $" { fail "bld_bst_tests" } - timeout { fail "(timeout) bld_bst_tests" } - } -} - -proc all_branch_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/25i branch_tests\n" - gdb_expect { - -re " -.*bra\tbranch_tests.* -.*brn\tbranch_tests.* -.*bhi\tbranch_tests.* -.*bls\tbranch_tests.* -.*bcc\tbranch_tests.* -.*bcs\tbranch_tests.* -.*bne\tbranch_tests.* -.*beq\tbranch_tests.* -.*bvc\tbranch_tests.* -.*bvs\tbranch_tests.* -.*bpl\tbranch_tests.* -.*bmi\tbranch_tests.* -.*bge\tbranch_tests.* -.*blt\tbranch_tests.* -.*bgt\tbranch_tests.* -.*ble\tbranch_tests.* -.*jmp\t@er0.* -.*jmp\t@branch_tests.* -.*jmp\t@@0 (0).* -.*bsr\tbranch_tests.* -.*bsr\tbranch_tests.* -.*jsr\t@er0.* -.*jsr\t@branch_tests.* -.*jsr\t@@0 (0).* -.*rts.* -.*$gdb_prompt $" { pass "branch_tests" } - -re "$gdb_prompt $" { fail "branch_tests" } - timeout { fail "(timeout) branch_tests" } - } -} - -proc all_system_control_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/40i system_control_tests\n" - gdb_expect { - -re " -.*trapa\t#0x2.* -.*rte.* -.*sleep.* -.*ldc\t#0x12,ccr*. -.*ldc\tr3l,ccr.* -.*ldc\t@er0,ccr.* -.*ldc\t@\\(0x1234:16,er0\\),ccr.* -.*ldc\t@\\(0x12345678:32,er0\\),ccr.* -.*ldc\t@er1\\+,ccr.* -.*ldc\t@0x1234:16,ccr.* -.*ldc\t@0x12345678:32,ccr.* -.*stc\tccr,r3l.* -.*stc\tccr,@er0.* -.*stc\tccr,@\\(0x1234:16,er0\\).* -.*stc\tccr,@\\(0x12345678:32,er0\\).* -.*stc\tccr,@\\-er1.* -.*stc\tccr,@0x1234:16.* -.*stc\tccr,@0x12345678:32.* -.*andc\t#0x12,ccr.* -.*orc\t#0x34,ccr.* -.*xorc\t#0x56,ccr.* -.*ldc\t#0x12,exr*. -.*ldc\tr3l,exr.* -.*ldc\t@er0,exr.* -.*ldc\t@\\(0x1234:16,er0\\),exr.* -.*ldc\t@\\(0x12345678:32,er0\\),exr.* -.*ldc\t@er1\\+,exr.* -.*ldc\t@0x1234:16,exr.* -.*ldc\t@0x12345678:32,exr.* -.*stc\texr,r3l.* -.*stc\texr,@er0.* -.*stc\texr,@\\(0x1234:16,er0\\).* -.*stc\texr,@\\(0x12345678:32,er0\\).* -.*stc\texr,@\\-er1.* -.*stc\texr,@0x1234:16.* -.*stc\texr,@0x12345678:32.* -.*andc\t#0x12,exr.* -.*orc\t#0x34,exr.* -.*xorc\t#0x56,exr.* -.*nop.* -.*$gdb_prompt $" { pass "system_control_tests" } - -re "$gdb_prompt $" { fail "system_control_tests" } - timeout { fail "(timeout) system_control_tests" } - } -} - -proc all_block_data_transfer_tests { } { - global gdb_prompt - global hex - global decimal - - send_gdb "x/2i block_data_transfer_tests\n" - gdb_expect { - -re " -.*eepmov.b.* -.*eepmov.w.* -.*$gdb_prompt $" { pass "block_data_transfer_tests" } - -re "$gdb_prompt $" { fail "block_data_transfer_tests" } - timeout { fail "(timeout) block_data_transfer_tests" } - } -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -all_set_machine_h8300s -gdb_load $binfile - -# Data transfer -all_movb_tests -all_movw_tests -all_movl_tests -all_ldm_stm_tests -all_movfpe_movtpe_tests - -# Arithmetic operations -all_add_sub_addx_subx_tests -all_inc_dec_adds_subs_tests -all_daa_das_tests -all_mul_div_tests -all_cmp_tests -all_neg_tests -all_ext_tests -all_tas_mac_tests - -# Logic operations -all_logic_operations_tests - -# Shift -all_sha_shl_tests -all_rot_rotx_tests - -# Bit manipulation -all_bset_bclr_tests -all_bnot_btst_tests -all_band_bor_bxor_tests -all_bld_bst_tests - -# Branch -all_branch_tests - -# System control -all_system_control_tests - -# Block data transfer -all_block_data_transfer_tests diff --git a/gdb/testsuite/gdb.disasm/h8300s.s b/gdb/testsuite/gdb.disasm/h8300s.s deleted file mode 100644 index ec66a55a002..00000000000 --- a/gdb/testsuite/gdb.disasm/h8300s.s +++ /dev/null @@ -1,356 +0,0 @@ - .h8300s - .section .text - .align 2 - .global _main - .global movb_tests - .global movw_tests - .global movl_tests - .global ldm_stm_tests - .global movfpe_movtpe_tests - .global add_sub_addx_subx_tests - .global inc_dec_adds_subs_tests - .global daa_das_tests - .global mul_div_tests - .global cmp_tests - .global neg_tests - .global ext_tests - .global tas_mac_tests - .global logic_operations_tests - .global sha_shl_tests - .global rot_rotx_tests - .global bset_bclr_tests - .global bnot_btst_tests - .global band_bor_bxor_tests - .global bld_bst_tests - .global branch_tests - .global system_control_tests - .global block_data_transfer_tests -_main: - nop - -movb_tests: - mov.b r0l,r0h - mov.b #0x12,r1l - mov.b @er0,r1h - mov.b @(0x1234:16,er0),r2l - mov.b @(0x12345678:32,er0),r2h - mov.b @er0+,r3l - mov.b @0x12:8,r3h - mov.b @0x1234:16,r4l - mov.b @0x12345678:32,r4h - -movw_tests: - mov.w e0,r0 - mov.w #0x1234,r1 - mov.w @er0,r2 - mov.w @(0x1234:16,er0),r3 - mov.w @(0x12345678:32,er0),r4 - mov.w @er0+,r5 - mov.w @0x1234:16,r6 - mov.w @0x12345678:32,r7 - -movl_tests: - mov.l er0,er1 - mov.l #0x12345678,er1 - mov.l @er0,er2 - mov.l @(0x1234:16,er0),er3 - mov.l @(0x12345678:32,er0),er4 - mov.l @er0+,er5 - mov.l @0x1234:16,er6 - mov.l @0x12345678:32,er7 - -ldm_stm_tests: - ldm.l @sp+,er0-er1 - ldm.l @sp+,er0-er2 - ldm.l @sp+,er0-er3 - stm.l er0-er1,@-sp - stm.l er0-er2,@-sp - stm.l er0-er3,@-sp - -movfpe_movtpe_tests: - movfpe @0x1234:16,r2l - movtpe r2l,@0x1234:16 - -add_sub_addx_subx_tests: - add.b #0x12,r0l - add.b r1l,r1h - add.w #0x1234,r2 - add.w r3,r4 - add.l #0x12345678,er5 - add.l er6,er7 - sub.b r1l,r1h - sub.w #0x1234,r2 - sub.w r3,r4 - sub.l #0x12345678,er5 - sub.l er6,er7 - addx #0x12,r0l - addx r1l,r1h - subx #0x12,r0l - subx r1l,r1h - -inc_dec_adds_subs_tests: - inc.b r0l - inc.w #0x1,r4 - inc.w #0x2,r3 - inc.l #0x1,er2 - inc.l #0x2,er1 - dec.b r0l - dec.w #0x1,r4 - dec.w #0x2,r3 - dec.l #0x1,er2 - dec.l #0x2,er1 - adds #0x1,er7 - adds #0x2,er6 - adds #0x4,er5 - subs #0x1,er7 - subs #0x2,er6 - subs #0x4,er5 - -daa_das_tests: - daa r0l - das r0h - -mul_div_tests: - mulxs.b r0l,r1 - mulxs.w r2,er3 - mulxu.b r0l,e1 - mulxu.w e2,er3 - divxs.b r0l,r1 - divxs.w r2,er3 - divxu.b r0l,e1 - divxu.w e2,er3 - -cmp_tests: - cmp.b #0x12,r0l - cmp.b r1l,r1h - cmp.w #0x1234,r2 - cmp.w r3,e3 - cmp.l #0x12345678,er4 - cmp.l er5,er6 - -neg_tests: - neg.b r0l - neg.w r2 - neg.l er3 - -ext_tests: - exts.w r0 - exts.l er1 - extu.w r2 - extu.l er3 - -tas_mac_tests: - tas @er0 - mac @er1+,@er2+ - clrmac - ldmac er4,mach - ldmac er5,macl - stmac mach,er6 - stmac macl,er7 - -logic_operations_tests: - and.b #0x12,r0l - and.b r1l,r2h - and.w #0x1234,r0 - and.w r1,r2 - and.l #0x12345678,er0 - and.l er1,er2 - or.b #0x12,r0l - or.b r1l,r2h - or.w #0x1234,r0 - or.w r1,r2 - or.l #0x12345678,er0 - or.l er1,er2 - xor.b #0x12,r0l - xor.b r1l,r2h - xor.w #0x1234,r0 - xor.w r1,r2 - xor.l #0x12345678,er0 - xor.l er1,er2 - not.b r0l - not.w r1 - not.l er2 - -sha_shl_tests: - shal r0l - shal r1 - shal er2 - shar r3l - shar r4 - shar er5 - shll r0l - shll r1 - shll er2 - shlr r3l - shlr r4 - shlr er5 - -rot_rotx_tests: - rotl r0l - rotl r1 - rotl er2 - rotr r3l - rotr r4 - rotr er5 - rotxl r0l - rotxl r1 - rotxl er2 - rotxr r3l - rotxr r4 - rotxr er5 - -bset_bclr_tests: - bset #0x7,r0l - bset #0x6,@er1 - bset #0x5,@0x12:8 - bset #0x4,@0x1234:16 - bset #0x3,@0x12345678:32 - bset r7l,r0h - bset r6l,@er1 - bset r5l,@0x12:8 - bset r4l,@0x1234:16 - bset r3l,@0x12345678:32 - bclr #0x7,r0l - bclr #0x6,@er1 - bclr #0x5,@0x12:8 - bclr #0x4,@0x1234:16 - bclr #0x3,@0x12345678:32 - bclr r7h,r0h - bclr r6h,@er1 - bclr r5h,@0x12:8 - bclr r4h,@0x1234:16 - bclr r3h,@0x12345678:32 - -bnot_btst_tests: - bnot #0x7,r0l - bnot #0x6,@er1 - bnot #0x5,@0x12:8 - bnot #0x4,@0x1234:16 - bnot #0x3,@0x12345678:32 - bnot r7l,r0h - bnot r6l,@er1 - bnot r5l,@0x12:8 - bnot r4l,@0x1234:16 - bnot r3l,@0x12345678:32 - btst #0x7,r0l - btst #0x6,@er1 - btst #0x5,@0x12:8 - btst #0x4,@0x1234:16 - btst #0x3,@0x12345678:32 - btst r7h,r0h - btst r6h,@er1 - btst r5h,@0x12:8 - btst r4h,@0x1234:16 - btst r3h,@0x12345678:32 - -band_bor_bxor_tests: - band #0x7,r0l - band #0x6,@er1 - band #0x5,@0x12:8 - band #0x4,@0x1234:16 - band #0x3,@0x12345678:32 - bor #0x7,r0l - bor #0x6,@er1 - bor #0x5,@0x12:8 - bor #0x4,@0x1234:16 - bor #0x3,@0x12345678:32 - bxor #0x7,r0l - bxor #0x6,@er1 - bxor #0x5,@0x12:8 - bxor #0x4,@0x1234:16 - bxor #0x3,@0x12345678:32 - -bld_bst_tests: - bld #0x7,r0l - bld #0x6,@er1 - bld #0x5,@0x12:8 - bld #0x4,@0x1234:16 - bld #0x3,@0x12345678:32 - bild #0x7,r0l - bild #0x6,@er1 - bild #0x5,@0x12:8 - bild #0x4,@0x1234:16 - bild #0x3,@0x12345678:32 - bst #0x7,r0l - bst #0x6,@er1 - bst #0x5,@0x12:8 - bst #0x4,@0x1234:16 - bst #0x3,@0x12345678:32 - bist #0x7,r0l - bist #0x6,@er1 - bist #0x5,@0x12:8 - bist #0x4,@0x1234:16 - bist #0x3,@0x12345678:32 - -branch_tests: - bra branch_tests - brn branch_tests - bhi branch_tests - bls branch_tests - bcc branch_tests - bcs branch_tests - bne branch_tests - beq branch_tests - bvc branch_tests - bvs branch_tests - bpl branch_tests - bmi branch_tests - bge branch_tests - blt branch_tests - bgt branch_tests - ble branch_tests - jmp @er0 - jmp @branch_tests - jmp @@0 (0) - bsr @branch_tests:8 - bsr @branch_tests:16 - jsr @er0 - jsr @branch_tests - jsr @@0 (0) - rts - -system_control_tests: - trapa #0x2 - rte - sleep - ldc #0x12,ccr - ldc r3l,ccr - ldc @er0,ccr - ldc @(0x1234:16,er0),ccr - ldc @(0x12345678:32,er0),ccr - ldc @er1+,ccr - ldc @0x1234:16,ccr - ldc @0x12345678:32,ccr - stc ccr,r3l - stc ccr,@er0 - stc ccr,@(0x1234:16,er0) - stc ccr,@(0x12345678:32,er0) - stc ccr,@-er1 - stc ccr,@0x1234:16 - stc ccr,@0x12345678:32 - andc #0x12,ccr - orc #0x34,ccr - xorc #0x56,ccr - ldc #0x12,exr - ldc r3l,exr - ldc @er0,exr - ldc @(0x1234:16,er0),exr - ldc @(0x12345678:32,er0),exr - ldc @er1+,exr - ldc @0x1234:16,exr - ldc @0x12345678:32,exr - stc exr,r3l - stc exr,@er0 - stc exr,@(0x1234:16,er0) - stc exr,@(0x12345678:32,er0) - stc exr,@-er1 - stc exr,@0x1234:16 - stc exr,@0x12345678:32 - andc #0x12,exr - orc #0x34,exr - xorc #0x56,exr - nop - -block_data_transfer_tests: - eepmov.b - eepmov.w diff --git a/gdb/testsuite/gdb.mi/ChangeLog b/gdb/testsuite/gdb.mi/ChangeLog-mi similarity index 77% rename from gdb/testsuite/gdb.mi/ChangeLog rename to gdb/testsuite/gdb.mi/ChangeLog-mi index cbd4462a347..e055bb1db61 100644 --- a/gdb/testsuite/gdb.mi/ChangeLog +++ b/gdb/testsuite/gdb.mi/ChangeLog-mi @@ -1,125 +1,3 @@ -2001-06-27 Andrew Cagney - - * mi-disassemble.exp: Update to accept mi1 breakpoint tables. - * mi-basics.exp: Ditto. - * mi-simplerun.exp: Ditto. - * mi-watch.exp: Ditto. Add check for full header. - * mi-break.exp: Ditto. Add check for full header. - -2001-06-26 Andrew Cagney - - * mi-stack.exp: Update. Output for args=... and - locals=... changed to a list. - -2001-06-26 Andrew Cagney - - * mi-stack.exp: Update. Output for stack=..., args=... and - stack-args=... changed to a list. - -2001-06-25 Andrew Cagney - - * mi-console.exp: Update args=... part of stop-reason - patterns. Output changed to a list of arguments. - * mi-disassemble.exp: Ditto. - * mi-simplerun.exp: Ditto. - * mi-return.exp: Ditto. - * mi-read-memory.exp: Ditto. - * mi-eval.exp: Ditto. - * mi-watch.exp: Ditto. - * mi-var-display.exp: Ditto. - * mi-var-cmd.exp: Ditto. - * mi-var-child.exp: Ditto. - * mi-var-block.exp: Ditto. - * mi-until.exp: Ditto. - * mi-stepi.exp: Ditto. - * mi-stack.exp: Ditto. - * mi-regs.exp: Ditto. - -2001-06-25 Andrew Cagney - - * mi-read-memory.exp: Update patterns matching data-read-memory. - Outputs a list. - -2001-06-25 Andrew Cagney - - * mi-regs.exp: Update patterns matching register-values. Outputs a - list. - -2001-06-25 Andrew Cagney - - * mi-regs.exp: Update patters matching register-names. Now - outputs a list. - -2001-06-25 Andrew Cagney - - * mi-regs.exp: Update patterns matching changed-registers. Now - outputs a list. - -2001-06-23 Andrew Cagney - - * ChangeLog-mi: Rename to ChangeLog. - * mi-basics.exp: Remove local emacs variable defining - change-log-default-name. - * mi-break.exp, mi-console.exp, mi-disassemble.exp: Ditto. - * mi-eval.exp, mi-hack-cli.exp, mi-read-memory.exp: Ditto. - * mi-regs.exp, mi-return.exp, mi-simplerun.exp: Ditto. - * mi-stack.exp, mi-stepi.exp, mi-until.exp: Ditto. - * mi-var-block.exp, mi-var-child.exp, mi-var-cmd.exp: Ditto. - * mi-var-display.exp, mi-watch.exp, mi0-basics.exp: Ditto. - * mi0-break.exp, mi0-console.exp, mi0-disassemble.exp: Ditto. - * mi0-eval.exp, mi0-hack-cli.exp, mi0-read-memory.exp: Ditto. - * mi0-regs.exp, mi0-return.exp, mi0-simplerun.exp: Ditto. - * mi0-stack.exp, mi0-stepi.exp, mi0-until.exp: Ditto. - * mi0-var-block.exp, mi0-var-child.exp, mi0-var-cmd.exp: Ditto. - * mi0-var-display.exp, mi0-watch.exp: Ditto. - -2001-06-23 Andrew Cagney - - * mi-disassemble.exp: Update patterns matching data-disassemble - output. Now produces a list of instructions and a list of - source/assembly lines. - -2001-06-18 Andrew Cagney - - * mi-basics.exp, mi-break.exp, mi-console.exp, mi-disassemble.exp, - mi-eval.exp, mi-hack-cli.exp, mi-read-memory.exp, mi-regs.exp, - mi-return.exp, mi-simplerun.exp, mi-stack.exp, mi-stepi.exp, - mi-until.exp, mi-var-block.exp, mi-var-child.exp, mi-var-cmd.exp, - mi-var-display.exp, mi-watch.exp, mi0-basics.exp, mi0-break.exp, - mi0-console.exp, mi0-disassemble.exp, mi0-eval.exp, - mi0-hack-cli.exp, mi0-read-memory.exp, mi0-regs.exp, - mi0-return.exp, mi0-simplerun.exp, mi0-stack.exp, mi0-stepi.exp, - mi0-until.exp, mi0-var-block.exp, mi0-var-child.exp, - mi0-var-cmd.exp, mi0-var-display.exp, mi0-watch.exp: Use MIFLAGS - to explictly select an interpreter. - -2001-06-16 Andrew Cagney - - MI0 was the never enabled MI interface included in GDB 5.0. - * mi0-basics.exp: Copy mi-basics.exp. - * mi0-break.exp: Copy mi-break.exp. - * mi0-console.exp: Copy mi-console.exp. - * mi0-disassemble.exp: Copy mi-disassemble.exp. - * mi0-eval.exp: Copy mi-eval.exp. - * mi0-hack-cli.exp: Copy mi-hack-cli.exp. - * mi0-read-memory.exp: Copy mi-read-memory.exp. - * mi0-regs.exp: Copy mi-regs.exp. - * mi0-return.exp: Copy mi-return.exp. - * mi0-simplerun.exp: Copy mi-simplerun.exp. - * mi0-stack.exp: Copy mi-stack.exp. - * mi0-stepi.exp: Copy mi-stepi.exp. - * mi0-until.exp: Copy mi-until.exp. - * mi0-var-block.exp: Copy mi-var-block.exp. - * mi0-var-child.exp: Copy mi-var-child.exp. - * mi0-var-cmd.exp: Copy mi-var-cmd.exp. - * mi0-var-display.exp: Copy mi-var-display.exp. - * mi0-watch.exp: Copy mi-watch.exp. - -2001-05-11 Fernando Nasser - - * mi-var-child.exp: Adjust for the fact that now (char *) can be - dereferenced. - 2001-03-06 Kevin Buettner * mi-basics.exp, mi-break.exp, mi-disassemble.exp, diff --git a/gdb/testsuite/gdb.mi/mi-basics.exp b/gdb/testsuite/gdb.mi/mi-basics.exp index 4913d8f8b35..41ce7925269 100644 --- a/gdb/testsuite/gdb.mi/mi-basics.exp +++ b/gdb/testsuite/gdb.mi/mi-basics.exp @@ -30,7 +30,6 @@ # load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -139,7 +138,7 @@ proc test_breakpoints_deletion {} { "break-delete (all) operation" mi_gdb_test "201-break-list" \ - ".*\\\^done,BreakpointTable=\\\{.*,body=\\\[\\\]\\\}" \ + ".*\\\^done,BreakpointTable=\\\{\\\}" \ "all breakpoints removed" } @@ -172,3 +171,7 @@ if [test_mi_interpreter_selection] { mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp index 5cbe4e40d2e..8ac38ea0a61 100644 --- a/gdb/testsuite/gdb.mi/mi-break.exp +++ b/gdb/testsuite/gdb.mi/mi-break.exp @@ -29,7 +29,6 @@ # load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -79,7 +78,7 @@ proc test_tbreak_creation_and_listing {} { "insert temp breakpoint at \"\":6 (callee4)" mi_gdb_test "666-break-list" \ - "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}.*\\\]\}" \ + "666\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \ "list of breakpoints" mi_gdb_test "777-break-delete" \ @@ -123,7 +122,7 @@ proc test_rbreak_creation_and_listing {} { setup_xfail "*-*-*" mi_gdb_test "166-break-list" \ - "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\\\]\}" \ + "166\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \ "list of breakpoints" mi_gdb_test "177-break-delete" \ @@ -136,3 +135,7 @@ test_rbreak_creation_and_listing mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: diff --git a/gdb/testsuite/gdb.mi/mi-console.exp b/gdb/testsuite/gdb.mi/mi-console.exp index 11d9cb31362..04ee84166b9 100644 --- a/gdb/testsuite/gdb.mi/mi-console.exp +++ b/gdb/testsuite/gdb.mi/mi-console.exp @@ -33,7 +33,6 @@ # remote target. load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -57,7 +56,7 @@ mi_gdb_test "200-break-insert main" \ "break-insert operation" mi_run_cmd gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*mi-console.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" { + -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*mi-console.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" { pass "run to main" } timeout { @@ -107,3 +106,7 @@ gdb_expect { mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: diff --git a/gdb/testsuite/gdb.mi/mi-disassemble.exp b/gdb/testsuite/gdb.mi/mi-disassemble.exp index 9d6fbc5398d..75f097d1f7e 100644 --- a/gdb/testsuite/gdb.mi/mi-disassemble.exp +++ b/gdb/testsuite/gdb.mi/mi-disassemble.exp @@ -25,7 +25,6 @@ # load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -61,7 +60,7 @@ proc test_breakpoints_creation_and_listing {} { "break-insert operation" mi_gdb_test "204-break-list" \ - "204\\^done,BreakpointTable=\{.*,body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}\\\]\}" \ + "204\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}\}" \ "list of breakpoints" } @@ -80,7 +79,7 @@ proc test_running_the_program {} { mi_run_cmd # The running part has been checked already by mi_run_cmd gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" { + -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" { pass "run to main" } -re ".*$mi_gdb_prompt$" {fail "run to main (2)"} @@ -100,11 +99,11 @@ proc test_disassembly_only {} { mi_gdb_test "print/x \$pc" "" "" mi_gdb_test "111-data-disassemble -s \$pc -e \"\$pc + 12\" -- 0" \ - "111\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\},\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\]" \ + "111\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\},\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\}" \ "data-disassemble from pc to pc+12 assembly only" mi_gdb_test "222-data-disassemble -f basics.c -l 32 -- 0" \ - "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \ + "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \ "data-disassemble file & line, assembly only" } @@ -121,15 +120,15 @@ proc test_disassembly_lines_limit {} { mi_gdb_test "print/x \$pc" "" "" mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 20 -- 0" \ - "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \ + "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \ "data-disassemble file, line, number assembly only" mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 0 -- 0" \ - "222\\^done,asm_insns=\\\[\\\]" \ + "222\\^done,asm_insns=\{\}" \ "data-disassemble file, line, number (zero lines) assembly only" mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 50 -- 0" \ - "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \ + "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \ "data-disassemble file, line, number (more than main lines) assembly only" } @@ -145,7 +144,7 @@ proc test_disassembly_mixed {} { # -data-disassembly -s $pc -e "$pc+8" -- 1 mi_gdb_test "002-data-disassemble -f basics.c -l 21 -- 1" \ - "002\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"21\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"callee2\",offset=\"0\",inst=\".*\"\}.*\\\]\}.*,src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[.*\{address=\"$hex\",func-name=\"callee2\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\\\]" \ + "002\\^done,asm_insns=\{src_and_asm_line=\{line=\"21\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"callee2\",offset=\"0\",inst=\".*\"\}.*\}\},.*,src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{.*\{address=\"$hex\",func-name=\"callee2\",offset=\"$decimal\",inst=\".*\"\}\}\}\}" \ "data-disassemble file, line assembly mixed" # @@ -154,7 +153,7 @@ proc test_disassembly_mixed {} { # which we are now, even if we have specified that the range is only 2 insns. # mi_gdb_test "003-data-disassemble -s \$pc -e \"\$pc+4\" -- 1" \ - "003\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\\\]" \ + "003\\^done,asm_insns=\{src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}\}\}" \ "data-disassemble range assembly mixed" } @@ -171,15 +170,15 @@ proc test_disassembly_mixed_lines_limit {} { mi_gdb_test "print/x \$pc" "" "" mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 20 -- 1" \ - "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\]" \ + "222\\^done,asm_insns=\{src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\}" \ "data-disassemble file, line, number assembly mixed" mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 0 -- 1" \ - "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"31\",file=\".*basics.c\",line_asm_insn=\\\[\\\]\}\\\]" \ + "222\\^done,asm_insns=\{src_and_asm_line=\{line=\"31\",file=\".*basics.c\",line_asm_insn=\{\}\}\}" \ "data-disassemble file, line, number (zero lines) assembly mixed" mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 50 -- 1" \ - "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\}.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\]" \ + "222\\^done,asm_insns=\{src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\}" \ "data-disassemble file, line, number (more than main lines) assembly mixed" } @@ -222,3 +221,7 @@ test_disassembly_mixed_lines_limit mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: diff --git a/gdb/testsuite/gdb.mi/mi-eval.exp b/gdb/testsuite/gdb.mi/mi-eval.exp index 641d768b3a1..542d31dc9b8 100644 --- a/gdb/testsuite/gdb.mi/mi-eval.exp +++ b/gdb/testsuite/gdb.mi/mi-eval.exp @@ -27,7 +27,6 @@ # load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -64,7 +63,7 @@ proc test_running_the_program {} { mi_run_cmd # The running part has been checked already by mi_run_cmd gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" \ + -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" \ { pass "run to callee4" } -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"} timeout {fail "run to callee4 (timeout 2)"} @@ -74,7 +73,7 @@ proc test_running_the_program {} { gdb_expect { -re "101\\^running\r\n$mi_gdb_prompt" { gdb_expect { - -re "\[\r\n\]*101\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"9\"\}\r\n$mi_gdb_prompt$" \ + -re "\[\r\n\]*101\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"9\"\}\r\n$mi_gdb_prompt$" \ { pass "next in callee4" } -re ".*$mi_gdb_prompt$" {fail "next in callee4 (2)"} timeout {fail "next in callee4 (timeout 2)"} @@ -99,3 +98,8 @@ mi_gdb_test "511-data-evaluate-expression \"A + 3\"" "511\\^done,value=\"4\"" "e mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: + diff --git a/gdb/testsuite/gdb.mi/mi-hack-cli.exp b/gdb/testsuite/gdb.mi/mi-hack-cli.exp index 54b789ffd3c..44b7ff3ba62 100644 --- a/gdb/testsuite/gdb.mi/mi-hack-cli.exp +++ b/gdb/testsuite/gdb.mi/mi-hack-cli.exp @@ -21,7 +21,6 @@ # Some basic checks for the CLI. load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -38,3 +37,7 @@ mi_gdb_test "47show architecture\n" \ mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: diff --git a/gdb/testsuite/gdb.mi/mi-read-memory.exp b/gdb/testsuite/gdb.mi/mi-read-memory.exp index 5185f5d41d8..871b1295f4f 100644 --- a/gdb/testsuite/gdb.mi/mi-read-memory.exp +++ b/gdb/testsuite/gdb.mi/mi-read-memory.exp @@ -30,7 +30,6 @@ # load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -52,7 +51,7 @@ send_gdb "101-exec-next\n" gdb_expect { -re "101\\^running\r\n$mi_gdb_prompt" { gdb_expect { - -re "\[\r\n\]*101\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*mi-read-memory.c\",line=\"20\"\}.*$mi_gdb_prompt$" \ + -re "\[\r\n\]*101\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*mi-read-memory.c\",line=\"20\"\}.*$mi_gdb_prompt$" \ { pass "do initialization" } -re ".*$mi_gdb_prompt$" {fail "do initialization (2)"} timeout {fail "do initialization (timeout 2)"} @@ -68,33 +67,37 @@ mi_gdb_test "1-data-read-memory" \ mi_gdb_test "2-data-read-memory bytes x 1 3 2" \ - "2\\^done,addr=\"$hex\",nr-bytes=\"6\",total-bytes=\"6\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x00\",\"0x01\"\\\]},{addr=\"$hex\",data=\\\[\"0x02\",\"0x03\"\\\]},{addr=\"$hex\",data=\\\[\"0x04\",\"0x05\"\\\]}\\\]" \ + "2\\^done,addr=\"$hex\",nr-bytes=\"6\",total-bytes=\"6\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0x00\",\"0x01\"}},{addr=\"$hex\",data={\"0x02\",\"0x03\"}},{addr=\"$hex\",data={\"0x04\",\"0x05\"}}}" \ "3x2, one byte" mi_gdb_test "9-data-read-memory -o -6 -- -0+bytes+6 x 1 3 2" \ - "9\\^done,addr=\"$hex\",nr-bytes=\"6\",total-bytes=\"6\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x00\",\"0x01\"\\\]},{addr=\"$hex\",data=\\\[\"0x02\",\"0x03\"\\\]},{addr=\"$hex\",data=\\\[\"0x04\",\"0x05\"\\\]}\\\]" \ + "9\\^done,addr=\"$hex\",nr-bytes=\"6\",total-bytes=\"6\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0x00\",\"0x01\"}},{addr=\"$hex\",data={\"0x02\",\"0x03\"}},{addr=\"$hex\",data={\"0x04\",\"0x05\"}}}" \ "3x2, one byte offset by -6" mi_gdb_test "3-data-read-memory \"(shorts + 128)\" x 2 1 2" \ - "3\\^done,addr=\"$hex\",nr-bytes=\"4\",total-bytes=\"4\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x0100\",\"0x0102\"\\\]}\\\]" \ + "3\\^done,addr=\"$hex\",nr-bytes=\"4\",total-bytes=\"4\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0x0100\",\"0x0102\"}}}" \ "expression in quotes" mi_gdb_test "4-data-read-memory bytes+16 x 1 8 4 x" \ - "4\\^done,addr=\"$hex\",nr-bytes=\"32\",total-bytes=\"32\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x10\",\"0x11\",\"0x12\",\"0x13\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x14\",\"0x15\",\"0x16\",\"0x17\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x18\",\"0x19\",\"0x1a\",\"0x1b\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x1c\",\"0x1d\",\"0x1e\",\"0x1f\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x20\",\"0x21\",\"0x22\",\"0x23\"\\\],ascii=\" !\\\\\"#\"},{addr=\"$hex\",data=\\\[\"0x24\",\"0x25\",\"0x26\",\"0x27\"\\\],ascii=\"\\$%&'\"},{addr=\"$hex\",data=\\\[\"0x28\",\"0x29\",\"0x2a\",\"0x2b\"\\\],ascii=\"().+\"},{addr=\"$hex\",data=\\\[\"0x2c\",\"0x2d\",\"0x2e\",\"0x2f\"\\\],ascii=\",-\./\"}\\\]" \ + "4\\^done,addr=\"$hex\",nr-bytes=\"32\",total-bytes=\"32\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0x10\",\"0x11\",\"0x12\",\"0x13\"},ascii=\"xxxx\"},{addr=\"$hex\",data={\"0x14\",\"0x15\",\"0x16\",\"0x17\"},ascii=\"xxxx\"},{addr=\"$hex\",data={\"0x18\",\"0x19\",\"0x1a\",\"0x1b\"},ascii=\"xxxx\"},{addr=\"$hex\",data={\"0x1c\",\"0x1d\",\"0x1e\",\"0x1f\"},ascii=\"xxxx\"},{addr=\"$hex\",data={\"0x20\",\"0x21\",\"0x22\",\"0x23\"},ascii=\" !\\\\\"#\"},{addr=\"$hex\",data={\"0x24\",\"0x25\",\"0x26\",\"0x27\"},ascii=\"\\$%&'\"},{addr=\"$hex\",data={\"0x28\",\"0x29\",\"0x2a\",\"0x2b\"},ascii=\"().+\"},{addr=\"$hex\",data={\"0x2c\",\"0x2d\",\"0x2e\",\"0x2f\"},ascii=\",-\./\"}}" \ "ascii and data" mi_gdb_test "5-data-read-memory shorts+64 d 2 1 1" \ - "5\\^done,addr=\"$hex\",nr-bytes=\"2\",total-bytes=\"2\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"128\"\\\]}\\\]" \ + "5\\^done,addr=\"$hex\",nr-bytes=\"2\",total-bytes=\"2\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"128\"}}}" \ "decimal" mi_gdb_test "6-data-read-memory shorts+64 o 2 1 1" \ - "6\\^done,addr=\"$hex\",nr-bytes=\"2\",total-bytes=\"2\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0200\"\\\]}\\\]" \ + "6\\^done,addr=\"$hex\",nr-bytes=\"2\",total-bytes=\"2\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0200\"}}}" \ "octal" mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: diff --git a/gdb/testsuite/gdb.mi/mi-regs.exp b/gdb/testsuite/gdb.mi/mi-regs.exp index edb2b239ff7..089b7679fae 100644 --- a/gdb/testsuite/gdb.mi/mi-regs.exp +++ b/gdb/testsuite/gdb.mi/mi-regs.exp @@ -27,7 +27,6 @@ load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -82,7 +81,7 @@ proc test_running_the_program {} { mi_run_cmd # The running part has been checked already by mi_run_cmd gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" { + -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" { pass "run to main" } -re ".*$mi_gdb_prompt$" {fail "run to main (2)"} @@ -116,51 +115,51 @@ proc sparc_register_tests { } { set float2 "\-?\[0-9\]+" mi_gdb_test "111-data-list-register-names" \ - "111\\^done,register-names=\\\[\"g0\",\"g1\",\"g2\",\"g3\",\"g4\",\"g5\",\"g6\",\"g7\",\"o0\",\"o1\",\"o2\",\"o3\",\"o4\",\"o5\",\"sp\",\"o7\",\"l0\",\"l1\",\"l2\",\"l3\",\"l4\",\"l5\",\"l6\",\"l7\",\"i0\",\"i1\",\"i2\",\"i3\",\"i4\",\"i5\",\"fp\",\"i7\",\"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\",\"y\",\"psr\",\"wim\",\"tbr\",\"pc\",\"npc\",\"fpsr\",\"cpsr\"\\\]" \ + "111\\^done,register-names=\{\"g0\",\"g1\",\"g2\",\"g3\",\"g4\",\"g5\",\"g6\",\"g7\",\"o0\",\"o1\",\"o2\",\"o3\",\"o4\",\"o5\",\"sp\",\"o7\",\"l0\",\"l1\",\"l2\",\"l3\",\"l4\",\"l5\",\"l6\",\"l7\",\"i0\",\"i1\",\"i2\",\"i3\",\"i4\",\"i5\",\"fp\",\"i7\",\"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\",\"y\",\"psr\",\"wim\",\"tbr\",\"pc\",\"npc\",\"fpsr\",\"cpsr\"\}" \ "list register names" mi_gdb_test "222-data-list-register-values x" \ - "222\\^done,register-values=\\\[\{number=\"0\",value=\"$hex\"\}.*\{number=\"71\",value=\"$hex\"\}\\\]" \ + "222\\^done,register-values=\{\{number=\"0\",value=\"$hex\"\}.*\{number=\"71\",value=\"$hex\"\}\}" \ "register values x" mi_gdb_test "333-data-list-register-values f" \ - "333\\^done,register-values=\\\[\{number=\"0\",value=\"$float\"\},\{number=\"1\",value=\"$float\"\},.*\{number=\"71\",value=\"$float\"\}\\\]" \ + "333\\^done,register-values=\{\{number=\"0\",value=\"$float\"\},\{number=\"1\",value=\"$float\"\},.*\{number=\"71\",value=\"$float\"\}\}" \ "register values f" mi_gdb_test "444-data-list-register-values d" \ - "444\\^done,register-values=\\\[\{number=\"0\",value=\"$decimal\"\}.*\{number=\"71\",value=\"$decimal\"\}\\\]" \ + "444\\^done,register-values=\{\{number=\"0\",value=\"$decimal\"\}.*\{number=\"71\",value=\"$decimal\"\}\}" \ "register values d" mi_gdb_test "555-data-list-register-values o" \ - "555\\^done,register-values=\\\[\{number=\"0\",value=\"$octal\"\}.*\{number=\"71\",value=\"$octal\"\}\\\]" \ + "555\\^done,register-values=\{\{number=\"0\",value=\"$octal\"\}.*\{number=\"71\",value=\"$octal\"\}\}" \ "register values o" mi_gdb_test "666-data-list-register-values t" \ - "666\\^done,register-values=\\\[\{number=\"0\",value=\"$binary\"\}.*\{number=\"71\",value=\"$binary\"\}\\\]" \ + "666\\^done,register-values=\{\{number=\"0\",value=\"$binary\"\}.*\{number=\"71\",value=\"$binary\"\}\}" \ "register values t" # On the sparc, registers 0-31 are int, 32-63 float, 64-71 int mi_gdb_test "777-data-list-register-values N" \ - "777\\^done,register-values=\\\[\{number=\"0\",value=\"$decimal\"\}.*\{number=\"31\",value=\"$decimal\"\},\{number=\"32\",value=\"$float\"\}.*\{number=\"63\",value=\"$float\"\},\{number=\"64\",value=\"$decimal\"\}.*\{number=\"71\",value=\"$decimal\"\}\\\]" \ + "777\\^done,register-values=\{\{number=\"0\",value=\"$decimal\"\}.*\{number=\"31\",value=\"$decimal\"\},\{number=\"32\",value=\"$float\"\}.*\{number=\"63\",value=\"$float\"\},\{number=\"64\",value=\"$decimal\"\}.*\{number=\"71\",value=\"$decimal\"\}\}" \ "register values N" mi_gdb_test "888-data-list-register-values r" \ - "888\\^done,register-values=\\\[\{number=\"0\",value=\"$hex\"\}.*\{number=\"71\",value=\"$hex\"\}\\\]" \ + "888\\^done,register-values=\{\{number=\"0\",value=\"$hex\"\}.*\{number=\"71\",value=\"$hex\"\}\}" \ "register values r" mi_gdb_test "999-data-list-register-names 68 69 70 71" \ - "999\\^done,register-names=\\\[\"pc\",\"npc\",\"fpsr\",\"cpsr\"\\\]" \ + "999\\^done,register-names=\{\"pc\",\"npc\",\"fpsr\",\"cpsr\"\}" \ "list names of some regs" mi_gdb_test "001-data-list-register-values x 68 69 70 71" \ - "001\\^done,register-values=\\\[\{number=\"68\",value=\"$hex\"\},\{number=\"69\",value=\"$hex\"\},\{number=\"70\",value=\"$hex\"\},\{number=\"71\",value=\"$hex\"\}\\\]" \ + "001\\^done,register-values=\{\{number=\"68\",value=\"$hex\"\},\{number=\"69\",value=\"$hex\"\},\{number=\"70\",value=\"$hex\"\},\{number=\"71\",value=\"$hex\"\}\}" \ "list values of some regs" # Don't know how useful this test is mi_gdb_test "002-data-list-changed-registers" \ - "002\\^done,changed-registers=\\\[\"1\",\"9\",\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"23\",\"24\",\"25\",\"26\",\"27\",\"28\",\"30\",\"31\",\"65\",\"68\",\"69\"\\\]" \ + "002\\^done,changed-registers=\{\"1\",\"9\",\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"23\",\"24\",\"25\",\"26\",\"27\",\"28\",\"30\",\"31\",\"65\",\"68\",\"69\"\}" \ "list changed registers" } @@ -175,3 +174,10 @@ if [istarget "sparc-*-*"] then { mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: + + + diff --git a/gdb/testsuite/gdb.mi/mi-return.exp b/gdb/testsuite/gdb.mi/mi-return.exp index f1cb6098fe5..57ea05ed25e 100644 --- a/gdb/testsuite/gdb.mi/mi-return.exp +++ b/gdb/testsuite/gdb.mi/mi-return.exp @@ -27,7 +27,6 @@ # load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -57,7 +56,7 @@ proc test_running_to_callee4 {} { mi_run_cmd gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" { + -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" { pass "run to callee4" } timeout { @@ -77,7 +76,7 @@ proc test_return_simple {} { send_gdb "111-exec-return\n" gdb_expect { - -re "111\\^done,frame=\{level=\"0 \",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"} + -re "111\\^done,frame=\{level=\"0 \",addr=\"$hex\",func=\"callee3\",args=\{.*\},file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"} -re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" } timeout { fail "return from callee4 now (timeout)" } @@ -89,3 +88,7 @@ test_return_simple mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: diff --git a/gdb/testsuite/gdb.mi/mi-simplerun.exp b/gdb/testsuite/gdb.mi/mi-simplerun.exp index 20ee341c669..636f60dbcca 100644 --- a/gdb/testsuite/gdb.mi/mi-simplerun.exp +++ b/gdb/testsuite/gdb.mi/mi-simplerun.exp @@ -29,7 +29,6 @@ # load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -78,7 +77,7 @@ proc test_breakpoints_creation_and_listing {} { "insert breakpoint at \"\":6 (callee4)" mi_gdb_test "204-break-list" \ - "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\\\]\}" \ + "204\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \ "list of breakpoints" mi_gdb_test "205-break-disable 2 3 4" \ @@ -86,7 +85,7 @@ proc test_breakpoints_creation_and_listing {} { "disabling of breakpoints" mi_gdb_test "206-break-info 2" \ - "206\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"2\",.*,enabled=\"n\",.*\}\\\]\}" \ + "206\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"2\",.*,enabled=\"n\",.*\}\}" \ "list of breakpoints, 16 disabled" } @@ -104,7 +103,7 @@ proc test_running_the_program {} { # The following is equivalent to a send_gdb "000-exec-run\n" mi_run_cmd gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" { + -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" { pass "run to main" } timeout { @@ -130,7 +129,7 @@ proc test_controlled_execution {} { # two prompts involved and this can lead to a race condition. send_gdb "220-exec-next\n" gdb_expect { - -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"33\"\}\r\n$mi_gdb_prompt$" { + -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"33\"\}\r\n$mi_gdb_prompt$" { pass "next at main" } timeout { @@ -143,7 +142,7 @@ proc test_controlled_execution {} { # NOTE: The ``\\\\\"'' is for \". send_gdb "221-exec-step\n" gdb_expect { - -re "221\\^running\r\n${mi_gdb_prompt}221\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee1\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument\.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\\\],file=\".*basics.c\",line=\"27\"\}\r\n$mi_gdb_prompt$" { + -re "221\\^running\r\n${mi_gdb_prompt}221\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee1\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument\.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\},file=\".*basics.c\",line=\"27\"\}\r\n$mi_gdb_prompt$" { pass "step at main" } timeout { @@ -155,7 +154,7 @@ proc test_controlled_execution {} { # we should look for the right thing here. send_gdb "222-exec-step 3\n" gdb_expect 30 { - -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" { + -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" { pass "step to callee4" } timeout { @@ -168,7 +167,7 @@ proc test_controlled_execution {} { # NOTE: The ``.'' is part of ``gdb-result-var="$1"'' send_gdb "223-exec-finish\n" gdb_expect 30 { - -re "223\\^running\r\n${mi_gdb_prompt}223\\*stopped,reason=\"function-finished\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"18\"\},gdb-result-var=\".1\",return-value=\"0\"\r\n$mi_gdb_prompt$" { + -re "223\\^running\r\n${mi_gdb_prompt}223\\*stopped,reason=\"function-finished\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee3\",args=\{.*\},file=\".*basics.c\",line=\"18\"\},gdb-result-var=\".1\",return-value=\"0\"\r\n$mi_gdb_prompt$" { pass "exec-finish" } timeout { @@ -225,3 +224,9 @@ test_program_termination mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: + + diff --git a/gdb/testsuite/gdb.mi/mi-stack.exp b/gdb/testsuite/gdb.mi/mi-stack.exp index 8b41551182e..045e981bc16 100644 --- a/gdb/testsuite/gdb.mi/mi-stack.exp +++ b/gdb/testsuite/gdb.mi/mi-stack.exp @@ -27,7 +27,6 @@ # load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -54,7 +53,7 @@ mi_gdb_test "200-break-insert callee4" \ mi_run_cmd # The running part has been checked already by mi_run_cmd gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" { + -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" { pass "run to callee4" } -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"} @@ -73,13 +72,13 @@ proc test_stack_frame_listing {} { # -stack-list-frames 1 3 mi_gdb_test "231-stack-list-frames" \ - "231\\^done,stack=\\\[frame=\{level=\"0 \",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4 \",addr=\"$hex\",func=\"main\",.*\}\\\]" \ + "231\\^done,stack=\{frame=\{level=\"0 \",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4 \",addr=\"$hex\",func=\"main\",.*\}\}" \ "stack frame listing" mi_gdb_test "232-stack-list-frames 1 1" \ - "232\\^done,stack=\\\[frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \ + "232\\^done,stack=\{frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\}\}" \ "stack frame listing 1 1" mi_gdb_test "233-stack-list-frames 1 3" \ - "233\\^done,stack=\\\[frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\}\\\]" \ + "233\\^done,stack=\{frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\}\}" \ "stack frame listing 1 3" mi_gdb_test "234-stack-list-frames 1" \ @@ -102,27 +101,27 @@ proc test_stack_args_listing {} { # -stack-list-arguments mi_gdb_test "231-stack-list-arguments 0" \ - "231\\^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=\\\[\\\]\}\\\]" \ + "231\\^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=\{\}\}\}" \ "stack args listing 0" mi_gdb_test "232-stack-list-arguments 0 1 1" \ - "232\\^done,stack-args=\\\[frame=\{level=\"1\",args=\\\[name=\"strarg\"\\\]\}\\\]" \ + "232\\^done,stack-args=\{frame=\{level=\"1\",args=\{name=\"strarg\"\}\}\}" \ "stack args listing 0 1 1" mi_gdb_test "233-stack-list-arguments 0 1 3" \ - "233\\^done,stack-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\"\\\]\}\\\]" \ + "233\\^done,stack-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\"\}\}\}" \ "stack args listing 0 1 3" mi_gdb_test "231-stack-list-arguments 1" \ - "231\\^done,stack-args=\\\[frame=\{level=\"0\",args=\\\[\\\]\},frame=\{level=\"1\",args=\\\[\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"2\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"3\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\\\]\},frame=\{level=\"4\",args=\\\[\\\]\}\\\]" \ + "231\\^done,stack-args=\{frame=\{level=\"0\",args=\{\}\},frame=\{level=\"1\",args=\{\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"2\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"3\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\}\},frame=\{level=\"4\",args=\{\}\}\}" \ "stack args listing 1" mi_gdb_test "232-stack-list-arguments 1 1 1" \ - "232\\^done,stack-args=\\\[frame=\{level=\"1\",args=\\\[\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\}\\\]" \ + "232\\^done,stack-args=\{frame=\{level=\"1\",args=\{\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\}\}" \ "stack args listing 1 1 1" mi_gdb_test "233-stack-list-arguments 1 1 3" \ - "233\\^done,stack-args=\\\[frame=\{level=\"1\",args=\\\[\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"2\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"3\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\\\]\}\\\]" \ + "233\\^done,stack-args=\{frame=\{level=\"1\",args=\{\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"2\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"3\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\}\}\}" \ "stack args listing 1 1 3" mi_gdb_test "234-stack-list-arguments" \ @@ -168,20 +167,20 @@ proc test_stack_locals_listing {} { # -stack-list-arguments mi_gdb_test "232-stack-list-locals 0" \ - "232\\^done,locals=\\\[name=\"A\",name=\"B\",name=\"C\"\\\]" \ + "232\\^done,locals=\{name=\"A\",name=\"B\",name=\"C\"\}" \ "stack locals listing 0" # step until A, B, C, have some reasonable values. send_gdb "-exec-next 3\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" { pass "next's in callee4" } timeout { fail "next in callee4 (timeout)" } } mi_gdb_test "232-stack-list-locals 1" \ - "232\\^done,locals=\\\[\{name=\"A\",value=\"1\"\},\{name=\"B\",value=\"2\"\},\{name=\"C\",value=\"3\"\}\\\]" \ + "232\\^done,locals=\{\{name=\"A\",value=\"1\"\},\{name=\"B\",value=\"2\"\},\{name=\"C\",value=\"3\"\}\}" \ "stack locals listing 1" mi_gdb_test "234-stack-list-locals" \ @@ -193,7 +192,7 @@ gdb_expect { "stack select frame 1" mi_gdb_test "232-stack-list-locals 1" \ - "232\\^done,locals=\\\[\\\]" \ + "232\\^done,locals=\{\}" \ "stack locals listing for new frame" # this should be a no-op @@ -203,7 +202,7 @@ gdb_expect { "stack select same frame" mi_gdb_test "232-stack-list-locals 1" \ - "232\\^done,locals=\\\[\\\]" \ + "232\\^done,locals=\{\}" \ "stack locals for same frame (level 1)" } @@ -216,3 +215,8 @@ test_stack_info_depth mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: + diff --git a/gdb/testsuite/gdb.mi/mi-stepi.exp b/gdb/testsuite/gdb.mi/mi-stepi.exp index 87c93af5903..a67d74248a4 100644 --- a/gdb/testsuite/gdb.mi/mi-stepi.exp +++ b/gdb/testsuite/gdb.mi/mi-stepi.exp @@ -27,7 +27,6 @@ # load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -57,7 +56,7 @@ proc test_running_to_main {} { mi_run_cmd gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" { + -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" { pass "run to main" } timeout { @@ -72,7 +71,7 @@ proc test_stepi_nexti {} { send_gdb "111-exec-step-instruction\n" gdb_expect { - -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" { + -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" { pass "step-instruction at main" } timeout { @@ -81,7 +80,7 @@ proc test_stepi_nexti {} { } send_gdb "222-exec-next-instruction\n" gdb_expect { - -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" { + -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" { pass "next-instruction at main" } timeout { @@ -90,7 +89,7 @@ proc test_stepi_nexti {} { } send_gdb "333-exec-next-instruction\n" gdb_expect { - -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" { + -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" { pass "next-instruction at main" } timeout { @@ -104,3 +103,8 @@ test_stepi_nexti mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: + diff --git a/gdb/testsuite/gdb.mi/mi-until.exp b/gdb/testsuite/gdb.mi/mi-until.exp index 57b92e2b090..cf3c21df1d2 100644 --- a/gdb/testsuite/gdb.mi/mi-until.exp +++ b/gdb/testsuite/gdb.mi/mi-until.exp @@ -27,7 +27,6 @@ # load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -57,7 +56,7 @@ proc test_running_to_foo {} { mi_run_cmd gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"10\"\}\r\n$mi_gdb_prompt$" { + -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"foo\",args=\{\},file=\".*until.c\",line=\"10\"\}\r\n$mi_gdb_prompt$" { pass "run to main" } timeout { @@ -75,7 +74,7 @@ proc test_until {} { send_gdb "111-exec-until\n" gdb_expect { - -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" { + -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"foo\",args=\{\},file=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" { pass "until after while loop" } timeout { @@ -85,7 +84,7 @@ proc test_until {} { send_gdb "222-exec-until 15\n" gdb_expect { - -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" { + -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"foo\",args=\{\},file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" { pass "until line number" } timeout { @@ -95,7 +94,7 @@ proc test_until {} { send_gdb "333-exec-until until.c:17\n" gdb_expect { - -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" { + -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"foo\",args=\{\},file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" { pass "until line number:file" } timeout { @@ -107,7 +106,7 @@ proc test_until {} { send_gdb "444-exec-until until.c:25\n" gdb_expect { - -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" { + -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" { pass "until after current function" } timeout { @@ -122,3 +121,7 @@ test_until mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: diff --git a/gdb/testsuite/gdb.mi/mi-var-block.exp b/gdb/testsuite/gdb.mi/mi-var-block.exp index 4b8eb95f938..539a58def6a 100644 --- a/gdb/testsuite/gdb.mi/mi-var-block.exp +++ b/gdb/testsuite/gdb.mi/mi-var-block.exp @@ -24,7 +24,6 @@ load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -49,7 +48,7 @@ mi_gdb_test "200-break-insert do_block_tests" \ mi_run_cmd # The running part has been checked already by mi_run_cmd gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"154\"\}\r\n$mi_gdb_prompt$" { + -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"154\"\}\r\n$mi_gdb_prompt$" { pass "run to do_block_tests" } -re ".*$mi_gdb_prompt$" {fail "run to do_block_tests (2)"} @@ -69,7 +68,7 @@ mi_gdb_test "-var-create foo * foo" \ # step to "foo = 123;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"158\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"158\"\}\r\n$mi_gdb_prompt$" { pass "step at do_block_tests" } timeout { @@ -93,7 +92,7 @@ mi_gdb_test "-var-create foo * foo" \ # step to "foo2 = 123;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"161\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"161\"\}\r\n$mi_gdb_prompt$" { pass "step at do_block_tests" } timeout { @@ -110,7 +109,7 @@ mi_gdb_test "-var-update *" \ # step to "foo = 321;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"164\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"164\"\}\r\n$mi_gdb_prompt$" { pass "step at do_block_tests" } timeout { @@ -127,7 +126,7 @@ mi_gdb_test "-var-create inner_foo * foo" \ # step to "foo2 = 0;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"166\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"166\"\}\r\n$mi_gdb_prompt$" { pass "step at do_block_tests" } timeout { fail "step at do_block_tests (timeout)" } @@ -165,7 +164,7 @@ mi_gdb_test "-var-delete inner_foo" \ # step to "foo = 0;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"168\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"168\"\}\r\n$mi_gdb_prompt$" { pass "step at do_block_tests" } timeout { fail "step at do_block_tests (timeout)" } @@ -182,7 +181,7 @@ clear_xfail *-*-* # step to "cb = 21;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"171\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"171\"\}\r\n$mi_gdb_prompt$" { pass "step at do_block_tests" } timeout { fail "step at do_block_tests (timeout)" } @@ -226,3 +225,9 @@ mi_gdb_test "-var-delete cb" \ mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: + + diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp index 397016837cc..9aafcedef34 100644 --- a/gdb/testsuite/gdb.mi/mi-var-child.exp +++ b/gdb/testsuite/gdb.mi/mi-var-child.exp @@ -24,7 +24,6 @@ load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -49,7 +48,7 @@ mi_gdb_test "200-break-insert do_children_tests" \ mi_run_cmd # The running part has been checked already by mi_run_cmd gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"190\"\}\r\n$mi_gdb_prompt$" { + -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"190\"\}\r\n$mi_gdb_prompt$" { pass "run to do_children_tests" } -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"} @@ -72,7 +71,7 @@ mi_gdb_test "-var-create struct_declarations * struct_declarations" \ # Test: c_variable-4.3 # Desc: children of struct_declarations mi_gdb_test "-var-list-children struct_declarations" \ - "\\^done,numchild=\"11\",children=\{child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \ + "\\^done,numchild=\"11\",children=\{child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"0\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \ "get children of struct_declarations" #gdbtk_test c_variable-4.3 {children of struct_declarations} { @@ -112,13 +111,13 @@ mi_gdb_test "-var-info-num-children struct_declarations.character" \ # Test: c_variable-4.9 # Desc: children of struct_declarations.char_ptr mi_gdb_test "-var-list-children struct_declarations.char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ + "\\^done,numchild=\"0\"" \ "get children of struct_declarations.char_ptr" # Test: c_variable-4.10 # Desc: number of children of struct_declarations.char_ptr mi_gdb_test "-var-info-num-children struct_declarations.char_ptr" \ - "\\^done,numchild=\"1\"" \ + "\\^done,numchild=\"0\"" \ "get number of children of struct_declarations.char_ptr" # Test: c_variable-4.11 @@ -205,7 +204,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_ptr" \ # Test: c_variable-4.23 # Desc: children of struct_declarations.u1 mi_gdb_test "-var-list-children struct_declarations.u1" \ - "\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.u1.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.u1.b\",exp=\"b\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.u1.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.u1.d\",exp=\"d\",numchild=\"0\",type=\"enum foo\"\}\}" \ + "\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.u1.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.u1.b\",exp=\"b\",numchild=\"0\",type=\"char \\*\"\},child=\{name=\"struct_declarations.u1.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.u1.d\",exp=\"d\",numchild=\"0\",type=\"enum foo\"\}\}" \ "get children of struct_declarations.u1" # Test: c_variable-4.24 @@ -354,13 +353,13 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1.a" \ # Test: c_variable-4.47 # Desc: children of struct_declarations.u1.b mi_gdb_test "-var-list-children struct_declarations.u1.b" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.u1.b.\\*b\",exp=\"\\*b\",numchild=\"0\",type=\"char\"\}\}" \ + "\\^done,numchild=\"0\"" \ "get children of struct_declarations.u1.b" # Test: c_variable-4.48 # Desc: number of children of struct_declarations.u1.b mi_gdb_test "-var-info-num-children struct_declarations.u1.b" \ - "\\^done,numchild=\"1\"" \ + "\\^done,numchild=\"0\"" \ "get number of children of struct_declarations.u1.b" # Test: c_variable-4.49 @@ -567,7 +566,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr.*int_ptr_ptr # Step to "struct_declarations.integer = 123;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"192\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"192\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -585,7 +584,7 @@ mi_gdb_test "-var-create weird * weird" \ # Test: c_variable-4.82 # Desc: children of weird mi_gdb_test "-var-list-children weird" \ - "\\^done,numchild=\"11\",children=\{child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \ + "\\^done,numchild=\"11\",children=\{child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"0\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \ "get children of weird" # Test: c_variable-4.83 @@ -774,7 +773,7 @@ mi_gdb_test "-var-update *" \ # Step over "struct_declarations.integer = 123;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"193\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"193\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -795,7 +794,7 @@ mi_gdb_test "-var-update *" \ send_gdb "-exec-step 3\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"196\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"196\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -806,13 +805,13 @@ gdb_expect { # Test: c_variable-5.3 # Desc: check that char_ptr changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ + "\\^done,changelist=\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ "update all vars struct_declarations.char_ptr" # Step over "struct_declarations.int_ptr_ptr = &foo;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"197\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"197\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -829,7 +828,7 @@ mi_gdb_test "-var-update *" \ # Step over "weird->long_array[0] = 1234;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"198\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"198\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -846,7 +845,7 @@ mi_gdb_test "-var-update *" \ # Step over "struct_declarations.long_array[1] = 2345;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"199\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"199\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -863,7 +862,7 @@ mi_gdb_test "-var-update *" \ # Step over "weird->long_array[2] = 3456;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"200\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"200\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -887,7 +886,7 @@ mi_gdb_test "-var-update *" \ # struct_declarations.long_array[9] = 1234; send_gdb "-exec-step 7\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"208\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"208\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -905,7 +904,7 @@ mi_gdb_test "-var-update *" \ # Step over "weird->func_ptr = nothing;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"211\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"211\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -921,7 +920,7 @@ mi_gdb_test "-var-update *" \ # Delete all variables mi_gdb_test "-var-delete struct_declarations" \ - "\\^done,ndeleted=\"65\"" \ + "\\^done,ndeleted=\"63\"" \ "delete var struct_declarations" mi_gdb_test "-var-delete weird->int_ptr_ptr" \ @@ -933,7 +932,7 @@ mi_gdb_test "-var-delete weird->int_ptr_ptr" \ # psnp = &snp0; send_gdb "-exec-step 43\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"254\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"254\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -974,13 +973,7 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr" \ # Test: c_variable-5.15 # Desc: children of *(*(psnp->char_ptr)) mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \ - "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" - -# Test: c_variable-5.15B -# Desc: children of *(*(*(psnp->char_ptr))) -mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ + "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char \\*\"\}\}" \ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" # Test: c_variable-5.16 @@ -992,26 +985,14 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ # Test: c_variable-5.17 # Desc: children of *(*(*(psnp->char_ptr))) mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ + "\\^done,numchild=\"0\"" \ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" # Test: c_variable-5.18 # Desc: number of children of *(*(*(psnp->char_ptr))) mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" - -# Test: c_variable-5.17B -# Desc: children of *(*(*(*(psnp->char_ptr)))) -mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \ "\\^done,numchild=\"0\"" \ - "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" - -# Test: c_variable-5.18B -# Desc: number of children of *(*(*(*(psnp->char_ptr)))) -mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \ - "\\^done,numchild=\"0\"" \ - "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" + "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" # Test: c_variable-5.19 @@ -1157,13 +1138,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr" \ # Test: c_variable-5.41 # Desc: children of **psnp->ptrs[0]->next->char_ptr mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \ - "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" - -# Test: c_variable-5.41B -# Desc: children of ***psnp->ptrs[0]->next->char_ptr -mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ + "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char \\*\"\}\}" \ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" # Test: c_variable-5.42 @@ -1175,24 +1150,12 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ # Test: c_variable-5.43 # Desc: children of ***psnp->ptrs[0]->next->char_ptr mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ + "\\^done,numchild=\"0\"" \ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" # Test: c_variable-5.44 # Desc: number of children of ***psnp->ptrs[0]->next->char_ptr mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" - -# Test: c_variable-5.43B -# Desc: children of ****psnp->ptrs[0]->next->char_ptr -mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \ - "\\^done,numchild=\"0\"" \ - "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" - -# Test: c_variable-5.44B -# Desc: number of children of ****psnp->ptrs[0]->next->char_ptr -mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \ "\\^done,numchild=\"0\"" \ "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" @@ -1211,7 +1174,7 @@ mi_gdb_test "-var-list-children psnp->ptrs.0.next.next.ptrs" \ # Step over "snp0.char_ptr = &b3;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"255\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"255\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -1222,13 +1185,13 @@ gdb_expect { # Test: c_variable-5.47 # Desc: check that psnp->char_ptr (and [0].char_ptr) changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ + "\\^done,changelist=\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ "update all vars psnp->char_ptr (and 0.char_ptr) changed" # Step over "snp1.char_ptr = &c3;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"256\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"256\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -1240,14 +1203,14 @@ gdb_expect { # Test: c_variable-5.48 # Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ + "\\^done,changelist=\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ "update all vars psnp->next->char_ptr (and 1.char_ptr) changed" # Step over "snp2.char_ptr = &a3;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"257\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"257\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -1266,7 +1229,7 @@ mi_gdb_test "-var-update *" \ # Step over "snp0.long_ptr = &y3;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"258\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"258\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -1284,7 +1247,7 @@ mi_gdb_test "-var-update *" \ # Step over "snp1.long_ptr = &x3;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"259\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"259\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -1309,7 +1272,7 @@ clear_xfail *-*-* # Step over "snp2.long_ptr = &z3;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" { pass "step at do_children_tests" } timeout { @@ -1329,3 +1292,7 @@ mi_gdb_test "-var-update *" \ mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp index 66b8cb663d1..f1fcedd26f4 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp @@ -24,7 +24,6 @@ load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -77,7 +76,7 @@ mi_gdb_test "200-break-insert do_locals_tests" \ mi_run_cmd # The running part has been checked already by mi_run_cmd gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"106\"\}\r\n$mi_gdb_prompt$" { + -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"106\"\}\r\n$mi_gdb_prompt$" { pass "run to do_locals_tests" } -re ".*$mi_gdb_prompt$" {fail "run todo_locals_tests (2)"} @@ -182,7 +181,7 @@ mi_gdb_test "-var-update *" \ # Step over "linteger = 1234;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"107\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"107\"\}\r\n$mi_gdb_prompt$" { pass "step at do_locals_tests" } timeout { @@ -199,7 +198,7 @@ mi_gdb_test "-var-update *" \ # Step over "lpinteger = &linteger;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"108\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"108\"\}\r\n$mi_gdb_prompt$" { pass "step at do_locals_tests" } timeout { @@ -216,7 +215,7 @@ mi_gdb_test "-var-update *" \ # Step over "lcharacter = 'a';" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"109\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"109\"\}\r\n$mi_gdb_prompt$" { pass "step at do_locals_tests" } timeout { @@ -233,7 +232,7 @@ mi_gdb_test "-var-update *" \ # Step over "lpcharacter = &lcharacter;" send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"110\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"110\"\}\r\n$mi_gdb_prompt$" { pass "step at do_locals_tests" } timeout { @@ -261,7 +260,7 @@ mi_gdb_test "-var-update *" \ send_gdb "-exec-step 9\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"119\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"119\"\}\r\n$mi_gdb_prompt$" { pass "step at do_locals_tests" } timeout { @@ -284,7 +283,7 @@ mi_gdb_test "-var-update *" \ send_gdb "-exec-step 4\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"125\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"125\"\}\r\n$mi_gdb_prompt$" { pass "step at do_locals_tests" } timeout { @@ -310,7 +309,7 @@ mi_gdb_test "-var-update *" \ send_gdb "-exec-step 8\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"133\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"133\"\}\r\n$mi_gdb_prompt$" { pass "step at do_locals_tests" } timeout { @@ -434,7 +433,7 @@ mi_gdb_test "-break-insert subroutine1" \ "break-insert subroutine1" send_gdb "-exec-continue\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\\\[\{name=\"i\",value=\"4321\"\},\{name=\"l\",value=\"$hex\"\}\\\],file=\".*var-cmd.c\",line=\"146\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\{\{name=\"i\",value=\"4321\"\},\{name=\"l\",value=\"$hex\"\}\},file=\".*var-cmd.c\",line=\"146\"\}\r\n$mi_gdb_prompt$" { pass "continue to subroutine1" } timeout { @@ -460,7 +459,7 @@ mi_gdb_test "-var-create linteger * linteger" \ send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\\\[\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}\\\],file=\".*var-cmd.c\",line=\"147\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\{\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}\},file=\".*var-cmd.c\",line=\"147\"\}\r\n$mi_gdb_prompt$" { pass "step at subroutine1" } timeout { @@ -483,7 +482,7 @@ clear_xfail *-*-* send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\\\[\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}\\\],file=\".*var-cmd.c\",line=\"148\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\{\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}\},file=\".*var-cmd.c\",line=\"148\"\}\r\n$mi_gdb_prompt$" { pass "step at subroutine1" } timeout { fail "step at subroutine1 (timeout)" } @@ -497,7 +496,7 @@ mi_gdb_test "-var-update *" \ send_gdb "-exec-step\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\\\[\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}\\\],file=\".*var-cmd.c\",line=\"149\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\{\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}\},file=\".*var-cmd.c\",line=\"149\"\}\r\n$mi_gdb_prompt$" { pass "step at subroutine1" } timeout { fail "step at subroutine1 (timeout)" } @@ -511,7 +510,7 @@ mi_gdb_test "-var-update *" \ send_gdb "-exec-next\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"136\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"136\"\}\r\n$mi_gdb_prompt$" { pass "next out of subroutine1" } timeout { fail "next out of subroutine1 (timeout)" } @@ -603,3 +602,8 @@ mi_gdb_test "-var-delete l" \ mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: + diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp index e84a1b7cca2..4f231d032f3 100644 --- a/gdb/testsuite/gdb.mi/mi-var-display.exp +++ b/gdb/testsuite/gdb.mi/mi-var-display.exp @@ -24,7 +24,6 @@ load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -49,7 +48,7 @@ mi_gdb_test "200-break-insert 260" \ mi_run_cmd # The running part has been checked already by mi_run_cmd gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" { + -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" { pass "run to do_children_tests" } -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"} @@ -330,7 +329,7 @@ mi_gdb_test "200-break-insert do_special_tests" \ send_gdb "-exec-continue\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"282\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\{\},file=\".*var-cmd.c\",line=\"282\"\}\r\n$mi_gdb_prompt$" { pass "continue to do_special_tests" } timeout { @@ -588,7 +587,7 @@ mi_gdb_test "200-break-insert incr_a" \ "break-insert operation" send_gdb "-exec-continue\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"85\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\{\{name=\"a\",value=\"2\.*\"\}\},file=\".*var-cmd.c\",line=\"85\"\}\r\n$mi_gdb_prompt$" { pass "continue to incr_a" } timeout { @@ -619,3 +618,11 @@ mi_gdb_test "-var-create a2 $fp a" \ mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: + + + + diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp index 7a09bd888f1..5b8908a8784 100644 --- a/gdb/testsuite/gdb.mi/mi-watch.exp +++ b/gdb/testsuite/gdb.mi/mi-watch.exp @@ -29,7 +29,6 @@ # load_lib mi-support.exp -set MIFLAGS "-i=mi" gdb_exit if [mi_gdb_start] { @@ -62,7 +61,7 @@ proc test_watchpoint_creation_and_listing {} { "break-watch operation" mi_gdb_test "222-break-list" \ - "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"1\"\},bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\"\}\\\]\}" \ + "222\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"1\"\},bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\"\}\}" \ "list of watchpoints" } @@ -83,7 +82,7 @@ proc test_awatch_creation_and_listing {} { "break-watch -a operation" mi_gdb_test "444-break-list" \ - "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\\\]\}" \ + "444\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \ "list of watchpoints awatch" mi_gdb_test "777-break-delete 3" \ @@ -107,7 +106,7 @@ proc test_rwatch_creation_and_listing {} { "break-insert -r operation" mi_gdb_test "300-break-list" \ - "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\\\}\}" \ + "300\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \ "list of breakpoints" mi_gdb_test "177-break-delete 4" \ @@ -133,7 +132,7 @@ proc test_running_the_program {} { mi_run_cmd # The running part has been checked already by mi_run_cmd gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" \ + -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" \ { pass "run to callee4" } -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"} timeout {fail "run to callee4 (timeout 2)"} @@ -154,7 +153,7 @@ proc test_watchpoint_triggering {} { gdb_expect { -re "222\\^running\r\n$mi_gdb_prompt" { gdb_expect { - -re "222\\*stopped,reason=\"watchpoint-trigger\",wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\},thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" { + -re "222\\*stopped,reason=\"watchpoint-trigger\",wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\},thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" { pass "watchpoint trigger" } -re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (2)"} @@ -169,7 +168,7 @@ proc test_watchpoint_triggering {} { gdb_expect { -re "223\\^running\r\n$mi_gdb_prompt" { gdb_expect { - -re "\[\r\n\]*223\\*stopped,reason=\"watchpoint-scope\",wpnum=\"2\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" { + -re "\[\r\n\]*223\\*stopped,reason=\"watchpoint-scope\",wpnum=\"2\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee3\",args=\{.*\},file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" { pass "wp out of scope" } -re ".*$mi_gdb_prompt$" {fail "wp out of scope (2)"} @@ -189,3 +188,8 @@ test_watchpoint_triggering mi_gdb_exit return 0 + +# Local variables: +# change-log-default-name: "ChangeLog-mi" +# End: + diff --git a/gdb/testsuite/gdb.mi/mi0-basics.exp b/gdb/testsuite/gdb.mi/mi0-basics.exp deleted file mode 100644 index d463244b816..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-basics.exp +++ /dev/null @@ -1,174 +0,0 @@ -# Copyright 1999, 2000 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 -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# -# test basic Machine interface (MI) operations -# -# Verify that, using the MI, we can load a program and do -# other basic things that are used by all test files through mi_gdb_exit, -# mi_gdb_start, mi_delete_breakpoints, mi_gdb_reinitialize_dir and -# mi_gdb_load, so we can safely use those. -# -# The goal is not to test gdb functionality, which is done by other tests, -# but the command syntax and correct output response to MI operations. -# - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "basics" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -# In this file we want to test if the operations needed by the following -# procedures work, so it makes no sense using them here. - -# mi_delete_breakpoints -# mi_gdb_reinitialize_dir $srcdir/$subdir -# mi_gdb_load ${binfile} - -# Test if the MI interpreter has been configured - -proc test_mi_interpreter_selection {} { - global mi_gdb_prompt - global gdb_prompt - - # All this test expects is to get the prompt back - # with no syntax error message - send_gdb "-gdb-version\n" - gdb_expect { - -re "GNU gdb .*\r\n$mi_gdb_prompt$" \ - { pass "acceptance of MI operations" - return 1} - -re ".*\r\n$mi_gdb_prompt$" \ - { fail "acceptance of MI operations" - note "Skipping all other MI tests." } - -re "Undefined command.*$gdb_prompt $" \ - { fail "acceptance of MI operations" - note "Skipping all other MI tests." } - -re ".*$gdb_prompt $" \ - { fail "acceptance of MI operations" - note "Skipping all other MI tests." } - timeout { fail "acceptance of MI operations (timeout)" - note "Skipping all other MI tests." } - } - return 0 -} - -proc test_exec_and_symbol_mi_operatons {} { - global mi_gdb_prompt - global binfile - - # Load symbols and specify executable on a single operation - # Tests: - # -file-exec-and-symbols - - # Can't use mi_gdb_test as if this doesn't work, - # we must give up on the whole test file - send_gdb "-file-exec-and-symbols ${binfile}\n" - gdb_expect { - -re "\[\r\n\]*\\\^done\r\n$mi_gdb_prompt$" \ - { pass "file-exec-and-symbols operation" } - timeout { fail "file-exec-and-symbols operation (timeout)" - note "Skipping all other MI tests." - return 0} - } - - # The following is not used by mi-support.exp, but we test here so - # we get done with loading a program basics. - - # Do it again, but now load symbols and specify executable with - # two separate operations - # Tests: - # -file-clear - # -file-exec-file - # -file-symbol-file - - # FIXME: file-clear is not implemented yet. -# mi_gdb_test "-file-clear" \ -# "\\\^done" \ -# "file-clear operation" - - mi_gdb_test "-file-exec-file ${binfile}" \ - "\\\^done" \ - "file-exec-file operation" - - mi_gdb_test "-file-symbol-file ${binfile}" \ - "\\\^done" \ - "file-symbol-file operation" - - # FIXME: if we cannot load we have to skip all other tests. -} - -proc test_breakpoints_deletion {} { - global mi_gdb_prompt - global srcfile - - # Clear all breakpoints and list to confirm - # Tests: - # -break-delete (all) - # -break-list - - # The all parameter is actually no parameter. - mi_gdb_test "200-break-delete" \ - "\\\^done" \ - "break-delete (all) operation" - - mi_gdb_test "201-break-list" \ - ".*\\\^done,BreakpointTable=\\\{\\\}" \ - "all breakpoints removed" -} - -proc test_dir_specification {} { - global mi_gdb_prompt - global srcdir - global subdir - - # Clear the search directories, then specify one to be searched - # Tests: - # -environment-directory - # -environment-directory arg - -#exp_internal 1 - mi_gdb_test "202-environment-directory" \ - "\\\^done" \ - "environment-directory operation" - - mi_gdb_test "203-environment-directory ${srcdir}/${subdir}" \ - "\\\^done" \ - "environment-directory arg operation" -#exp_internal 0 -} - -if [test_mi_interpreter_selection] { - test_exec_and_symbol_mi_operatons - test_breakpoints_deletion - test_dir_specification -} - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-break.exp b/gdb/testsuite/gdb.mi/mi0-break.exp deleted file mode 100644 index b763587ae69..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-break.exp +++ /dev/null @@ -1,138 +0,0 @@ -# Copyright 1999 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# -# Test essential Machine interface (MI) operations -# -# Verify that, using the MI, we can run a simple program and perform basic -# debugging activities like: insert breakpoints, run the program, -# step, next, continue until it ends and, last but not least, quit. -# -# The goal is not to test gdb functionality, which is done by other tests, -# but to verify the correct output response to MI operations. -# - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "basics" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -proc test_tbreak_creation_and_listing {} { - global mi_gdb_prompt - global srcfile - global hex - - # Insert some breakpoints and list them - # Also, disable some so they do not interfere with other tests - # Tests: - # -break-insert -t main - # -break-insert -t basics.c:callee2 - # -break-insert -t basics.c:15 - # -break-insert -t srcfile:6 - # -break-list - - mi_gdb_test "222-break-insert -t main" \ - "222\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \ - "break-insert -t operation" - - mi_gdb_test "333-break-insert -t basics.c:callee2" \ - "333\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"22\",times=\"0\"\}" \ - "insert temp breakpoint at basics.c:callee2" - - mi_gdb_test "444-break-insert -t basics.c:15" \ - "444\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"15\",times=\"0\"\}" \ - "insert temp breakpoint at basics.c:15 (callee3)" - - # Getting the quoting right is tricky. That is "\"\":6" - mi_gdb_test "555-break-insert -t \"\\\"${srcfile}\\\":6\"" \ - "555\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"6\",times=\"0\"\}" \ - "insert temp breakpoint at \"\":6 (callee4)" - - mi_gdb_test "666-break-list" \ - "666\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \ - "list of breakpoints" - - mi_gdb_test "777-break-delete" \ - "777\\^done" \ - "delete temp breakpoints" -} - -proc test_rbreak_creation_and_listing {} { - global mi_gdb_prompt - global srcfile - global hex - - # Insert some breakpoints and list them - # Also, disable some so they do not interfere with other tests - # Tests: - # -break-insert -r main - # -break-insert -r callee2 - # -break-insert -r callee - # -break-insert -r .*llee - # -break-list - - setup_xfail "*-*-*" - mi_gdb_test "122-break-insert -r main" \ - "122\\^done,bkpt=\{number=\"5\",addr=\"$hex\",file=\".*basics.c\",line=\"32\"\}" \ - "break-insert -r operation" - - setup_xfail "*-*-*" - mi_gdb_test "133-break-insert -r callee2" \ - "133\\^done,bkpt=\{number=\"6\",addr=\"$hex\",file=\".*basics.c\",line=\"22\"\}" \ - "insert breakpoint with regexp callee2" - - setup_xfail "*-*-*" - mi_gdb_test "144-break-insert -r callee" \ - "144\\^done,bkpt=\{number=\"7\",addr=\"$hex\",file=\".*basics.c\",line=\"27\"\},bkpt=\{number=\"8\",addr=\"$hex\",file=\".*basics.c\",line=\"22\"\},bkpt=\{number=\"9\",addr=\"$hex\",file=\".*basics.c\",line=\"17\"\},bkpt=\{number=\"10\",addr=\"$hex\",file=\".*basics.c\",line=\"8\"\}" \ - "insert breakpoint with regexp callee" - - setup_xfail "*-*-*" - mi_gdb_test "155-break-insert -r \.\*llee" \ - "155\\^done,bkpt=\{number=\"11\",addr=\"$hex\",file=\".*basics.c\",line=\"27\"\},bkpt=\{number=\"12\",addr=\"$hex\",file=\".*basics.c\",line=\"22\"\},bkpt=\{number=\"13\",addr=\"$hex\",file=\".*basics.c\",line=\"17\"\},bkpt=\{number=\"14\",addr=\"$hex\",file=\".*basics.c\",line=\"8\"\}" \ - "insert breakpoint with regexp .*llee" - - setup_xfail "*-*-*" - mi_gdb_test "166-break-list" \ - "166\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \ - "list of breakpoints" - - mi_gdb_test "177-break-delete" \ - "177\\^done" \ - "delete temp breakpoints" -} - -test_tbreak_creation_and_listing -test_rbreak_creation_and_listing - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-console.exp b/gdb/testsuite/gdb.mi/mi0-console.exp deleted file mode 100644 index 4735dc40dad..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-console.exp +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright 1999, 2000, 2001 Cygnus Solutions. - -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# -# Test essential Machine interface (MI) operations -# -# Verify that, using the MI, we can run a simple program and perform basic -# debugging activities like: insert breakpoints, run the program, -# step, next, continue until it ends and, last but not least, quit. -# -# The goal is not to test gdb functionality, which is done by other tests, -# but to verify the correct output response to MI operations. -# - -# This test only works when talking to a target that routes its output -# through GDB. Check that we're either talking to a simulator or a -# remote target. - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "mi-console" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -# Halt in main -mi_gdb_test "200-break-insert main" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*mi-console.c\",line=\"13\",times=\"0\"\}" \ - "break-insert operation" -mi_run_cmd -gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*mi-console.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" { - pass "run to main" - } - timeout { - fail "run to main (timeout)" - } -} - -# Next over the hello() call which will produce lots of output -send_gdb "47-exec-next\n" -gdb_expect { - -re "47\\^running\r\n$mi_gdb_prompt" { - pass "Started step over hello" - } - timeout { - fail "Started step over hello (timeout)" - } -} - -gdb_expect { - -re "@\"H\"\r\n.*@\"e\"\r\n.*@\"l\"\r\n.*@\"l\"\r\n.*@\"o\"\r\n.*@\" \"\r\n.*@\"\\\\\\\\\"\r\n.*@\"\\\\\"\"\r\n.*@\"!\"\r\n.*@\"\\\\r\"\r\n.*@\"\\\\n\"\r\n" { - pass "Hello message" - } - -re "Hello" { - - # Probably a native system where GDB doesn't have direct - # control over the inferior console. - # For this to work, GDB would need to run the inferior process - # under a PTY and then use the even-loops ability to wait on - # multiple event sources to channel the output back through the - # MI. - - fail "Hello message (known bug)" - } - timeout { - fail "Hello message (timeout)" - } -} - -gdb_expect { - -re "47\\*stopped.*$mi_gdb_prompt$" { - pass "Finished step over hello" - } - timeout { - fail "Finished step over hello (timeout)" - } -} - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-disassemble.exp b/gdb/testsuite/gdb.mi/mi0-disassemble.exp deleted file mode 100644 index 3c9cf194d0b..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-disassemble.exp +++ /dev/null @@ -1,224 +0,0 @@ -# Copyright 1999, 2000 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 -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# -# Test Machine interface (MI) operations for disassembly. -# -# The goal is not to test gdb functionality, which is done by other tests, -# but to verify the correct output response to MI operations. -# - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "basics" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -proc test_breakpoints_creation_and_listing {} { - global mi_gdb_prompt - global srcfile - global hex - - # Insert some breakpoints and list them - # Also, disable some so they do not interfere with other tests - # Tests: - # -break-insert - # -break-list - # -break-disable - # -break-info - - mi_gdb_test "200-break-insert main" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \ - "break-insert operation" - - mi_gdb_test "204-break-list" \ - "204\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}\}" \ - "list of breakpoints" -} - -proc test_running_the_program {} { - global mi_gdb_prompt - global hex - - # Run the program without args - # Tests: - # -exec-run - - # mi_gdb_test cannot be used for asynchronous commands because there are - # two prompts involved and this can lead to a race condition. - # FIXME: We are accepting a duplicate file and line info temporarely. - # The following is equivalent to a send_gdb "000-exec-run\n" - mi_run_cmd - # The running part has been checked already by mi_run_cmd - gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" { - pass "run to main" - } - -re ".*$mi_gdb_prompt$" {fail "run to main (2)"} - timeout {fail "run to main (timeout 2)"} - } -} - -proc test_disassembly_only {} { - global mi_gdb_prompt - global hex - global decimal - - # Test disassembly more only for the current function. - # Tests: - # -data-disassemble -s $pc -e "$pc+8" -- 0 - # -data-disassembly -f basics.c -l 32 -- 0 - - mi_gdb_test "print/x \$pc" "" "" - mi_gdb_test "111-data-disassemble -s \$pc -e \"\$pc + 12\" -- 0" \ - "111\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\},\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\}" \ - "data-disassemble from pc to pc+12 assembly only" - - mi_gdb_test "222-data-disassemble -f basics.c -l 32 -- 0" \ - "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \ - "data-disassemble file & line, assembly only" -} - -proc test_disassembly_lines_limit {} { - global mi_gdb_prompt - global hex - global decimal - - # Test disassembly more only for the current function. - # Tests: - # -data-disassembly -f basics.c -l 32 -n 20 -- 0 - # -data-disassembly -f basics.c -l 32 -n 0 -- 0 - # -data-disassembly -f basics.c -l 32 -n 50 -- 0 - - mi_gdb_test "print/x \$pc" "" "" - mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 20 -- 0" \ - "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \ - "data-disassemble file, line, number assembly only" - - mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 0 -- 0" \ - "222\\^done,asm_insns=\{\}" \ - "data-disassemble file, line, number (zero lines) assembly only" - - mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 50 -- 0" \ - "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \ - "data-disassemble file, line, number (more than main lines) assembly only" -} - - -proc test_disassembly_mixed {} { - global mi_gdb_prompt - global hex - global decimal - - # Test disassembly more only for the current function. - # Tests: - # -data-disassembly -f basics.c -l 21 -- 1 - # -data-disassembly -s $pc -e "$pc+8" -- 1 - - mi_gdb_test "002-data-disassemble -f basics.c -l 21 -- 1" \ - "002\\^done,asm_insns=\{src_and_asm_line=\{line=\"21\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"callee2\",offset=\"0\",inst=\".*\"\}.*\}\},.*,src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{.*\{address=\"$hex\",func-name=\"callee2\",offset=\"$decimal\",inst=\".*\"\}\}\}\}" \ - "data-disassemble file, line assembly mixed" - - # - # In mixed mode, the lowest level of granularity is the source line. - # So we are going to get the disassembly for the source line at - # which we are now, even if we have specified that the range is only 2 insns. - # - mi_gdb_test "003-data-disassemble -s \$pc -e \"\$pc+4\" -- 1" \ - "003\\^done,asm_insns=\{src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}\}\}" \ - "data-disassemble range assembly mixed" -} - -proc test_disassembly_mixed_lines_limit {} { - global mi_gdb_prompt - global hex - global decimal - - # Test disassembly more only for the current function. - # Tests: - # -data-disassembly -f basics.c -l 32 -n 20 -- 1 - # -data-disassembly -f basics.c -l 32 -n 0 -- 1 - # -data-disassembly -f basics.c -l 32 -n 50 -- 1 - - mi_gdb_test "print/x \$pc" "" "" - mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 20 -- 1" \ - "222\\^done,asm_insns=\{src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\}" \ - "data-disassemble file, line, number assembly mixed" - - mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 0 -- 1" \ - "222\\^done,asm_insns=\{src_and_asm_line=\{line=\"31\",file=\".*basics.c\",line_asm_insn=\{\}\}\}" \ - "data-disassemble file, line, number (zero lines) assembly mixed" - - mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 50 -- 1" \ - "222\\^done,asm_insns=\{src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\}" \ - "data-disassemble file, line, number (more than main lines) assembly mixed" -} - -proc test_disassembly_bogus_args {} { - global mi_gdb_prompt - global hex - - # Test that bogus input to disassembly command is rejected. - # Tests: - # -data-disassembly -f foo -l abc -n 0 -- 0 - # -data-disassembly -s foo -e bar -- 0 - # -data-disassembly -s $pc -f basics.c -- 0 - # -data-disassembly -f basics.c -l 32 -- 9 - - mi_gdb_test "123-data-disassemble -f foo -l abc -n 0 -- 0" \ - ".*123\\^error,msg=\"mi_cmd_disassemble: Invalid filename.\"" \ - "data-disassemble bogus filename" - - mi_gdb_test "321-data-disassemble -s foo -e bar -- 0" \ - "321\\^error,msg=\"No symbol \\\\\"foo\\\\\" in current context.\"" \ - "data-disassemble bogus address" - - mi_gdb_test "456-data-disassemble -s \$pc -f basics.c -- 0" \ - "456\\^error,msg=\"mi_cmd_disassemble: Usage: \\( .-f filename -l linenum .-n howmany.. | .-s startaddr -e endaddr.\\) .--. mixed_mode.\"" \ - "data-disassemble mix different args" - - mi_gdb_test "789-data-disassemble -f basics.c -l 32 -- 9" \ - "789\\^error,msg=\"mi_cmd_disassemble: Mixed_mode argument must be 0 or 1.\"" \ - "data-disassemble wrong mode arg" - -} - -test_breakpoints_creation_and_listing -test_running_the_program -test_disassembly_only -test_disassembly_mixed -test_disassembly_bogus_args -test_disassembly_lines_limit -test_disassembly_mixed_lines_limit - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-eval.exp b/gdb/testsuite/gdb.mi/mi0-eval.exp deleted file mode 100644 index a6f6978848d..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-eval.exp +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright 1999, 2000 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 -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# -# Test essential Machine interface (MI) operations -# -# Verify -data-evaluate-expression. There are really minimal tests. - -# The goal is not to test gdb functionality, which is done by other tests, -# but to verify the correct output response to MI operations. -# - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "basics" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -proc test_running_the_program {} { - global mi_gdb_prompt - global hex - - # Run the program without args, then specify srgs and rerun the program - # Tests: - # -exec-run - - mi_gdb_test "300-break-insert callee4" \ - "300\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \ - "insert breakpoint at callee4" - - # mi_gdb_test cannot be used for asynchronous commands because there are - # two prompts involved and this can lead to a race condition. - # The following is equivalent to a send_gdb "000-exec-run\n" - mi_run_cmd - # The running part has been checked already by mi_run_cmd - gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" \ - { pass "run to callee4" } - -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"} - timeout {fail "run to callee4 (timeout 2)"} - } - - send_gdb "101-exec-next\n" - gdb_expect { - -re "101\\^running\r\n$mi_gdb_prompt" { - gdb_expect { - -re "\[\r\n\]*101\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"9\"\}\r\n$mi_gdb_prompt$" \ - { pass "next in callee4" } - -re ".*$mi_gdb_prompt$" {fail "next in callee4 (2)"} - timeout {fail "next in callee4 (timeout 2)"} - } - } - -re ".*$mi_gdb_prompt$" {fail "next in callee4 (1)"} - timeout {fail "next in callee4 (timeout 1)"} - } - -} - -test_running_the_program - -mi_gdb_test "211-data-evaluate-expression A" "211\\^done,value=\"1\"" "eval A" - -mi_gdb_test "311-data-evaluate-expression &A" "311\\^done,value=\"$hex\"" "eval &A" - -mi_gdb_test "411-data-evaluate-expression A+3" "411\\^done,value=\"4\"" "eval A+3" - -mi_gdb_test "511-data-evaluate-expression \"A + 3\"" "511\\^done,value=\"4\"" "eval A + 3" - - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-hack-cli.exp b/gdb/testsuite/gdb.mi/mi0-hack-cli.exp deleted file mode 100644 index 50a1e19f8ea..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-hack-cli.exp +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 1999 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - - -# Some basic checks for the CLI. - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -mi_gdb_test "show architecture\n" \ - "&\"show architecture\\\\n\"\r\n~\"The target architecture.*\"\r\n\\^done" \ - "show architecture" - -mi_gdb_test "47show architecture\n" \ - "&\"show architecture\\\\n\"\r\n~\"The target architecture.*\"\r\n47\\^done" \ - "47show architecture" - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-read-memory.exp b/gdb/testsuite/gdb.mi/mi0-read-memory.exp deleted file mode 100644 index f48bfa536eb..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-read-memory.exp +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright 1999, 2000 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 -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# -# test basic Machine interface (MI) operations -# -# Verify that, using the MI, we can load a program and do -# other basic things that are used by all test files through mi_gdb_exit, -# mi_gdb_start, mi_delete_breakpoints, mi_gdb_reinitialize_dir and -# mi_gdb_load, so we can safely use those. -# -# The goal is not to test gdb functionality, which is done by other tests, -# but the command syntax and correct output response to MI operations. -# - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "mi-read-memory" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - - -mi_run_to_main - -#mi_next "do initialization" -send_gdb "101-exec-next\n" -gdb_expect { - -re "101\\^running\r\n$mi_gdb_prompt" { - gdb_expect { - -re "\[\r\n\]*101\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*mi-read-memory.c\",line=\"20\"\}.*$mi_gdb_prompt$" \ - { pass "do initialization" } - -re ".*$mi_gdb_prompt$" {fail "do initialization (2)"} - timeout {fail "do initialization (timeout 2)"} - } - } - -re ".*$mi_gdb_prompt$" {fail "do initialization (1)"} - timeout {fail "do initialization (timeout 1)"} -} - -mi_gdb_test "1-data-read-memory" \ - "1\\^error,msg=\".*\"" \ - "no arguments" - - -mi_gdb_test "2-data-read-memory bytes x 1 3 2" \ - "2\\^done,addr=\"$hex\",nr-bytes=\"6\",total-bytes=\"6\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0x00\",\"0x01\"}},{addr=\"$hex\",data={\"0x02\",\"0x03\"}},{addr=\"$hex\",data={\"0x04\",\"0x05\"}}}" \ - "3x2, one byte" - - -mi_gdb_test "9-data-read-memory -o -6 -- -0+bytes+6 x 1 3 2" \ - "9\\^done,addr=\"$hex\",nr-bytes=\"6\",total-bytes=\"6\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0x00\",\"0x01\"}},{addr=\"$hex\",data={\"0x02\",\"0x03\"}},{addr=\"$hex\",data={\"0x04\",\"0x05\"}}}" \ - "3x2, one byte offset by -6" - - -mi_gdb_test "3-data-read-memory \"(shorts + 128)\" x 2 1 2" \ - "3\\^done,addr=\"$hex\",nr-bytes=\"4\",total-bytes=\"4\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0x0100\",\"0x0102\"}}}" \ - "expression in quotes" - - -mi_gdb_test "4-data-read-memory bytes+16 x 1 8 4 x" \ - "4\\^done,addr=\"$hex\",nr-bytes=\"32\",total-bytes=\"32\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0x10\",\"0x11\",\"0x12\",\"0x13\"},ascii=\"xxxx\"},{addr=\"$hex\",data={\"0x14\",\"0x15\",\"0x16\",\"0x17\"},ascii=\"xxxx\"},{addr=\"$hex\",data={\"0x18\",\"0x19\",\"0x1a\",\"0x1b\"},ascii=\"xxxx\"},{addr=\"$hex\",data={\"0x1c\",\"0x1d\",\"0x1e\",\"0x1f\"},ascii=\"xxxx\"},{addr=\"$hex\",data={\"0x20\",\"0x21\",\"0x22\",\"0x23\"},ascii=\" !\\\\\"#\"},{addr=\"$hex\",data={\"0x24\",\"0x25\",\"0x26\",\"0x27\"},ascii=\"\\$%&'\"},{addr=\"$hex\",data={\"0x28\",\"0x29\",\"0x2a\",\"0x2b\"},ascii=\"().+\"},{addr=\"$hex\",data={\"0x2c\",\"0x2d\",\"0x2e\",\"0x2f\"},ascii=\",-\./\"}}" \ - "ascii and data" - - -mi_gdb_test "5-data-read-memory shorts+64 d 2 1 1" \ - "5\\^done,addr=\"$hex\",nr-bytes=\"2\",total-bytes=\"2\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"128\"}}}" \ - "decimal" - -mi_gdb_test "6-data-read-memory shorts+64 o 2 1 1" \ - "6\\^done,addr=\"$hex\",nr-bytes=\"2\",total-bytes=\"2\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0200\"}}}" \ - "octal" - - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-regs.exp b/gdb/testsuite/gdb.mi/mi0-regs.exp deleted file mode 100644 index 1b6dac830a1..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-regs.exp +++ /dev/null @@ -1,177 +0,0 @@ -# Copyright 1999, 2000 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 -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu -# -# Test essential Machine interface (MI) operations -# -# Verify that, using the MI, we can run a simple program and look at registers. -# -# The goal is not to test gdb functionality, which is done by other tests, -# but to verify the correct output response to MI operations. -# - - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "basics" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -proc test_breakpoints_creation_and_listing {} { - global mi_gdb_prompt - global srcfile - global hex - - # Insert some breakpoints and list them - # Also, disable some so they do not interfere with other tests - # Tests: - # -break-insert - # -break-list - # -break-disable - # -break-info - - mi_gdb_test "200-break-insert main" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \ - "break-insert operation" - - mi_gdb_test "204-break-list" \ - "204\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}\}" \ - "list of breakpoints" -} - -proc test_running_the_program {} { - global mi_gdb_prompt - global hex - - # Run the program without args - # Tests: - # -exec-run - - # mi_gdb_test cannot be used for asynchronous commands because there are - # two prompts involved and this can lead to a race condition. - # FIXME: We are accepting a duplicate file and line info temporarely. - # The following is equivalent to a send_gdb "000-exec-run\n" - mi_run_cmd - # The running part has been checked already by mi_run_cmd - gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" { - pass "run to main" - } - -re ".*$mi_gdb_prompt$" {fail "run to main (2)"} - timeout {fail "run to main (timeout 2)"} - } -} - -proc sparc_register_tests_no_exec { } { - # Test the generic IDT chip. - mi_gdb_test "111-data-list-register-values" \ - ".*111\\^error,msg=\"mi_cmd_data_list_register_values: Usage: -data-list-register-values \\\[...\\\]\"" \ - "wrong arguments" - - mi_gdb_test "111-data-list-register-values x" \ - ".*111\\^error,msg=\"mi_cmd_data_list_register_values: No registers\.\"" \ - "no executable" -} - -# These tests exercise IDT-specific MIPS registers for several -# different processor models. - -# This should detect the actual processor in use and change -# the expected results appropriately. FIXME - -proc sparc_register_tests { } { - global hex - global decimal - set octal "\[0-7\]+" - set binary "\[0-1\]+" - set float "-?\[0-9\]+(\.\[0-9\]+)?(e\[+\-\]\[0-9\]+)?" - set float2 "\-?\[0-9\]+" - - mi_gdb_test "111-data-list-register-names" \ - "111\\^done,register-names=\{\"g0\",\"g1\",\"g2\",\"g3\",\"g4\",\"g5\",\"g6\",\"g7\",\"o0\",\"o1\",\"o2\",\"o3\",\"o4\",\"o5\",\"sp\",\"o7\",\"l0\",\"l1\",\"l2\",\"l3\",\"l4\",\"l5\",\"l6\",\"l7\",\"i0\",\"i1\",\"i2\",\"i3\",\"i4\",\"i5\",\"fp\",\"i7\",\"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\",\"y\",\"psr\",\"wim\",\"tbr\",\"pc\",\"npc\",\"fpsr\",\"cpsr\"\}" \ - "list register names" - - mi_gdb_test "222-data-list-register-values x" \ - "222\\^done,register-values=\{\{number=\"0\",value=\"$hex\"\}.*\{number=\"71\",value=\"$hex\"\}\}" \ - "register values x" - - mi_gdb_test "333-data-list-register-values f" \ - "333\\^done,register-values=\{\{number=\"0\",value=\"$float\"\},\{number=\"1\",value=\"$float\"\},.*\{number=\"71\",value=\"$float\"\}\}" \ - "register values f" - - mi_gdb_test "444-data-list-register-values d" \ - "444\\^done,register-values=\{\{number=\"0\",value=\"$decimal\"\}.*\{number=\"71\",value=\"$decimal\"\}\}" \ - "register values d" - - mi_gdb_test "555-data-list-register-values o" \ - "555\\^done,register-values=\{\{number=\"0\",value=\"$octal\"\}.*\{number=\"71\",value=\"$octal\"\}\}" \ - "register values o" - - mi_gdb_test "666-data-list-register-values t" \ - "666\\^done,register-values=\{\{number=\"0\",value=\"$binary\"\}.*\{number=\"71\",value=\"$binary\"\}\}" \ - "register values t" - - # On the sparc, registers 0-31 are int, 32-63 float, 64-71 int - - mi_gdb_test "777-data-list-register-values N" \ - "777\\^done,register-values=\{\{number=\"0\",value=\"$decimal\"\}.*\{number=\"31\",value=\"$decimal\"\},\{number=\"32\",value=\"$float\"\}.*\{number=\"63\",value=\"$float\"\},\{number=\"64\",value=\"$decimal\"\}.*\{number=\"71\",value=\"$decimal\"\}\}" \ - "register values N" - - mi_gdb_test "888-data-list-register-values r" \ - "888\\^done,register-values=\{\{number=\"0\",value=\"$hex\"\}.*\{number=\"71\",value=\"$hex\"\}\}" \ - "register values r" - - mi_gdb_test "999-data-list-register-names 68 69 70 71" \ - "999\\^done,register-names=\{\"pc\",\"npc\",\"fpsr\",\"cpsr\"\}" \ - "list names of some regs" - - mi_gdb_test "001-data-list-register-values x 68 69 70 71" \ - "001\\^done,register-values=\{\{number=\"68\",value=\"$hex\"\},\{number=\"69\",value=\"$hex\"\},\{number=\"70\",value=\"$hex\"\},\{number=\"71\",value=\"$hex\"\}\}" \ - "list values of some regs" - - # Don't know how useful this test is - - mi_gdb_test "002-data-list-changed-registers" \ - "002\\^done,changed-registers=\{\"1\",\"9\",\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"23\",\"24\",\"25\",\"26\",\"27\",\"28\",\"30\",\"31\",\"65\",\"68\",\"69\"\}" \ - "list changed registers" -} - -if [istarget "sparc-*-*"] then { - sparc_register_tests_no_exec - test_breakpoints_creation_and_listing - test_running_the_program - sparc_register_tests -} else { - verbose "mi-regs.exp tests ignored for this target" -} - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-return.exp b/gdb/testsuite/gdb.mi/mi0-return.exp deleted file mode 100644 index 95e02526a8e..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-return.exp +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright 1999, 2000 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 -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# Test Machine interface (MI) operations -# Verify that, using the MI, we can run a simple program and perform -# exec-return. - -# The goal is not to -# test gdb functionality, which is done by other tests, but to verify -# the correct output response to MI operations. -# - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "basics" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -proc test_running_to_callee4 {} { - global mi_gdb_prompt - global hex - - mi_gdb_test "200-break-insert callee4" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \ - "break-insert operation" - - mi_run_cmd - - gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" { - pass "run to callee4" - } - timeout { - fail "run to callee4 (timeout)" - } - } - - mi_gdb_test "205-break-delete" \ - "205\\^done.*" \ - "delete all breakpoints" - -} - -proc test_return_simple {} { - global mi_gdb_prompt - global hex - - send_gdb "111-exec-return\n" - gdb_expect { - -re "111\\^done,frame=\{level=\"0 \",addr=\"$hex\",func=\"callee3\",args=\{.*\},file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"} - -re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" } - timeout { fail "return from callee4 now (timeout)" - } - } -} - -test_running_to_callee4 -test_return_simple - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-simplerun.exp b/gdb/testsuite/gdb.mi/mi0-simplerun.exp deleted file mode 100644 index 683d6bb4848..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-simplerun.exp +++ /dev/null @@ -1,227 +0,0 @@ -# Copyright 1999, 2000 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 -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# -# Test essential Machine interface (MI) operations -# -# Verify that, using the MI, we can run a simple program and perform basic -# debugging activities like: insert breakpoints, run the program, -# step, next, continue until it ends and, last but not least, quit. -# -# The goal is not to test gdb functionality, which is done by other tests, -# but to verify the correct output response to MI operations. -# - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "basics" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -proc test_breakpoints_creation_and_listing {} { - global mi_gdb_prompt - global srcfile - global hex - - # Insert some breakpoints and list them - # Also, disable some so they do not interfere with other tests - # Tests: - # -break-insert - # -break-list - # -break-disable - # -break-info - - mi_gdb_test "200-break-insert main" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \ - "break-insert operation" - - mi_gdb_test "201-break-insert basics.c:callee2" \ - "201\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"22\",times=\"0\"\}" \ - "insert breakpoint at basics.c:callee2" - - mi_gdb_test "202-break-insert basics.c:15" \ - "202\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"15\",times=\"0\"\}" \ - "insert breakpoint at basics.c:15 (callee3)" - - mi_gdb_test "203-break-insert \"\\\"${srcfile}\\\":6\"" \ - "203\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"6\",times=\"0\"\}" \ - "insert breakpoint at \"\":6 (callee4)" - - mi_gdb_test "204-break-list" \ - "204\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \ - "list of breakpoints" - - mi_gdb_test "205-break-disable 2 3 4" \ - "205\\^done.*" \ - "disabling of breakpoints" - - mi_gdb_test "206-break-info 2" \ - "206\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"2\",.*,enabled=\"n\",.*\}\}" \ - "list of breakpoints, 16 disabled" -} - -proc test_running_the_program {} { - global mi_gdb_prompt - global hex - - # Run the program without args, then specify srgs and rerun the program - # Tests: - # -exec-run - # -gdb-set - - # mi_gdb_test cannot be used for asynchronous commands because there are - # two prompts involved and this can lead to a race condition. - # The following is equivalent to a send_gdb "000-exec-run\n" - mi_run_cmd - gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" { - pass "run to main" - } - timeout { - fail "run to main (timeout)" - } - } -} - -proc test_controlled_execution {} { - global mi_gdb_prompt - global hex - - # Continue execution until a breakpoint is reached, step into calls, verifying - # if the arguments are correctly shown, continue to the end of a called - # function, step over a call (next). - # Tests: - # -exec-continue - # -exec-next - # -exec-step - # -exec-finish - - # mi_gdb_test cannot be used for asynchronous commands because there are - # two prompts involved and this can lead to a race condition. - send_gdb "220-exec-next\n" - gdb_expect { - -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"33\"\}\r\n$mi_gdb_prompt$" { - pass "next at main" - } - timeout { - fail "next at main (timeout)" - } - } - - # FIXME: A string argument is not printed right; should be fixed and - # we should look for the right thing here. - # NOTE: The ``\\\\\"'' is for \". - send_gdb "221-exec-step\n" - gdb_expect { - -re "221\\^running\r\n${mi_gdb_prompt}221\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee1\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument\.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\},file=\".*basics.c\",line=\"27\"\}\r\n$mi_gdb_prompt$" { - pass "step at main" - } - timeout { - fail "step at main (timeout)" - } - } - - # FIXME: A string argument is not printed right; should be fixed and - # we should look for the right thing here. - send_gdb "222-exec-step 3\n" - gdb_expect 30 { - -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" { - pass "step to callee4" - } - timeout { - fail "step to callee4 (timeout)" - } - } - - # FIXME: A string argument is not printed right; should be fixed and - # we should look for the right thing here. - # NOTE: The ``.'' is part of ``gdb-result-var="$1"'' - send_gdb "223-exec-finish\n" - gdb_expect 30 { - -re "223\\^running\r\n${mi_gdb_prompt}223\\*stopped,reason=\"function-finished\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee3\",args=\{.*\},file=\".*basics.c\",line=\"18\"\},gdb-result-var=\".1\",return-value=\"0\"\r\n$mi_gdb_prompt$" { - pass "exec-finish" - } - timeout { - fail "exec-finish (timeout)" - } - } -} - -proc test_controlling_breakpoints {} { - global mi_gdb_prompt - - # Enable, delete, set ignore counts in breakpoints - # (disable was already tested above) - # Tests: - # -break-delete - # -break-enable - # -break-after - # -break-condition - -} - -proc test_program_termination {} { - global mi_gdb_prompt - - # Run to completion: normal and forced - # Tests: - # -exec-abort - # (normal termination of inferior) - - # FIXME: "stopped" doesn't seem appropriate. - # mi_gdb_test cannot be used for asynchronous commands because there are - # two prompts involved and this can lead to a race condition. - send_gdb "999-exec-continue\n" - gdb_expect { - -re "999\\^running\r\n$mi_gdb_prompt" { - gdb_expect { - -re "999\\*stopped,reason=\"exited-normally\"\r\n$mi_gdb_prompt$" { - pass "continue to end" - } - -re ".*$mi_gdb_prompt$" {fail "continue to end (2)"} - timeout {fail "continue to end (timeout 2)"} - } - } - -re ".*$mi_gdb_prompt$" {fail "continue to end (1)"} - timeout {fail "continue to end (timeout 1)"} - } -} - -test_breakpoints_creation_and_listing -test_running_the_program -test_controlled_execution -test_controlling_breakpoints -test_program_termination - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-stack.exp b/gdb/testsuite/gdb.mi/mi0-stack.exp deleted file mode 100644 index faa92ec181e..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-stack.exp +++ /dev/null @@ -1,218 +0,0 @@ -# Copyright 2000 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 -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# -# Test essential Machine interface (MI) operations -# -# Verify that stack commands work. - -# The goal is not to test gdb functionality, which is done by other tests, -# but to verify the correct output response to MI operations. -# - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "basics" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - - -mi_gdb_test "200-break-insert callee4" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \ - "break-insert operation" - -mi_run_cmd -# The running part has been checked already by mi_run_cmd -gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" { - pass "run to callee4" - } - -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"} - timeout {fail "run to callee4 (timeout 2)"} -} - - -proc test_stack_frame_listing {} { - global mi_gdb_prompt - global hex - - # Obtain a stack trace - # Tests: - # -stack-list-frames - # -stack-list-frames 1 1 - # -stack-list-frames 1 3 - - mi_gdb_test "231-stack-list-frames" \ - "231\\^done,stack=\{frame=\{level=\"0 \",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4 \",addr=\"$hex\",func=\"main\",.*\}\}" \ - "stack frame listing" - mi_gdb_test "232-stack-list-frames 1 1" \ - "232\\^done,stack=\{frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\}\}" \ - "stack frame listing 1 1" - mi_gdb_test "233-stack-list-frames 1 3" \ - "233\\^done,stack=\{frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\}\}" \ - "stack frame listing 1 3" - - mi_gdb_test "234-stack-list-frames 1" \ - "234\\^error,msg=\"mi_cmd_stack_list_frames: Usage.*FRAME_LOW FRAME_HIGH.*\"" \ - "stack frame listing wrong" -} - -proc test_stack_args_listing {} { - global mi_gdb_prompt - global hex - - # Obtain lists for args for the stack frames - # Tests: - # -stack-list-arguments 0 - # -stack-list-arguments 0 1 1 - # -stack-list-arguments 0 1 3 - # -stack-list-arguments 1 - # -stack-list-arguments 1 1 1 - # -stack-list-arguments 1 1 3 - # -stack-list-arguments - - mi_gdb_test "231-stack-list-arguments 0" \ - "231\\^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=\{\}\}\}" \ - "stack args listing 0" - - mi_gdb_test "232-stack-list-arguments 0 1 1" \ - "232\\^done,stack-args=\{frame=\{level=\"1\",args=\{name=\"strarg\"\}\}\}" \ - "stack args listing 0 1 1" - - mi_gdb_test "233-stack-list-arguments 0 1 3" \ - "233\\^done,stack-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\"\}\}\}" \ - "stack args listing 0 1 3" - - mi_gdb_test "231-stack-list-arguments 1" \ - "231\\^done,stack-args=\{frame=\{level=\"0\",args=\{\}\},frame=\{level=\"1\",args=\{\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"2\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"3\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\}\},frame=\{level=\"4\",args=\{\}\}\}" \ - "stack args listing 1" - - mi_gdb_test "232-stack-list-arguments 1 1 1" \ - "232\\^done,stack-args=\{frame=\{level=\"1\",args=\{\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\}\}" \ - "stack args listing 1 1 1" - - mi_gdb_test "233-stack-list-arguments 1 1 3" \ - "233\\^done,stack-args=\{frame=\{level=\"1\",args=\{\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"2\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"3\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\}\}\}" \ - "stack args listing 1 1 3" - - mi_gdb_test "234-stack-list-arguments" \ - "234\\^error,msg=\"mi_cmd_stack_list_args: Usage.*PRINT_VALUES.*FRAME_LOW FRAME_HIGH.*\"" \ - "stack args listing wrong" -} - -proc test_stack_info_depth {} { - global mi_gdb_prompt - global hex - - # Obtain depth of stack - # Tests: - # -stack-info-depth - # -stack-info-depth 3 - # -stack-info-depth 99 - - mi_gdb_test "231-stack-info-depth" \ - "231\\^done,depth=\"5\"" \ - "stack info-depth" - - mi_gdb_test "231-stack-info-depth 3" \ - "231\\^done,depth=\"3\"" \ - "stack info-depth 3" - - mi_gdb_test "231-stack-info-depth 99" \ - "231\\^done,depth=\"5\"" \ - "stack info-depth 99" - - mi_gdb_test "231-stack-info-depth 99 99" \ - "231\\^error,msg=\"mi_cmd_stack_info_depth: Usage: .MAX_DEPTH.\"" \ - "stack info-depth wrong usage" -} - -proc test_stack_locals_listing {} { - global mi_gdb_prompt - global hex - - # Obtain lists for locals for the stack frames - # Tests: - # -stack-list-locals 0 - # -stack-list-locals 1 - # -stack-list-arguments - - mi_gdb_test "232-stack-list-locals 0" \ - "232\\^done,locals=\{name=\"A\",name=\"B\",name=\"C\"\}" \ - "stack locals listing 0" - -# step until A, B, C, have some reasonable values. -send_gdb "-exec-next 3\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" { - pass "next's in callee4" - } - timeout { fail "next in callee4 (timeout)" } -} - - mi_gdb_test "232-stack-list-locals 1" \ - "232\\^done,locals=\{\{name=\"A\",value=\"1\"\},\{name=\"B\",value=\"2\"\},\{name=\"C\",value=\"3\"\}\}" \ - "stack locals listing 1" - - mi_gdb_test "234-stack-list-locals" \ - "234\\^error,msg=\"mi_cmd_stack_list_locals: Usage.*PRINT_VALUES.*\"" \ - "stack locals listing wrong" - - mi_gdb_test "232-stack-select-frame 1" \ - "232\\^done" \ - "stack select frame 1" - - mi_gdb_test "232-stack-list-locals 1" \ - "232\\^done,locals=\{\}" \ - "stack locals listing for new frame" - -# this should be a no-op - - mi_gdb_test "232-stack-select-frame" \ - "232\\^done" \ - "stack select same frame" - - mi_gdb_test "232-stack-list-locals 1" \ - "232\\^done,locals=\{\}" \ - "stack locals for same frame (level 1)" - -} - -test_stack_frame_listing -test_stack_args_listing -test_stack_locals_listing -test_stack_info_depth - - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-stepi.exp b/gdb/testsuite/gdb.mi/mi0-stepi.exp deleted file mode 100644 index 800cef87145..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-stepi.exp +++ /dev/null @@ -1,106 +0,0 @@ -# Copyright 1999, 2000 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 -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# Test Machine interface (MI) operations -# Verify that, using the MI, we can run a simple program and perform -# exec-step-instruction and exec-next-instruction. - -# The goal is not to -# test gdb functionality, which is done by other tests, but to verify -# the correct output response to MI operations. -# - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "basics" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -proc test_running_to_main {} { - global mi_gdb_prompt - global hex - - mi_gdb_test "200-break-insert main" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \ - "break-insert operation" - - mi_run_cmd - - gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" { - pass "run to main" - } - timeout { - fail "run to main (timeout)" - } - } -} - -proc test_stepi_nexti {} { - global mi_gdb_prompt - global hex - - send_gdb "111-exec-step-instruction\n" - gdb_expect { - -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" { - pass "step-instruction at main" - } - timeout { - fail "step-instruction at main (timeout)" - } - } - send_gdb "222-exec-next-instruction\n" - gdb_expect { - -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" { - pass "next-instruction at main" - } - timeout { - fail "next-instruction at main (timeout)" - } - } - send_gdb "333-exec-next-instruction\n" - gdb_expect { - -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" { - pass "next-instruction at main" - } - timeout { - fail "next-instruction at main (timeout)" - } - } -} - -test_running_to_main -test_stepi_nexti - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-until.exp b/gdb/testsuite/gdb.mi/mi0-until.exp deleted file mode 100644 index e6330020cb1..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-until.exp +++ /dev/null @@ -1,124 +0,0 @@ -# Copyright 1999, 2000 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 -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# Test Machine interface (MI) operations -# Verify that, using the MI, we can run a simple program and perform -# exec-until. - -# The goal is not to -# test gdb functionality, which is done by other tests, but to verify -# the correct output response to MI operations. -# - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "until" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -proc test_running_to_foo {} { - global mi_gdb_prompt - global hex - - mi_gdb_test "200-break-insert 10" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"foo\",file=\".*until.c\",line=\"10\",times=\"0\"\}" \ - "break-insert operation" - - mi_run_cmd - - gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"foo\",args=\{\},file=\".*until.c\",line=\"10\"\}\r\n$mi_gdb_prompt$" { - pass "run to main" - } - timeout { - fail "run to main (timeout)" - } - } - - mi_gdb_test "100-break-delete 1" "100\\^done" "break-delete 1" - -} - -proc test_until {} { - global mi_gdb_prompt - global hex - - send_gdb "111-exec-until\n" - gdb_expect { - -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"foo\",args=\{\},file=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" { - pass "until after while loop" - } - timeout { - fail "until after while loop (timeout)" - } - } - - send_gdb "222-exec-until 15\n" - gdb_expect { - -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"foo\",args=\{\},file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" { - pass "until line number" - } - timeout { - fail "until line number (timeout)" - } - } - - send_gdb "333-exec-until until.c:17\n" - gdb_expect { - -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"foo\",args=\{\},file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" { - pass "until line number:file" - } - timeout { - fail "until line number:file (timeout)" - } - } - - # This is supposed to NOT stop at line 25. It stops right after foo is over. - - send_gdb "444-exec-until until.c:25\n" - gdb_expect { - -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" { - pass "until after current function" - } - timeout { - fail "until after current function (timeout)" - } - } - -} - -test_running_to_foo -test_until - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-var-block.exp b/gdb/testsuite/gdb.mi/mi0-var-block.exp deleted file mode 100644 index 2ef383f7932..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-var-block.exp +++ /dev/null @@ -1,228 +0,0 @@ -# Copyright (C) 1999 2000 s Solutions -# -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# Test essential Machine interface (MI) operations -# -# Verify that, using the MI, we can create, update, delete variables. -# - - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "var-cmd" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -mi_gdb_test "200-break-insert do_block_tests" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_block_tests\",file=\".*var-cmd.c\",line=\"154\",times=\"0\"\}" \ - "break-insert operation" - -mi_run_cmd -# The running part has been checked already by mi_run_cmd -gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"154\"\}\r\n$mi_gdb_prompt$" { - pass "run to do_block_tests" - } - -re ".*$mi_gdb_prompt$" {fail "run to do_block_tests (2)"} - timeout {fail "run to do_block_tests (timeout 2)"} -} - -# Test: c_variable-3.2 -# Desc: create cb and foo -mi_gdb_test "-var-create cb * cb" \ - "\\^done,name=\"cb\",numchild=\"0\",type=\"int\"" \ - "create local variable cb" - -mi_gdb_test "-var-create foo * foo" \ - "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \ - "create local variable foo" - -# step to "foo = 123;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"158\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_block_tests" - } - timeout { - fail "step at do_block_tests (timeout)" - } -} - - -# Be paranoid and assume 3.2 created foo -mi_gdb_test "-var-delete foo" \ - "&\"Variable object not found\\\\n\".*\\^error,msg=\"Variable object not found\"" \ - "delete var foo" - - -# Test: c_variable-3.3 -# Desc: create foo -mi_gdb_test "-var-create foo * foo" \ - "\\^done,name=\"foo\",numchild=\"0\",type=\"int\"" \ - "create local variable foo" - -# step to "foo2 = 123;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"161\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_block_tests" - } - timeout { - fail "step at do_block_tests (timeout)" - } -} - -# Test: c_variable-3.4 -# Desc: check foo, cb changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"foo\",in_scope=\"true\",type_changed=\"false\",name=\"cb\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars: cb foo changed" - -# step to "foo = 321;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"164\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_block_tests" - } - timeout { - fail "step at do_block_tests (timeout)" - } -} - -# Test: c_variable-3.5 -# Desc: create inner block foo -mi_gdb_test "-var-create inner_foo * foo" \ - "\\^done,name=\"inner_foo\",numchild=\"0\",type=\"int\"" \ - "create local variable inner_foo" - -# step to "foo2 = 0;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"166\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_block_tests" - } - timeout { fail "step at do_block_tests (timeout)" } -} - -# Test: c_variable-3.6 -# Desc: create foo2 -mi_gdb_test "-var-create foo2 * foo2" \ - "\\^done,name=\"foo2\",numchild=\"0\",type=\"int\"" \ - "create local variable foo2" - -# Test: c_variable-3.7 -# Desc: check that outer foo in scope and inner foo out of scope -# Note: also a known gdb problem -setup_xfail *-*-* -mi_gdb_test "-var-update inner_foo" \ - "\\^done,changelist=\{FIXME\}" \ - "update inner_foo: should be out of scope: KNOWN PROBLEM" -clear_xfail *-*-* - -setup_xfail *-*-* -mi_gdb_test "-var-evaluate-expression inner_foo" \ - "\\^done,value=\{FIXME\}" \ - "evaluate inner_foo: should be out of scope: KNOWN PROBLEM" -clear_xfail *-*-* - -mi_gdb_test "-var-update foo" \ - "\\^done,changelist=\{\}" \ - "update foo: did not change" - -mi_gdb_test "-var-delete inner_foo" \ - "\\^done,ndeleted=\"1\"" \ - "delete var inner_foo" - -# step to "foo = 0;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"168\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_block_tests" - } - timeout { fail "step at do_block_tests (timeout)" } -} - -# Test: c_variable-3.8 -# Desc: check that foo2 out of scope (known gdb problem) -setup_xfail *-*-* -mi_gdb_test "-var-update foo2" \ - "\\^done,changelist=\{FIXME\}" \ - "update foo2: should be out of scope: KNOWN PROBLEM" -clear_xfail *-*-* - -# step to "cb = 21;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"171\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_block_tests" - } - timeout { fail "step at do_block_tests (timeout)" } -} - - -# Test: c_variable-3.9 -# Desc: check that only cb is in scope (known gdb problem) -setup_xfail *-*-* -mi_gdb_test "-var-update foo2" \ - "\\^done,changelist=\{FIXME\}" \ - "update foo2 should be out of scope: KNOWN PROBLEM" -clear_xfail *-*-* -setup_xfail *-*-* -mi_gdb_test "-var-update foo" \ - "\\^done,changelist=\{FIXME\}" \ - "update foo should be out of scope: KNOWN PROBLEM" -clear_xfail *-*-* -mi_gdb_test "-var-update cb" \ - "\\^done,changelist=\{\}" \ - "update cb" - -# Test: c_variable-3.10 -# Desc: names of editable variables -#gdbtk_test c_variable-3.10 {names of editable variables} { -# editable_variables -#} {{foo cb foo2} {}} - -# Done with block tests -mi_gdb_test "-var-delete foo" \ - "\\^done,ndeleted=\"1\"" \ - "delete var foo" - -mi_gdb_test "-var-delete foo2" \ - "\\^done,ndeleted=\"1\"" \ - "delete var foo2" - -mi_gdb_test "-var-delete cb" \ - "\\^done,ndeleted=\"1\"" \ - "delete var cb" - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-var-child.exp b/gdb/testsuite/gdb.mi/mi0-var-child.exp deleted file mode 100644 index c89438d4738..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-var-child.exp +++ /dev/null @@ -1,1331 +0,0 @@ -# Copyright (C) 1999 2000 Cygnus Solutions -# -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# Test essential Machine interface (MI) operations -# -# Verify that, using the MI, we can create, update, delete variables. -# - - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "var-cmd" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -mi_gdb_test "200-break-insert do_children_tests" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"190\",times=\"0\"\}" \ - "break-insert operation" - -mi_run_cmd -# The running part has been checked already by mi_run_cmd -gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"190\"\}\r\n$mi_gdb_prompt$" { - pass "run to do_children_tests" - } - -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"} - timeout {fail "run to do_children_tests (timeout 2)"} -} - -##### ##### -# # -# children tests # -# # -##### ##### - - -# Test: c_variable-4.2 -# Desc: create variable "struct_declarations" -mi_gdb_test "-var-create struct_declarations * struct_declarations" \ - "\\^done,name=\"struct_declarations\",numchild=\"11\",type=\"struct _struct_decl\"" \ - "create local variable struct_declarations" - -# Test: c_variable-4.3 -# Desc: children of struct_declarations -mi_gdb_test "-var-list-children struct_declarations" \ - "\\^done,numchild=\"11\",children=\{child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \ - "get children of struct_declarations" - -#gdbtk_test c_variable-4.3 {children of struct_declarations} { -# get_children struct_declarations -#} {integer character char_ptr long_int int_ptr_ptr long_array func_ptr func_ptr_struct func_ptr_ptr u1 s2} - -# Test: c_variable-4.4 -# Desc: number of children of struct_declarations -mi_gdb_test "-var-info-num-children struct_declarations" \ - "\\^done,numchild=\"11\"" \ - "get number of children of struct_declarations" - -# Test: c_variable-4.5 -# Desc: children of struct_declarations.integer -mi_gdb_test "-var-list-children struct_declarations.integer" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.integer" - -# Test: c_variable-4.6 -# Desc: number of children of struct_declarations.integer -mi_gdb_test "-var-info-num-children struct_declarations.integer" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.integer" - -# Test: c_variable-4.7 -# Desc: children of struct_declarations.character -mi_gdb_test "-var-list-children struct_declarations.character" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.character" - -# Test: c_variable-4.8 -# Desc: number of children of struct_declarations.character -mi_gdb_test "-var-info-num-children struct_declarations.character" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.character" - -# Test: c_variable-4.9 -# Desc: children of struct_declarations.char_ptr -mi_gdb_test "-var-list-children struct_declarations.char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ - "get children of struct_declarations.char_ptr" - -# Test: c_variable-4.10 -# Desc: number of children of struct_declarations.char_ptr -mi_gdb_test "-var-info-num-children struct_declarations.char_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of struct_declarations.char_ptr" - -# Test: c_variable-4.11 -# Desc: children of struct_declarations.long_int -mi_gdb_test "-var-list-children struct_declarations.long_int" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.long_int" - -# Test: c_variable-4.12 -# Desc: number of children of struct_declarations.long_int -mi_gdb_test "-var-info-num-children struct_declarations.long_int" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.long_int" - -# Test: c_variable-4.13 -# Desc: children of int_ptr_ptr -mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \ - "get children of struct_declarations.int_ptr_ptr" - -#gdbtk_test c_variable-4.13 {children of int_ptr_ptr} { -# get_children struct_declarations.int_ptr_ptr -#} {*int_ptr_ptr} - -# Test: c_variable-4.14 -# Desc: number of children of int_ptr_ptr -mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of struct_declarations.int_ptr_ptr" - - -# Test: c_variable-4.15 -# Desc: children of struct_declarations.long_array -mi_gdb_test "-var-list-children struct_declarations.long_array" \ - "\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \ - "get children of struct_declarations.long_array" - -# Test: c_variable-4.16 -# Desc: number of children of struct_declarations.long_array -mi_gdb_test "-var-info-num-children struct_declarations.long_array" \ - "\\^done,numchild=\"10\"" \ - "get number of children of struct_declarations.long_array" - -# Test: c_variable-4.17 -# Desc: children of struct_declarations.func_ptr -mi_gdb_test "-var-list-children struct_declarations.func_ptr" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.func_ptr" - - -# Test: c_variable-4.18 -# Desc: number of children of struct_declarations.func_ptr -mi_gdb_test "-var-info-num-children struct_declarations.func_ptr" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.func_ptr" - - -# Test: c_variable-4.19 -# Desc: children of struct_declarations.func_ptr_struct -mi_gdb_test "-var-list-children struct_declarations.func_ptr_struct" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.func_ptr_struct" - -# Test: c_variable-4.20 -# Desc: number of children of struct_declarations.func_ptr_struct -mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_struct" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.func_ptr_struct" - - -# Test: c_variable-4.21 -# Desc: children of struct_declarations.func_ptr_ptr -mi_gdb_test "-var-list-children struct_declarations.func_ptr_ptr" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.func_ptr_ptr" - -# Test: c_variable-4.22 -# Desc: number of children of struct_declarations.func_ptr_ptr -mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_ptr" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.func_ptr_ptr" - - -# Test: c_variable-4.23 -# Desc: children of struct_declarations.u1 -mi_gdb_test "-var-list-children struct_declarations.u1" \ - "\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.u1.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.u1.b\",exp=\"b\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.u1.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.u1.d\",exp=\"d\",numchild=\"0\",type=\"enum foo\"\}\}" \ - "get children of struct_declarations.u1" - -# Test: c_variable-4.24 -# Desc: number of children of struct_declarations.u1 -mi_gdb_test "-var-info-num-children struct_declarations.u1" \ - "\\^done,numchild=\"4\"" \ - "get number of children of struct_declarations.u1" - -# Test: c_variable-4.25 -# Desc: children of struct_declarations.s2 -mi_gdb_test "-var-list-children struct_declarations.s2" \ - "\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.s2.u2\",exp=\"u2\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.g\",exp=\"g\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.h\",exp=\"h\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.i\",exp=\"i\",numchild=\"10\",type=\"long int \\\[10\\\]\"\}\}" \ - "get children of struct_declarations.s2" -#gdbtk_test c_variable-4.25 {children of struct_declarations.s2} { -# get_children struct_declarations.s2 -#} {u2 g h i} - -# Test: c_variable-4.26 -# Desc: number of children of struct_declarations.s2 -mi_gdb_test "-var-info-num-children struct_declarations.s2" \ - "\\^done,numchild=\"4\"" \ - "get number of children of struct_declarations.s2" - - -# Test: c_variable-4.27 -# Desc: children of struct_declarations.long_array.1 -mi_gdb_test "-var-list-children struct_declarations.long_array.1" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.long_array.1" - -# Test: c_variable-4.28 -# Desc: number of children of struct_declarations.long_array.1 -mi_gdb_test "-var-info-num-children struct_declarations.long_array.1" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.long_array.1" - -# Test: c_variable-4.29 -# Desc: children of struct_declarations.long_array.2 -mi_gdb_test "-var-list-children struct_declarations.long_array.2" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.long_array.2" - -# Test: c_variable-4.30 -# Desc: number of children of struct_declarations.long_array.2 -mi_gdb_test "-var-info-num-children struct_declarations.long_array.2" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.long_array.2" - -# Test: c_variable-4.31 -# Desc: children of struct_declarations.long_array.3 -mi_gdb_test "-var-list-children struct_declarations.long_array.3" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.long_array.3" - -# Test: c_variable-4.32 -# Desc: number of children of struct_declarations.long_array.3 -mi_gdb_test "-var-info-num-children struct_declarations.long_array.3" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.long_array.3" - -# Test: c_variable-4.33 -# Desc: children of struct_declarations.long_array.4 -mi_gdb_test "-var-list-children struct_declarations.long_array.4" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.long_array.4" - -# Test: c_variable-4.34 -# Desc: number of children of struct_declarations.long_array.4 -mi_gdb_test "-var-info-num-children struct_declarations.long_array.4" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.long_array.4" - -# Test: c_variable-4.35 -# Desc: children of struct_declarations.long_array.5 -mi_gdb_test "-var-list-children struct_declarations.long_array.5" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.long_array.5" - -# Test: c_variable-4.36 -# Desc: number of children of struct_declarations.long_array.5 -mi_gdb_test "-var-info-num-children struct_declarations.long_array.5" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.long_array.5" - -# Test: c_variable-4.37 -# Desc: children of struct_declarations.long_array.6 -mi_gdb_test "-var-list-children struct_declarations.long_array.6" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.long_array.6" - -# Test: c_variable-4.38 -# Desc: number of children of struct_declarations.long_array.6 -mi_gdb_test "-var-info-num-children struct_declarations.long_array.6" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.long_array.6" - -# Test: c_variable-4.39 -# Desc: children of struct_declarations.long_array.7 -mi_gdb_test "-var-list-children struct_declarations.long_array.7" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.long_array.7" - -# Test: c_variable-4.40 -# Desc: number of children of struct_declarations.long_array.7 -mi_gdb_test "-var-info-num-children struct_declarations.long_array.7" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.long_array.7" - -# Test: c_variable-4.41 -# Desc: children of struct_declarations.long_array.8 -mi_gdb_test "-var-list-children struct_declarations.long_array.8" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.long_array.8" - -# Test: c_variable-4.42 -# Desc: number of children of struct_declarations.long_array.8 -mi_gdb_test "-var-info-num-children struct_declarations.long_array.8" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.long_array.8" - - -# Test: c_variable-4.43 -# Desc: children of struct_declarations.long_array.9 -mi_gdb_test "-var-list-children struct_declarations.long_array.9" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.long_array.9" - -# Test: c_variable-4.44 -# Desc: number of children of struct_declarations.long_array.9 -mi_gdb_test "-var-info-num-children struct_declarations.long_array.9" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.long_array.9" - -# Test: c_variable-4.45 -# Desc: children of struct_declarations.u1.a -mi_gdb_test "-var-list-children struct_declarations.u1.a" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.u1.a" - -# Test: c_variable-4.46 -# Desc: number of children of struct_declarations.u1.a -mi_gdb_test "-var-info-num-children struct_declarations.u1.a" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.u1.a" - -# Test: c_variable-4.47 -# Desc: children of struct_declarations.u1.b -mi_gdb_test "-var-list-children struct_declarations.u1.b" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.u1.b.\\*b\",exp=\"\\*b\",numchild=\"0\",type=\"char\"\}\}" \ - "get children of struct_declarations.u1.b" - -# Test: c_variable-4.48 -# Desc: number of children of struct_declarations.u1.b -mi_gdb_test "-var-info-num-children struct_declarations.u1.b" \ - "\\^done,numchild=\"1\"" \ - "get number of children of struct_declarations.u1.b" - -# Test: c_variable-4.49 -# Desc: children of struct_declarations.u1.c -mi_gdb_test "-var-list-children struct_declarations.u1.c" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.u1.c" - -# Test: c_variable-4.50 -# Desc: number of children of struct_declarations.u1.c -mi_gdb_test "-var-info-num-children struct_declarations.u1.c" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.u1.c" - -# Test: c_variable-4.51 -# Desc: children of struct_declarations.u1.d -mi_gdb_test "-var-list-children struct_declarations.u1.d" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.u1.d" - - -# Test: c_variable-4.52 -# Desc: number of children of struct_declarations.u1.d -mi_gdb_test "-var-info-num-children struct_declarations.u1.d" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.u1.d" - - -# Test: c_variable-4.53 -# Desc: children of struct_declarations.s2.u2 -mi_gdb_test "-var-list-children struct_declarations.s2.u2" \ - "\\^done,numchild=\"3\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1\",exp=\"u1s1\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.u2.f\",exp=\"f\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.u2.u1s2\",exp=\"u1s2\",numchild=\"2\",type=\"struct \{\\.\\.\\.\}\"\}\}" \ - "get children of struct_declarations.s2.u2" - -# Test: c_variable-4.54 -# Desc: number of children of struct_declarations.s2.u2 -mi_gdb_test "-var-info-num-children struct_declarations.s2.u2" \ - "\\^done,numchild=\"3\"" \ - "get number of children of struct_declarations.s2.u2" - -# Test: c_variable-4.55 -# Desc: children of struct_declarations.s2.g -mi_gdb_test "-var-list-children struct_declarations.s2.g" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.s2.g" - -# Test: c_variable-4.56 -# Desc: number of children of struct_declarations.s2.g -mi_gdb_test "-var-info-num-children struct_declarations.s2.g" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.s2.g" - - -# Test: c_variable-4.57 -# Desc: children of struct_declarations.s2.h -mi_gdb_test "-var-list-children struct_declarations.s2.h" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.s2.h" - -# Test: c_variable-4.58 -# Desc: number of children of struct_declarations.s2.h -mi_gdb_test "-var-info-num-children struct_declarations.s2.h" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.s2.h" - - -# Test: c_variable-4.59 -# Desc: children of struct_declarations.s2.i -mi_gdb_test "-var-list-children struct_declarations.s2.i" \ - "\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.s2.i.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \ - "get children of struct_declarations.s2.i" - -# Test: c_variable-4.60 -# Desc: number of children of struct_declarations.s2.i -mi_gdb_test "-var-info-num-children struct_declarations.s2.i" \ - "\\^done,numchild=\"10\"" \ - "get number of children of struct_declarations.s2.i" - -# Test: c_variable-4.61 -# Desc: children of struct_declarations.s2.u2.u1s1 -mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1" \ - "\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1.d\",exp=\"d\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e\",exp=\"e\",numchild=\"10\",type=\"char \\\[10\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.func\",exp=\"func\",numchild=\"0\",type=\"int \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.foo\",exp=\"foo\",numchild=\"0\",type=\"efoo\"\}\}" \ - "get children of struct_declarations.s2.u2.u1s1" - -# Test: c_variable-4.62 -# Desc: number of children of struct_declarations.s2.u2.u1s1 -mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1" \ - "\\^done,numchild=\"4\"" \ - "get number of children of struct_declarations.s2.u2.u1s1" - -# Test: c_variable-4.63 -# Desc: children of struct_declarations.s2.u2.f -mi_gdb_test "-var-list-children struct_declarations.s2.u2.f" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.s2.u2.f" - -# Test: c_variable-4.64 -# Desc: number of children of struct_declarations.s2.u2.f -mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.f" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.s2.u2.f" - -# Test: c_variable-4.65 -# Desc: children of struct_declarations.s2.u2.u1s2 -mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2" \ - "\\^done,numchild=\"2\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr\",exp=\"array_ptr\",numchild=\"2\",type=\"char \\\[2\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s2.func\",exp=\"func\",numchild=\"0\",type=\"int \\(\\*\\)\\(\\)\"\}\}" \ - "get children of struct_declarations.s2.u2.u1s2" - -# Test: c_variable-4.66 -# Desc: number of children of struct_declarations.s2.u2.u1s2 -mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2" \ - "\\^done,numchild=\"2\"" \ - "get number of children of struct_declarations.s2.u2.u1s2" - -# Test: c_variable-4.67 -# Desc: children of struct_declarations.s2.u2.u1s1.d -mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.d" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.s2.u2.u1s1.d" - -# Test: c_variable-4.68 -# Desc: number of children of struct_declarations.s2.u2.u1s1.d -mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.d" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.s2.u2.u1s1.d" - -# Test: c_variable-4.69 -# Desc: children of struct_declarations.s2.u2.u1s1.e -mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.e" \ - "\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1.e.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.1\",exp=\"1\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.2\",exp=\"2\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s1.e.3\",exp=\"3\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.4\",exp=\"4\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.5\",exp=\"5\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.6\",exp=\"6\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.7\",exp=\"7\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.8\",exp=\"8\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.9\",exp=\"9\",numchild=\"0\",type=\"char\"\}\}" \ - "get children of struct_declarations.s2.u2.u1s1.e" - -# Test: c_variable-4.70 -# Desc: number of children of struct_declarations.s2.u2.u1s1.e -mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.e" \ - "\\^done,numchild=\"10\"" \ - "get number of children of struct_declarations.s2.u2.u1s1.e" - - -# Test: c_variable-4.71 -# Desc: children of struct_declarations.s2.u2.u1s1.func -mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.func" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.s2.u2.u1s1.func" - -# Test: c_variable-4.72 -# Desc: number of children of struct_declarations.s2.u2.u1s1.func -mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.func" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.s2.u2.u1s1.func" - - -# Test: c_variable-4.73 -# Desc: children of struct_declarations.s2.u2.u1s1.foo -mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.foo" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.s2.u2.u1s1.foo" - -# Test: c_variable-4.74 -# Desc: number of children of struct_declarations.s2.u2.u1s1.foo -mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.foo" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.s2.u2.u1s1.foo" - - -# Test: c_variable-4.75 -# Desc: children of struct_declarations.s2.u2.u1s2.array_ptr -mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.array_ptr" \ - "\\^done,numchild=\"2\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s2.array_ptr.1\",exp=\"1\",numchild=\"0\",type=\"char\"\}\}" \ - "get children of struct_declarations.s2.u2.u1s2.array_ptr" - -# Test: c_variable-4.76 -# Desc: number of children of struct_declarations.s2.u2.u1s2.array_ptr -mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.array_ptr" \ - "\\^done,numchild=\"2\"" \ - "get number of children of struct_declarations.s2.u2.u1s2.array_ptr" - -# Test: c_variable-4.77 -# Desc: children of struct_declarations.s2.u2.u1s2.func -mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.func" \ - "\\^done,numchild=\"0\"" \ - "get children of struct_declarations.s2.u2.u1s2.func" - -# Test: c_variable-4.78 -# Desc: number of children of struct_declarations.s2.u2.u1s2.func -mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.func" \ - "\\^done,numchild=\"0\"" \ - "get number of children of struct_declarations.s2.u2.u1s2.func" - -# Test: c_variable-4.79 -# Desc: children of struct_declarations.int_ptr_ptr.*int_ptr_ptr -mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \ - "get children of struct_declarations.int_ptr_ptr.*int_ptr_ptr" -#} {**int_ptr_ptr} - -# Test: c_variable-4.80 -# Desc: Number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr -mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr" - - -# Step to "struct_declarations.integer = 123;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"192\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - - -# Test: c_variable-4.81 -# Desc: create local variable "weird" -mi_gdb_test "-var-create weird * weird" \ - "\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \ - "create local variable weird" - -# Test: c_variable-4.82 -# Desc: children of weird -mi_gdb_test "-var-list-children weird" \ - "\\^done,numchild=\"11\",children=\{child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \ - "get children of weird" - -# Test: c_variable-4.83 -# Desc: number of children of weird -mi_gdb_test "-var-info-num-children weird" \ - "\\^done,numchild=\"11\"" \ - "get number of children of weird" - - -# Test: c_variable-4.84 -# Desc: children of weird->long_array -mi_gdb_test "-var-list-children weird.long_array" \ - "\\^done,numchild=\"10\",children=\{child=\{name=\"weird.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \ - "get children of weird.long_array" -#gdbtk_test c_variable-4.84 {children of weird->long_array} { -# get_children weird.long_array -#} {0 1 2 3 4 5 6 7 8 9} - -# Test: c_variable-4.85 -# Desc: number of children of weird.long_array -mi_gdb_test "-var-info-num-children weird.long_array" \ - "\\^done,numchild=\"10\"" \ - "get number of children of weird.long_array" - -# Test: c_variable-4.86 -# Desc: children of weird.int_ptr_ptr -mi_gdb_test "-var-list-children weird.int_ptr_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \ - "get children of weird.int_ptr_ptr" -#gdbtk_test c_variable-4.86 {children of weird->int_ptr_ptr} { -# get_children weird.int_ptr_ptr -#} {*int_ptr_ptr} - -# Test: c_variable-4.87 -# Desc: number of children of weird.int_ptr_ptr -mi_gdb_test "-var-info-num-children weird.int_ptr_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of weird.int_ptr_ptr" - -# Test: c_variable-4.88 -# Desc: children of *weird->int_ptr_ptr -mi_gdb_test "-var-list-children weird.int_ptr_ptr.*int_ptr_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \ - "get children of weird.int_ptr_ptr.*int_ptr_ptr" -#gdbtk_test c_variable-4.88 {children of *weird->int_ptr_ptr} { -# get_children weird.int_ptr_ptr.*int_ptr_ptr -#} {**int_ptr_ptr} - -# Test: c_variable-4.89 -# Desc: number of children *weird->int_ptr_ptr -mi_gdb_test "-var-info-num-children weird.int_ptr_ptr.*int_ptr_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of weird.int_ptr_ptr.*int_ptr_ptr" - -# Test: c_variable-4.90 -# Desc: create weird->int_ptr_ptr -mi_gdb_test "-var-create weird->int_ptr_ptr * weird->int_ptr_ptr" \ - "\\^done,name=\"weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"" \ - "create local variable weird->int_ptr_ptr" - -# Test: c_variable-4.91 -# Desc: children of weird->int_ptr_ptr -mi_gdb_test "-var-list-children weird->int_ptr_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",exp=\"\\*weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \ - "get children of weird->int_ptr_ptr" - - -# Test: c_variable-4.92 -# Desc: number of children of (weird->int_ptr_ptr) -mi_gdb_test "-var-info-num-children weird->int_ptr_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of weird->int_ptr_ptr" - -# Test: c_variable-4.93 -# Desc: children of *(weird->int_ptr_ptr) -mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",exp=\"\\*\\*weird->int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \ - "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr" - -# Test: c_variable-4.94 -# Desc: number of children of *(weird->int_ptr_ptr) -mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr" - -# Test: c_variable-4.95 -# Desc: children of *(*(weird->int_ptr_ptr)) -mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \ - "\\^done,numchild=\"0\"" \ - "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" - -# Test: c_variable-4.96 -# Desc: number of children of *(*(weird->int_ptr_ptr)) -mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \ - "\\^done,numchild=\"0\"" \ - "get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" - -# Test: c_variable-4.97 -# Desc: is weird editable -mi_gdb_test "-var-show-attributes weird" \ - "\\^done,attr=\"editable\"" \ - "is weird editable" - -# Test: c_variable-4.98 -# Desc: is weird->int_ptr_ptr editable -mi_gdb_test "-var-show-attributes weird->int_ptr_ptr" \ - "\\^done,attr=\"editable\"" \ - "is weird->int_ptr_ptr editable" - -# Test: c_variable-4.99 -# Desc: is *(weird->int_ptr_ptr) editable -mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr" \ - "\\^done,attr=\"editable\"" \ - "is weird.int_ptr_ptr.*int_ptr_ptr editable" - -# Test: c_variable-4.100 -# Desc: is *(*(weird->int_ptr_ptr)) editable -mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr" \ - "\\^done,attr=\"editable\"" \ - "is weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr editable" - -# Test: c_variable-4.101 -# Desc: is weird->u1 editable -mi_gdb_test "-var-show-attributes weird.u1" \ - "\\^done,attr=\"noneditable\"" \ - "is weird.u1 editable" - -# Test: c_variable-4.102 -# Desc: is weird->s2 editable -mi_gdb_test "-var-show-attributes weird.s2" \ - "\\^done,attr=\"noneditable\"" \ - "is weird.s2 editable" - -# Test: c_variable-4.103 -# Desc: is struct_declarations.u1.a editable -mi_gdb_test "-var-show-attributes struct_declarations.u1.a" \ - "\\^done,attr=\"editable\"" \ - "is struct_declarations.u1.a editable" - -# Test: c_variable-4.104 -# Desc: is struct_declarations.u1.b editable -mi_gdb_test "-var-show-attributes struct_declarations.u1.b" \ - "\\^done,attr=\"editable\"" \ - "is struct_declarations.u1.b editable" - -# Test: c_variable-4.105 -# Desc: is struct_declarations.u1.c editable -mi_gdb_test "-var-show-attributes struct_declarations.u1.c" \ - "\\^done,attr=\"editable\"" \ - "is struct_declarations.u1.c editable" - -# Test: c_variable-4.106 -# Desc: is struct_declarations.long_array editable -mi_gdb_test "-var-show-attributes struct_declarations.long_array" \ - "\\^done,attr=\"noneditable\"" \ - "is struct_declarations.long_array editable" - -# Test: c_variable-4.107 -# Desc: is struct_declarations.long_array[0] editable -mi_gdb_test "-var-show-attributes struct_declarations.long_array.0" \ - "\\^done,attr=\"editable\"" \ - "is struct_declarations.long_array.0 editable" - -# Test: c_variable-4.108 -# Desc: is struct_declarations editable -mi_gdb_test "-var-show-attributes struct_declarations" \ - "\\^done,attr=\"noneditable\"" \ - "is struct_declarations editable" - -mi_gdb_test "-var-delete weird" \ - "\\^done,ndeleted=\"24\"" \ - "delete var weird" - -##### ##### -# # -# children and update tests # -# # -##### ##### - -# Test: c_variable-5.1 -# Desc: check that nothing changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{\}" \ - "update all vars. None changed" - -# Step over "struct_declarations.integer = 123;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"193\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - -# Test: c_variable-5.2 -# Desc: check that integer changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars struct_declarations.integer" - -# Step over: -# weird->char_ptr = "hello"; -# bar = 2121; -# foo = &bar; - -send_gdb "-exec-step 3\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"196\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - -# Test: c_variable-5.3 -# Desc: check that char_ptr changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars struct_declarations.char_ptr" - -# Step over "struct_declarations.int_ptr_ptr = &foo;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"197\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - -# Test: c_variable-5.4 -# Desc: check that int_ptr_ptr and children changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars int_ptr_ptr and children changed" - -# Step over "weird->long_array[0] = 1234;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"198\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - -# Test: c_variable-5.5 -# Desc: check that long_array[0] changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars struct_declarations.long_array.0 changed" - -# Step over "struct_declarations.long_array[1] = 2345;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"199\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - -# Test: c_variable-5.6 -# Desc: check that long_array[1] changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars struct_declarations.long_array.1 changed" - -# Step over "weird->long_array[2] = 3456;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"200\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - -# Test: c_variable-5.7 -# Desc: check that long_array[2] changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars struct_declarations.long_array.2 changed" - -# Step over: -# struct_declarations.long_array[3] = 4567; -# weird->long_array[4] = 5678; -# struct_declarations.long_array[5] = 6789; -# weird->long_array[6] = 7890; -# struct_declarations.long_array[7] = 8901; -# weird->long_array[8] = 9012; -# struct_declarations.long_array[9] = 1234; -send_gdb "-exec-step 7\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"208\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - -# Test: c_variable-5.8 -# Desc: check that long_array[3-9] changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars struct_declarations.long_array.3-9 changed" - - -# Step over "weird->func_ptr = nothing;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"211\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - -# Test: c_variable-5.9 -# Desc: check that func_ptr changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars struct_declarations.func_ptr changed" - -# Delete all variables -mi_gdb_test "-var-delete struct_declarations" \ - "\\^done,ndeleted=\"65\"" \ - "delete var struct_declarations" - -mi_gdb_test "-var-delete weird->int_ptr_ptr" \ - "\\^done,ndeleted=\"3\"" \ - "delete var weird->int_ptr_ptr" - -# Step over all lines: -# ... -# psnp = &snp0; -send_gdb "-exec-step 43\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"254\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - -# Test: c_variable-5.10 -# Desc: create psnp->char_ptr -mi_gdb_test "-var-create psnp->char_ptr * psnp->char_ptr" \ - "\\^done,name=\"psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"" \ - "create local variable psnp->char_ptr" - -# Test: c_variable-5.11 -# Desc: children of psnp->char_ptr -mi_gdb_test "-var-list-children psnp->char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",exp=\"\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\}" \ - "get children of psnp->char_ptr" - -# Test: c_variable-5.12 -# Desc: number of children of psnp->char_ptr -mi_gdb_test "-var-info-num-children psnp->char_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of psnp->char_ptr" - -# Test: c_variable-5.13 -# Desc: children of *(psnp->char_ptr) -mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",exp=\"\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\}" \ - "get children of psnp->char_ptr.*psnp->char_ptr" - -# Test: c_variable-5.14 -# Desc: number of children of *(psnp->char_ptr) -mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of psnp->char_ptr.*psnp->char_ptr" - -# Test: c_variable-5.15 -# Desc: children of *(*(psnp->char_ptr)) -mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \ - "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" - -# Test: c_variable-5.15B -# Desc: children of *(*(*(psnp->char_ptr))) -mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ - "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" - -# Test: c_variable-5.16 -# Desc: number of children of *(*(psnp->char_ptr)) -mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" - -# Test: c_variable-5.17 -# Desc: children of *(*(*(psnp->char_ptr))) -mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ - "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" - -# Test: c_variable-5.18 -# Desc: number of children of *(*(*(psnp->char_ptr))) -mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" - -# Test: c_variable-5.17B -# Desc: children of *(*(*(*(psnp->char_ptr)))) -mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \ - "\\^done,numchild=\"0\"" \ - "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" - -# Test: c_variable-5.18B -# Desc: number of children of *(*(*(*(psnp->char_ptr)))) -mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \ - "\\^done,numchild=\"0\"" \ - "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" - - -# Test: c_variable-5.19 -# Desc: create psnp->long_ptr -mi_gdb_test "-var-create psnp->long_ptr * psnp->long_ptr" \ - "\\^done,name=\"psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"" \ - "create local variable psnp->long_ptr" - -# Test: c_variable-5.20 -# Desc: children of psnp->long_ptr -mi_gdb_test "-var-list-children psnp->long_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",exp=\"\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\"\}\}" \ - "get children of psnp->long_ptr" - -# Test: c_variable-5.21 -# Desc: number of children of psnp->long_ptr -mi_gdb_test "-var-info-num-children psnp->long_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of psnp->long_ptr" - -# Test: c_variable-5.22 -# Desc: children of *(psnp->long_ptr) -mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",exp=\"\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\"\}\}" \ - "get children of psnp->long_ptr.*psnp->long_ptr" - - -# Test: c_variable-5.23 -# Desc: number of children of *(psnp->long_ptr) -mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of psnp->long_ptr.*psnp->long_ptr" - -# Test: c_variable-5.24 -# Desc: children of *(*(psnp->long_ptr)) -mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\"\}\}" \ - "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" - -# Test: c_variable-5.25 -# Desc: number of children of *(*(psnp->long_ptr)) -mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" - -# Test: c_variable-5.26 -# Desc: children of *(*(*(psnp->long_ptr))) -mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*\\*psnp->long_ptr\",numchild=\"0\",type=\"long int\"\}\}" \ - "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" - -# Test: c_variable-5.27 -# Desc: number of children of *(*(*(psnp->long_ptr))) -mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" - -# Test: c_variable-5.28 -# Desc: children of *(*(*(*(psnp->long_ptr)))) -mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \ - "\\^done,numchild=\"0\"" \ - "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" - -# Test: c_variable-5.29 -# Desc: number of children of *(*(*(*(psnp->long_ptr)))) -mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \ - "\\^done,numchild=\"0\"" \ - "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" - -# Test: c_variable-5.30 -# Desc: create psnp->ptrs -mi_gdb_test "-var-create psnp->ptrs * psnp->ptrs" \ - "\\^done,name=\"psnp->ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"" \ - "create local variable psnp->ptrs" - -# Test: c_variable-5.31 -# Desc: children of psnp->ptrs -mi_gdb_test "-var-list-children psnp->ptrs" \ - "\\^done,numchild=\"3\",children=\{child=\{name=\"psnp->ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \ - "get children of psnp->ptrs" - -# Test: c_variable-5.32 -# Desc: number of children of psnp->ptrs -mi_gdb_test "-var-info-num-children psnp->ptrs" \ - "\\^done,numchild=\"3\"" \ - "get number of children of psnp->ptrs" - -# Test: c_variable-5.33 -# Desc: children of psnp->ptrs[0] -mi_gdb_test "-var-list-children psnp->ptrs.0" \ - "\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \ - "get children of psnp->ptrs.0" - -# Test: c_variable-5.34 -# Desc: number of children of psnp->ptrs[0] -mi_gdb_test "-var-info-num-children psnp->ptrs.0" \ - "\\^done,numchild=\"4\"" \ - "get number of children of psnp->ptrs.0" - -# Test: c_variable-5.35 -# Desc: children of psnp->ptrs[0]->next -mi_gdb_test "-var-list-children psnp->ptrs.0.next" \ - "\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \ - "get children of psnp->ptrs.0.next" - -#} {char_ptr long_ptr ptrs next} - -# Test: c_variable-5.36 -# Desc: number of children of psnp->ptrs[0]->next -mi_gdb_test "-var-info-num-children psnp->ptrs.0.next" \ - "\\^done,numchild=\"4\"" \ - "get number of children of psnp->ptrs.0.next" - - -# Test: c_variable-5.37 -# Desc: children of psnp->ptrs[0]->next->char_ptr -mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\}" \ - "get children of psnp->ptrs.0.next.char_ptr" - -#gdbtk_test c_variable-5.37 {children of psnp->ptrs[0]->next->char_ptr} { -# get_children psnp->ptrs.0.next.char_ptr -#} {*char_ptr} - -# Test: c_variable-5.38 -# Desc: number of children of psnp->ptrs[0]->next->char_ptr -mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of psnp->ptrs.0.next.char_ptr" - -# Test: c_variable-5.39 -# Desc: children of *psnp->ptrs[0]->next->char_ptr -mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",exp=\"\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\}" \ - "get children of psnp->ptrs.0.next.char_ptr.*char_ptr" - -# Test: c_variable-5.40 -# Desc: number of children of *psnp->ptrs[0]->next->char_ptr -mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr" - -# Test: c_variable-5.41 -# Desc: children of **psnp->ptrs[0]->next->char_ptr -mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \ - "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" - -# Test: c_variable-5.41B -# Desc: children of ***psnp->ptrs[0]->next->char_ptr -mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ - "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" - -# Test: c_variable-5.42 -# Desc: number of children of **psnp->ptrs[0]->next->char_ptr -mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" - -# Test: c_variable-5.43 -# Desc: children of ***psnp->ptrs[0]->next->char_ptr -mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \ - "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \ - "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" - -# Test: c_variable-5.44 -# Desc: number of children of ***psnp->ptrs[0]->next->char_ptr -mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \ - "\\^done,numchild=\"1\"" \ - "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" - -# Test: c_variable-5.43B -# Desc: children of ****psnp->ptrs[0]->next->char_ptr -mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \ - "\\^done,numchild=\"0\"" \ - "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" - -# Test: c_variable-5.44B -# Desc: number of children of ****psnp->ptrs[0]->next->char_ptr -mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \ - "\\^done,numchild=\"0\"" \ - "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" - -# Test: c_variable-5.45 -# Desc: children of psnp->ptrs[0]->next->next -mi_gdb_test "-var-list-children psnp->ptrs.0.next.next" \ - "\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.next.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \ - "get children of psnp->ptrs.0.next.next" - -# Test: c_variable-5.46 -# Desc: children of psnp->ptrs[0]->next->next->ptrs -mi_gdb_test "-var-list-children psnp->ptrs.0.next.next.ptrs" \ - "\\^done,numchild=\"3\",children=\{child=\{name=\"psnp->ptrs.0.next.next.ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \ - "get children of psnp->ptrs.0.next.next.ptrs" - -# Step over "snp0.char_ptr = &b3;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"255\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - -# Test: c_variable-5.47 -# Desc: check that psnp->char_ptr (and [0].char_ptr) changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars psnp->char_ptr (and 0.char_ptr) changed" - -# Step over "snp1.char_ptr = &c3;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"256\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - - -# Test: c_variable-5.48 -# Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars psnp->next->char_ptr (and 1.char_ptr) changed" - - -# Step over "snp2.char_ptr = &a3;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"257\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - - -# Test: c_variable-5.49 -# Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars psnp->next->next->char_ptr (and 2.char_ptr) changed" - - -# Step over "snp0.long_ptr = &y3;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"258\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - -# Test: c_variable-5.50 -# Desc: check that psnp->long_ptr (and [0].long_ptr) changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars psnp->long_ptr (and 0.long_ptr) changed" - - -# Step over "snp1.long_ptr = &x3;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"259\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - - -# Test: c_variable-5.51 -# Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed -# Why does this have a FIXME? -setup_xfail *-*-* -mi_gdb_test "-var-update *" \ - "FIXME\\^done,changelist=\{name=\"psnp->ptrs.0.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars psnp->next->long_ptr (and 1.long_ptr) changed" -clear_xfail *-*-* - -# This command produces this error message: -# &"warning: varobj_list: assertion failed - mycount <> 0\n" -# - -# Step over "snp2.long_ptr = &z3;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - - -# Test: c_variable-5.52 -# Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars psnp->next->next->long_ptr (and 2.long_ptr) changed" - - - - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-var-cmd.exp b/gdb/testsuite/gdb.mi/mi0-var-cmd.exp deleted file mode 100644 index ae2bd7b66eb..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-var-cmd.exp +++ /dev/null @@ -1,605 +0,0 @@ -# Copyright (C) 1999 2000 Cygnus Solutions -# -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# Test essential Machine interface (MI) operations -# -# Verify that, using the MI, we can create, update, delete variables. -# - - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "var-cmd" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - - -##### ##### -# # -# Variable Creation tests # -# # -##### ##### - -# Test: c_variable-1.1 -# Desc: Create global variable - -mi_gdb_test "111-var-create global_simple * global_simple" \ - "111\\^done,name=\"global_simple\",numchild=\"6\",type=\"simpleton\"" \ - "create global variable" - -# Test: c_variable-1.2 -# Desc: Create non-existent variable - -mi_gdb_test "112-var-create bogus_unknown_variable * bogus_unknown_variable" \ - "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*112\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \ - "create non-existent variable" - -# Test: c_variable-1.3 -# Desc: Create out of scope variable - -mi_gdb_test "113-var-create argc * argc" \ - "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*113\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \ - "create out of scope variable" - -mi_gdb_test "200-break-insert do_locals_tests" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_locals_tests\",file=\".*var-cmd.c\",line=\"106\",times=\"0\"\}" \ - "break-insert operation" - -mi_run_cmd -# The running part has been checked already by mi_run_cmd -gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"106\"\}\r\n$mi_gdb_prompt$" { - pass "run to do_locals_tests" - } - -re ".*$mi_gdb_prompt$" {fail "run todo_locals_tests (2)"} - timeout {fail "run to do_locals_tests (timeout 2)"} -} - -# Test: c_variable-1.4 -# Desc: create local variables - -mi_gdb_test "-var-create linteger * linteger" \ - "\\^done,name=\"linteger\",numchild=\"0\",type=\"int\"" \ - "create local variable linteger" - -mi_gdb_test "-var-create lpinteger * lpinteger" \ - "\\^done,name=\"lpinteger\",numchild=\"1\",type=\"int \\*\"" \ - "create local variable lpinteger" - -mi_gdb_test "-var-create lcharacter * lcharacter" \ - "\\^done,name=\"lcharacter\",numchild=\"0\",type=\"char\"" \ - "create local variablelcharacter " - -mi_gdb_test "-var-create lpcharacter * lpcharacter" \ - "\\^done,name=\"lpcharacter\",numchild=\"0\",type=\"char \\*\"" \ - "create local variable lpcharacter" - -mi_gdb_test "-var-create llong * llong" \ - "\\^done,name=\"llong\",numchild=\"0\",type=\"long int\"" \ - "create local variable llong" - -mi_gdb_test "-var-create lplong * lplong" \ - "\\^done,name=\"lplong\",numchild=\"1\",type=\"long int \\*\"" \ - "create local variable lplong" - -mi_gdb_test "-var-create lfloat * lfloat" \ - "\\^done,name=\"lfloat\",numchild=\"0\",type=\"float\"" \ - "create local variable lfloat" - -mi_gdb_test "-var-create lpfloat * lpfloat" \ - "\\^done,name=\"lpfloat\",numchild=\"1\",type=\"float \\*\"" \ - "create local variable lpfloat" - -mi_gdb_test "-var-create ldouble * ldouble" \ - "\\^done,name=\"ldouble\",numchild=\"0\",type=\"double\"" \ - "create local variable ldouble" - -mi_gdb_test "-var-create lpdouble * lpdouble" \ - "\\^done,name=\"lpdouble\",numchild=\"1\",type=\"double \\*\"" \ - "create local variable lpdouble" - -mi_gdb_test "-var-create lsimple * lsimple" \ - "\\^done,name=\"lsimple\",numchild=\"6\",type=\"struct _simple_struct\"" \ - "create local variable lsimple" - -mi_gdb_test "-var-create lpsimple * lpsimple" \ - "\\^done,name=\"lpsimple\",numchild=\"6\",type=\"struct _simple_struct \\*\"" \ - "create local variable lpsimple" - -mi_gdb_test "-var-create func * func" \ - "\\^done,name=\"func\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"" \ - "create local variable func" - -# Test: c_variable-1.5 -# Desc: create lsimple.character -mi_gdb_test "-var-create lsimple.character * lsimple.character" \ - "\\^done,name=\"lsimple.character\",numchild=\"0\",type=\"char\"" \ - "create lsimple.character" - -# Test: c_variable-1.6 -# Desc: create lpsimple->integer -mi_gdb_test "-var-create lsimple->integer * lsimple->integer" \ - "\\^done,name=\"lsimple->integer\",numchild=\"0\",type=\"int\"" \ - "create lsimple->integer" - -# Test: c_variable-1.7 -# Desc: ceate lsimple.integer -mi_gdb_test "-var-create lsimple.integer * lsimple.integer" \ - "\\^done,name=\"lsimple.integer\",numchild=\"0\",type=\"int\"" \ - "create lsimple->integer" - - -# Test: c_variable-1.9 -# Desc: create type name -# Type names (like int, long, etc..) are all proper expressions to gdb. -# make sure variable code does not allow users to create variables, though. -mi_gdb_test "-var-create int * int" \ - "&\"Attempt to use a type name as an expression.mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \ - "create int" - - -##### ##### -# # -# Value changed tests # -# # -##### ##### - -# Test: c_variable-2.1 -# Desc: check whether values changed at do_block_tests -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{\}" \ - "update all vars" - -# Step over "linteger = 1234;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"107\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_locals_tests" - } - timeout { - fail "step at do_locals_tests (timeout)" - } -} - -# Test: c_variable-2.2 -# Desc: check whether only linteger changed values -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars: linteger changed" - -# Step over "lpinteger = &linteger;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"108\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_locals_tests" - } - timeout { - fail "step at do_locals_tests (timeout)" - } -} - -# Test: c_variable-2.3 -# Desc: check whether only lpinteger changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars: lpinteger changed" - -# Step over "lcharacter = 'a';" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"109\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_locals_tests" - } - timeout { - fail "step at do_locals_tests (timeout)" - } -} - -# Test: c_variable-2.4 -# Desc: check whether only lcharacter changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars: lcharacter changed" - -# Step over "lpcharacter = &lcharacter;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"110\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_locals_tests" - } - timeout { - fail "step at do_locals_tests (timeout)" - } -} - -# Test: c_variable-2.5 -# Desc: check whether only lpcharacter changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars: lpcharacter changed" - - -# Step over: -# llong = 2121L; -# lplong = &llong; -# lfloat = 2.1; -# lpfloat = &lfloat; -# ldouble = 2.718281828459045; -# lpdouble = &ldouble; -# lsimple.integer = 1234; -# lsimple.unsigned_integer = 255; -# lsimple.character = 'a'; - -send_gdb "-exec-step 9\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"119\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_locals_tests" - } - timeout { - fail "step at do_locals_tests (timeout)" - } -} - -# Test: c_variable-2.6 -# Desc: check whether llong, lplong, lfloat, lpfloat, ldouble, lpdouble, lsimple.integer, -# lsimple.unsigned_character lsimple.integer lsimple.character changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",name=\"lpdouble\",in_scope=\"true\",type_changed=\"false\",name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",name=\"lpfloat\",in_scope=\"true\",type_changed=\"false\",name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",name=\"lplong\",in_scope=\"true\",type_changed=\"false\",name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars: many changed" - -# Step over: -# lsimple.signed_character = 21; -# lsimple.char_ptr = &lcharacter; -# lpsimple = &lsimple; -# func = nothing; - -send_gdb "-exec-step 4\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"125\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_locals_tests" - } - timeout { - fail "step at do_locals_tests (timeout)" - } -} - -# Test: c_variable-2.7 -# Desc: check whether (lsimple.signed_character, lsimple.char_ptr) lpsimple, func changed -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"func\",in_scope=\"true\",type_changed=\"false\",name=\"lpsimple\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars: func and lpsimple changed" - -# Step over -# linteger = 4321; -# lcharacter = 'b'; -# llong = 1212L; -# lfloat = 1.2; -# ldouble = 5.498548281828172; -# lsimple.integer = 255; -# lsimple.unsigned_integer = 4321; -# lsimple.character = 'b'; - -send_gdb "-exec-step 8\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"133\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_locals_tests" - } - timeout { - fail "step at do_locals_tests (timeout)" - } -} - -# Test: c_variable-2.8 -# Desc: check whether linteger, lcharacter, llong, lfoat, ldouble, lsimple.integer, -# lpsimple.integer lsimple.character changed -# Note: this test also checks that lpsimple->integer and lsimple.integer have -# changed (they are the same) -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",name=\"llong\",in_scope=\"true\",type_changed=\"false\",name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\",name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars: func and lpsimple changed" - - -### -# -# Test assignment to variables. More tests on assignment are in other files. -# -### -mi_gdb_test "-var-assign global_simple 0" \ - "&\"mi_cmd_var_assign: Variable object is not editable\\\\n\".*\\^error,msg=\"mi_cmd_var_assign: Variable object is not editable\"" \ - "assign to global_simple" - -mi_gdb_test "-var-assign linteger 3333" \ - "\\^done,value=\"3333\"" \ - "assign to linteger" - -mi_gdb_test "-var-evaluate-expression linteger" \ - "\\^done,value=\"3333\"" \ - "eval linteger" - -mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \ - "\\^done,value=\"$hex\"" \ - "assign to lpinteger" - -mi_gdb_test "-var-evaluate-expression lpinteger" \ - "\\^done,value=\"$hex\"" \ - "eval lpinteger" - -# reset the values to the original ones so that the rest of the file doesn't suffer. - -mi_gdb_test "-var-assign linteger 4321" \ - "\\^done,value=\"4321\"" \ - "assign to linteger" - -mi_gdb_test "-var-assign lpinteger &linteger" \ - "\\^done,value=\"$hex\"" \ - "assign to lpinteger" - -mi_gdb_test "-var-assign lcharacter 'z'" \ - "\\^done,value=\"122 'z'\"" \ - "assign to lcharacter" - -mi_gdb_test "-var-evaluate-expression lcharacter" \ - "\\^done,value=\"122 'z'\"" \ - "eval lcharacter" - -mi_gdb_test "-var-assign llong 1313L" \ - "\\^done,value=\"1313\"" \ - "assign to llong" -mi_gdb_test "-var-evaluate-expression llong" \ - "\\^done,value=\"1313\"" \ - "eval llong" -mi_gdb_test "-var-assign llong 1212L" \ - "\\^done,value=\"1212\"" \ - "assign to llong" - -mi_gdb_test "-var-assign lplong &llong+4" \ - "\\^done,value=\"$hex\"" \ - "assign to lplong" -mi_gdb_test "-var-evaluate-expression lplong" \ - "\\^done,value=\"$hex\"" \ - "eval lplong" -mi_gdb_test "-var-assign lplong &llong" \ - "\\^done,value=\"$hex\"" \ - "assign to lplong" - -mi_gdb_test "-var-assign lfloat 3.4" \ - "\\^done,value=\"3.4.*\"" \ - "assign to lfloat" -mi_gdb_test "-var-evaluate-expression lfloat" \ - "\\^done,value=\"3.4.*\"" \ - "eval lfloat" -mi_gdb_test "-var-assign lfloat 1.2" \ - "\\^done,value=\"1.2.*\"" \ - "assign to lfloat" - -mi_gdb_test "-var-assign lpfloat &lfloat+4" \ - "\\^done,value=\"$hex\"" \ - "assign to lpfloat" - -mi_gdb_test "-var-assign ldouble 5.333318284590435" \ - "\\^done,value=\"5.333318284590435\"" \ - "assign to ldouble" - -mi_gdb_test "-var-assign func do_block_tests" \ - "\\^done,value=\"$hex \"" \ - "assign to func" - -mi_gdb_test "-var-assign lsimple.character 'd'" \ - "\\^done,value=\"100 'd'\"" \ - "assign to lsimple.character" - -mi_gdb_test "-var-assign lsimple->integer 222" \ - "\\^done,value=\"222\"" \ - "assign to lsimple->integer" - -mi_gdb_test "-var-assign lsimple.integer 333" \ - "\\^done,value=\"333\"" \ - "assign to lsimple.integer" - -###### -# End of assign tests -##### - -mi_gdb_test "-break-insert subroutine1" \ - "\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine1\",file=\".*var-cmd.c\",line=\"146\",times=\"0\"\}" \ - "break-insert subroutine1" -send_gdb "-exec-continue\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\{\{name=\"i\",value=\"4321\"\},\{name=\"l\",value=\"$hex\"\}\},file=\".*var-cmd.c\",line=\"146\"\}\r\n$mi_gdb_prompt$" { - pass "continue to subroutine1" - } - timeout { - fail "continue to subroutine1 (timeout)" - } -} - -# Test: c_variable-2.10 -# Desc: create variable for locals i,l in subroutine1 -mi_gdb_test "-var-create i * i" \ - "\\^done,name=\"i\",numchild=\"0\",type=\"int\"" \ - "create i" - -mi_gdb_test "-var-create l * l" \ - "\\^done,name=\"l\",numchild=\"1\",type=\"long int \\*\"" \ - "create l" - -# Test: c_variable-2.11 -# Desc: create do_locals_tests local in subroutine1 -mi_gdb_test "-var-create linteger * linteger" \ - "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \ - "create linteger" - -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\{\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}\},file=\".*var-cmd.c\",line=\"147\"\}\r\n$mi_gdb_prompt$" { - pass "step at subroutine1" - } - timeout { - fail "step at subroutine1 (timeout)" - } -} - -# Test: c_variable-2.12 -# Desc: change global_simple.integer -# Note: This also tests whether we are reporting changes in structs properly. -# gdb normally would say that global_simple has changed, but we -# special case that, since it is not what a human expects to -# see. - -setup_xfail *-*-* -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{FIXME: WHAT IS CORRECT HERE\}" \ - "update all vars: changed FIXME" -clear_xfail *-*-* - -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\{\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}\},file=\".*var-cmd.c\",line=\"148\"\}\r\n$mi_gdb_prompt$" { - pass "step at subroutine1" - } - timeout { fail "step at subroutine1 (timeout)" } -} - -# Test: c_variable-2.13 -# Desc: change subroutine1 local i -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"i\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars: i changed" - -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"subroutine1\",args=\{\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}\},file=\".*var-cmd.c\",line=\"149\"\}\r\n$mi_gdb_prompt$" { - pass "step at subroutine1" - } - timeout { fail "step at subroutine1 (timeout)" } -} - -# Test: c_variable-2.14 -# Desc: change do_locals_tests local llong -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}" \ - "update all vars: llong changed" - -send_gdb "-exec-next\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"136\"\}\r\n$mi_gdb_prompt$" { - pass "next out of subroutine1" - } - timeout { fail "next out of subroutine1 (timeout)" } -} - -# Test: c_variable-2.15 -# Desc: check for out of scope subroutine1 locals -mi_gdb_test "-var-update *" \ - "\\^done,changelist=\{name=\"l\",in_scope=\"false\",name=\"i\",in_scope=\"false\"\}" \ - "update all vars: all now out of scope" - -# Done with locals/globals tests. Erase all variables -#delete_all_variables -mi_gdb_test "-var-delete global_simple" \ - "\\^done,ndeleted=\"1\"" \ - "delete var" - -mi_gdb_test "-var-delete linteger" \ - "\\^done,ndeleted=\"1\"" \ - "delete var linteger" - -mi_gdb_test "-var-delete lpinteger" \ - "\\^done,ndeleted=\"1\"" \ - "delete var lpinteger" - -mi_gdb_test "-var-delete lcharacter" \ - "\\^done,ndeleted=\"1\"" \ - "delete var lcharacter" - -mi_gdb_test "-var-delete lpcharacter" \ - "\\^done,ndeleted=\"1\"" \ - "delete var lpcharacter" - -mi_gdb_test "-var-delete llong" \ - "\\^done,ndeleted=\"1\"" \ - "delete var llong" - -mi_gdb_test "-var-delete lplong" \ - "\\^done,ndeleted=\"1\"" \ - "delete var lplong" - -mi_gdb_test "-var-delete lfloat" \ - "\\^done,ndeleted=\"1\"" \ - "delete var lfloat" - -mi_gdb_test "-var-delete lpfloat" \ - "\\^done,ndeleted=\"1\"" \ - "delete var lpfloat" - -mi_gdb_test "-var-delete ldouble" \ - "\\^done,ndeleted=\"1\"" \ - "delete var ldouble" - -mi_gdb_test "-var-delete lpdouble" \ - "\\^done,ndeleted=\"1\"" \ - "delete var lpdouble" - -mi_gdb_test "-var-delete lsimple" \ - "\\^done,ndeleted=\"1\"" \ - "delete var lsimple" - -mi_gdb_test "-var-delete lpsimple" \ - "\\^done,ndeleted=\"1\"" \ - "delete var lpsimple" - -mi_gdb_test "-var-delete func" \ - "\\^done,ndeleted=\"1\"" \ - "delete var func" - -mi_gdb_test "-var-delete lsimple.character" \ - "\\^done,ndeleted=\"1\"" \ - "delete var lsimple.character" - -mi_gdb_test "-var-delete lsimple->integer" \ - "\\^done,ndeleted=\"1\"" \ - "delete var lsimple->integer" - -mi_gdb_test "-var-delete lsimple.integer" \ - "\\^done,ndeleted=\"1\"" \ - "delete var lsimple.integer" - -mi_gdb_test "-var-delete i" \ - "\\^done,ndeleted=\"1\"" \ - "delete var i" - -mi_gdb_test "-var-delete l" \ - "\\^done,ndeleted=\"1\"" \ - "delete var l" - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-var-display.exp b/gdb/testsuite/gdb.mi/mi0-var-display.exp deleted file mode 100644 index e01f5341adc..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-var-display.exp +++ /dev/null @@ -1,621 +0,0 @@ -# Copyright (C) 1999 2000 Cygnus Solutions -# -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# Test essential Machine interface (MI) operations -# -# Verify that, using the MI, we can create, update, delete variables. -# - - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "var-cmd" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -mi_gdb_test "200-break-insert 260" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"260\",times=\"0\"\}" \ - "break-insert operation" - -mi_run_cmd -# The running part has been checked already by mi_run_cmd -gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" { - pass "run to do_children_tests" - } - -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"} - timeout {fail "run to do_children_tests (timeout 2)"} -} - -##### ##### -# # -# Display tests # -# # -##### ##### - -# Test: c_variable-6.1 -# Desc: create variable bar -mi_gdb_test "-var-create bar * bar" \ - "\\^done,name=\"bar\",numchild=\"0\",type=\"int\"" \ - "create local variable bar" - -# Test: c_variable-6.2 -# Desc: type of variable bar -mi_gdb_test "-var-info-type bar" \ - "\\^done,type=\"int\"" \ - "info type variable bar" - -# Test: c_variable-6.3 -# Desc: format of variable bar -mi_gdb_test "-var-show-format bar" \ - "\\^done,format=\"natural\"" \ - "show format variable bar" - -# Test: c_variable-6.4 -# Desc: value of variable bar -mi_gdb_test "-var-evaluate-expression bar" \ - "\\^done,value=\"2121\"" \ - "eval variable bar" - -# Test: c_variable-6.5 -# Desc: change format of bar to hex -mi_gdb_test "-var-set-format bar hexadecimal" \ - "\\^done,format=\"hexadecimal\"" \ - "set format variable bar" - -# Test: c_variable-6.6 -# Desc: value of bar with new format -mi_gdb_test "-var-evaluate-expression bar" \ - "\\^done,value=\"0x849\"" \ - "eval variable bar with new format" - -# Test: c_variable-6.7 -# Desc: change value of bar -mi_gdb_test "-var-assign bar 3" \ - "\\^done,value=\"0x3\"" \ - "assing to variable bar" - -mi_gdb_test "-var-set-format bar decimal" \ - "\\^done,format=\"decimal\"" \ - "set format variable bar" - -mi_gdb_test "-var-evaluate-expression bar" \ - "\\^done,value=\"3\"" \ - "eval variable bar with new value" - -mi_gdb_test "-var-delete bar" \ - "\\^done,ndeleted=\"1\"" \ - "delete var bar" - -# Test: c_variable-6.11 -# Desc: create variable foo -mi_gdb_test "-var-create foo * foo" \ - "\\^done,name=\"foo\",numchild=\"1\",type=\"int \\*\"" \ - "create local variable foo" - -# Test: c_variable-6.12 -# Desc: type of variable foo -mi_gdb_test "-var-info-type foo" \ - "\\^done,type=\"int \\*\"" \ - "info type variable foo" - -# Test: c_variable-6.13 -# Desc: format of variable foo -mi_gdb_test "-var-show-format foo" \ - "\\^done,format=\"natural\"" \ - "show format variable foo" - -# Test: c_variable-6.14 -# Desc: value of variable foo -mi_gdb_test "-var-evaluate-expression foo" \ - "\\^done,value=\"$hex\"" \ - "eval variable foo" - -# Test: c_variable-6.15 -# Desc: change format of var to octal -mi_gdb_test "-var-set-format foo octal" \ - "\\^done,format=\"octal\"" \ - "set format variable foo" - -mi_gdb_test "-var-show-format foo" \ - "\\^done,format=\"octal\"" \ - "show format variable foo" - -# Test: c_variable-6.16 -# Desc: value of foo with new format -mi_gdb_test "-var-evaluate-expression foo" \ - "\\^done,value=\"\[0-7\]+\"" \ - "eval variable foo" - -# Test: c_variable-6.17 -# Desc: change value of foo -mi_gdb_test "-var-assign foo 3" \ - "\\^done,value=\"03\"" \ - "assing to variable foo" - -mi_gdb_test "-var-set-format foo decimal" \ - "\\^done,format=\"decimal\"" \ - "set format variable foo" - -# Test: c_variable-6.18 -# Desc: check new value of foo -mi_gdb_test "-var-evaluate-expression foo" \ - "\\^done,value=\"3\"" \ - "eval variable foo" - -mi_gdb_test "-var-delete foo" \ - "\\^done,ndeleted=\"1\"" \ - "delete var foo" - -# Test: c_variable-6.21 -# Desc: create variable weird and children -mi_gdb_test "-var-create weird * weird" \ - "\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \ - "create local variable weird" - -mi_gdb_test "-var-list-children weird" \ - "\\^done,numchild=\"11\",children=\{child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"0\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \ - "get children local variable weird" - - -# Test: c_variable-6.23 -# Desc: change format of weird.func_ptr and weird.func_ptr_ptr -mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \ - "\\^done,format=\"hexadecimal\"" \ - "set format variable weird.func_ptr" - -mi_gdb_test "-var-show-format weird.func_ptr" \ - "\\^done,format=\"hexadecimal\"" \ - "show format variable weird.func_ptr" - -mi_gdb_test "-var-set-format weird.func_ptr_ptr hexadecimal" \ - "\\^done,format=\"hexadecimal\"" \ - "set format variable weird.func_ptr_ptr" - -mi_gdb_test "-var-show-format weird.func_ptr_ptr" \ - "\\^done,format=\"hexadecimal\"" \ - "show format variable weird.func_ptr_ptr" - -# Test: c_variable-6.24 -# Desc: format of weird and children -mi_gdb_test "-var-set-format weird natural" \ - "\\^done,format=\"natural\"" \ - "set format variable weird" - -mi_gdb_test "-var-set-format weird.integer natural" \ - "\\^done,format=\"natural\"" \ - "set format variable weird.integer" - -mi_gdb_test "-var-set-format weird.character natural" \ - "\\^done,format=\"natural\"" \ - "set format variable weird.character" - -mi_gdb_test "-var-set-format weird.char_ptr natural" \ - "\\^done,format=\"natural\"" \ - "set format variable weird.char_ptr" - -mi_gdb_test "-var-set-format weird.long_int natural" \ - "\\^done,format=\"natural\"" \ - "set format variable weird.long_int" - -mi_gdb_test "-var-set-format weird.int_ptr_ptr natural" \ - "\\^done,format=\"natural\"" \ - "set format variable weird.int_ptr_ptr" - -mi_gdb_test "-var-set-format weird.long_array natural" \ - "\\^done,format=\"natural\"" \ - "set format variable weird.long_array" - -mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \ - "\\^done,format=\"hexadecimal\"" \ - "set format variable weird.func_ptr" - -mi_gdb_test "-var-set-format weird.func_ptr_struct hexadecimal" \ - "\\^done,format=\"hexadecimal\"" \ - "set format variable weird.func_ptr_struct" - -mi_gdb_test "-var-set-format weird.func_ptr_ptr natural" \ - "\\^done,format=\"natural\"" \ - "set format variable weird.func_ptr_ptr" - -mi_gdb_test "-var-set-format weird.u1 natural" \ - "\\^done,format=\"natural\"" \ - "set format variable weird.u1" - -mi_gdb_test "-var-set-format weird.s2 natural" \ - "\\^done,format=\"natural\"" \ - "set format variable weird.s2" - -# Test: c_variable-6.25 -# Desc: value of weird and children -#gdbtk_test c_variable-6.25 {value of weird and children} { -# set values {} -# foreach v [lsort [array names var]] f [list x "" "" x x x x d d d d d] { -# lappend values [value $v $f] -# } - -# set values -#} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1} - -# Test: c_variable-6.26 -# Desc: change format of weird and children to octal -#gdbtk_test c_variable-6.26 {change format of weird and children to octal} { -# set formats {} -# foreach v [lsort [array names var]] { -# $var($v) format octal -# lappend formats [$var($v) format] -# } - -# set formats -#} {octal octal octal octal octal octal octal octal octal octal octal octal} - -# Test: c_variable-6.27 -# Desc: value of weird and children with new format -#gdbtk_test c_variable-6.27 {value of foo with new format} { -# set values {} -# foreach v [lsort [array names var]] { -# lappend values [value $v o] -# } - -# set values -#} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1} - -# Test: c_variable-6.30 -# Desc: create more children of weird -#gdbtk_test c_variable-6.30 {create more children of weird} { -# foreach v [array names var] { -# get_children $v -# } - -# # Do it twice to get more children -# foreach v [array names var] { -# get_children $v -# } - -# lsort [array names var] -#} {weird weird.char_ptr weird.character weird.func_ptr weird.func_ptr_ptr weird.func_ptr_struct weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.integer weird.long_array weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.long_int weird.s2 weird.s2.g weird.s2.h weird.s2.i weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9 weird.s2.u2 weird.s2.u2.f weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.u1 weird.u1.a weird.u1.b weird.u1.c weird.u1.d} - -# Test: c_variable-6.31 -# Desc: check that all children of weird change -# Ok, obviously things like weird.s2 and weird.u1 will not change! -#gdbtk_test *c_variable-6.31 {check that all children of weird change (ops, we are now reporting array names as changed in this case - seems harmless though)} { -# $var(weird) value 0x2121 -# check_update -#} {{weird.integer weird.character weird.char_ptr weird.long_int weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.func_ptr weird.func_ptr_struct weird.func_ptr_ptr weird.u1.a weird.u1.b weird.u1.c weird.u1.d weird.s2.u2.f weird.s2.g weird.s2.h weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9} {weird.s2.i weird.s2.u2 weird weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.s2 weird.long_array weird.u1} {}} - -mi_gdb_test "-var-delete weird" \ - "\\^done,ndeleted=\"12\"" \ - "delete var weird" - - -##### ##### -# # -# Special Display Tests # -# # -##### ##### - -# Stop in "do_special_tests" -mi_gdb_test "200-break-insert do_special_tests" \ - "200\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_special_tests\",file=\".*var-cmd.c\",line=\"282\",times=\"0\"\}" \ - "break-insert operation" - -send_gdb "-exec-continue\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\{\},file=\".*var-cmd.c\",line=\"282\"\}\r\n$mi_gdb_prompt$" { - pass "continue to do_special_tests" - } - timeout { - fail "continue to do_special_tests (timeout)" - } -} - -# Test: c_variable-7.10 -# Desc: create union u -mi_gdb_test "-var-create u * u" \ - "\\^done,name=\"u\",numchild=\"2\",type=\"union named_union\"" \ - "create local variable u" - -# Test: c_variable-7.11 -# Desc: value of u -mi_gdb_test "-var-evaluate-expression u" \ - "\\^done,value=\"\{\\.\\.\\.\}\"" \ - "eval variable u" - -# Test: c_variable-7.12 -# Desc: type of u -mi_gdb_test "-var-info-type u" \ - "\\^done,type=\"union named_union\"" \ - "info type variable u" - -# Test: c_variable-7.13 -# Desc: is u editable -mi_gdb_test "-var-show-attributes u" \ - "\\^done,attr=\"noneditable\"" \ - "is u editable" - -# Test: c_variable-7.14 -# Desc: number of children of u -mi_gdb_test "-var-info-num-children u" \ - "\\^done,numchild=\"2\"" \ - "get number of children of u" - -# Test: c_variable-7.15 -# Desc: children of u -mi_gdb_test "-var-list-children u" \ - "\\^done,numchild=\"2\",children=\{child=\{name=\"u.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"u.char_ptr\",exp=\"char_ptr\",numchild=\"0\",type=\"char \\*\"\}\}" \ - "get children of u" - -# Test: c_variable-7.20 -# Desc: create anonu -mi_gdb_test "-var-create anonu * anonu" \ - "\\^done,name=\"anonu\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"" \ - "create local variable anonu" - -# Test: c_variable-7.21 -# Desc: value of anonu -mi_gdb_test "-var-evaluate-expression anonu" \ - "\\^done,value=\"\{\\.\\.\\.\}\"" \ - "eval variable anonu" - -# Test: c_variable-7.22 -# Desc: type of anonu -mi_gdb_test "-var-info-type anonu" \ - "\\^done,type=\"union \{\\.\\.\\.\}\"" \ - "info type variable anonu" - -# Test: c_variable-7.23 -# Desc: is anonu editable -mi_gdb_test "-var-show-attributes anonu" \ - "\\^done,attr=\"noneditable\"" \ - "is anonu editable" - -# Test: c_variable-7.24 -# Desc: number of children of anonu -mi_gdb_test "-var-info-num-children anonu" \ - "\\^done,numchild=\"3\"" \ - "get number of children of anonu" - -# Test: c_variable-7.25 -# Desc: children of anonu -mi_gdb_test "-var-list-children anonu" \ - "\\^done,numchild=\"3\",children=\{child=\{name=\"anonu.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anonu.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anonu.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\}" \ - "get children of anonu" - -# Test: c_variable-7.30 -# Desc: create struct s -mi_gdb_test "-var-create s * s" \ - "\\^done,name=\"s\",numchild=\"6\",type=\"struct _simple_struct\"" \ - "create local variable s" - - -# Test: c_variable-7.31 -# Desc: value of s -mi_gdb_test "-var-evaluate-expression s" \ - "\\^done,value=\"\{\\.\\.\\.\}\"" \ - "eval variable s" - -# Test: c_variable-7.32 -# Desc: type of s -mi_gdb_test "-var-info-type s" \ - "\\^done,type=\"struct _simple_struct\"" \ - "info type variable s" - -# Test: c_variable-7.33 -# Desc: is s editable -mi_gdb_test "-var-show-attributes s" \ - "\\^done,attr=\"noneditable\"" \ - "is s editable" - -# Test: c_variable-7.34 -# Desc: number of children of s -mi_gdb_test "-var-info-num-children s" \ - "\\^done,numchild=\"6\"" \ - "get number of children of s" - -# Test: c_variable-7.35 -# Desc: children of s -mi_gdb_test "-var-list-children s" \ - "\\^done,numchild=\"6\",children=\{child=\{name=\"s.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"s.unsigned_integer\",exp=\"unsigned_integer\",numchild=\"0\",type=\"unsigned int\"\},child=\{name=\"s.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"s.signed_character\",exp=\"signed_character\",numchild=\"0\",type=\"signed char\"\},child=\{name=\"s.char_ptr\",exp=\"char_ptr\",numchild=\"0\",type=\"char \\*\"\},child=\{name=\"s.array_of_10\",exp=\"array_of_10\",numchild=\"10\",type=\"int \\\[10\\\]\"\}\}" \ - "get children of s" -#} {integer unsigned_integer character signed_character char_ptr array_of_10} - -# Test: c_variable-7.40 -# Desc: create anons -mi_gdb_test "-var-create anons * anons" \ - "\\^done,name=\"anons\",numchild=\"3\",type=\"struct \{\\.\\.\\.\}\"" \ - "create local variable anons" - -# Test: c_variable-7.41 -# Desc: value of anons -mi_gdb_test "-var-evaluate-expression anons" \ - "\\^done,value=\"\{\\.\\.\\.\}\"" \ - "eval variable anons" - -# Test: c_variable-7.42 -# Desc: type of anons -mi_gdb_test "-var-info-type anons" \ - "\\^done,type=\"struct \{\\.\\.\\.\}\"" \ - "info type variable anons" - -# Test: c_variable-7.43 -# Desc: is anons editable -mi_gdb_test "-var-show-attributes anons" \ - "\\^done,attr=\"noneditable\"" \ - "is anons editable" - -# Test: c_variable-7.44 -# Desc: number of children of anons -mi_gdb_test "-var-info-num-children anons" \ - "\\^done,numchild=\"3\"" \ - "get number of children of anons" - -# Test: c_variable-7.45 -# Desc: children of anons -mi_gdb_test "-var-list-children anons" \ - "\\^done,numchild=\"3\",children=\{child=\{name=\"anons.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anons.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anons.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\}" \ - "get children of anons" - - -# Test: c_variable-7.50 -# Desc: create enum e -mi_gdb_test "-var-create e * e" \ - "\\^done,name=\"e\",numchild=\"0\",type=\"enum foo\"" \ - "create local variable e" - -setup_xfail "*-*-*" -# Test: c_variable-7.51 -# Desc: value of e -mi_gdb_test "-var-evaluate-expression e" \ - "\\^done,value=\"FIXME\"" \ - "eval variable e" -clear_xfail "*-*-*" - -# Test: c_variable-7.52 -# Desc: type of e -mi_gdb_test "-var-info-type e" \ - "\\^done,type=\"enum foo\"" \ - "info type variable e" - -# Test: c_variable-7.53 -# Desc: is e editable -mi_gdb_test "-var-show-attributes e" \ - "\\^done,attr=\"editable\"" \ - "is e editable" - -# Test: c_variable-7.54 -# Desc: number of children of e -mi_gdb_test "-var-info-num-children e" \ - "\\^done,numchild=\"0\"" \ - "get number of children of e" - -# Test: c_variable-7.55 -# Desc: children of e -mi_gdb_test "-var-list-children e" \ - "\\^done,numchild=\"0\"" \ - "get children of e" - -# Test: c_variable-7.60 -# Desc: create anone -mi_gdb_test "-var-create anone * anone" \ - "\\^done,name=\"anone\",numchild=\"0\",type=\"enum \{\\.\\.\\.\}\"" \ - "create local variable anone" - -setup_xfail "*-*-*" -# Test: c_variable-7.61 -# Desc: value of anone -mi_gdb_test "-var-evaluate-expression anone" \ - "\\^done,value=\"A\"" \ - "eval variable anone" -clear_xfail "*-*-*" - - -# Test: c_variable-7.70 -# Desc: create anone -mi_gdb_test "-var-create anone * anone" \ - "&\"Duplicate variable object name\\\\n\".*\\^error,msg=\"Duplicate variable object name\"" \ - "create duplicate local variable anone" - - -# Test: c_variable-7.72 -# Desc: type of anone -mi_gdb_test "-var-info-type anone" \ - "\\^done,type=\"enum \{\\.\\.\\.\}\"" \ - "info type variable anone" - - -# Test: c_variable-7.73 -# Desc: is anone editable -mi_gdb_test "-var-show-attributes anone" \ - "\\^done,attr=\"editable\"" \ - "is anone editable" - -# Test: c_variable-7.74 -# Desc: number of children of anone -mi_gdb_test "-var-info-num-children anone" \ - "\\^done,numchild=\"0\"" \ - "get number of children of anone" - -# Test: c_variable-7.75 -# Desc: children of anone -mi_gdb_test "-var-list-children anone" \ - "\\^done,numchild=\"0\"" \ - "get children of anone" - - -# Record fp - -send_gdb "p/x \$fp\n" -gdb_expect { - -re ".*($hex).*\\^done\r\n$mi_gdb_prompt$" { - pass "print FP register" - set fp $expect_out(1,string) - } -# -re ".*" { fail "print FP register"} - timeout { fail "print FP register (timeout)"} -} - -mi_gdb_test "200-break-insert incr_a" \ - "200\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"incr_a\",file=\".*var-cmd.c\",line=\"85\",times=\"0\"\}" \ - "break-insert operation" -send_gdb "-exec-continue\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\{\{name=\"a\",value=\"2\.*\"\}\},file=\".*var-cmd.c\",line=\"85\"\}\r\n$mi_gdb_prompt$" { - pass "continue to incr_a" - } - timeout { - fail "continue to incr_a (timeout)" - } -} - -# Test: c_variable-7.81 -# Desc: Create variables in different scopes -mi_gdb_test "-var-create a1 * a" \ - "\\^done,name=\"a1\",numchild=\"0\",type=\"char\"" \ - "create local variable a1" - -mi_gdb_test "-var-create a2 $fp a" \ - "\\^done,name=\"a2\",numchild=\"0\",type=\"int\"" \ - "create variable a2 in different scope" - -#gdbtk_test c_variable-7.81 {create variables in different scopes} { -# set a1 [gdb_variable create -expr a] -# set a2 [gdb_variable create -expr a -frame $fp] - -# set vals {} -# lappend vals [$a1 value] -# lappend vals [$a2 value] -# set vals -#} {2 1} - - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi0-watch.exp b/gdb/testsuite/gdb.mi/mi0-watch.exp deleted file mode 100644 index a565193fb2e..00000000000 --- a/gdb/testsuite/gdb.mi/mi0-watch.exp +++ /dev/null @@ -1,191 +0,0 @@ -# Copyright 1999, 2000 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 -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# -# Test essential Machine interface (MI) operations -# -# Verify that, using the MI, we can run a simple program and perform basic -# debugging activities like: insert breakpoints, run the program, -# step, next, continue until it ends and, last but not least, quit. -# -# The goal is not to test gdb functionality, which is done by other tests, -# but to verify the correct output response to MI operations. -# - -load_lib mi-support.exp -set MIFLAGS "-i=mi0" - -gdb_exit -if [mi_gdb_start] { - continue -} - -set testfile "basics" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -proc test_watchpoint_creation_and_listing {} { - global mi_gdb_prompt - global srcfile - global hex - - # Insert a watchpoint and list - # Tests: - # -break-watch C - # -break-list - - mi_gdb_test "111-break-watch C" \ - "111\\^done,wpt=\{number=\"2\",exp=\"C\"\}" \ - "break-watch operation" - - mi_gdb_test "222-break-list" \ - "222\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"1\"\},bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\"\}\}" \ - "list of watchpoints" - -} - -# UNUSED at the time -proc test_awatch_creation_and_listing {} { - global mi_gdb_prompt - global srcfile - global hex - - # Insert an access watchpoint and list it - # Tests: - # -break-watch -a A - # -break-list - - mi_gdb_test "333-break-watch -a A" \ - "333\\^done,bkpt=\{number=\"1\",addr=\"$hex\",file=\".*basics.c\",line=\"32\"\}" \ - "break-watch -a operation" - - mi_gdb_test "444-break-list" \ - "444\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \ - "list of watchpoints awatch" - - mi_gdb_test "777-break-delete 3" \ - "777\\^done" \ - "delete access watchpoint" -} - -# UNUSED at the time -proc test_rwatch_creation_and_listing {} { - global mi_gdb_prompt - global srcfile - global hex - - # Insert a read watchpoint and list it. - # Tests: - # -break-insert -r B - # -break-list - - mi_gdb_test "200-break-watch -r C" \ - "200\\^done,bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \ - "break-insert -r operation" - - mi_gdb_test "300-break-list" \ - "300\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \ - "list of breakpoints" - - mi_gdb_test "177-break-delete 4" \ - "177\\^done" \ - "delete read watchpoint" -} - -proc test_running_the_program {} { - global mi_gdb_prompt - global hex - - # Run the program without args, then specify srgs and rerun the program - # Tests: - # -exec-run - - mi_gdb_test "300-break-insert callee4" \ - "300\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \ - "insert breakpoint at callee4" - - # mi_gdb_test cannot be used for asynchronous commands because there are - # two prompts involved and this can lead to a race condition. - # The following is equivalent to a send_gdb "000-exec-run\n" - mi_run_cmd - # The running part has been checked already by mi_run_cmd - gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" \ - { pass "run to callee4" } - -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"} - timeout {fail "run to callee4 (timeout 2)"} - } -} - -proc test_watchpoint_triggering {} { - global mi_gdb_prompt - global hex - - # Continue execution until the watchpoint is reached, continue again, - # to see the watchpoint go out of scope. - # Does: - # -exec-continue (Here wp triggers) - # -exec-continue (Here wp goes out of scope) - - send_gdb "222-exec-continue\n" - gdb_expect { - -re "222\\^running\r\n$mi_gdb_prompt" { - gdb_expect { - -re "222\\*stopped,reason=\"watchpoint-trigger\",wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\},thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" { - pass "watchpoint trigger" - } - -re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (2)"} - timeout {fail "watchpoint trigger (timeout 2)"} - } - } - -re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (1)"} - timeout {fail "watchpoint trigger (timeout 1)"} - } - - send_gdb "223-exec-continue\n" - gdb_expect { - -re "223\\^running\r\n$mi_gdb_prompt" { - gdb_expect { - -re "\[\r\n\]*223\\*stopped,reason=\"watchpoint-scope\",wpnum=\"2\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee3\",args=\{.*\},file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" { - pass "wp out of scope" - } - -re ".*$mi_gdb_prompt$" {fail "wp out of scope (2)"} - timeout {fail "wp out of scope (timeout 2)"} - } - } - -re ".*$mi_gdb_prompt$" {fail "wp out of scope (1)"} - timeout {fail "wp out of scope (timeout 1)"} - } -} - -test_running_the_program -test_watchpoint_creation_and_listing -#test_rwatch_creation_and_listing -#test_awatch_creation_and_listing -test_watchpoint_triggering - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.threads/linux-dp.exp b/gdb/testsuite/gdb.threads/linux-dp.exp index bdb320927de..f4b2af07fc4 100644 --- a/gdb/testsuite/gdb.threads/linux-dp.exp +++ b/gdb/testsuite/gdb.threads/linux-dp.exp @@ -146,15 +146,9 @@ proc select_thread {thread} { ### Return true if the thread had a stack which was not only ### acceptable, but interesting. SEEN should be an array in which ### SEEN(N) exists iff we have found philosopher number N before. - -set main_seen 0 -set manager_seen 0 - proc check_philosopher_stack {thread seen_name} { global gdb_prompt upvar $seen_name seen - global main_seen - global manager_seen set name "philosopher is distinct: $thread" set interesting 0 @@ -176,24 +170,6 @@ proc check_philosopher_stack {thread seen_name} { ## Maybe the thread hasn't started yet. pass $name } - -re ".* in main \\(.*$gdb_prompt $" { - if {$main_seen == 1} { - fail "main is distinct: $thread" - } else { - set main_seen 1 - pass "main is distinct: $thread" - } - set interesting 1 - } - -re ".* in __pthread_manager \\(.*$gdb_prompt $" { - if {$manager_seen == 1} { - fail "manager thread is distinct: $thread" - } else { - set manager_seen 1 - pass "manager thread is distinct: $thread" - } - set interesting 1 - } -re " in \\?\\?.*\r\n$gdb_prompt $" { ## Sometimes we can't get a backtrace. I'm going to call ## this a pass, since we do verify that at least one @@ -215,7 +191,7 @@ proc check_philosopher_stack {thread seen_name} { set any_interesting 0 array set seen {} -for {set i 1} {$i <= 7} {incr i} { +for {set i 3} {$i <= 7} {incr i} { if [check_philosopher_stack $i seen] { set any_interesting 1 } diff --git a/gdb/testsuite/gdb.threads/pthreads.exp b/gdb/testsuite/gdb.threads/pthreads.exp index e57583b475c..88db0f0ed3e 100644 --- a/gdb/testsuite/gdb.threads/pthreads.exp +++ b/gdb/testsuite/gdb.threads/pthreads.exp @@ -170,11 +170,7 @@ proc all_threads_running {} { send_gdb "p common_routine::full_coverage\n" gdb_expect { - -re ".* = 1.*$gdb_prompt $" {} - -re ".* = 0.*$gdb_prompt $" { - fail "some threads didn't run" - return 0 - } + -re ".*= 1\r\n$gdb_prompt $" {} default { fail "some threads didn't run" return 0 @@ -197,11 +193,13 @@ proc test_startup {} { # We should be able to do an info threads before starting any others. send_gdb "info threads\n" gdb_expect { - -re ".*Thread.*main.*$gdb_prompt $" { + -re ".*Thread.*LWP.*main.*$gdb_prompt $" { pass "info threads" } -re "\r\n$gdb_prompt $" { - unsupported "gdb does not support pthreads for this machine" + pass "info threads" + setup_xfail "*-*-*" + fail "gdb does not support pthreads for this machine" return 0 } } @@ -259,7 +257,6 @@ proc check_control_c {} { } timeout { fail "$description (timeout)" - return 1; } } gdb_test "bt" "" @@ -268,7 +265,6 @@ proc check_control_c {} { if [all_threads_running] then { pass "All threads running after continuing from ^C stop" } - return 0; } proc check_backtraces {} { @@ -339,10 +335,7 @@ setup_xfail "alpha-*-osf*" if [runto_main] then { clear_xfail "alpha-*-osf*" if [test_startup] then { - if [check_control_c] then { - warning "Could not stop child with ^C; skipping rest of tests.\n" - return; - } + check_control_c check_backtraces } } diff --git a/gdb/testsuite/gdb.trace/actions.c b/gdb/testsuite/gdb.trace/actions.c index ae3c1c38c1c..e8df6148461 100644 --- a/gdb/testsuite/gdb.trace/actions.c +++ b/gdb/testsuite/gdb.trace/actions.c @@ -53,15 +53,15 @@ unsigned long gdb_c_test( unsigned long *parm ) { char *p = "gdb_c_test"; - char *ridiculously_long_variable_name_with_equally_long_string_assignment; + char *rediculously_long_variable_name_with_equally_long_string_assignment; register long local_reg = 7; static unsigned long local_static, local_static_sizeof; long local_long; unsigned long *stack_ptr; unsigned long end_of_stack; - ridiculously_long_variable_name_with_equally_long_string_assignment = - "ridiculously long variable name with equally long string assignment"; + rediculously_long_variable_name_with_equally_long_string_assignment = + "rediculously long variable name with equally long string assignment"; local_static = 9; local_static_sizeof = sizeof (struct GDB_STRUCT_TEST); local_long = local_reg + 1; diff --git a/gdb/testsuite/gdb.trace/gdb_c_test.c b/gdb/testsuite/gdb.trace/gdb_c_test.c index 747759011a7..6447fb194c9 100644 --- a/gdb/testsuite/gdb.trace/gdb_c_test.c +++ b/gdb/testsuite/gdb.trace/gdb_c_test.c @@ -497,15 +497,15 @@ ULONG gdb_c_test( ULONG *parm ) { char *p = "gdb_c_test"; - char *ridiculously_long_variable_name_with_equally_long_string_assignment; + char *rediculously_long_variable_name_with_equally_long_string_assignment; register long local_reg = 7; static unsigned long local_static, local_static_sizeof; long local_long; unsigned long *stack_ptr; unsigned long end_of_stack; - ridiculously_long_variable_name_with_equally_long_string_assignment = - "ridiculously long variable name with equally long string assignment"; + rediculously_long_variable_name_with_equally_long_string_assignment = + "rediculously long variable name with equally long string assignment"; local_static = 9; local_static_sizeof = sizeof (struct GDB_STRUCT_TEST); local_long = local_reg + 1; diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 73df80f53a7..496b21a2a6c 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -371,8 +371,7 @@ proc gdb_continue_to_breakpoint {name} { -# gdb_test COMMAND PATTERN MESSAGE QUESTION RESPONSE -# Send a command to gdb; test the result. +# gdb_test COMMAND PATTERN MESSAGE -- send a command to gdb; test the result. # # COMMAND is the command to execute, send to GDB with send_gdb. If # this is the null string no command is sent. @@ -382,9 +381,6 @@ proc gdb_continue_to_breakpoint {name} { # omitted, then the pass/fail messages use the command string as the # message. (If this is the empty string, then sometimes we don't # call pass or fail at all; I don't understand this at all.) -# QUESTION is a question GDB may ask in response to COMMAND, like -# "are you sure?" -# RESPONSE is the response to send if QUESTION appears. # # Returns: # 1 if the test failed, @@ -1603,30 +1599,6 @@ proc rerun_to_main {} { } } -# Initializes the display for gdbtk testing. -# Returns 1 if tests should run, 0 otherwise. -proc gdbtk_initialize_display {} { - global _using_windows - - # This is hacky, but, we don't have much choice. When running - # expect under Windows, tcl_platform(platform) is "unix". - if {![info exists _using_windows]} { - set _using_windows [expr {![catch {exec cygpath --help}]}] - } - - if {![_gdbtk_xvfb_init]} { - if {$_using_windows} { - untested "No GDB_DISPLAY -- skipping tests" - } else { - untested "No GDB_DISPLAY or Xvfb -- skipping tests" - } - - return 0 - } - - return 1 -} - # From dejagnu: # srcdir = testsuite src dir (e.g., devo/gdb/testsuite) # objdir = testsuite obj dir (e.g., gdb/testsuite) @@ -1660,34 +1632,34 @@ proc gdbtk_start {test} { } } + set wd [pwd] - - # Find absolute path to test - set test [to_tcl_path -abs $test] - - # Set environment variables for tcl libraries and such cd $srcdir set abs_srcdir [pwd] - set env(GDBTK_LIBRARY) [to_tcl_path -abs [file join $abs_srcdir .. gdbtk library]] - set env(TCL_LIBRARY) [to_tcl_path -abs [file join $abs_srcdir .. .. tcl library]] - set env(TK_LIBRARY) [to_tcl_path -abs [file join $abs_srcdir .. .. tk library]] - set env(TIX_LIBRARY) [to_tcl_path -abs [file join $abs_srcdir .. .. tix library]] - set env(ITCL_LIBRARY) [to_tcl_path -abs [file join $abs_srcdir .. .. itcl itcl library]] - set env(CYGNUS_GUI_LIBRARY) [to_tcl_path -abs [file join .. $abs_srcdir .. .. libgui library]] - set env(DEFS) [to_tcl_path -abs [file join $abs_srcdir $subdir defs]] - + cd [file join $abs_srcdir .. gdbtk library] + set env(GDBTK_LIBRARY) [pwd] + cd [file join $abs_srcdir .. .. tcl library] + set env(TCL_LIBRARY) [pwd] + cd [file join $abs_srcdir .. .. tk library] + set env(TK_LIBRARY) [pwd] + cd [file join $abs_srcdir .. .. tix library] + set env(TIX_LIBRARY) [pwd] + cd [file join $abs_srcdir .. .. itcl itcl library] + set env(ITCL_LIBRARY) [pwd] + cd [file join .. $abs_srcdir .. .. libgui library] + set env(CYGNUS_GUI_LIBRARY) [pwd] + cd $wd + cd [file join $abs_srcdir $subdir] + set env(DEFS) [file join [pwd] defs] cd $wd cd [file join $objdir $subdir] set env(OBJDIR) [pwd] cd $wd - # Set info about target into env - _gdbtk_export_target_info - set env(SRCDIR) $abs_srcdir set env(GDBTK_VERBOSE) 1 - set env(GDBTK_LOGFILE) [to_tcl_path [file join $objdir gdb.log]] - + set env(GDBTK_LOGFILE) [file join $objdir gdb.log] + set env(GDBTK_TEST_RUNNING) 1 set err [catch {exec $GDB -nx -q --tclcommand=$test} res] if { $err } { perror "Execing $GDB failed: $res" @@ -1696,149 +1668,6 @@ proc gdbtk_start {test} { return $res } -# Start xvfb when using it. -# The precedence is: -# 1. If GDB_DISPLAY is set, use it -# 2. If Xvfb exists, use it (not on cygwin) -# 3. Skip tests -proc _gdbtk_xvfb_init {} { - global env spawn_id _xvfb_spawn_id _using_windows - - if {[info exists env(GDB_DISPLAY)]} { - set env(DISPLAY) $env(GDB_DISPLAY) - } elseif {!$_using_windows && [which Xvfb] != 0} { - set screen ":[getpid]" - set pid [spawn Xvfb $screen] - set _xvfb_spawn_id $spawn_id - set env(DISPLAY) $screen - } else { - # No Xvfb found -- skip test - return 0 - } - - return 1 -} - -# Kill xvfb -proc _gdbtk_xvfb_exit {} { - global objdir subdir env _xvfb_spawn_id - - if {[info exists _xvfb_spawn_id]} { - exec kill [exp_pid -i $_xvfb_spawn_id] - wait -i $_xvfb_spawn_id - } -} - -# help proc for setting tcl-style paths from unix-style paths -# pass "-abs" to make it an absolute path -proc to_tcl_path {unix_path {arg {}}} { - global _using_windows - - if {[string compare $unix_path "-abs"] == 0} { - set unix_path $arg - set wd [pwd] - cd [file dirname $unix_path] - set dirname [pwd] - set unix_name [file join $dirname [file tail $unix_path]] - cd $wd - } - - if {$_using_windows} { - set unix_path [exec cygpath -aw $unix_path] - set unix_path [join [split $unix_path \\] /] - } - - return $unix_path -} - -# Set information about the target into the environment -# variable TARGET_INFO. This array will contain a list -# of commands that are necessary to run a target. -# -# This is mostly devined from how dejagnu works, what -# procs are defined, and analyzing unix.exp, monitor.exp, -# and sim.exp. -# -# Array elements exported: -# Index Meaning -# ----- ------- -# init list of target/board initialization commands -# target target command for target/board -# load load command for target/board -# run run command for target_board -proc _gdbtk_export_target_info {} { - global env - - # Figure out what "target class" the testsuite is using, - # i.e., sim, monitor, native - if {[string compare [info proc gdb_target_monitor] gdb_target_monitor] == 0} { - # Using a monitor/remote target - set target monitor - } elseif {[string compare [info proc gdb_target_sim] gdb_target_sim] == 0} { - # Using a simulator target - set target simulator - } else { - # Assume native - set target native - } - - # Now setup the array to be exported. - set info(init) {} - set info(target) {} - set info(load) {} - set info(run) {} - - switch $target { - simulator { - set opts "[target_info gdb,target_sim_options]" - set info(target) "target sim $opts" - set info(load) "load" - set info(run) "run" - } - - monitor { - # Setup options for the connection - if {[target_info exists baud]} { - lappend info(init) "set remotebaud [target_info baud]" - } - if {[target_info exists binarydownload]} { - lappend info(init) "set remotebinarydownload [target_info binarydownload]" - } - if {[target_info exists disable_x_packet]} { - lappend info(init) "set remote X-packet disable" - } - if {[target_info exists disable_z_packet]} { - lappend info(init) "set remote Z-packet disable" - } - - # Get target name and connection info - if {[target_info exists gdb_protocol]} { - set targetname "[target_info gdb_protocol]" - } else { - set targetname "not_specified" - } - if {[target_info exists gdb_serial]} { - set serialport "[target_info gdb_serial]" - } elseif {[target_info exists netport]} { - set serialport "[target_info netport]" - } else { - set serialport "[target_info serial]" - } - - set info(target) "target $targetname $serialport" - set info(load) "load" - set info(run) "continue" - } - - native { - set info(run) "run" - } - } - - # Export the array to the environment - set env(TARGET_INFO) [array get info] -} - # gdbtk tests call this function to print out the results of the # tests. The argument is a proper list of lists of the form: # {status name description msg}. All of these things typically @@ -1874,16 +1703,6 @@ proc gdbtk_analyze_results {results} { } } -proc gdbtk_done {{results {}}} { - global _xvfb_spawn_id - gdbtk_analyze_results $results - - # Kill off xvfb if using it - if {[info exists _xvfb_spawn_id]} { - _gdbtk_xvfb_exit - } -} - # Print a message and return true if a test should be skipped # due to lack of floating point suport. diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 2f48ebef1b1..202a0a0923c 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -206,7 +206,6 @@ proc mi_delete_breakpoints {} { send_gdb "103-break-list\n" gdb_expect 30 { -re "103-break-list\r\n103\\\^done,BreakpointTable=\{\}\r\n$mi_gdb_prompt$" {} - -re "103-break-list\r\n103\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[\\\]\}" {} -re "103-break-list\r\n103\\\^doneNo breakpoints or watchpoints.\r\n\r\n$mi_gdb_prompt$" {warning "Unexpected console text received"} -re "$mi_gdb_prompt$" { perror "Breakpoints not deleted" ; return } -re "Delete all breakpoints.*or n.*$" { @@ -633,7 +632,7 @@ proc mi_run_to_main { } { mi_run_cmd gdb_expect { - -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"main\",args=\(\\\[\\\]\|\{\}\),file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { + -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { pass "$test" return 0 } @@ -655,7 +654,7 @@ proc mi_next { test } { global mi_gdb_prompt send_gdb "220-exec-next\n" gdb_expect { - -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{].*[\\\]\}\],,file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { + -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\{.*\},,file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { pass "$test" return 0 } @@ -677,7 +676,7 @@ proc mi_step { test } { global mi_gdb_prompt send_gdb "220-exec-step\n" gdb_expect { - -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],,file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { + -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\{.*\},,file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" { pass "$test" return 0 } @@ -687,3 +686,8 @@ proc mi_step { test } { } } } + + +# Local variables: +# change-log-default-name: "../gdb.mi/ChangeLog-mi" +# End: diff --git a/gdb/thread-db.c b/gdb/thread-db.c index 8ddc6a27332..8c1bdba4411 100644 --- a/gdb/thread-db.c +++ b/gdb/thread-db.c @@ -56,8 +56,7 @@ static void (*target_new_objfile_chain) (struct objfile *objfile); /* Non-zero if we're using this module's target vector. */ static int using_thread_db; -/* Non-zero if we have to keep this module's target vector active - across re-runs. */ +/* Non-zero if we musn't deactivate this module's target vector. */ static int keep_thread_db; /* Non-zero if we have determined the signals used by the threads @@ -123,17 +122,24 @@ static void thread_db_find_new_threads (void); /* Building process ids. */ +#ifndef TIDGET +#define TIDGET(PID) (((PID) & 0x7fffffff) >> 16) +#define PIDGET0(PID) (((PID) & 0xffff)) +#define PIDGET(PID) ((PIDGET0 (PID) == 0xffff) ? -1 : PIDGET0 (PID)) +#define MERGEPID(PID, TID) (((PID) & 0xffff) | ((TID) << 16)) +#endif -#define GET_PID(ptid) ptid_get_pid (ptid) -#define GET_LWP(ptid) ptid_get_lwp (ptid) -#define GET_THREAD(ptid) ptid_get_tid (ptid) +#define THREAD_FLAG 0x80000000 -#define is_lwp(ptid) (GET_LWP (ptid) != 0) -#define is_thread(ptid) (GET_THREAD (ptid) != 0) +#define is_lwp(pid) (((pid) & THREAD_FLAG) == 0 && TIDGET (pid)) +#define is_thread(pid) ((pid) & THREAD_FLAG) -#define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0) -#define BUILD_THREAD(tid, pid) ptid_build (pid, 0, tid) +#define GET_PID(pid) PIDGET (pid) +#define GET_LWP(pid) TIDGET (pid) +#define GET_THREAD(pid) TIDGET (pid) +#define BUILD_LWP(tid, pid) MERGEPID (pid, tid) +#define BUILD_THREAD(tid, pid) (MERGEPID (pid, tid) | THREAD_FLAG) struct private_thread_info @@ -143,6 +149,27 @@ struct private_thread_info }; +/* Helper functions. */ + +static void +restore_inferior_ptid (void *arg) +{ + ptid_t *saved_ptid_ptr = arg; + inferior_ptid = *saved_ptid_ptr; + xfree (arg); +} + +static struct cleanup * +save_inferior_ptid (void) +{ + ptid_t *saved_ptid_ptr; + + saved_ptid_ptr = xmalloc (sizeof (ptid_t)); + *saved_ptid_ptr = inferior_ptid; + return make_cleanup (restore_inferior_ptid, saved_ptid_ptr); +} + + static char * thread_db_err_str (td_err_e err) { @@ -479,6 +506,20 @@ disable_thread_signals (void) #endif } +static void +deactivate_target (void) +{ + /* Forget about the child's process ID. We shouldn't need it + anymore. */ + proc_handle.pid = 0; + + if (! keep_thread_db) + { + using_thread_db = 0; + unpush_target (&thread_db_ops); + } +} + static void thread_db_new_objfile (struct objfile *objfile) { @@ -487,15 +528,11 @@ thread_db_new_objfile (struct objfile *objfile) if (objfile == NULL) { /* All symbols have been discarded. If the thread_db target is - active, deactivate it now. */ - if (using_thread_db) - { - gdb_assert (proc_handle.pid == 0); - unpush_target (&thread_db_ops); - using_thread_db = 0; - } - + active, deactivate it now, even if the application was linked + statically against the thread library. */ keep_thread_db = 0; + if (using_thread_db) + deactivate_target (); goto quit; } @@ -573,13 +610,10 @@ attach_thread (ptid_t ptid, const td_thrhandle_t *th_p, tp->private = xmalloc (sizeof (struct private_thread_info)); tp->private->lwpid = ti_p->ti_lid; - if (ti_p->ti_state == TD_THR_UNKNOWN || - ti_p->ti_state == TD_THR_ZOMBIE) - return;/* A zombie thread -- do not attach. */ - /* Under Linux, we have to attach to each and every thread. */ #ifdef ATTACH_LWP - ATTACH_LWP (BUILD_LWP (ti_p->ti_lid, GET_PID (ptid)), 0); + if (ti_p->ti_lid != GET_PID (ptid)) + ATTACH_LWP (BUILD_LWP (ti_p->ti_lid, GET_PID (ptid)), 0); #endif /* Enable thread event reporting for this thread. */ @@ -589,23 +623,6 @@ attach_thread (ptid_t ptid, const td_thrhandle_t *th_p, target_pid_to_str (ptid), thread_db_err_str (err)); } -static void -thread_db_attach (char *args, int from_tty) -{ - target_beneath->to_attach (args, from_tty); - - /* Destroy thread info; it's no longer valid. */ - init_thread_list (); - - /* The child process is now the actual multi-threaded - program. Snatch its process ID... */ - proc_handle.pid = GET_PID (inferior_ptid); - - /* ...and perform the remaining initialization steps. */ - enable_thread_event_reporting (); - thread_db_find_new_threads(); -} - static void detach_thread (ptid_t ptid, int verbose) { @@ -617,14 +634,7 @@ static void thread_db_detach (char *args, int from_tty) { disable_thread_event_reporting (); - - /* There's no need to save & restore inferior_ptid here, since the - inferior is supposed to be survive this function call. */ - inferior_ptid = lwp_from_thread (inferior_ptid); - - /* Forget about the child's process ID. We shouldn't need it - anymore. */ - proc_handle.pid = 0; + deactivate_target (); target_beneath->to_detach (args, from_tty); } @@ -850,21 +860,12 @@ thread_db_store_registers (int regno) static void thread_db_kill (void) { - /* There's no need to save & restore inferior_ptid here, since the - inferior isn't supposed to survive this function call. */ - inferior_ptid = lwp_from_thread (inferior_ptid); target_beneath->to_kill (); } static void thread_db_create_inferior (char *exec_file, char *allargs, char **env) { - if (! keep_thread_db) - { - unpush_target (&thread_db_ops); - using_thread_db = 0; - } - target_beneath->to_create_inferior (exec_file, allargs, env); } @@ -887,10 +888,7 @@ static void thread_db_mourn_inferior (void) { remove_thread_event_breakpoints (); - - /* Forget about the child's process ID. We shouldn't need it - anymore. */ - proc_handle.pid = 0; + deactivate_target (); target_beneath->to_mourn_inferior (); } @@ -898,12 +896,11 @@ thread_db_mourn_inferior (void) static int thread_db_thread_alive (ptid_t ptid) { - td_thrhandle_t th; - td_thrinfo_t ti; - td_err_e err; - if (is_thread (ptid)) { + td_thrhandle_t th; + td_err_e err; + err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (ptid), &th); if (err != TD_OK) return 0; @@ -912,14 +909,6 @@ thread_db_thread_alive (ptid_t ptid) if (err != TD_OK) return 0; - err = td_thr_get_info_p (&th, &ti); - if (err != TD_OK) - return 0; - - if (ti.ti_state == TD_THR_UNKNOWN || - ti.ti_state == TD_THR_ZOMBIE) - return 0; /* A zombie thread. */ - return 1; } @@ -940,11 +929,6 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data) if (err != TD_OK) error ("Cannot get thread info: %s", thread_db_err_str (err)); - if (ti.ti_state == TD_THR_UNKNOWN || - ti.ti_state == TD_THR_ZOMBIE) - - return 0; /* A zombie -- ignore. */ - ptid = BUILD_THREAD (ti.ti_tid, GET_PID (inferior_ptid)); if (! in_thread_list (ptid)) @@ -1012,7 +996,6 @@ init_thread_db_ops (void) thread_db_ops.to_shortname = "multi-thread"; thread_db_ops.to_longname = "multi-threaded child process."; thread_db_ops.to_doc = "Threads and pthreads support."; - thread_db_ops.to_attach = thread_db_attach; thread_db_ops.to_detach = thread_db_detach; thread_db_ops.to_resume = thread_db_resume; thread_db_ops.to_wait = thread_db_wait; diff --git a/gdb/thread.c b/gdb/thread.c index 210b9461bfc..e781682ff6e 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -65,23 +65,6 @@ static void restore_current_thread (ptid_t); static void switch_to_thread (ptid_t ptid); static void prune_threads (void); -void -delete_step_resume_breakpoint (void *arg) -{ - struct breakpoint **breakpointp = (struct breakpoint **) arg; - struct thread_info *tp; - - if (*breakpointp != NULL) - { - delete_breakpoint (*breakpointp); - for (tp = thread_list; tp; tp = tp->next) - if (tp->step_resume_breakpoint == *breakpointp) - tp->step_resume_breakpoint = NULL; - - *breakpointp = NULL; - } -} - static void free_thread (struct thread_info *tp) { @@ -124,11 +107,26 @@ add_thread (ptid_t ptid) { struct thread_info *tp; - tp = (struct thread_info *) xmalloc (sizeof (*tp)); - memset (tp, 0, sizeof (*tp)); + tp = (struct thread_info *) xmalloc (sizeof (struct thread_info)); + tp->ptid = ptid; tp->num = ++highest_thread_num; + tp->prev_pc = 0; + tp->prev_func_start = 0; + tp->prev_func_name = NULL; + tp->step_range_start = 0; + tp->step_range_end = 0; + tp->step_frame_address = 0; + tp->step_resume_breakpoint = 0; + tp->through_sigtramp_breakpoint = 0; + tp->handling_longjmp = 0; + tp->trap_expected = 0; + tp->another_trap = 0; + tp->stepping_through_solib_after_catch = 0; + tp->stepping_through_solib_catchpoints = NULL; + tp->stepping_through_sigtramp = 0; tp->next = thread_list; + tp->private = NULL; thread_list = tp; return tp; } @@ -261,7 +259,7 @@ do_captured_list_thread_ids (void *arg) struct thread_info *tp; int num = 0; - ui_out_tuple_begin (uiout, "thread-ids"); + ui_out_list_begin (uiout, "thread-ids"); for (tp = thread_list; tp; tp = tp->next) { @@ -269,7 +267,7 @@ do_captured_list_thread_ids (void *arg) ui_out_field_int (uiout, "thread-id", tp->num); } - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); ui_out_field_int (uiout, "number-of-threads", num); return GDB_RC_OK; } @@ -287,24 +285,15 @@ gdb_list_thread_ids (/* output object */) /* Load infrun state for the thread PID. */ void -load_infrun_state (ptid_t ptid, - CORE_ADDR *prev_pc, - CORE_ADDR *prev_func_start, - char **prev_func_name, - int *trap_expected, +load_infrun_state (ptid_t ptid, CORE_ADDR *prev_pc, CORE_ADDR *prev_func_start, + 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_end, - CORE_ADDR *step_frame_address, - int *handling_longjmp, - int *another_trap, - int *stepping_through_solib_after_catch, + CORE_ADDR *step_range_start, CORE_ADDR *step_range_end, + CORE_ADDR *step_frame_address, int *handling_longjmp, + 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 *stepping_through_sigtramp) { struct thread_info *tp; @@ -317,43 +306,31 @@ load_infrun_state (ptid_t ptid, *prev_pc = tp->prev_pc; *prev_func_start = tp->prev_func_start; *prev_func_name = tp->prev_func_name; - *trap_expected = tp->trap_expected; *step_resume_breakpoint = tp->step_resume_breakpoint; - *through_sigtramp_breakpoint = tp->through_sigtramp_breakpoint; *step_range_start = tp->step_range_start; *step_range_end = tp->step_range_end; *step_frame_address = tp->step_frame_address; + *through_sigtramp_breakpoint = tp->through_sigtramp_breakpoint; *handling_longjmp = tp->handling_longjmp; + *trap_expected = tp->trap_expected; *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_sigtramp = tp->stepping_through_sigtramp; - *current_line = tp->current_line; - *current_symtab = tp->current_symtab; - *step_sp = tp->step_sp; } /* Save infrun state for the thread PID. */ void -save_infrun_state (ptid_t ptid, - CORE_ADDR prev_pc, - CORE_ADDR prev_func_start, - char *prev_func_name, - int trap_expected, +save_infrun_state (ptid_t ptid, CORE_ADDR prev_pc, CORE_ADDR prev_func_start, + 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_end, - CORE_ADDR step_frame_address, - int handling_longjmp, - int another_trap, - int stepping_through_solib_after_catch, + CORE_ADDR step_range_start, CORE_ADDR step_range_end, + CORE_ADDR step_frame_address, int handling_longjmp, + 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 stepping_through_sigtramp) { struct thread_info *tp; @@ -366,20 +343,17 @@ save_infrun_state (ptid_t ptid, tp->prev_pc = prev_pc; tp->prev_func_start = prev_func_start; tp->prev_func_name = prev_func_name; - tp->trap_expected = trap_expected; tp->step_resume_breakpoint = step_resume_breakpoint; - tp->through_sigtramp_breakpoint = through_sigtramp_breakpoint; tp->step_range_start = step_range_start; tp->step_range_end = step_range_end; tp->step_frame_address = step_frame_address; + tp->through_sigtramp_breakpoint = through_sigtramp_breakpoint; tp->handling_longjmp = handling_longjmp; + tp->trap_expected = trap_expected; tp->another_trap = another_trap; tp->stepping_through_solib_after_catch = stepping_through_solib_after_catch; tp->stepping_through_solib_catchpoints = stepping_through_solib_catchpoints; tp->stepping_through_sigtramp = stepping_through_sigtramp; - tp->current_line = current_line; - tp->current_symtab = current_symtab; - tp->step_sp = step_sp; } /* Return true if TP is an active thread. */ diff --git a/gdb/top.c b/gdb/top.c index 79eaa41cf49..be4504d68ba 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -224,6 +224,21 @@ int target_executing = 0; /* Level of control structure. */ static int control_level; +/* Structure for arguments to user defined functions. */ +#define MAXUSERARGS 10 +struct user_args + { + struct user_args *next; + struct + { + char *arg; + int len; + } + a[MAXUSERARGS]; + int count; + } + *user_args; + /* Signal to catch ^Z typed while reading a command: SIGTSTP or SIGCONT. */ #ifndef STOP_SIGNAL diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index fbe377e02a1..41d2062eb2b 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -33,8 +33,6 @@ #include "remote.h" #include "linespec.h" #include "regcache.h" -#include "completer.h" -#include "gdb-events.h" #include "ax.h" #include "ax-gdb.h" @@ -424,6 +422,10 @@ trace_command (char *arg, int from_tty) t->addr_string = savestring (addr_start, addr_end - addr_start); trace_mention (t); + + /* Let the UI know of any additions */ + if (create_tracepoint_hook) + create_tracepoint_hook (t); } if (sals.nelts > 1) @@ -570,11 +572,13 @@ tracepoint_operation (struct tracepoint *t, int from_tty, { case enable_op: t->enabled = enabled; - tracepoint_modify_event (t->number); + if (modify_tracepoint_hook) + modify_tracepoint_hook (t); break; case disable_op: t->enabled = disabled; - tracepoint_modify_event (t->number); + if (modify_tracepoint_hook) + modify_tracepoint_hook (t); break; case delete_op: if (tracepoint_chain == t) @@ -583,11 +587,14 @@ tracepoint_operation (struct tracepoint *t, int from_tty, ALL_TRACEPOINTS (t2) if (t2->next == t) { - tracepoint_delete_event (t2->number); t2->next = t->next; break; } + /* Let the UI know of any deletions */ + if (delete_tracepoint_hook) + delete_tracepoint_hook (t); + if (t->addr_string) xfree (t->addr_string); if (t->source_file) @@ -733,7 +740,8 @@ trace_pass_command (char *args, int from_tty) if (t1 == (struct tracepoint *) -1 || t1 == t2) { t2->pass_count = count; - tracepoint_modify_event (t2->number); + if (modify_tracepoint_hook) + modify_tracepoint_hook (t2); if (from_tty) printf_filtered ("Setting tracepoint %d's passcount to %d\n", t2->number, count); @@ -2786,13 +2794,12 @@ Arguments are tracepoint numbers, separated by spaces.\n\ No argument means enable all tracepoints.", &enablelist); - c = add_com ("trace", class_trace, trace_command, - "Set a tracepoint at a specified line or function or address.\n\ + add_com ("trace", class_trace, trace_command, + "Set a tracepoint at a specified line or function or address.\n\ Argument may be a line number, function name, or '*' plus an address.\n\ For a line number or function, trace at the start of its code.\n\ If an address is specified, trace at that exact address.\n\n\ Do \"help tracepoints\" for info on other tracepoint commands."); - c->completer = location_completer; add_com_alias ("tp", "trace", class_alias, 0); add_com_alias ("tr", "trace", class_alias, 1); diff --git a/gdb/ui-out.c b/gdb/ui-out.c index 910cb169c4e..b6f9c7a7203 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -25,7 +25,6 @@ #include "expression.h" /* For language.h */ #include "language.h" #include "ui-out.h" -#include "gdb_assert.h" /* Convenience macro for allocting typesafe memory. */ @@ -39,25 +38,10 @@ struct ui_out_hdr int colno; int width; int alignment; - char *col_name; char *colhdr; struct ui_out_hdr *next; }; -/* Maintain a stack so that the info applicable to the inner most list - is always available. Stack/nested level 0 is reserved for the - top-level result. */ - -enum { MAX_UI_OUT_LEVELS = 5 }; - -struct ui_out_level - { - /* Count each field; the first element is for non-list fields */ - int field_count; - /* The type of this level. */ - enum ui_out_type type; - }; - /* The ui_out structure */ /* Any change here requires a corresponding one in the initialization of the default uiout, which is statically initialized */ @@ -81,9 +65,11 @@ struct ui_out /* strinf identifying the table (as specified in the table_begin call) */ char *table_id; - /* Sub structure tracking the table depth. */ - int level; - struct ui_out_level levels[MAX_UI_OUT_LEVELS]; + /* if on, a list is being generated. The value is the level of nesting */ + int list_flag; + + /* we count each field; the first element is for non-list fields */ + int field_count[5]; /* points to the first header (if any) */ struct ui_out_hdr *headerfirst; @@ -96,78 +82,30 @@ struct ui_out }; -/* The current (inner most) level. */ -static struct ui_out_level * -current_level (struct ui_out *uiout) -{ - return &uiout->levels[uiout->level]; -} - -/* Create a new level, of TYPE. Return the new level's index. */ -static int -push_level (struct ui_out *uiout, - enum ui_out_type type, - const char *id) -{ - struct ui_out_level *current; - /* We had better not overflow the buffer. */ - uiout->level++; - gdb_assert (uiout->level >= 0 && uiout->level < MAX_UI_OUT_LEVELS); - current = current_level (uiout); - current->field_count = 0; - current->type = type; - return uiout->level; -} - -/* Discard the current level, return the discarded level's index. - TYPE is the type of the level being discarded. */ -static int -pop_level (struct ui_out *uiout, - enum ui_out_type type) -{ - /* We had better not underflow the buffer. */ - gdb_assert (uiout->level > 0 && uiout->level < MAX_UI_OUT_LEVELS); - gdb_assert (current_level (uiout)->type == type); - uiout->level--; - return uiout->level + 1; -} - - /* These are the default implementation functions */ static void default_table_begin (struct ui_out *uiout, int nbrofcols, - int nr_rows, const char *tblid); + char *tblid); static void default_table_body (struct ui_out *uiout); static void default_table_end (struct ui_out *uiout); static void default_table_header (struct ui_out *uiout, int width, - enum ui_align alig, const char *col_name, - const char *colhdr); -static void default_begin (struct ui_out *uiout, - enum ui_out_type type, - int level, const char *id); -static void default_end (struct ui_out *uiout, - enum ui_out_type type, - int level); + enum ui_align alig, char *colhdr); +static void default_list_begin (struct ui_out *uiout, int list_flag, + char *lstid); +static void default_list_end (struct ui_out *uiout, int list_flag); static void default_field_int (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, - const char *fldname, - int value); + enum ui_align alig, char *fldname, int value); static void default_field_skip (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, - const char *fldname); + enum ui_align alig, char *fldname); static void default_field_string (struct ui_out *uiout, int fldno, int width, - enum ui_align align, - const char *fldname, + enum ui_align align, char *fldname, const char *string); static void default_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align, - const char *fldname, - const char *format, - va_list args); + char *fldname, char *format, va_list args); static void default_spaces (struct ui_out *uiout, int numspaces); -static void default_text (struct ui_out *uiout, const char *string); -static void default_message (struct ui_out *uiout, int verbosity, - const char *format, +static void default_text (struct ui_out *uiout, char *string); +static void default_message (struct ui_out *uiout, int verbosity, char *format, va_list args); static void default_wrap_hint (struct ui_out *uiout, char *identstring); static void default_flush (struct ui_out *uiout); @@ -180,8 +118,8 @@ struct ui_out_impl default_ui_out_impl = default_table_body, default_table_end, default_table_header, - default_begin, - default_end, + default_list_begin, + default_list_end, default_field_int, default_field_skip, default_field_string, @@ -190,8 +128,7 @@ struct ui_out_impl default_ui_out_impl = default_text, default_message, default_wrap_hint, - default_flush, - 0, /* Does not need MI hacks. */ + default_flush }; /* The default ui_out */ @@ -210,42 +147,33 @@ struct ui_out *uiout = &def_uiout; /* These are the interfaces to implementation functions */ -static void uo_table_begin (struct ui_out *uiout, int nbrofcols, - int nr_rows, const char *tblid); +static void uo_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid); static void uo_table_body (struct ui_out *uiout); static void uo_table_end (struct ui_out *uiout); static void uo_table_header (struct ui_out *uiout, int width, - enum ui_align align, const char *col_name, - const char *colhdr); -static void uo_begin (struct ui_out *uiout, - enum ui_out_type type, - int level, const char *id); -static void uo_end (struct ui_out *uiout, - enum ui_out_type type, - int level); + enum ui_align align, char *colhdr); +static void uo_list_begin (struct ui_out *uiout, int list_flag, char *lstid); +static void uo_list_end (struct ui_out *uiout, int list_flag); static void uo_field_int (struct ui_out *uiout, int fldno, int width, - enum ui_align align, const char *fldname, int value); + enum ui_align align, char *fldname, int value); static void uo_field_skip (struct ui_out *uiout, int fldno, int width, - enum ui_align align, const char *fldname); + enum ui_align align, char *fldname); static void uo_field_string (struct ui_out *uiout, int fldno, int width, - enum ui_align align, const char *fldname, - const char *string); + enum ui_align align, char *fldname, const char *string); static void uo_field_fmt (struct ui_out *uiout, int fldno, int width, - enum ui_align align, const char *fldname, - const char *format, va_list args); + enum ui_align align, char *fldname, + char *format, va_list args); static void uo_spaces (struct ui_out *uiout, int numspaces); -static void uo_text (struct ui_out *uiout, const char *string); +static void uo_text (struct ui_out *uiout, char *string); static void uo_message (struct ui_out *uiout, int verbosity, - const char *format, va_list args); + char *format, va_list args); static void uo_wrap_hint (struct ui_out *uiout, char *identstring); static void uo_flush (struct ui_out *uiout); /* Prototypes for local functions */ extern void _initialize_ui_out (void); -static void append_header_to_list (struct ui_out *uiout, int width, - int alignment, const char *col_name, - const char *colhdr); +static void append_header_to_list (struct ui_out *uiout, int width, int alignment, char *colhdr); static int get_curr_header (struct ui_out *uiout, int *colno, int *width, int *alignment, char **colhdr); static void clear_header_list (struct ui_out *uiout); @@ -259,9 +187,7 @@ static void init_ui_out_state (struct ui_out *uiout); /* Mark beginning of a table */ void -ui_out_table_begin (struct ui_out *uiout, int nbrofcols, - int nr_rows, - const char *tblid) +ui_out_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid) { if (uiout->table_flag) internal_error (__FILE__, __LINE__, @@ -276,7 +202,7 @@ previous table_end."); uiout->table_id = NULL; clear_header_list (uiout); - uo_table_begin (uiout, nbrofcols, nr_rows, uiout->table_id); + uo_table_begin (uiout, nbrofcols, uiout->table_id); } void @@ -320,132 +246,73 @@ ui_out_table_end (struct ui_out *uiout) void ui_out_table_header (struct ui_out *uiout, int width, enum ui_align alignment, - const char *col_name, - const char *colhdr) + char *colhdr) { if (!uiout->table_flag || uiout->body_flag) internal_error (__FILE__, __LINE__, "table header must be specified after table_begin \ and before table_body."); - append_header_to_list (uiout, width, alignment, col_name, colhdr); + append_header_to_list (uiout, width, alignment, colhdr); - uo_table_header (uiout, width, alignment, col_name, colhdr); + uo_table_header (uiout, width, alignment, colhdr); } void -ui_out_begin (struct ui_out *uiout, - enum ui_out_type type, - const char *id) +ui_out_list_begin (struct ui_out *uiout, char *lstid) { - int new_level; if (uiout->table_flag && !uiout->body_flag) internal_error (__FILE__, __LINE__, "table header or table_body expected; lists must be \ specified after table_body."); - new_level = push_level (uiout, type, id); - if (uiout->table_flag && (new_level == 1)) - uiout->headercurr = uiout->headerfirst; - uo_begin (uiout, type, new_level, id); -} - -void -ui_out_list_begin (struct ui_out *uiout, - const char *id) -{ - ui_out_begin (uiout, ui_out_type_list, id); -} + if (uiout->list_flag >= 4) + internal_error (__FILE__, __LINE__, + "list depth exceeded; only 4 levels of lists can be \ +nested."); -void -ui_out_tuple_begin (struct ui_out *uiout, const char *id) -{ - ui_out_begin (uiout, ui_out_type_tuple, id); -} + uiout->list_flag++; + uiout->field_count[uiout->list_flag] = 0; + if (uiout->table_flag && (uiout->list_flag == 1)) + uiout->headercurr = uiout->headerfirst; -void -ui_out_end (struct ui_out *uiout, - enum ui_out_type type) -{ - int old_level = pop_level (uiout, type); - uo_end (uiout, type, old_level); + uo_list_begin (uiout, uiout->list_flag, lstid); } void ui_out_list_end (struct ui_out *uiout) { - ui_out_end (uiout, ui_out_type_list); -} - -void -ui_out_tuple_end (struct ui_out *uiout) -{ - ui_out_end (uiout, ui_out_type_tuple); -} - -struct ui_out_end_cleanup_data -{ - struct ui_out *uiout; - enum ui_out_type type; -}; + if (!uiout->list_flag) + internal_error (__FILE__, __LINE__, + "misplaced list_end; there is no list to be closed."); -static void -do_cleanup_end (void *data) -{ - struct ui_out_end_cleanup_data *end_cleanup_data = data; - ui_out_end (end_cleanup_data->uiout, end_cleanup_data->type); - xfree (end_cleanup_data); -} + uo_list_end (uiout, uiout->list_flag); -static struct cleanup * -make_cleanup_ui_out_end (struct ui_out *uiout, - enum ui_out_type type) -{ - struct ui_out_end_cleanup_data *end_cleanup_data; - end_cleanup_data = XMALLOC (struct ui_out_end_cleanup_data); - end_cleanup_data->uiout = uiout; - end_cleanup_data->type = type; - return make_cleanup (do_cleanup_end, end_cleanup_data); + uiout->list_flag--; } -struct cleanup * -make_cleanup_ui_out_begin_end (struct ui_out *uiout, - enum ui_out_type type, - const char *id) -{ - ui_out_begin (uiout, type, id); - return make_cleanup_ui_out_end (uiout, type); -} - -struct cleanup * -make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout, - const char *id) +static void +do_list_end (void *uiout) { - ui_out_tuple_begin (uiout, id); - return make_cleanup_ui_out_end (uiout, ui_out_type_tuple); + ui_out_list_end (uiout); } struct cleanup * -make_cleanup_ui_out_list_begin_end (struct ui_out *uiout, - const char *id) +make_cleanup_ui_out_list_end (struct ui_out *uiout) { - ui_out_list_begin (uiout, id); - return make_cleanup_ui_out_end (uiout, ui_out_type_list); + return make_cleanup (do_list_end, uiout); } void -ui_out_field_int (struct ui_out *uiout, - const char *fldname, - int value) +ui_out_field_int (struct ui_out *uiout, char *fldname, int value) { int fldno; int width; int align; - struct ui_out_level *current = current_level (uiout); verify_field_proper_position (uiout); - current->field_count += 1; - fldno = current->field_count; + uiout->field_count[uiout->list_flag] += 1; + fldno = uiout->field_count[uiout->list_flag]; verify_field_alignment (uiout, fldno, &width, &align); @@ -453,9 +320,7 @@ ui_out_field_int (struct ui_out *uiout, } void -ui_out_field_core_addr (struct ui_out *uiout, - const char *fldname, - CORE_ADDR address) +ui_out_field_core_addr (struct ui_out *uiout, char *fldname, CORE_ADDR address) { char addstr[20]; @@ -467,9 +332,7 @@ ui_out_field_core_addr (struct ui_out *uiout, } void -ui_out_field_stream (struct ui_out *uiout, - const char *fldname, - struct ui_stream *buf) +ui_out_field_stream (struct ui_out *uiout, char *fldname, struct ui_stream *buf) { long length; char *buffer = ui_file_xstrdup (buf->stream, &length); @@ -485,18 +348,16 @@ ui_out_field_stream (struct ui_out *uiout, /* used to ommit a field */ void -ui_out_field_skip (struct ui_out *uiout, - const char *fldname) +ui_out_field_skip (struct ui_out *uiout, char *fldname) { int fldno; int width; int align; - struct ui_out_level *current = current_level (uiout); verify_field_proper_position (uiout); - current->field_count += 1; - fldno = current->field_count; + uiout->field_count[uiout->list_flag] += 1; + fldno = uiout->field_count[uiout->list_flag]; verify_field_alignment (uiout, fldno, &width, &align); @@ -505,18 +366,17 @@ ui_out_field_skip (struct ui_out *uiout, void ui_out_field_string (struct ui_out *uiout, - const char *fldname, + char *fldname, const char *string) { int fldno; int width; int align; - struct ui_out_level *current = current_level (uiout); verify_field_proper_position (uiout); - current->field_count += 1; - fldno = current->field_count; + uiout->field_count[uiout->list_flag] += 1; + fldno = uiout->field_count[uiout->list_flag]; verify_field_alignment (uiout, fldno, &width, &align); @@ -525,20 +385,17 @@ ui_out_field_string (struct ui_out *uiout, /* VARARGS */ void -ui_out_field_fmt (struct ui_out *uiout, - const char *fldname, - const char *format, ...) +ui_out_field_fmt (struct ui_out *uiout, char *fldname, char *format,...) { va_list args; int fldno; int width; int align; - struct ui_out_level *current = current_level (uiout); verify_field_proper_position (uiout); - current->field_count += 1; - fldno = current->field_count; + uiout->field_count[uiout->list_flag] += 1; + fldno = uiout->field_count[uiout->list_flag]; /* will not align, but has to call anyway */ verify_field_alignment (uiout, fldno, &width, &align); @@ -557,15 +414,13 @@ ui_out_spaces (struct ui_out *uiout, int numspaces) } void -ui_out_text (struct ui_out *uiout, - const char *string) +ui_out_text (struct ui_out *uiout, char *string) { uo_text (uiout, string); } void -ui_out_message (struct ui_out *uiout, int verbosity, - const char *format,...) +ui_out_message (struct ui_out *uiout, int verbosity, char *format,...) { va_list args; @@ -713,18 +568,10 @@ gdb_query (struct ui_out *uiout, int qflags, char *qprompt) } #endif -int -ui_out_is_mi_like_p (struct ui_out *uiout) -{ - return uiout->impl->is_mi_like_p; -} - /* default gdb-out hook functions */ static void -default_table_begin (struct ui_out *uiout, int nbrofcols, - int nr_rows, - const char *tblid) +default_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid) { } @@ -740,36 +587,29 @@ default_table_end (struct ui_out *uiout) static void default_table_header (struct ui_out *uiout, int width, enum ui_align alignment, - const char *col_name, - const char *colhdr) + char *colhdr) { } static void -default_begin (struct ui_out *uiout, - enum ui_out_type type, - int level, - const char *id) +default_list_begin (struct ui_out *uiout, int list_flag, char *lstid) { } static void -default_end (struct ui_out *uiout, - enum ui_out_type type, - int level) +default_list_end (struct ui_out *uiout, int list_flag) { } static void default_field_int (struct ui_out *uiout, int fldno, int width, - enum ui_align align, - const char *fldname, int value) + enum ui_align align, char *fldname, int value) { } static void default_field_skip (struct ui_out *uiout, int fldno, int width, - enum ui_align align, const char *fldname) + enum ui_align align, char *fldname) { } @@ -778,16 +618,14 @@ default_field_string (struct ui_out *uiout, int fldno, int width, enum ui_align align, - const char *fldname, + char *fldname, const char *string) { } static void default_field_fmt (struct ui_out *uiout, int fldno, int width, - enum ui_align align, - const char *fldname, - const char *format, + enum ui_align align, char *fldname, char *format, va_list args) { } @@ -798,13 +636,12 @@ default_spaces (struct ui_out *uiout, int numspaces) } static void -default_text (struct ui_out *uiout, const char *string) +default_text (struct ui_out *uiout, char *string) { } static void -default_message (struct ui_out *uiout, int verbosity, - const char *format, +default_message (struct ui_out *uiout, int verbosity, char *format, va_list args) { } @@ -822,13 +659,11 @@ default_flush (struct ui_out *uiout) /* Interface to the implementation functions */ void -uo_table_begin (struct ui_out *uiout, int nbrofcols, - int nr_rows, - const char *tblid) +uo_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid) { if (!uiout->impl->table_begin) return; - uiout->impl->table_begin (uiout, nbrofcols, nr_rows, tblid); + uiout->impl->table_begin (uiout, nbrofcols, tblid); } void @@ -848,40 +683,31 @@ uo_table_end (struct ui_out *uiout) } void -uo_table_header (struct ui_out *uiout, int width, enum ui_align align, - const char *col_name, - const char *colhdr) +uo_table_header (struct ui_out *uiout, int width, enum ui_align align, char *colhdr) { if (!uiout->impl->table_header) return; - uiout->impl->table_header (uiout, width, align, col_name, colhdr); + uiout->impl->table_header (uiout, width, align, colhdr); } void -uo_begin (struct ui_out *uiout, - enum ui_out_type type, - int level, - const char *id) +uo_list_begin (struct ui_out *uiout, int list_flag, char *lstid) { - if (uiout->impl->begin == NULL) + if (!uiout->impl->list_begin) return; - uiout->impl->begin (uiout, type, level, id); + uiout->impl->list_begin (uiout, list_flag, lstid); } void -uo_end (struct ui_out *uiout, - enum ui_out_type type, - int level) +uo_list_end (struct ui_out *uiout, int list_flag) { - if (uiout->impl->end == NULL) + if (!uiout->impl->list_end) return; - uiout->impl->end (uiout, type, level); + uiout->impl->list_end (uiout, list_flag); } void -uo_field_int (struct ui_out *uiout, int fldno, int width, enum ui_align align, - const char *fldname, - int value) +uo_field_int (struct ui_out *uiout, int fldno, int width, enum ui_align align, char *fldname, int value) { if (!uiout->impl->field_int) return; @@ -889,8 +715,7 @@ uo_field_int (struct ui_out *uiout, int fldno, int width, enum ui_align align, } void -uo_field_skip (struct ui_out *uiout, int fldno, int width, enum ui_align align, - const char *fldname) +uo_field_skip (struct ui_out *uiout, int fldno, int width, enum ui_align align, char *fldname) { if (!uiout->impl->field_skip) return; @@ -899,9 +724,7 @@ uo_field_skip (struct ui_out *uiout, int fldno, int width, enum ui_align align, void uo_field_string (struct ui_out *uiout, int fldno, int width, - enum ui_align align, - const char *fldname, - const char *string) + enum ui_align align, char *fldname, const char *string) { if (!uiout->impl->field_string) return; @@ -909,10 +732,7 @@ uo_field_string (struct ui_out *uiout, int fldno, int width, } void -uo_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align, - const char *fldname, - const char *format, - va_list args) +uo_field_fmt (struct ui_out *uiout, int fldno, int width, enum ui_align align, char *fldname, char *format, va_list args) { if (!uiout->impl->field_fmt) return; @@ -928,8 +748,7 @@ uo_spaces (struct ui_out *uiout, int numspaces) } void -uo_text (struct ui_out *uiout, - const char *string) +uo_text (struct ui_out *uiout, char *string) { if (!uiout->impl->text) return; @@ -937,9 +756,7 @@ uo_text (struct ui_out *uiout, } void -uo_message (struct ui_out *uiout, int verbosity, - const char *format, - va_list args) +uo_message (struct ui_out *uiout, int verbosity, char *format, va_list args) { if (!uiout->impl->message) return; @@ -985,8 +802,7 @@ static void append_header_to_list (struct ui_out *uiout, int width, int alignment, - const char *col_name, - const char *colhdr) + char *colhdr) { struct ui_out_hdr *temphdr; @@ -995,13 +811,10 @@ append_header_to_list (struct ui_out *uiout, temphdr->alignment = alignment; /* we have to copy the column title as the original may be an automatic */ if (colhdr != NULL) - temphdr->colhdr = xstrdup (colhdr); - else - temphdr->colhdr = NULL; - if (col_name != NULL) - temphdr->col_name = xstrdup (colhdr); - else - temphdr->col_name = xstrdup (colhdr); + { + temphdr->colhdr = xmalloc (strlen (colhdr) + 1); + strcpy (temphdr->colhdr, colhdr); + } temphdr->next = NULL; if (uiout->headerfirst == NULL) { @@ -1049,7 +862,7 @@ verify_field_proper_position (struct ui_out *uiout) internal_error (__FILE__, __LINE__, "table_body missing; table fields must be \ specified after table_body and inside a list."); - if (uiout->level == 0) + if (!uiout->list_flag) internal_error (__FILE__, __LINE__, "list_begin missing; table fields must be \ specified after table_body and inside a list."); @@ -1109,8 +922,8 @@ ui_out_new (struct ui_out_impl *impl, uiout->flags = flags; uiout->table_flag = 0; uiout->body_flag = 0; - uiout->level = 0; - memset (uiout->levels, 0, sizeof (uiout->levels)); + uiout->list_flag = 0; + uiout->field_count[0] = 0; uiout->headerfirst = NULL; uiout->headerlast = NULL; uiout->headercurr = NULL; diff --git a/gdb/ui-out.h b/gdb/ui-out.h index 797c2fe960d..a7be1ed6015 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -65,80 +65,44 @@ struct ui_stream /* Prototypes for ui-out API. */ -/* A result is a recursive data structure consisting of lists and - tuples. */ - -enum ui_out_type - { - ui_out_type_tuple, - ui_out_type_list - }; - -extern void ui_out_begin (struct ui_out *uiout, - enum ui_out_type level_type, - const char *id); - -extern void ui_out_end (struct ui_out *uiout, enum ui_out_type type); - -extern struct cleanup *ui_out_begin_cleanup_end (struct ui_out *uiout, - enum ui_out_type level_type, - const char *id); - -/* A table can be considered a special tuple/list combination with the - implied structure: ``table = { hdr = { header, ... } , body = [ { - field, ... }, ... ] }''. If NR_ROWS is negative then there is at - least one row. */ - extern void ui_out_table_begin (struct ui_out *uiout, int nbrofcols, - int nr_rows, const char *tblid); + char *tblid); extern void ui_out_table_header (struct ui_out *uiout, int width, - enum ui_align align, const char *col_name, - const char *colhdr); + enum ui_align align, char *colhdr); extern void ui_out_table_body (struct ui_out *uiout); extern void ui_out_table_end (struct ui_out *uiout); -/* Compatibility wrappers. */ - -extern void ui_out_list_begin (struct ui_out *uiout, const char *id); +extern void ui_out_list_begin (struct ui_out *uiout, char *lstid); extern void ui_out_list_end (struct ui_out *uiout); -extern struct cleanup *make_cleanup_ui_out_list_begin_end (struct ui_out *uiout, - const char *id); - -extern void ui_out_tuple_begin (struct ui_out *uiout, const char *id); - -extern void ui_out_tuple_end (struct ui_out *uiout); +extern struct cleanup *make_cleanup_ui_out_list_end (struct ui_out *uiout); -extern struct cleanup *make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout, - const char *id); +extern void ui_out_field_int (struct ui_out *uiout, char *fldname, int value); -extern void ui_out_field_int (struct ui_out *uiout, const char *fldname, - int value); - -extern void ui_out_field_core_addr (struct ui_out *uiout, const char *fldname, +extern void ui_out_field_core_addr (struct ui_out *uiout, char *fldname, CORE_ADDR address); -extern void ui_out_field_string (struct ui_out * uiout, const char *fldname, +extern void ui_out_field_string (struct ui_out * uiout, char *fldname, const char *string); -extern void ui_out_field_stream (struct ui_out *uiout, const char *fldname, +extern void ui_out_field_stream (struct ui_out *uiout, char *fldname, struct ui_stream *buf); -extern void ui_out_field_fmt (struct ui_out *uiout, const char *fldname, - const char *format, ...); +extern void ui_out_field_fmt (struct ui_out *uiout, char *fldname, + char *format, ...); -extern void ui_out_field_skip (struct ui_out *uiout, const char *fldname); +extern void ui_out_field_skip (struct ui_out *uiout, char *fldname); extern void ui_out_spaces (struct ui_out *uiout, int numspaces); -extern void ui_out_text (struct ui_out *uiout, const char *string); +extern void ui_out_text (struct ui_out *uiout, char *string); extern void ui_out_message (struct ui_out *uiout, int verbosity, - const char *format, ...); + char *format, ...); extern struct ui_stream *ui_out_stream_new (struct ui_out *uiout); @@ -184,13 +148,6 @@ extern void gdb_error (struct ui_out *uiout, int severity, char *format, ...); extern void gdb_query (struct ui_out *uiout, int qflags, char *qprompt); #endif -/* HACK: Code in GDB is currently checking to see the type of ui_out - builder when determining which output to produce. This function is - a hack to encapsulate that test. Once GDB manages to separate the - CLI/MI from the core of GDB the problem should just go away .... */ - -extern int ui_out_is_mi_like_p (struct ui_out *uiout); - /* From here on we have things that are only needed by implementation routines and main.c. We should pehaps have a separate file for that, like a ui-out-impl.h file */ @@ -200,41 +157,28 @@ extern int ui_out_is_mi_like_p (struct ui_out *uiout); /* Type definition of all implementation functions. */ typedef void (table_begin_ftype) (struct ui_out * uiout, - int nbrofcols, int nr_rows, - const char *tblid); + int nbrofcols, char *tblid); typedef void (table_body_ftype) (struct ui_out * uiout); typedef void (table_end_ftype) (struct ui_out * uiout); typedef void (table_header_ftype) (struct ui_out * uiout, int width, - enum ui_align align, const char *col_name, - const char *colhdr); -/* Note: level 0 is the top-level so LEVEL is always greater than - zero. */ -typedef void (ui_out_begin_ftype) (struct ui_out *uiout, - enum ui_out_type type, - int level, const char *id); -typedef void (ui_out_end_ftype) (struct ui_out *uiout, - enum ui_out_type type, - int level); + enum ui_align align, char *colhdr); +typedef void (list_begin_ftype) (struct ui_out * uiout, + int list_flag, char *lstid); +typedef void (list_end_ftype) (struct ui_out * uiout, int list_flag); typedef void (field_int_ftype) (struct ui_out * uiout, int fldno, int width, - enum ui_align align, - const char *fldname, int value); + enum ui_align align, char *fldname, int value); typedef void (field_skip_ftype) (struct ui_out * uiout, int fldno, int width, - enum ui_align align, - const char *fldname); + enum ui_align align, char *fldname); typedef void (field_string_ftype) (struct ui_out * uiout, int fldno, int width, - enum ui_align align, - const char *fldname, + enum ui_align align, char *fldname, const char *string); typedef void (field_fmt_ftype) (struct ui_out * uiout, int fldno, int width, - enum ui_align align, - const char *fldname, - const char *format, - va_list args); + enum ui_align align, char *fldname, + char *format, va_list args); typedef void (spaces_ftype) (struct ui_out * uiout, int numspaces); -typedef void (text_ftype) (struct ui_out * uiout, - const char *string); +typedef void (text_ftype) (struct ui_out * uiout, char *string); typedef void (message_ftype) (struct ui_out * uiout, int verbosity, - const char *format, va_list args); + char *format, va_list args); typedef void (wrap_hint_ftype) (struct ui_out * uiout, char *identstring); typedef void (flush_ftype) (struct ui_out * uiout); @@ -249,8 +193,8 @@ struct ui_out_impl table_body_ftype *table_body; table_end_ftype *table_end; table_header_ftype *table_header; - ui_out_begin_ftype *begin; - ui_out_end_ftype *end; + list_begin_ftype *list_begin; + list_end_ftype *list_end; field_int_ftype *field_int; field_skip_ftype *field_skip; field_string_ftype *field_string; @@ -260,7 +204,6 @@ struct ui_out_impl message_ftype *message; wrap_hint_ftype *wrap_hint; flush_ftype *flush; - int is_mi_like_p; }; extern struct ui_out_data *ui_out_data (struct ui_out *uiout); diff --git a/gdb/utils.c b/gdb/utils.c index 294ad426580..1e9c44f750e 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -868,6 +868,35 @@ quit (void) return_to_top_level (RETURN_QUIT); } + +#if defined(_MSC_VER) /* should test for wingdb instead? */ + +/* + * Windows translates all keyboard and mouse events + * into a message which is appended to the message + * queue for the process. + */ + +void +notice_quit (void) +{ + int k = win32pollquit (); + if (k == 1) + quit_flag = 1; + else if (k == 2) + immediate_quit = 1; +} + +#else /* !defined(_MSC_VER) */ + +void +notice_quit (void) +{ + /* Done by signals */ +} + +#endif /* !defined(_MSC_VER) */ + /* Control C comes here */ void request_quit (int signo) diff --git a/gdb/valops.c b/gdb/valops.c index 7cc025d4eff..0e7e7e14056 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -365,7 +365,7 @@ value_cast (struct type *type, register value_ptr arg2) /* No superclass found, just fall through to change ptr type. */ } VALUE_TYPE (arg2) = type; - arg2 = value_change_enclosing_type (arg2, type); + VALUE_ENCLOSING_TYPE (arg2) = type; /* pai: chk_val */ VALUE_POINTED_TO_OFFSET (arg2) = 0; /* pai: chk_val */ return arg2; } @@ -609,7 +609,7 @@ value_assign (register value_ptr toval, register value_ptr fromval) case lval_internalvar: set_internalvar (VALUE_INTERNALVAR (toval), fromval); val = value_copy (VALUE_INTERNALVAR (toval)->value); - val = value_change_enclosing_type (val, VALUE_ENCLOSING_TYPE (fromval)); + VALUE_ENCLOSING_TYPE (val) = VALUE_ENCLOSING_TYPE (fromval); VALUE_EMBEDDED_OFFSET (val) = VALUE_EMBEDDED_OFFSET (fromval); VALUE_POINTED_TO_OFFSET (val) = VALUE_POINTED_TO_OFFSET (fromval); return val; @@ -823,7 +823,7 @@ value_assign (register value_ptr toval, register value_ptr fromval) memcpy (VALUE_CONTENTS_RAW (val), VALUE_CONTENTS (fromval), TYPE_LENGTH (type)); VALUE_TYPE (val) = type; - val = value_change_enclosing_type (val, VALUE_ENCLOSING_TYPE (fromval)); + VALUE_ENCLOSING_TYPE (val) = VALUE_ENCLOSING_TYPE (fromval); VALUE_EMBEDDED_OFFSET (val) = VALUE_EMBEDDED_OFFSET (fromval); VALUE_POINTED_TO_OFFSET (val) = VALUE_POINTED_TO_OFFSET (fromval); @@ -965,7 +965,7 @@ value_addr (value_ptr arg1) /* This may be a pointer to a base subobject; so remember the full derived object's type ... */ - arg2 = value_change_enclosing_type (arg2, lookup_pointer_type (VALUE_ENCLOSING_TYPE (arg1))); + VALUE_ENCLOSING_TYPE (arg2) = lookup_pointer_type (VALUE_ENCLOSING_TYPE (arg1)); /* ... and also the relative position of the subobject in the full object */ VALUE_POINTED_TO_OFFSET (arg2) = VALUE_EMBEDDED_OFFSET (arg1); VALUE_BFD_SECTION (arg2) = VALUE_BFD_SECTION (arg1); @@ -1009,7 +1009,7 @@ value_ind (value_ptr arg1) /* Re-adjust type */ VALUE_TYPE (arg2) = TYPE_TARGET_TYPE (base_type); /* Add embedding info */ - arg2 = value_change_enclosing_type (arg2, enc_type); + VALUE_ENCLOSING_TYPE (arg2) = enc_type; VALUE_EMBEDDED_OFFSET (arg2) = VALUE_POINTED_TO_OFFSET (arg1); /* We may be pointing to an object of some derived type */ @@ -3165,7 +3165,7 @@ value_full_object (value_ptr argp, struct type *rtype, int xfull, int xtop, type is wrong, set it *//* pai: FIXME -- sounds iffy */ if (full) { - argp = value_change_enclosing_type (argp, real_type); + VALUE_ENCLOSING_TYPE (argp) = real_type; return argp; } diff --git a/gdb/value.h b/gdb/value.h index 8b1d18f0b5d..50abe0ebfe7 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -68,55 +68,16 @@ struct value at the same place in memory. This will be described in the lval enum above as "lval_reg_frame_relative". */ CORE_ADDR frame_addr; - /* Type of the value. */ struct type *type; + /* Type of the enclosing object if this is an embedded subobject. + The member embedded_offset gives the real position of the subobject + if type is not the same as enclosing_type. - /* If a value represents a C++ object, then the `type' field gives - the object's compile-time type. If the object actually belongs - to some class derived from `type', perhaps with other base - classes and additional members, then `type' is just a subobject - of the real thing, and the full object is probably larger than - `type' would suggest. - - If `type' is a dynamic class (i.e. one with a vtable), then GDB - can actually determine the object's run-time type by looking at - the run-time type information in the vtable. When this - information is available, we may elect to read in the entire - object, for several reasons: - - - When printing the value, the user would probably rather see - the full object, not just the limited portion apparent from - the compile-time type. - - - If `type' has virtual base classes, then even printing - `type' alone may require reaching outside the `type' - portion of the object to wherever the virtual base class - has been stored. - - When we store the entire object, `enclosing_type' is the - run-time type --- the complete object --- and `embedded_offset' - is the offset of `type' within that larger type, in bytes. The - VALUE_CONTENTS macro takes `embedded_offset' into account, so - most GDB code continues to see the `type' portion of the value, - just as the inferior would. - - If `type' is a pointer to an object, then `enclosing_type' is a - pointer to the object's run-time type, and `pointed_to_offset' - is the offset in bytes from the full object to the pointed-to - object --- that is, the value `embedded_offset' would have if - we followed the pointer and fetched the complete object. (I - don't really see the point. Why not just determine the - run-time type when you indirect, and avoid the special case? - The contents don't matter until you indirect anyway.) - - If we're not doing anything fancy, `enclosing_type' is equal to - `type', and `embedded_offset' is zero, so everything works - normally. */ + If the type field is a pointer type, then enclosing_type is + a pointer type pointing to the real (enclosing) type of the target + object. */ struct type *enclosing_type; - int embedded_offset; - int pointed_to_offset; - /* Values are stored in a chain, so that they can be deleted easily over calls to the inferior. Values assigned to internal variables or put into the value history are taken off this @@ -154,6 +115,21 @@ struct value /* If nonzero, this is the value of a variable which does not actually exist in the program. */ char optimized_out; + /* If this value represents an object that is embedded inside a + larger object (e.g., a base subobject in C++), this gives the + offset (in bytes) from the start of the contents buffer where + the embedded object begins. This is required because some C++ + runtime implementations lay out objects (especially virtual bases + with possibly negative offsets to ancestors). + Note: This may be positive or negative! Also note that this offset + is not used when retrieving contents from target memory; the entire + enclosing object has to be retrieved always, and the offset for + that is given by the member offset above. */ + int embedded_offset; + /* If this value represents a pointer to an object that is embedded + in another object, this gives the embedded_offset of the object + that is pointed to. */ + int pointed_to_offset; /* The BFD section associated with this value. */ asection *bfd_section; /* Actual contents of the value. For use of this value; setting @@ -331,8 +307,6 @@ extern value_ptr allocate_value (struct type *type); extern value_ptr allocate_repeat_value (struct type *type, int count); -extern value_ptr value_change_enclosing_type (value_ptr val, struct type *new_type); - extern value_ptr value_mark (void); extern void value_free_to_mark (value_ptr mark); diff --git a/gdb/values.c b/gdb/values.c index 43ff194c160..8a93be9f1f7 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -695,7 +695,12 @@ unpack_double (struct type *type, char *valaddr, int *invp) else if (nosign) { /* Unsigned -- be sure we compensate for signed LONGEST. */ +#if !defined (_MSC_VER) || (_MSC_VER > 900) return (ULONGEST) unpack_long (type, valaddr); +#else + /* FIXME!!! msvc22 doesn't support unsigned __int64 -> double */ + return (LONGEST) unpack_long (type, valaddr); +#endif /* _MSC_VER */ } else { @@ -757,65 +762,14 @@ value_static_field (struct type *type, int fieldno) } else { - /* Anything static that isn't a constant, has an address */ - if (SYMBOL_CLASS (sym) != LOC_CONST) - { - addr = SYMBOL_VALUE_ADDRESS (sym); - sect = SYMBOL_BFD_SECTION (sym); - } - /* However, static const's do not, the value is already known. */ - else - { - return value_from_longest (TYPE_FIELD_TYPE (type, fieldno), SYMBOL_VALUE (sym)); - } - } + addr = SYMBOL_VALUE_ADDRESS (sym); + sect = SYMBOL_BFD_SECTION (sym); + } SET_FIELD_PHYSADDR (TYPE_FIELD (type, fieldno), addr); } return value_at (TYPE_FIELD_TYPE (type, fieldno), addr, sect); } -/* Change the enclosing type of a value object VAL to NEW_ENCL_TYPE. - You have to be careful here, since the size of the data area for the value - is set by the length of the enclosing type. So if NEW_ENCL_TYPE is bigger - than the old enclosing type, you have to allocate more space for the data. - The return value is a pointer to the new version of this value structure. */ - -value_ptr -value_change_enclosing_type (value_ptr val, struct type *new_encl_type) -{ - if (TYPE_LENGTH (new_encl_type) <= TYPE_LENGTH (VALUE_ENCLOSING_TYPE (val))) - { - VALUE_ENCLOSING_TYPE (val) = new_encl_type; - return val; - } - else - { - value_ptr new_val; - register value_ptr prev; - - new_val = (value_ptr) xrealloc (val, sizeof (struct value) + TYPE_LENGTH (new_encl_type)); - - /* We have to make sure this ends up in the same place in the value - chain as the original copy, so it's clean-up behavior is the same. - If the value has been released, this is a waste of time, but there - is no way to tell that in advance, so... */ - - if (val != all_values) - { - for (prev = all_values; prev != NULL; prev = prev->next) - { - if (prev->next == val) - { - prev->next = new_val; - break; - } - } - } - - return new_val; - } -} - /* Given a value ARG1 (offset by OFFSET bytes) of a struct or union type ARG_TYPE, extract and return the value of one of its (non-static) fields. @@ -851,7 +805,7 @@ value_primitive_field (register value_ptr arg1, int offset, entire object's contents for later references to virtual bases, etc. */ v = allocate_value (VALUE_ENCLOSING_TYPE (arg1)); - VALUE_TYPE (v) = type; + VALUE_TYPE (v) = arg_type; if (VALUE_LAZY (arg1)) VALUE_LAZY (v) = 1; else @@ -1328,7 +1282,7 @@ value_being_returned (struct type *valtype, char *retbuf, int struct_return) CORE_ADDR addr; /* If this is not defined, just use EXTRACT_RETURN_VALUE instead. */ - if (EXTRACT_STRUCT_VALUE_ADDRESS_P ()) + if (EXTRACT_STRUCT_VALUE_ADDRESS_P) if (struct_return) { addr = EXTRACT_STRUCT_VALUE_ADDRESS (retbuf); diff --git a/gdb/varobj.c b/gdb/varobj.c index c62aecffd65..40bc209de3e 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -1639,7 +1639,7 @@ value_of_root (struct varobj **var_handle, int *type_changed) { tmp_var->obj_name = savestring (var->obj_name, strlen (var->obj_name)); - varobj_delete (var, NULL, 0); + uninstall_variable (var); } else { @@ -1761,13 +1761,7 @@ c_number_of_children (struct varobj *var) case TYPE_CODE_PTR: /* This is where things get compilcated. All pointers have one child. Except, of course, for struct and union ptr, which we automagically - dereference for the user and function ptrs, which have no children. - We also don't dereference void* as we don't know what to show. - We can show char* so we allow it to be dereferenced. If you decide - to test for it, please mind that a little magic is necessary to - properly identify it: char* has TYPE_CODE == TYPE_CODE_INT and - TYPE_NAME == "char" */ - + dereference for the user and function ptrs, which have no children. */ switch (TYPE_CODE (target)) { case TYPE_CODE_STRUCT: @@ -1776,12 +1770,17 @@ c_number_of_children (struct varobj *var) break; case TYPE_CODE_FUNC: - case TYPE_CODE_VOID: children = 0; break; default: - children = 1; + /* Don't dereference char* or void*. */ + if (TYPE_NAME (target) != NULL + && (STREQ (TYPE_NAME (target), "char") + || STREQ (TYPE_NAME (target), "void"))) + children = 0; + else + children = 1; } break; diff --git a/gdb/version.in b/gdb/version.in deleted file mode 100644 index 6b58a0e8c24..00000000000 --- a/gdb/version.in +++ /dev/null @@ -1 +0,0 @@ -2001-07-06-cvs