* cli/cli-cmds.c (show_user): Print error when used on a python
command.
(init_cli_cmds): Update documentation strings for "show user" and
"set/show max-user-call-depth" to clarify that it does not apply to
python commands.
* python/py-cmd.c (cmdpy_init): Treat class_user as a valid class in
error check.
(gdbpy_initialize_commands): Add COMMAND_USER as a constant in
gdb python api.
* top.c (execute_command): Only execute a user-defined command as a
legacy macro if c->user_commands is set.
doc/
* gdb.texinfo (Commands In Python): Put example python macro in
COMMAND_USER category rather than COMMAND_OBSCURE.
Document gdb.COMMAND_USER.
(User-defined Commands): Update documentation to clarify
"set/show max-user-call-depth" and "show user" don't apply to python
commands. Update documentation to clarify "help user-defined" may
also include python commands defined as COMMAND_USER.
testsuite/
* gdb.python/py-cmd.exp: Add test to verify that python commands can
be put in the user-defined category and that the commands appear in
"help user-defined".
* solib.c (update_solib_list): Update the program space's
added_solibs and deleted_solibs fields.
* progspace.h (struct program_space) <added_solibs,
deleted_solibs>: New fields.
(clear_program_space_solib_cache): Declare.
* progspace.c (release_program_space): Call
clear_program_space_solib_cache.
(clear_program_space_solib_cache): New function.
* infrun.c (handle_inferior_event) <TARGET_WAITKIND_LOADED>: Call
bpstat_stop_status. Use handle_solib_event.
* breakpoint.c: Include gdb_regex.h.
(print_solib_event): New function.
(bpstat_print): Use print_solib_event.
(bpstat_stop_status): Add special case for bp_shlib_event.
(handle_solib_event): New function.
(bpstat_what): Use handle_solib_event.
(struct solib_catchpoint): New.
(dtor_catch_solib, insert_catch_solib, remove_catch_solib)
(breakpoint_hit_catch_solib, check_status_catch_solib)
(print_it_catch_solib, print_one_catch_solib)
(print_mention_catch_solib, print_recreate_catch_solib): New
functions.
(catch_solib_breakpoint_ops): New global.
(catch_load_or_unload, catch_load_command_1)
(catch_unload_command_1): New functions.
(internal_bkpt_check_status): Add special case for
bp_shlib_event.
(internal_bkpt_print_it): Use print_solib_event.
(initialize_breakpoint_ops): Initialize
catch_solib_breakpoint_ops.
(_initialize_breakpoint): Register "catch load" and "catch
unload".
* breakpoint.h (handle_solib_event): Declare.
* NEWS: Add entry for "catch load" and "catch unload".
gdb/doc
* gdb.texinfo (Set Catchpoints): Document "catch load" and "catch
unload".
(Files): Mention new catch commands.
(GDB/MI Async Records): Likewise.
gdb/testsuite
* lib/mi-support.exp (mi_expect_stop): Add special case for
solib-event.
* gdb.base/catch-load-so.c: New file.
* gdb.base/catch-load.exp: New file.
* gdb.base/catch-load.c: New file.
* gdb.base/break-interp.exp (reach_1): Update regexp.
* NEWS: Add item.
* symtab.h (compare_filenames_for_search): Declare.
* symtab.c (compare_filenames_for_search): New function.
(iterate_over_some_symtabs): Use it.
* symfile.h (struct quick_symbol_functions)
<map_symtabs_matching_filename>: Change spec.
* psymtab.c (partial_map_symtabs_matching_filename): Use
compare_filenames_for_search. Update for new spec.
* dwarf2read.c (dw2_map_symtabs_matching_filename): Use
compare_filenames_for_search. Update for new spec.
* breakpoint.c (clear_command): Use compare_filenames_for_search.
gdb/doc
* gdb.texinfo (Specify Location): Document relative file name
handling.
gdb/testsuite
* gdb.linespec/linespec.exp: Change some tests to use $decimal.
Add tests for relative directory.
* Makefile.in (SUBDIR_PYTHON_OBS): Add py-finishbreakpoint.o.
(SUBDIR_PYTHON_SRCS): Add python/py-finishbreakpoint.c.
Add build rule for this file.
* infcmd.c (print_return_value): Split to create get_return_value.
(get_return_value): New function based on print_return_value. Handle
case where stop_registers are not set.
* inferior.h (get_return_value): New prototype.
* python/py-breakpoint.c (bppy_pending_object): Make non-static.
(gdbpy_breakpoint_created): Set is_py_finish_bp is necessary.
(struct breakpoint_object): Move to python-internal.h
(BPPY_REQUIRE_VALID): Likewise.
(BPPY_SET_REQUIRE_VALID): Likewise.
(gdbpy_breakpoint_created): Initialize is_finish_bp.
(gdbpy_should_stop): Add pre/post hooks before/after calling stop
method.
* python/python-internal.h (breakpoint_object_type): Add as extern.
(bppy_pending_object): Likewise.
(typedef struct breakpoint_object) Removed.
(struct breakpoint_object): Moved from py-breakpoint.c.
Add field is_finish_bp.
(BPPY_REQUIRE_VALID): Moved from py-breakpoint.c.
(BPPY_SET_REQUIRE_VALID): Likewise.
(frame_object_to_frame_info): New prototype.
(gdbpy_initialize_finishbreakpoints): New prototype.
(bpfinishpy_is_finish_bp): Likewise.
(bpfinishpy_pre_stop_hook): Likewise.
(bpfinishpy_post_stop_hook): Likewise.
* python/py-finishbreakpoint.c: New file.
* python/py-frame.c(frame_object_to_frame_info): Make non-static and
accept PyObject instead of frame_object.
(frapy_is_valid): Don't cast to frame_object.
(frapy_name): Likewise.
(frapy_type): Likewise.
(frapy_unwind_stop_reason): Likewise.
(frapy_pc): Likewise.
(frapy_block): Likewise.
(frapy_function): Likewise.
(frapy_older): Likewise.
(frapy_newer): Likewise.
(frapy_find_sal): Likewise.
(frapy_read_var): Likewise.
(frapy_select): Likewise.
* python/python.c (gdbpy_is_stopped_at_finish_bp): New noop function.
(_initialize_python): Add gdbpy_initialize_finishbreakpoints.
* python/python.h: Include breakpoint.h
(gdbpy_is_stopped_at_finish_bp): New prototype.
doc/
* gdb.texinfo (Finish Breakpoints in Python): New subsection.
(Python API): Add menu entry for Finish Breakpoints.
testsuite/
* Makefile.in (EXECUTABLES): Add py-finish-breakpoint and
py-finish-breakpoint2
(MISCALLANEOUS): Add py-events-shlib.so and py-events-shlib-nodebug.so
* gdb.python/py-breakpoint.exp (mult_line): Define and use variable
instead of line number.
* gdb.python/py-finish-breakpoint.c: New file.
* gdb.python/py-finish-breakpoint.exp: New file.
* gdb.python/py-finish-breakpoint.py: New file.
* gdb.python/py-finish-breakpoint2.cc: New file.
* gdb.python/py-finish-breakpoint2.exp: New file.
* gdb.python/py-finish-breakpoint2.py: New file.
* breakpoint.h (struct tracepoint): New field traceframe_usage.
* breakpoint.c (print_one_breakpoint_location): Identify
tracepoints as such when reporting hit counts, report
trace buffer usage.
(create_tracepoint_from_upload): Copy status info.
* tracepoint.h (struct trace_status): Rename error_desc to stop_desc,
add fields user_name, notes, start_time, stop_time.
(struct uploaded_tp): Add fields hit_count, traceframe_usage.
* tracepoint.c (trace_user): New global.
(trace_notes): New global.
(trace_stop_notes): New global.
(start_tracing): Add argument and trace note handling.
(stop_tracing): Ditto.
(trace_start_command): Add notes argument.
(trace_stop_command): Ditto.
(trace_status_command): Report additional status info.
(trace_status_mi): Similarly.
(trace_save): Update, record tracepoint status.
(set_disconnected_tracing): Call target method directly.
(send_disconnected_tracing_value): Remove.
(set_trace_user): New function.
(set_trace_notes): New function.
(set_trace_stop_notes): New function.
(parse_trace_status): Handle additional status.
(parse_tracepoint_status): New function.
(parse_tracepoint_definition): Call it.
(tfile_get_tracepoint_status): New function.
(init_tfile_ops): Use it.
(_initialize_tracepoint): Add new setshows.
* target.h (struct target_ops): New methods to_get_tracepoint_status
and to_set_trace_notes.
(target_get_tracepoint_status): New macro.
(target_set_trace_notes): New macro.
* target.c (update_current_target): Add new methods.
* remote.c (remote_get_tracepoint_status): New function.
(remote_set_trace_notes): New function.
(init_remote_ops): Add them.
* mi/mi-main.c (mi_cmd_trace_start): Add argument to call.
(mi_cmd_trace_stop): Ditto.
* tracepoint.c (struct tracepoint): New field traceframe_usage.
(tracing_start_time): New global.
(tracing_stop_time): New global.
(tracing_user_name): New global.
(tracing_notes): New global.
(tracing_stop_note): New global.
(cmd_qtstart): Set traceframe_usage, start_time.
(stop_tracing): Set stop_time.
(cmd_qtstatus): Report additional status.
(cmd_qtp): New function.
(handle_tracepoint_query): Call it.
(cmd_qtnotes): New function.
(handle_tracepoint_general_set): Call it.
(get_timestamp): Rename from tsv_get_timestamp.
* gdb.texinfo (Starting and Stopping Trace Experiments): Document
note-related options and variables.
(Tracepoint Packets): Document packet changes.
* gdb.trace/tstatus.exp: New.
* gdb.trace/actions.c: Include string.h.
Kwok Cheung Yeung <kcy@codesourcery.com>
* NEWS: Document shorter fast tracepoints and qTMinFTPILen packet.
* i386-tdep.c (i386_fast_tracepoint_valid_at): Query target for
the minimum instruction size for fast tracepoints.
* target.h (struct target_ops): Add new method
to_get_min_fast_tracepoint_insn_len.
(target_get_min_fast_tracepoint_insn_len): New.
* target.c (update_current_target): Set up new target operation.
* remote.c (remote_write_bytes_aux): Fix typo.
(remote_get_min_fast_tracepoint_insn_len): New.
(init_remote_ops): Initialize new field.
* gdb.texinfo (Create and Delete Tracepoints): Describe what is
needed to get shorter fast tracepoints.
(Tracepoint Packets): Document new qTMinFTPILen packet.
* linux-x86-low.c (small_jump_insn): New.
(i386_install_fast_tracepoint_jump_pad): Add arguments for
trampoline and error message, build a trampoline and issue a small
jump instruction to it.
(x86_install_fast_tracepoint_jump_pad): Add arguments for
trampoline and error message.
(x86_get_min_fast_tracepoint_insn_len): New.
(the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
* linux-low.h (struct linux_target_ops): Add arguments to
install_fast_tracepoint_jump_pad operation, add new operation.
* linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
arguments.
(linux_get_min_fast_tracepoint_insn_len): New function.
(linux_target_op): Add new operation.
* tracepoint.c (gdb_trampoline_buffer): New IPA variable.
(gdb_trampoline_buffer_end): Ditto.
(gdb_trampoline_buffer_error): Ditto.
(struct ipa_sym_addresses): Add fields for new IPA variables.
(symbol_list): Add entries for new IPA variables.
(struct tracepoint): Add fields to hold the address range of the
trampoline used by the tracepoint.
(trampoline_buffer_head): New static variable.
(trampoline_buffer_tail): Ditto.
(claim_trampoline_space): New function.
(have_fast_tracepoint_trampoline_buffer): New function.
(clone_fast_tracepoint): Fill in trampoline fields of tracepoint
structure.
(install_fast_tracepoint): Ditto, also add error buffer argument.
(cmd_qtminftpilen): New function.
(handle_tracepoint_query): Add response to qTMinFTPILen packet.
(fast_tracepoint_from_trampoline_address): New function.
(fast_tracepoint_collecting): Handle trampoline as part of jump
pad space.
(set_trampoline_buffer_space): New function.
(initialize_tracepoint): Initialize new IPA variables.
* target.h (struct target_ops): Add arguments to
install_fast_tracepoint_jump_pad operation, add new
get_min_fast_tracepoint_insn_len operation.
(target_get_min_fast_tracepoint_insn_len): New.
(install_fast_tracepoint_jump_pad): Add arguments.
* server.h (IPA_BUFSIZ): Define.
* linux-i386-ipa.c: Include extra header files.
(initialize_fast_tracepoint_trampoline_buffer): New function.
(initialize_low_tracepoint): Call it.
* server.h (set_trampoline_buffer_space): Declare.
(claim_trampoline_space): Ditto.
(have_fast_tracepoint_trampoline_buffer): Ditto.
* gdb.trace/ftrace.c: New.
* gdb.trace/ftrace.exp: New.
Handle multiple breakpoint hits in Python interface:
* python/py-bpevent.c (create_breakpoint_event_object): Rename C/Python
variable to breakpoints.
* python/py-stopevent.c (emit_stop_event): Return a Python tuple of
bps instead of single breakpoint. Fix some space typos.
* python/py-stopevent.c (create_breakpoint_event_object): Rename
variable to breakpoints.
testsuite:
* gdb.python/py-events.exp: Set a duplicate breakpoint and check its
presence.
* gdb.python/py-events.py (breakpoint_stop_handler): Browse all the
breakpoint hits.
doc:
* gdb.texinfo (Events In Python): New function documentation:
gdb.BreakpointEvent.breakpoints. Indicate that
gdb.BreakpointEvent.breakpoint is now deprecated.
* python/lib/gdb/__init__.py: Auto-load files in command and
function directories.
* python/python.c (finish_python_initialization): Use
os.path.join.
* python/lib/gdb/command/pretty_printers.py: Self register
command.
* NEWS: Document auto-loading.
2011-08-09 Phil Muldoon <pmuldoon@redhat.com>
* gdb.texinfo (Python): Document command and function
auto-loading.
* remote.c (remote_region_ok_for_hw_watchpoint): New function.
(remote_hw_watchpoint_length_limit): New variable.
(_initialize_remote) add set,show cmds for this new variable.
* gdb.texinfo: document these new commands.
* NEWS: Mention these new commands.
* NEWS: Mention $sdir,$pdir.
* gdb_thread_db.h (LIBTHREAD_DB_SEARCH_PATH): Add $sdir:$pdir.
* linux-thread-db.c (try_thread_db_load_from_pdir): New function.
(try_thread_db_load_from_sdir): New function.
(try_thread_db_load_from_dir): New function.
(thread_db_load_search): Handle $pdir, $sdir. Remove trying of
system directories if search of libthread-db-search-path fails,
that is now done via $sdir.
(has_libpthread): New function.
(thread_db_load): Remove search for libthread_db in directory of
libpthread, that is now done via $pdir.
gdbserver/
* thread-db.c (try_thread_db_load_from_sdir): New function.
(try_thread_db_load_from_dir): New function.
(thread_db_load_search): Handle $sdir, ignore $pdir.
Remove trying of system directories if search of
libthread-db-search-path fails, that is now done via $sdir.
doc/
* gdb.texinfo (Threads): Document $sdir,$pdir.
(Server): Document $pdir exception.
* python/py-auto-load.c (struct auto_load_pspace_info): New member
script_not_found_warning_printed.
(init_loaded_scripts_info): Renamed from create_loaded_scripts_hash,
all callers updated. Initialize script_not_found_warning_printed.
(get_auto_load_pspace_data_for_loading): New function.
(maybe_add_script): New function.
(source_section_scripts): Simplify. Only print one warning regardless
of the number of auto-load scripts not found.
(clear_section_scripts): Clear script_not_found_warning_printed.
(auto_load_objfile_script): Record script in hash table.
(count_matching_scripts): New function.
(maybe_print_script): Renamed from maybe_print_section_script, all
callers updated. Rewrite to use ui_out_*.
(info_auto_load_scripts): Renamed from
maintenance_print_section_scripts, all callers updated.
(gdbpy_initialize_auto_load): "maintenance print section-scripts"
renamed as "info auto-load-scripts".
doc/
* gdb.texinfo (Auto-loading): Document "info auto-load-scripts".
testsuite/
* gdb.python/py-objfile-script.exp: New file.
* gdb.python/py-objfile-script.c: New file.
* gdb.python/py-objfile-script-gdb.py: New file.
* testsuite/gdb.python/py-section-script.exp: Test
"info auto-load-scripts".
experiment is still running.
gdb/
* breakpoint.c (disable_breakpoint): Disable all locations
associated with a tracepoint on target if a trace experiment is
running.
(disable_command): Disable a specific tracepoint location on target if
a trace experiment is running.
(do_enable_breakpoint): Enable all locations associated with a
tracepoint on target if a trace experiment is running.
(enable_command) Enable a specific tracepoint location on target if a
trace experiment is running.
* target.c (update_current_target): Add INHERIT and de_fault clauses for
to_supports_enable_disable_tracepoint, to_enable_tracepoint and
to_disable_tracepoint.
* target.h: Add declaration of struct bp_location.
(struct target_ops): Add new functions
to_supports_enable_disable_tracepoint, to_enable_tracepoint and
to_disable_tracepoint to target operations.
(target_supports_enable_disable_tracepoint): New macro.
(target_enable_tracepoint): New macro.
(target_disable_tracepoint): New macro.
* remote.c (struct remote_state): Add new field.
(remote_enable_disable_tracepoint_feature): New.
(remote_protocol_features): Add new entry.
(remote_supports_enable_disable_tracepoint): New.
(remote_enable_tracepoint): New.
(remote_disable_tracepoint): New.
(init_remote_ops): Add remote_enable_tracepoint,
remote_disable_tracepoint and remote_supports_enable_disable_tracepoint
to remote operations.
* tracepoint.c (start_tracing): Allow tracing to start without any
tracepoints enabled with just a warning if they can be re-enabled
later.
* NEWS: Add news item for the new behaviour of the enable and disable
GDB commands when applied to tracepoints.
Add news items for the new remote packets QTEnable and QTDisable.
gdb/doc/
* gdb.texinfo: Document change in the behaviour of the enable and
disable GDB commands when applied to tracepoints.
Document the EnableDisableTracepoints remote stub feature.
Document QTEnable and QTDisable in the list of tracepoint packets.
gdb/gdbserver/
* server.c (handle_query): Add EnableDisableTracepoints to the list
of supported features.
* tracepoint.c (clear_installed_tracepoints): Uninstall disabled
tracepoints.
(cmd_qtenable_disable): New.
(cmd_qtstart): Install tracepoints even if disabled.
(handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
receiving a QTEnable or QTDisable packet.
(gdb_collect): Skip data collection if fast tracepoint is disabled.
(ust_marker_to_static_tracepoint): Do not ignore disabled static
tracepoints.
(gdb_probe): Skip data collection if static tracepoint is disabled.
Thiago Jung Bauermann <bauerman@br.ibm.com>
Implement support for PowerPC BookE masked watchpoints.
gdb/
* NEWS: Mention masked watchpoint support. Create "Changed commands"
section.
* breakpoint.h (struct breakpoint_ops) <works_in_software_mode>: New
method. Initialize to NULL in all existing breakpoint_ops instances.
(struct breakpoint) <hw_wp_mask>: New field.
* breakpoint.c (is_masked_watchpoint): Add prototype.
(update_watchpoint): Don't set b->val for masked watchpoints. Call
breakpoint's breakpoint_ops.works_in_software_mode if available.
(watchpoints_triggered): Handle the case of a hardware masked
watchpoint trigger.
(watchpoint_check): Likewise.
(works_in_software_mode_watchpoint): New function.
(insert_masked_watchpoint, remove_masked_watchpoint)
(resources_needed_masked_watchpoint)
(works_in_software_mode_masked_watchpoint, print_it_masked_watchpoint)
(print_one_detail_masked_watchpoint, print_mention_masked_watchpoint)
(print_recreate_masked_watchpoint, is_masked_watchpoint): New
functions.
(masked_watchpoint_breakpoint_ops): New structure.
(watch_command_1): Check for the existence of the `mask' parameter.
Set b->ops according to the type of hardware watchpoint being created.
* ppc-linux-nat.c (ppc_linux_insert_mask_watchpoint)
(ppc_linux_remove_mask_watchpoint)
(ppc_linux_masked_watch_num_registers): New functions.
(_initialize_ppc_linux_nat): Initialize to_insert_mask_watchpoint,
to_remove_mask_watchpoint and to_masked_watch_num_registers.
* target.c (update_current_target): Mention to_insert_mask_watchpoint,
to_remove_mask_watchpoint, and to_masked_watch_num_registers.
(target_insert_mask_watchpoint, target_remove_mask_watchpoint)
(target_masked_watch_num_registers): New functions.
* target.h (struct target_ops) <to_insert_mask_watchpoint>,
<to_remove_mask_watchpoint>, <to_masked_watch_num_registers>: New
methods.
(target_insert_mask_watchpoint, target_remove_mask_watchpoint)
(target_masked_watch_num_registers): Add prototypes.
gdb/doc/
* gdb.texinfo (Set Watchpoints): Document mask parameter.
(PowerPC Embedded): Mention support of masked watchpoints.
* NEWS: Document the new gdbserver --once option.
gdb/doc/
* gdb.texinfo (Starting and Stopping Trace Experiments): New anchor
for disconnected tracing.
(Multi-Process Mode for @code{gdbserver}): Mention --multi and
extended-remote relationship. Mention --once.
(TCP port allocation lifecycle of @code{gdbserver}): New.
gdb/gdbserver/
* remote-utils.c (handle_accept_event): Close LISTEN_DESC only if
RUN_ONCE. Comment for the LISTEN_DESC delete_file_handler call.
(remote_prepare): New function with most of the TCP code from ...
(remote_open): ... here. Detect PORT here unconditionally. Move also
setting transport_is_reliable.
* server.c (run_once): New variable.
(gdbserver_usage): Document it.
(main): Set run_once for `--once'. Call remote_prepare. Exit after
the first run if RUN_ONCE.
* server.h (run_once, remote_prepare): New declarations.
gdb/testsuite/
* gdb.base/solib-disc.exp: Set gdbserver_reconnect_p.
* lib/gdb.exp (gdb_init): Clear gdbserver_reconnect_p.
* lib/gdbserver-support.exp (gdbserver_start): Add `--once' if
!gdbserver_reconnect_p..
(gdbserver_reconnect): Call error if !gdbserver_reconnect_p..
Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com>
Implement support for PowerPC BookE ranged breakpoints.
gdb/
* NEWS: Mention support for ranged breakpoints on embedded PowerPC.
* breakpoint.h (struct bp_target_info) <length>: New member
variable.
(struct breakpoint_ops) <breakpoint_hit>: Take struct bp_location
instead of struct breakpoint as argument, and also add ASPACE
and BP_ADDR arguments. Update all callers.
(struct breakpoint_ops) <print_one_detail>: New method.
(struct breakpoint) <addr_string_range_end>: New member variable.
* breakpoint.c (breakpoint_location_address_match): Add function
prototype.
(insert_bp_location): Set bl->target_info.length.
(breakpoint_here_p): Call breakpoint_location_address_match.
(moribund_breakpoint_here_p): Likewise.
(regular_breakpoint_inserted_here_p): Likewise.
(breakpoint_thread_match): Likewise.
(bpstat_stop_status): Likewise.
(bpstat_check_location): Move call to
breakpoint_ops.breakpoint_hit to the top.
(print_one_breakpoint_location): Call
breakpoint_ops.print_one_detail if available.
(breakpoint_address_match_range): New function.
(breakpoint_location_address_match): Likewise.
(breakpoint_locations_match): Compare the length field of the
locations too.
(hw_breakpoint_used_count): Count resources used by all locations
in a breakpoint, and use breakpoint_ops.resources_needed if
available.
(breakpoint_hit_ranged_breakpoint): New function.
(resources_needed_ranged_breakpoint): Likewise.
(print_it_ranged_breakpoint): Likewise.
(print_one_ranged_breakpoint): Likewise.
(print_one_detail_ranged_breakpoint): Likewise.
(print_mention_ranged_breakpoint): Likewise.
(print_recreate_ranged_breakpoint): Likewise.
(ranged_breakpoint_ops): New structure.
(find_breakpoint_range_end): New function.
(break_range_command): Likewise.
(delete_breakpoint): Free addr_string_range_end.
(update_breakpoint_locations): Add SALS_END argument. Update
all callers. Calculate breakpoint length if a non-zero SALS_END
is given. Call breakpoint_locations_match instead of
breakpoint_address_match.
(reset_breakpoint): Find SaL of the end of the range if B is a
ranged breakpoint.
(_initialize_breakpoint): Register break-range command.
* defs.h (print_core_address): Add function prototype.
* ppc-linux-nat.c (ppc_linux_ranged_break_num_registers): New
function.
(ppc_linux_insert_hw_breakpoint): Support ranged breakpoints.
(ppc_linux_remove_hw_breakpoint): Likewise.
(_initialize_ppc_linux_nat): Initialize
to_ranged_break_num_registers.
* target.c (update_current_target): Add comment about
to_ranged_break_num_registers.
(target_ranged_break_num_registers): New function.
* target.h (struct target_ops) <to_ranged_break_num_registers>:
New method.
(target_ranged_break_num_registers): Add function prototype.
* ui-out.c (ui_out_field_core_addr): Move address-printing logic to ...
* utils.c (print_core_address): ... here.
gdb/doc/
* gdb.texinfo (PowerPC Embedded): Document ranged breakpoints.
This simulates a CFI flash. Its pretty configurable via the device
tree. For now, only basic read/write/erase operations are supported
for the Intel command set, but it's easy enough to extend support.
It's certainly enough to trick Das U-Boot into using it for probing,
reading, writing, and erasing.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* command.h (enum command_class): New class 'no_set_class', for
"show" commands without a corresponding "set" command.
* value.c (_initialize_values): Use 'no_set_class' for "show values".
* copying.c (_initialize_copying): Ditto for "show copying" and
"show warranty".
* cli/cli-cmds.c (init_cli_cmds): Ditto for "show commands" and
"show version".
* cli/cli-setshow.c (cmd_show_list): Skip "show" commands for
which there is no corresponding "set" command (eg. "show copying").
2011-02-14 Michael Snyder <msnyder@vmware.com>
* gdb.texinfo (threads): Document argument for "info threads" cmd.
Document new command "thread find".
2011-02-15 Michael Snyder <msnyder@vmware.com>
* gdb.base/default.exp: Add tests for thread commands.
* gdb.base/help.exp: Add tests for thread commands.
* gdb.threads/thread-find.exp: New test for thread find command.
2011-02-04 Sami Wagiaalla <swagiaal@redhat.com>
* gdb.python/py-evthreads.c: New file.
* gdb.python/py-evthreads.exp: New file.
* gdb.python/py-events.py: New file.
* gdb.python/py-events.exp: New file.
* gdb.python/py-events.c: New file.
2011-02-04 Sami Wagiaalla <swagiaal@redhat.com>
Oguz Kayral <oguzkayral@gmail.com>
* python/py-inferior.c (python_on_normal_stop): New function.
(python_on_resume): New function.
(python_inferior_exit): New function.
(gdbpy_initialize_inferior): Add normal_stop, target_resumed, and
inferior_exit observers.
* python/py-evtregistry.c: New file.
* python/py-threadevent.c : New file.
* python/py-event.c: New file.
* python/py-evts.c: New file.
* python/py-continueevent.c: New file.
* python/py-bpevent.c: New file.
* python/py-signalevent.c: New file.
* python/py-exetiedevent.c: New file.
* python/py-breakpoint.c (gdbpy_breakpoint_from_bpstats): New function.
Move struct breakpoint_object from here...
* python/python-internal.h: ... to here.
* python/py-event.h: New file.
* python/py-events.h: New file.
* Makefile.in (SUBDIR_PYTHON_OBS): Add py-breakpointstopevent.o,
py-continueevent.o, py-event.o, py-eventregistry.o, py-events.o,
py-exitedevent.o, py-signalstopevent.o, and py-stopevent.o.
(SUBDIR_PYTHON_SRCS): Add py-breakpointstopevent.c,
py-continueevent.c, py-event.c, py-eventregistry.c, py-events.c,
py-exitedevent.c, py-signalstopevent.c, and py-stopevent.c.
Add build rules for all the above.
gdb/
* disasm.c (dump_insns): Support dumping opcodes for MI.
* mi/mi-cmd-disas.c (mi_cmd_disassemble): Allow mode to control
dumping of instruction opcodes.
gdb/doc/
* gdb.texinfo (GDB/MI Data Manipulation): Update to reflect
changes in mi/mi-cmd-disas.c
gdb/testsuite/
* gdb.mi/mi-disassemble.exp, gdb.mi/mi2-disassemble.exp: Update
expected output to reflect changes in gdb/mi/mi-cmd-disas.c and
add new tests for opcode dumping.
Initial support for Blackfin processors. This supports the standard ABI.
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
C++ class type is returned, fix incorrect enclosing type / embedded
offset. If internal variable is returned, allocate new internalvar
value using value_of_internalvar.
* NEWS: Document changes in behavior of "print x = 0" and similar
expressions.
New command "set directories".
* NEWS: Document them.
* source.c (set_directories_command): New function.
(show_directories_1): Renamed from show_directories.
All callers updated.
(show_directories_command): New function.
(_initialize_source): Install "directories" as a set/show
variable instead of just a show command.
doc/
* gdb.texinfo (Source Path): Document "set directories".
testsuite/
* gdb.base/help.exp: Update expected output.
* gdb.python/py-parameter.exp: New file.
enable pretty-printer, disable pretty-printer.
* NEWS: Mention them.
* data-directory/Makefile.in (PYTHON_FILES): Add gdb/printing.py,
gdb/command/__init__.py, gdb/command/pretty_printers.py.
* python/lib/gdb/__init__.py: Install pretty-printer commands.
* python/lib/gdb/printing.py: New file.
* python/lib/gdb/command/__init__.py: New file.
* python/lib/gdb/command/pretty_printers.py: New file.
doc/
* gdb.texinfo (Pretty Printing): Expand into three sections,
introduction, example, and commands.
(Python API): Delete section Disabling Pretty-Printers, merge into
Selecting Pretty-Printers.
(Writing a Pretty-Printer): New section. Move the pretty-printer
example here, and reformat to match python coding style. Add a second
example using the gdb.printing module.
(Python modules): Add gdb.printing.
testsuite/
* gdb.python/py-pp-maint.c: New file.
* gdb.python/py-pp-maint.exp: New file.
* gdb.python/py-pp-maint.py: New file.
This announces the support for debugging Ada programs using
the Ravenscar Profile, as well as documents the new commands
introduced as part of this effort.
gdb/ChangeLog:
* NEWS: Announce Ravenscar Profile support.
gdb/doc/ChangeLog:
* gdb.texinfo (Ravenscar Profile): New node.
This patch adjusts the NEWS entry for the LynxOS gdbserver to include
x86-lynxos to the list of supported platforms.
gdb/ChangeLog:
* NEWS: Add x86-lynxos to the list of platforms supported by
gdbserver.
This adjusts the news entry about ppc-lynxos to add version 5.x
of the OS to the list of supported versions...
gdb/ChangeLog:
* NEWS: Announce GDBserver support for version 5.x of ppc-lynxos.
This adds an entry in the NEWS file announcing the GDBserver support
on powerpc-lynxos.
gdb/ChangeLog:
* NEWS: Add entry announcing GDBserver support on powerpc-lynxos.
* 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-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.
* NEWS: Document them.
* python/py-cmd.c (cmdpy_function): Don't print a traceback if
the exception is gdb.GdbError. Print a second traceback if there's
an error computing the error message.
(gdbpy_string_to_argv): New function.
* python/py-utils.c (gdbpy_obj_to_string): New function.
(gdbpy_exception_to_string): New function.
* python/python-internal.h (gdbpy_string_to_argv): Declare.
(gdbpy_obj_to_string, gdbpy_exception_to_string): Declare.
(gdbpy_gdberror_exc): Declare.
* python/python.c (gdbpy_gdberror_exc): New global.
(_initialize_python): Initialize gdbpy_gdberror_exc and create
gdb.GdbError.
(GdbMethods): Add string_to_argv.
doc/
* gdb.texinfo (Exception Handling): Document gdb.GdbError.
(Commands In Python): Document gdb.string_to_argv.
testsuite/
* gdb.python/py-cmd.exp: Add tests for gdb.GdbError and
gdb.string_to_argv.
Tom Tromey <tromey@redhat.com>
Thiago Jung Bauermann <bauerman@br.ibm.com>
* Makefile.in (SUBDIR_PYTHON_OBS): Add py-parameter.
(SUBDIR_PYTHON_SRCS): Likewise.
(py-parameter.o): New rule.
* python/py-parameter.c: New file.
* python/python-internal.h (gdbpy_initialize_parameter)
(gdbpy_parameter, gdbpy_parameter_value)
(gdbpy_parse_command_name): Declare.
* python/py-cmd.c (parse_command_name): Rename to
gdbpy_parse_command_name.
(gdbpy_parse_command_name): Accept a starting list parameter and
use over cmdlist.
(cmdpy_init): Use gdbpy_parse_command_name.
* python/python.c (parameter_to_python): Rename to
gdbpy_parameter_to_python. Accept enum var_types and value.
(gdbpy_parameter): Use gdbpy_parameter_value.
(_initialize_python): Call gdbpy_initialize_parameters.
2010-04-29 Phil Muldoon <pmuldoon@redhat.com>
* gdb.python/py-param.exp: New File.
2010-04-29 Phil Muldoon <pmuldoon@redhat.com>
Tom Tromey <tromey@redhat.com>
Thiago Jung Bauermann <bauerman@br.ibm.com>
* gdb.texinfo (Parameters In Python): New Node.
Implement `save-breakpoints'.
gdb/
* breakpoint.c (save_cmdlist): New.
(breakpoint_set_cmdlist, breakpoint_show_cmdlist): Moved up close
to save_cmdlist.
(print_recreate_catch_fork): New.
(catch_fork_breakpoint_ops): Install it.
(print_recreate_catch_vfork): New.
(catch_vfork_breakpoint_ops): Install it.
(print_recreate_catch_syscall): New.
(catch_syscall_breakpoint_ops): Install it.
(print_recreate_catch_exec): New.
(catch_exec_breakpoint_ops): Install it.
(print_recreate_exception_catchpoint): New.
(gnu_v3_exception_catchpoint_ops): Install it.
(save_breakpoints): New, based on tracepoint_save_command, but
handle all breakpoint types.
(save_breakpoints_command): New.
(tracepoint_save_command): Rename to...
(save_tracepoints_command): ... this, and reimplement using
save_breakpoints.
(save_command): New.
(_initialize_breakpoints): Install the "save" command prefix.
Install the "save breakpoints" command. Make "save-tracepoints" a
deprecated alias for "save tracepoints".
* breakpoint.h (struct breakpoint_ops): New field `print_recreate'.
* ada-lang.c (print_recreate_exception): New.
(print_recreate_catch_exception): New.
(catch_exception_breakpoint_ops): Install it.
(print_recreate_catch_exception_unhandled): New.
(catch_exception_unhandled_breakpoint_ops): Install it.
(print_recreate_catch_assert): New.
(catch_assert_breakpoint_ops): Install it.
* NEWS: Mention the new `save breakpoints' command. Mention the
new `save tracepoints' alias and that `save-tracepoints' is now
deprecated.
gdb/doc/
* gdb.texinfo (Save Breakpoints): New node.
(save-tracepoints): Rename to ...
(save tracepoints): ... this. Mention that `save-tracepoints' is
a deprecated alias to `save tracepoints'.
gdb/testsuite/
* gdb.trace/save-trace.exp: Adjust.
* NEWS: Document new feature.
* remote.c (PACKET_qGetTIBAddr): New enum element.
(remote_get_tib_address): New function.
(init_remote_ops): Set to_get_tib_address field
to remote_get_tib_address.
(_initialize_remote): Add add_packet_config_cmd
for PACKET_qGetTIBAddr.
* target.c (update_current_target): Set default value for
new to_get_tib_address field.
* target.h (target_ops): New field to_get_tib_address.
(target_get_tib_address): New macro.
* windows-nat.c (thread_info): Add thread_local_base field.
(windows_add_thread): Add tlb argument of type 'void *'.
(fake_create_process): Adapt windows_add_thread call.
(get_windows_debug_event): Idem.
(windows_get_tib_address): New function.
(init_windows_ops): Set to_get_tib_address field
to remote_get_tib_address.
(_initialize_windows_nat): Replace info_w32_cmdlist
initialization by a call to init_w32_command_list.
(info_w32_command, info_w32_cmdlist): Removed from here...
to windows-tdep.c file.
* windows-tdep.h (info_w32_cmdlist): Declare.
(init_w32_command_list): New external function
declaration.
* windows-tdep.c: Add several headers.
(info_w32_cmdlist): to here, made global.
(thread_information_32): New struct.
(thread_information_64): New struct.
(TIB_NAME): New char array.
(MAX_TIB32, MAX_TIB64, FULL_TIB_SIZE): New constants.
(maint_display_all_tib): New static variable.
(windows_get_tlb_type): New function.
(tlb_value_read, tlb_value_write): New functions.
(tlb_value_funcs): New static struct.
(tlb_make_value): New function.
(display_one_tib): New function.
(display_tib): New function.
(show_maint_show_all_tib):New function.
(info_w32_command): Moved from windows-nat.c.
(init_w32_command_list): New function.
(_initialize_windows_tdep): New function.
New "maint set/show show-all-tib" command
New "$_tlb" internal variable.
gdbserver/ChangeLog entry:
* server.c (handle_query): Handle 'qGetTIBAddr' query.
* target.h (target_ops): New get_tib_address field.
* win32-low.h (win32_thread_info): Add thread_local_base field.
* win32-low.c (child_add_thread): Add tlb argument.
Set thread_local_base field to TLB.
(get_child_debug_event): Adapt to child_add_thread change.
(win32_get_tib_address): New function.
(win32_target_ops): Set get_tib_address field to
win32_get_tib_address.
* linux-low.c (linux_target_ops): Set get_tib_address field to NULL.
doc/ChangeLog entry:
gdb.texinfo ($_tlb): Document new automatic convinience variable.
(info w32 thread-information-block): Document new command.
(qGetTIBAddress): Document new gdbserver query.
(maint set/show show-all-tib): Document new command.
PR breakpoints/9352:
* NEWS: Mention changes to `commands' and `rbreak'.
* symtab.c (do_end_rbreak_breakpoints): New function.
(rbreak_command): Call start_rbreak_breakpoints; arrange to call
end_rbreak_breakpoints.
* breakpoint.c (breakpoint_count, tracepoint_count): Now static.
(set_breakpoint_count): Likewise. Clear last_was_multi.
(multi_start, multi_end, last_was_multi): New globals.
(start_rbreak_breakpoints, end_rbreak_breakpoints): New
functions.
(struct commands_info): New
(do_map_commands_command): New function.
(commands_command_1): New function.
(commands_command): Use it.
(commands_from_control_command): Likewise.
(do_delete_breakpoint): New function.
(delete_command): Use it.
(map_breakpoint_numbers): Add 'data' argument. Pass to callback.
(do_map_disable_breakpoint): New function.
(disable_command): Use it.
(do_map_enable_breakpoint): New function.
(enable_command): Use it.
(enable_once_breakpoint): Add argument.
(enable_once_command): Update.
(enable_delete_breakpoint): Add argument.
(enable_delete_command): Update.
(break_command_really): Set last_was_multi when needed.
(check_tracepoint_command): Fix formatting.
(validate_commands_for_breakpoint): New function.
(breakpoint_set_commands): Use it.
(tracepoint_save_command): Update.
* breakpoint.h (start_rbreak_breakpoints, end_rbreak_breakpoints):
Declare.
gdb/doc
PR breakpoints/9352:
* gdb.texinfo (Break Commands): Update.
gdb/testsuite
PR breakpoints/9352:
* gdb.base/default.exp: Update.
* gdb.base/commands.exp: Update.
* gdb.cp/extern-c.exp: Test setting commands on multiple
breakpoints at once.
* defs.h (read_command_lines, read_command_lines_1): New
parameters validator and closure.
* tracepoint.h (struct action_line): Remove.
* breakpoint.h (struct breakpoint): Remove the 'actions'
field.
* defs.h (enum command_control_type): New value
while_stepping_control.
(struct command_line): Add comments.
* breakpoint.c (breakoint_is_tracepoint): New.
(breakpoint_set_commands): For tracepoints,
verify the commands are permissible.
(check_tracepoint_commands): New.
(commands_command): Require that each new line is validated using
check_tracepoint_command, if we set commands for a tracepoint.
(create_tracepoint_from_upload): Likewise.
(print_one_breakpoint_location): Remove the code to print
actions specifically.
(tracepoint_save_command): Relay to print_command_lines.
* cli/cli-script.c (process_next_line): New parameters validator
and closure. Handle 'while-stepping'. Call validator if not null.
(read_command_lines, read_command_lines1): Likewise.
(recurse_read_control_structure): New parameters validator and
closure. Handle while_stepping_control.
(print_command_lines): Handle while-stepping.
(get_command_line, define_command, document_command): Adjust.
* remote.c (remote_download_tracepoint): Adjust.
* tracepoint.c (make_cleanup_free_actions, read_actions)
(free_actions, do_free_actions_cleanup): Remove.
(trace_actions_command): Use read_command_lines.
(validate_actionline): Use error in one place.
(encode_actions_1): New, extracted from...
(encode_actions): ...this. Also use cleanups for exception
safety.
(trace_dump_command): Adjust.
* mi/mi-cmd-break (mi_cmd_break_commands): Validate commands if
it's tracepoint.
Pedro Alves <pedro@codesourcery.com>
* target.h (struct target_ops): New method
to_set_circular_trace_buffer.
(target_set_circular_trace_buffer): New macro.
* target.c (update_current_target): Add
to_set_circular_trace_buffer, fix to_set_disconnected_tracing
default behavior.
* remote.c (remote_set_circular_trace_buffer): New function.
(init_remote_ops): Add it to vector.
* tracepoint.h (struct trace_status): New field traceframes_created,
change buffer_size and buffer_free to int.
* tracepoint.c (circular_trace_buffer): New global.
(start_tracing): Send values of disconnected tracing and circular
trace buffer settings.
(set_circular_trace_buffer): New function.
(parse_trace_state): Handle total space and frames created.
(trace_status_command): Display total space and total frames
created.
(trace_save): Write out new status values.
(parse_trace_status): Set traceframe_count, traceframes_created,
buffer_free and buffer_size to -1 by default.
(_initialize_tracepoint): New setshow for circular-trace-buffer.
* NEWS: Mention the circular trace buffer option.
* gdb.texinfo (Starting and Stopping Trace Experiments): Describe
circular-trace-buffer.
(Tracepoint Packets): Describe QTBuffer, and details of the
qTStatus reply.
* gdb.trace/circ.exp: Test circular-trace-buffer.
* gdb.trace/tfile.exp: Update tstatus test.
* tracepoint.h (enum trace_stop_reason): New enum.
(struct trace_status): New struct.
(parse_trace_status): Declare.
(struct uploaded_tp): Move here from remote.c,
add fields for actions.
(struct uploaded_tsv): New struct.
* tracepoint.c (tfile_ops): New target vector.
(trace_fd): New global.
(tfile_open): New function.
(tfile_close): New function.
(tfile_files_info): New function.
(tfile_get_trace_status): New function.
(tfile_get_traceframe_address): New function.
(tfile_trace_find): New function.
(tfile_fetch_registers): New function.
(tfile_xfer_partial): New function.
(tfile_get_trace_state_variable_value): New function.
(init_tfile_ops): New function.
(_initialize_tracepoint): Call it, add tfile target.
(trace_status): New global.
(current_trace_status): New function.
(trace_running_p): Remove, change all users to get from
current_trace_status()->running.
(get_trace_status): Remove.
(trace_status_command): Call target_get_trace_status directly,
report more detail including tracing stop reasons.
(trace_find_command): Always allow tfind on a file.
(trace_find_pc_command): Ditto.
(trace_find_tracepoint_command): Ditto.
(trace_find_line_command): Ditto.
(trace_find_range_command): Ditto.
(trace_find_outside_command): Ditto.
(trace_frames_offset, cur_offset): Declare as off_t.
(trace_regblock_size): Rename from reg_size, update users.
(parse_trace_status): New function.
(tfile_interp_line): New function.
(disconnect_or_stop_tracing): Ensure current trace
status before asking what to do.
(stop_reason_names): New global.
(trace_save_command): New command.
(get_uploaded_tp): Move here from remote.c.
(find_matching_tracepoint): Ditto.
(merge_uploaded_tracepoints): New function.
(parse_trace_status): Use stop_reason_names.
(_initialize_tracepoint): Define tsave command.
* target.h (target_ops): New fields to_save_trace_data,
to_upload_tracepoints, to_upload_trace_state_variables,
to_get_raw_trace_data, change to_get_trace_status
to take a pointer to a status struct.
(target_save_trace_data): New macro.
(target_upload_tracepoints): New macro.
(target_upload_trace_state_variables): New macro.
(target_get_raw_trace_data): New macro.
* target.c (update_current_target): Add new methods, change
signature of to_get_trace_status.
* remote.c (hex2bin): Make globally visible.
(bin2hex): Ditto.
(remote_download_trace_state_variable): Download name also.
(remote_get_trace_status): Update parameter, use
parse_trace_status.
(remote_save_trace_data): New function.
(remote_upload_tracepoints): New function.
(remote_upload_trace_state_variables): New function.
(remote_get_raw_trace_data): New function.
(remote_start_remote): Use them.
(_initialize_remote_ops): Add operations.
* ax-gdb.c: Include breakpoint.h.
* breakpoint.c (create_tracepoint_from_upload): Use
break_command_really, return tracepoint, warn about unimplemented
parts.
* NEWS: Mention trace file addition.
* gdb.texinfo (Trace Files): New section.
(Tracepoint Packets): Document QTSave and qTBuffer.
(Trace File Format): New appendix.
* generic/gdbtk-bp.c (gdb_trace_status): Use current_trace_status.
* gdb.trace/tfile.c: New file.
* gdb.trace/tfile.exp: New file.
* infcmd.c (detach_command): Ask whether to stop tracing.
* cli/cli-cmds.c (quit_command): Ditto.
* breakpoint.h (struct breakpoint): New field number_on_target.
* breakpoint.c (create_tracepoint_from_upload): New function.
(get_tracepoint_by_number_on_target): New function.
* remote.c (struct remote): New field disconnected_tracing.
(remote_disconnected_tracing_feature): New function.
(remote_protocol_features): Add DisconnectedTracing.
(struct uploaded_tp): New struct.
(uploaded_tps): New global.
(get_uploaded_tp): New function.
(find_matching_tracepoint): New function.
(remote_get_tracing_state): New function.
(remote_start_remote): Call it.
* tracepoint.c (disconnected_tracing): New global.
(trace_start_command): Initialize number_on_target.
(stop_tracing): New function, split out from...
(trace_stop_command): Call stop_tracing.
(get_trace_status): New function, split out from...
(trace_status_command): Call get_trace_status, add info on
disconnection behavior.
(disconnect_or_stop_tracing): New function.
(finish_tfind_command): Translate from number on target.
(trace_find_tracepoint_command): Translate to number on target.
(send_disconnected_tracing_value): New function.
(set_disconnected_tracing): New function.
(_initialize_tracepoint): Add disconnected-tracing variable.
* NEWS: Mention disconnected tracing.
* gdb.texinfo (Starting and Stopping Trace Experiments): Document
disconnected tracing.
(Tracepoint Packets): Document new protocol.