aboutsummaryrefslogtreecommitdiff
path: root/gdb
AgeCommit message (Collapse)AuthorFilesLines
2010-07-05gdb/Jan Kratochvil4-46/+304
Fix attaching to PIEs prelinked on the disk after the process was started. * solib-svr4.c (svr4_exec_displacement): New variable arch_size. Verify it against bfd_get_arch_size. Try to match arbitrary displacement for the phdrs comparison. gdb/testsuite/ * gdb.base/break-interp.exp: Run $binpie with new value "ATTACH", new code for it. New variable relink_args. (prelinkYES): Call prelinkNO. (test_attach): Accept new parameter relink_args. Re-prelink the binary in such case. Move the core code to ... (test_attach_gdb): ... a new function. Send GDB command "file". Extend expected "Attaching to " string.
2010-07-05*** empty log message ***gdbadmin1-1/+1
2010-07-04*** empty log message ***gdbadmin1-1/+1
2010-07-03*** empty log message ***gdbadmin1-1/+1
2010-07-02 PR exp/11780:Tom Tromey2-1/+6
* libunwind-frame.c (libunwind_frame_prev_register): Don't set value as optimized-out.
2010-07-022010-07-02 Ulrich Weigand <uweigand@de.ibm.com>Thiago Jung Bauermann2-2/+8
Thiago Jung Bauermann <bauerman@br.ibm.com> * breakpoint.c (can_use_hardware_watchpoint): Answer "what does this represent?" question in comment. Change comment to a proper sentence.
2010-07-02 * gdb.base/bitops.exp: Remove extraneous "pass".Tom Tromey2-1/+5
2010-07-022010-07-02 Ken Werner <ken.werner@de.ibm.com>Tom Tromey4-2/+11
gdb * c-valprint.c (c_val_print): Fix printing of character vectors. gdb/testsuite * gdb.arch/altivec-abi.exp: Fix expect pattern of character vectors.
2010-07-02gdb/Jan Kratochvil2-1/+6
* spu-tdep.c (spu_catch_start): Adjust the caller of changed create_breakpoint prototype.
2010-07-02*** empty log message ***gdbadmin1-1/+1
2010-07-01 gdb/Pedro Alves4-8/+19
* breakpoint.c (BREAK_ARGS_HELP, _initialize_breakpoint): Clarify usefulness suggestion of multiple breakpoints at same location. gdb/testsuite/ * gdb.base/help.exp: Adjust expected output.
2010-07-01 gdb/Pedro Alves4-7/+15
* breakpoint.c (BREAK_ARGS_HELP): Add missing `the'. gdb/testsuite/ * gdb.base/help: Adjust expected output.
2010-07-01 * gdb.texinfo (Create and Delete Tracepoints): Add more indexPedro Alves2-1/+9
entries for fast tracepoints and static tracepoints.
2010-07-01 * gdb.texinfo (General Query Packets) <qfThreadInfo,Pedro Alves2-1/+6
qsThreadInfo>: Spell out `l' as ell.
2010-07-01 * dwarf2loc.c (locexpr_tracepoint_var_ref)Pedro Alves2-6/+16
(loclist_tracepoint_var_ref): Handle optimized out values.
2010-07-01 * breakpoint.c (update_watchpoint, _initialize_breakpoint): RemovePedro Alves17-34/+55
unnecessary space in string. * filesystem.c (_initialize_filesystem): Ditto. * frame.c (_initialize_frame): Ditto. * infcmd.c (step_once): Ditto. * infrun.c (_initialize_infrun): Ditto. * linux-nat.c (linux_child_follow_fork): Ditto. * maint.c (maintenance_deprecate): Ditto. * memattr.c (_initialize_mem): Ditto. * mips-tdep.c (_initialize_mips_tdep): Ditto. * monitor.c (monitor_open): Ditto. * procfs.c (procfs_xfer_memory): Ditto. * reverse.c (bookmarks_info): Ditto. * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Ditto. * stack.c (_initialize_stack): Ditto. * tracepoint.c (_initialize_tracepoint): Ditto. * xtensa-tdep.c (xtensa_supply_gregset, xtensa_regset_from_core_section): Ditto.
2010-07-01 * value.h (struct lval_funcs) <check_any_valid>: Rename fromTom Tromey3-2/+9
check_all_valid. * value.c (value_entirely_optimized_out): Invert result. Update for new function name.
2010-07-01 Static tracepoints support, and UST integration.Pedro Alves26-69/+3149
gdb/gdbserver/ * configure.ac: Handle --with-ust. substitute ustlibs and ustinc. * mem-break.c (uninsert_all_breakpoints) (reinsert_all_breakpoints): New. * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints): * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New. (gdb_agent_ust_loaded, helper_thread_id) (gdb_agent_helper_thread_id): New macros. (struct ipa_sym_addresses): Add addr_ust_loaded, addr_helper_thread_id, addr_cmd_buf. (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf. (in_process_agent_loaded_ust): New. (write_e_ust_not_loaded): New. (maybe_write_ipa_ust_not_loaded): New. (struct collect_static_trace_data_action): New. (enum tracepoint_type) <static_tracepoint>: New. (struct tracepoint) <handle>: Mention static tracepoints. (struct static_tracepoint_ctx): New. (CMD_BUF_SIZE): New. (add_tracepoint_action): Handle static tracepoint actions. (unprobe_marker_at): New. (clear_installed_tracepoints): Handle static tracepoints. (cmd_qtdp): Handle static tracepoints. (probe_marker_at): New. (cmd_qtstart): Handle static tracepoints. (response_tracepoint): Handle static tracepoints. (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New. (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat. (get_context_regcache): Handle static tracepoints. (do_action_at_tracepoint): Handle static tracepoint actions. (traceframe_find_block_type): Handle static trace data blocks. (traceframe_read_sdata): New. (download_tracepoints): Download static tracepoint actions. [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h. (GDB_PROBE_NAME): New. (ust_ops): New. (GET_UST_SYM): New. (USTF): New. (dlsym_ust): New. (ust_marker_to_static_tracepoint): New. (gdb_probe): New. (collect_ust_data_at_tracepoint): New. (gdb_ust_probe): New. (UNIX_PATH_MAX, SOCK_DIR): New. (gdb_ust_connect_sync_socket): New. (resume_thread, stop_thread): New. (run_inferior_command): New. (init_named_socket): New. (gdb_ust_socket_init): New. (cstr_to_hexstr): New. (next_st): New. (first_marker, next_marker): New. (response_ust_marker): New. (cmd_qtfstm, cmd_qtsstm): New. (unprobe_marker_at, probe_marker_at): New. (cmd_qtstmat, gdb_ust_thread): New. (gdb_ust_init): New. (initialize_tracepoint_ftlib): Call gdb_ust_init. * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h (ST_REGENTRY): New. (x86_64_st_collect_regmap): New. (X86_64_NUM_ST_COLLECT_GREGS): New. (AMD64_RIP_REGNUM): New. (supply_static_tracepoint_registers): New. * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h (ST_REGENTRY): New. (i386_st_collect_regmap): New. (i386_NUM_ST_COLLECT_GREGS): New. (supply_static_tracepoint_registers): New. * server.c (handle_query): Handle qXfer:statictrace:read. <qSupported>: Report support for StaticTracepoints, and qXfer:statictrace:read features. * server.h (traceframe_read_sdata) (supply_static_tracepoint_registers): Declare. * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex) (unpack_varlen_hex): Include in IPA build. * Makefile.in (ustlibs, ustinc): New. (IPA_OBJS): Add remote-utils-ipa.o. ($(IPA_LIB)): Link -ldl and -lpthread. (UST_CFLAGS): New. (IPAGENT_CFLAGS): Add UST_CFLAGS. * config.in, configure: Regenerate. gdb/ * NEWS: Mention new support for static tracepoints. (New packets): Mention qTfSTM, qTsSTM, qTSTMat and qXfer:statictrace:read. (New features in the GDB remote stub, GDBserver): Mention static tracepoints support using an UST based backend. (New commands): Mention "info static-tracepoint-markers" and "strace". * breakpoint.c (is_marker_spec): New. (is_tracepoint): Handle static tracepoints. (validate_commands_for_breakpoint): Static tracepoints can't do while-stepping. (static_tracepoints_here): New. (bpstat_what): Handle static tracepoints. (print_one_breakpoint_location, allocate_bp_location, mention): Ditto. (create_breakpoint_sal): Ditto. (decode_static_tracepoint_spec): New. (create_breakpoint): Replace `hardwareflag', and `traceflag' with `type_wanted'. Adjust. Handle static tracepoint marker locations. (break_command_1): Adjust. (update_static_tracepoint): New. (update_breakpoint_locations): Handle static tracepoints. (breakpoint_re_set_one): Handle static tracepoint marker locations. (disable_command, enable_command): Handle static tracepoints. (trace_command, ftrace_command): Adjust. (strace_command): New. (create_tracepoint_from_upload): Adjust. (save_breakpoints): Handle static tracepoints. (_initialize_breakpoint): Install the "strace" command. * breakpoint.h (enum bptype): New bp_static_tracepoint type. (struct breakpoint): New fields static_trace_marker_id and static_trace_marker_id_idx. (breakpoints_here_p): Declare. (create_breakpoint): Adjust. (static_tracepoints_here): Declare. * remote.c (struct remote_state) <static_tracepoints>: New field. (PACKET_qXfer_statictrace_read, PACKET_StaticTracepoints): New. (remote_static_tracepoint_marker_at): New. (remote_static_tracepoint_markers_by_strid): New. (remote_static_tracepoint_feature): New. (remote_disconnected_tracing_feature): Handle "StaticTracepoints". (remote_xfer_partial): Handle TARGET_OBJECT_STATIC_TRACE_DATA. (remote_supports_static_tracepoints): New. (remote_download_tracepoint): Download static tracepoints. (init_remote_ops): Install remote_static_tracepoint_marker_at and remote_static_tracepoint_markers_by_strid. (_initialize_remote): Install set|show remote static-tracepoints, and set|show remote read-sdata-object commands. * target.c (update_current_target): Inherit and default to_static_tracepoint_marker_at, and to_static_tracepoint_markers_by_strid. * target.h (static_tracepoint_marker): Forward declare. (enum target_object): New object TARGET_OBJECT_STATIC_TRACE_DATA. (static_tracepoint_marker_p): New typedef. (DEF_VEC_P(static_tracepoint_marker_p)): New VEC type. (struct target_ops): New fields to_static_tracepoint_marker_at and to_static_tracepoint_markers_by_strid. (target_static_tracepoint_marker_at) (target_static_tracepoint_markers_by_strid): New. * tracepoint.c: Include source.h. (validate_actionline): Handle $_sdata. (struct collection_list): New field strace_data. (add_static_trace_data): New. (clear_collection_list): Clear strace_data. (stringify_collection_list): Account for a possible static trace data collection. (encode_actions_1): Encode an $_sdata collection. (parse_tracepoint_definition): Handle static tracepoints. (parse_static_tracepoint_marker_definition): New. (release_static_tracepoint_marker): New. (print_one_static_tracepoint_marker): New. (info_static_tracepoint_markers_command): New. (sdata_make_value): New. (_initialize_tracepoint): Create the $_sdata convenience variable. Add the "info static-tracepoint-markers" command. Mention $_sdata in the "collect" command's help output. * tracepoint.h (struct static_tracepoint_marker): New. (parse_static_tracepoint_marker_definition) (release_static_tracepoint_marker): Declare. * mi/mi-cmd-break.c (mi_cmd_break_insert): Adjust. * python/py-breakpoint.c (bppy_new): Adjust. doc/ * gdb.texinfo (Convenience Variables): Document $_sdata. (Commands to Set Tracepoints): Describe static tracepoints. Add `Listing Static Tracepoint Markers' menu entry. Document "strace". (Tracepoint Action Lists): Document collecting $_sdata. (Listing Static Tracepoint Markers): New subsection. (Tracepoints support in gdbserver): Mention static tracepoints. (remote packets, enabling and disabling): Mention read-sdata-object. (General Query Packets) <qSupported>: Document qXfer:sdata:read and StaticTracepoint. Mention qTfSTM, qTsSTM and qTSTMat as tracepoint packets. Document qXfer:sdata:read. (Tracepoint packets): Document qTfSTM, qTsSTM and qTSTMat.
2010-07-01*** empty log message ***gdbadmin1-1/+1
2010-06-30Fix build failure with Python installed in non-system location.Joel Brobecker2-1/+9
The debugger fails to build when configure with --python-python=<path> where <path> is a non-system location. The reason is a warning made fatal due to the definition of _XOPEN_SOURCE inside pyconfig.h. This is exactly the same problem as with _POSIX_C_SOURCE, handled in python-internal.h as follow: | /* /usr/include/features.h on linux systems will define _POSIX_C_SOURCE | if it sees _GNU_SOURCE (which config.h will define). | pyconfig.h defines _POSIX_C_SOURCE to a different value than | /usr/include/features.h does causing compilation to fail. | To work around this, undef _POSIX_C_SOURCE before we include Python.h. */ | #undef _POSIX_C_SOURCE This patch fixes this problem the same way. 2010-06-30 Joel Brobecker <brobecker@adacore.com> * python/python-internal.h (_XOPEN_SOURCE): Undefine before including Python.h.
2010-06-30gdb/testsuite/Jan Kratochvil2-21/+8
* gdb.cp/namespace.exp (print C::OtherFileClass::cOtherFileClassVar) (print ::C::OtherFileClass::cOtherFileClassVar): Remove KFAIL for c++/11702.
2010-06-30 PR gdb/11702Doug Evans2-10/+12
* dwarf2read.c (dwarf2_add_field): Only create a symbol if DW_AT_external is present.
2010-06-30*** empty log message ***gdbadmin1-1/+1
2010-06-29gdb/testsuite/Jan Kratochvil2-0/+11
* gdb.base/break-interp.exp (prelinkYES): XFAIL on `Not enough room to add .dynamic entry'.
2010-06-29 PR c++/11702Doug Evans8-8/+68
* NEWS: Add entry. * dwarf2read.c (dwarf2_add_field): If DW_AT_const_value is present, create a symbol for the field and record the value. (new_symbol): Handle DW_TAG_member. * gdbtypes.c (field_is_static): Remove FIXME. * symtab.c (search_symbols): When searching for VARIABLES_DOMAIN, only ignore LOC_CONST symbols that are enums. testsuite/ Test PR c++/11702. * gdb.cp/m-static.exp: Add testcase. * gdb.cp/m-static.h (gnu_obj_4): Add initialized static const member.
2010-06-29 * dwarf2read.c: Remove trailing whitespace.Doug Evans2-59/+61
2010-06-29 Delete FIELD_LOC_KIND_DWARF_BLOCK, unused.Doug Evans3-15/+12
* gdbtypes.h (enum field_loc_kind): Delete FIELD_LOC_KIND_DWARF_BLOCK. (struct main_type, field loc): Delete dwarf_block. (FIELD_DWARF_BLOCK): Delete. (SET_FIELD_DWARF_BLOCK): Delete. (TYPE_FIELD_DWARF_BLOCK): Delete. * gdb-gdb.py (StructMainTypePrettyPrinter.struct_field_location_img): Update.
2010-06-292010-06-29 Hui Zhu <teawater@gmail.com>Hui Zhu2-0/+626
* record.c (set_record_pic_cmdlist, show_record_pic_cmdlist): New variables. (set_record_pic_command, show_record_pic_command): New functions. (record_pic_function, record_pic_line, record_pic_enum, set_record_pic_type, record_pic_hide_nofunction, record_pic_hide_nosource, record_pic_hide_same): New variables. (record_pic_fputs): New function. (function_list, node_list, edge_list): New struct. (function_list, node_list, edge_list): New variables. (record_pic_cleanups, record_pic_node, record_pic_edge, cmd_record_pic): New functions. (_initialize_record): Add new commands for record pic.
2010-06-29Fix unmatched @end table in gdb.texinfo.Joel Brobecker2-0/+5
2010-06-29 Joel Brobecker <brobecker@adacore.com> * gdb.texinfo (Threads In Python): Fix unmatched @end table.
2010-06-29*** empty log message ***gdbadmin1-1/+1
2010-06-28gdb/Jan Kratochvil2-2/+6
* dwarf2read.c (read_structure_type) <fi.typedef_field_list>: Call ALLOCATE_CPLUS_STRUCT_TYPE.
2010-06-282010-06-28 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon20-11/+1672
Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> * value.c (pack_unsigned_long): New function. (value_from_ulongest): New function. * value.h (value_from_ulongest): Declare. * python/python.c (_initialize_python): Call gdbpy_initialize_thread and gdbpy_initialize_inferior. * python/python-internal.h: Define thread_object. (gdbpy_inferiors, gdbpy_selected_thread) (frame_info_to_frame_object, create_thread_object) (find_thread_object, find_inferior_object) (gdbpy_initialize_thread, gdbpy_initialize_inferiors) (gdbpy_is_value_object, get_addr_from_python): Declare. * python/py-value.c (builtin_type_upylong): Define. (convert_value_from_python): Add logic for ulongest. (gdbpy_is_value_object): New function. * python/py-utils.c (get_addr_from_python): New function. * python/py-frame.c (frame_info_to_frame_object): Return a PyObject. (gdbpy_selected_frame): Use PyObject over frame_info. * Makefile.in (SUBDIR_PYTHON_OBS): Add py-inferior and py-infthread. (SUBDIR_PYTHON_SRCS): Likewise. (py-inferior.o): New Rule. (py-infthread.o): New Rule. * python/py-inferior.c: New File. * python/py-infthread.c: New File. 2010-06-28 Phil Muldoon <pmuldoon@redhat.com> Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> * gdb.texinfo (Inferiors In Python): New node. * gdb.texinfo (Threads In Python): New node. 2010-06-28 Phil Muldoon <pmuldoon@redhat.com> Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> * gdb.python/py-inferior.c: New File. * gdb.python/py-infthread.c: New File. * gdb.python/py-inferior.exp: New File. * gdb.python/py-infthread.exp: New File.
2010-06-28gdb/Jan Kratochvil8-4/+164
* c-typeprint.c (c_type_print_base): For no fields check include also TYPE_TYPEDEF_FIELD_COUNT. Print new typedefs section. * dwarf2read.c (struct typedef_field_list) (struct field_info) <typedef_field_list, typedef_field_list_count>: New. (dwarf2_add_typedef): New. (read_structure_type): Call dwarf2_add_typedef for DW_TAG_typedef. Copy also FI.TYPEDEF_FIELD_LIST. * gdbtypes.h (struct typedef_field) (struct cplus_struct_type) <typedef_field, typedef_field_count> (TYPE_TYPEDEF_FIELD_ARRAY, TYPE_TYPEDEF_FIELD, TYPE_TYPEDEF_FIELD_NAME) (TYPE_TYPEDEF_FIELD_TYPE, TYPE_TYPEDEF_FIELD_COUNT): New. gdb/testsuite/ * gdb.cp/namespace.exp (ptype OtherFileClass typedefs) (ptype ::C::OtherFileClass typedefs): New. * gdb.cp/namespace1.cc (C::OtherFileClass::cOtherFileClassType2) (C::OtherFileClass::cOtherFileClassVar2): New. (C::OtherFileClass::cOtherFileClassVar_use): Use also cOtherFileClassVar2. (C::cOtherFileType2, C::cOtherFileVar2): New. (C::cOtherFileVar_use): use also cOtherFileVar2. * gdb.cp/userdef.exp (ptype &*c): Permit arbitrary trailing text.
2010-06-28gdb/Jan Kratochvil8-12/+159
* cp-namespace.c (cp_lookup_nested_type): New variable concatenated_name. Turn the current return condition into a reverse one. Call also lookup_static_symbol_aux on the constructed qualified name. * symtab.c (lookup_symbol_aux): Move variable objfile and searching in other files into a called ... (lookup_static_symbol_aux): ... new function here. * symtab.h (lookup_static_symbol_aux): New prototype. * valops.c (value_maybe_namespace_elt): Call also lookup_static_symbol_aux if we failed otherwise. gdb/testsuite/ * gdb.cp/namespace.exp (whatis C::cOtherFileType) (whatis ::C::cOtherFileType, whatis C::cOtherFileVar) (whatis ::C::cOtherFileVar, print C::cOtherFileVar) (print ::C::cOtherFileVar) (whatis C::OtherFileClass::cOtherFileClassType) (whatis ::C::OtherFileClass::cOtherFileClassType) (print C::OtherFileClass::cOtherFileClassVar) (print ::cOtherFileClassVar) (print ::C::OtherFileClass::cOtherFileClassVar): New tests. (ptype OtherFileClass, ptype ::C::OtherFileClass): Permit arbitrary trailing content. * gdb.cp/namespace1.cc (C::OtherFileClass::cOtherFileClassType) (C::OtherFileClass::cOtherFileClassVar) (C::OtherFileClass::cOtherFileClassVar_use, C::cOtherFileType) (C::cOtherFileVar, C::cOtherFileVar_use): New.
2010-06-28gdb/Jan Kratochvil4-2/+13
Fix PR c++/11703 and PR gdb/1448. * c-exp.y (yylex) <last_was_coloncolon && first_was_coloncolon>: Add FIRST_ITER check. gdb/testsuite/ Test PR c++/11703 and PR gdb/1448. * gdb.cp/namespace.exp (ptype ::C::NestedClass): Remove KFAIL for gdb/1448.
2010-06-28gdb/Jan Kratochvil6-2/+34
Fix modification of cplus_struct_default. * dwarf2read.c (dwarf2_add_member_fn) <no DW_AT_vtable_elem_location>: Call ALLOCATE_CPLUS_STRUCT_TYPE. * gdbtypes.c (cplus_struct_default): New empty initializer, comment it. gdb/testsuite/ * gdb.cp/virtbase.cc (class RTTI_base, class RTTI_data) (main) <rtti_data>: New. * gdb.cp/virtbase.exp (print rtti_data): New.
2010-06-28gdb/testsuite/Jan Kratochvil2-0/+9
* lib/gdb.exp (gdb_test_multiple): Error on trailing newlines.
2010-06-28Document the GDB python directory.Joel Brobecker4-0/+28
2010-06-27 Joel Brobecker <brobecker@adacore.com> * NEWS: Add entry announcing the python directory. 2010-06-27 Joel Brobecker <brobecker@adacore.com> * gdb.texinfo (Python): Document what the python directory is and what its location is. (Basic Python): Document the gdb.PYTHONDIR constant.
2010-06-28 * dwarf2read.c (read_structure_type): Allocate null cleanup later.Tom Tromey2-1/+7
2010-06-28 * breakpoint.c (breakpoint_sals_to_pc): Delete arg address, unused.Doug Evans2-3/+7
All callers updated.
2010-06-28gdb/Jan Kratochvil5-24/+124
* cp-valprint.c (cp_print_value_fields) <recurse == 0>: Call obstack_begin after each obstack_free. gdb/testsuite/ * gdb.cp/static-print-quit.exp, gdb.cp/static-print-quit.cc: New.
2010-06-28 * gdb.base/break-interp.exp (reach): Relax expected output a bit.Doug Evans2-1/+5
2010-06-28*** empty log message ***gdbadmin1-1/+1
2010-06-27 * gdb.cp/m-static.exp: Update expected test output.Doug Evans2-1/+5
2010-06-27 * value.c (value_static_field): Use `switch' instead of `if'.Doug Evans2-4/+13
Assert-fail if passed invalid TYPE_FIELD_LOC_KIND.
2010-06-27 * valops.c (search_struct_field): Fix typo in error message.Doug Evans2-1/+5
2010-06-27*** empty log message ***gdbadmin1-1/+1
2010-06-26 * dwarf2expr.c (execute_stack_op): Place preprocessorUlrich Weigand2-2/+7
directives at the start of the source line.
2010-06-26Refactor 'maint time' command statistics.Paul N. Hilfinger9-133/+141
Consolidate code for displaying per-command time and space statistics to avoid duplication. Piggyback on cleanups so that statistics get printed even when commands terminate as a result of an error. Changelog * gdb/defs.h (make_command_stats_cleanup): Declare. (set_display_time): Declare. (set_display_space): Declare. * gdb/event-top.c (command_handler): Use make_command_stats_cleanup. * gdb/main.c (display_time, display_space): Move definitions to utils.c. (captured_main): Use make_command_stats_cleanup to get start-up statistics. Use set_display_time and set_display_space for processing OPT_STATISTICS case. * gdb/maint.c (maintenance_time_display): Use set_display_time. (maintenance_space_display): Use set_display_space. * gdb/top.c (execute_command): Remove obsolete 'maint time' code. (command_loop): Use make_command_stats_cleanup. * gdb/utils.c (struct cmd_stats): Structure for storing initial time and space usage. (display_time, display_space): Move definitions here from utils.c. (set_display_time): New function. (set_display_space): New function. (make_command_stats_cleanup): New function. (report_command_stats): New auxiliary function for make_command_stats_cleanup. * gdb/testsuite/gdb.gdb/selftest.exp: Adjust expected message for capturing start-up runtime.
2010-06-26*** empty log message ***gdbadmin1-1/+1