This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1/2] Global breakpoints, GDB part


This patch is a little long, but it's mostly the minutiae entailed by having an additional breakpoint attribute and some new target vector methods.

The interesting parts are the process specification parsing in breakpoint.c and the interaction with /dev/breakpoint in linux-nat.c. Also there is a bit of dancing involved with keeping track of which processes should have which global breakpoints, since the list connected with "process *" changes from moment to moment, but once a process has had a global breakpoint installed in it, we need to remember that fact.

Stan
stan@codesourcery.com

2011-06-13 Stan Shebs <stan@codesourcery.com>

    * breakpoint.h (struct breakpoint): Add field process_string.
    (ALL_CURRENT_PROCESSES): New macro.
    (ALL_FUTURE_PROCESSES): New macro.
    (SET_ALL_CURRENT_PROCESSES): New macro.
    (SET_ALL_FUTURE_PROCESSES): New macro.
    (queue_attach_request): Declare.
    (handle_attach_requests): Declare.
    (discard_attach_requests): Declare.
    (record_breakpoint): Declare.
    (number_of_global_breakpoints): Declare.
    * breakpoint.c (breakpoint_applies_to_inferior): New function.
    (insert_breakpoint_locations): Call it.
    (print_one_breakpoint_location): Print process string.
    (create_breakpoint_sals): Add process string argument.
    (create_breakpoint_sal): Handle global breakpoints.
    (find_condition_and_thread): Find and parse process string.
    (create_breakpoint): Handle global breakpoints.
    (delete_breakpoint): Delete global breakpoints.
    (breakpoint_re_set_one): Add process string.
    (parse_process_string): New function.
    (struct gb): New structure, records global breakpoints.
    (gbps): New global, list of global breakpoints.
    (dump_gbps_command): New function, maintenance command.
    (add_breakpoint_to_inferior): New function.
    (define_global_breakpoint): New function.
    (delete_global_breakpoint): New function.
    (number_of_global_breakpoints): New function.
    (struct attach_request): New struct.
    (queue_attach_request): New function.
    (discard_attach_requests): New function.
    (handle_attach_requests): New function.
    (record_breakpoint): New function.
    (_initialize_breakpoint): Add maintenance command.
    * inferior.h (struct inferior): New field installed_breakpoints.
    * inferior.c (inferior_appeared): Clear list of inferior's
    externally-installed breakpoints.
    (print_inferior): Display installed breakpoints.
    * c-exp.y (lex_one_token): Add process case.
    * target.h (struct target_ops): New fields
    to_define_global_breakpoint, to_insert_global_breakpoint,
    to_delete_global_breakpoint.
    * target.c (target_define_global_breakpoint): New function.
    (target_insert_global_breakpoint): New function.
    (target_delete_global_breakpoint): New function.
    (update_current_target): Add inheritance note.
    (find_default_define_global_breakpoint): New function.
    (find_default_insert_global_breakpoint): New function.
    (find_default_delete_global_breakpoint): New function.
    (init_dummy_target): Use them.
    (debug_to_define_global_breakpoint): New function.
    (debug_to_insert_global_breakpoint): New function.
    (debug_to_delete_global_breakpoint): New function.
    (setup_target_debug): Use them.
    * linux-nat.c: Include exceptions.h and breakpoint.h.
    (BREAKPOINT_DEVICE): New macro.
    (MAX_GB_PACKET): New macro.
    (gbfd): New global.
    (open_gb_device): New function.
    (close_gb_device): New function.
    (linux_nat_handle_attach_request): New function.
    (linux_nat_record_breakpoint): New function.
    (get_gb_reply): New function.
    (linux_nat_define_global_breakpoint): New function.
    (linux_nat_insert_global_breakpoint): New function.
    (linux_nat_delete_global_breakpoint): New function.
    (linux_nat_add_target): Use them.
    (gb_event_handler): New function.
    (linux_nat_parse_attach_request): Call queue_attach_request.
    * remote.c: Include breakpoint.h.
    (struct remote_state): New field global_breakpoints.
    (PACKET_GlobalBreakpoints): New support packet.
    (remote_async_get_gb_hit_token): New global.
    (remote_close): Clean up attach requests.
    (remote_global_breakpoint_feature): New function.
    (remote_protocol_features): Add global breakpoint entry.
    (remote_open_1): Create async handler for attach requests.
    (handle_notification): Add cases for new notifications.
    (remote_define_global_breakpoint): New function.
    (remote_insert_global_breakpoint): New function.
    (remote_delete_global_breakpoint): New function.
    (init_remote_ops): Add them to the target vector.
    (remote_async_attach_handler): New function.

    [doc]
    * gdb.texinfo (Global Breakpoints): New section.
    (General Query Packets): Describe QGBreakDefine,
    QGBreakDelete, QGBreakInsert packets, and supported feature
    name GlobalBreakpoints.
    (Notification Packets): Describe Hit and BP packets.



Attachment: gb-patch-1
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]