Re: [PATCH v4 1/2] gdb/breakpoint: disable a bp location if condition is invalid at that location

Eli Zaretskii via Gdb-patches
2020-10-13T15:06:44Z

> Date: Tue, 13 Oct 2020 14:25:02 +0200
> From: Tankut Baris Aktemur via Gdb-patches <gdb-patches@sourceware.org>
> Cc: simark@simark.ca
>
> gdb/ChangeLog:
> 2020-07-31 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
>
> * breakpoint.h (class bp_location) <disabled_by_cond>: New field.
> * breakpoint.c (set_breakpoint_location_condition): New function.
> (set_breakpoint_condition): Disable a breakpoint
> location if parsing the condition string gives an error.
> (should_be_inserted): Update to consider the 'disabled_by_cond' field.
> (build_target_condition_list): Ditto.
> (build_target_command_list): Ditto.
> (build_bpstat_chain): Ditto.
> (print_one_breakpoint_location): Ditto.
> (print_one_breakpoint): Ditto.
> (breakpoint_1): Ditto.
> (bp_location::bp_location): Ditto.
> (locations_are_equal): Ditto.
> (update_breakpoint_locations): Ditto.
> (enable_disable_bp_num_loc): Ditto.
> (init_breakpoint_sal): Use set_breakpoint_location_condition.
> (find_condition_and_thread_for_sals): New static function.
> (create_breakpoint): Call find_condition_and_thread_for_sals.
> (location_to_sals): Call find_condition_and_thread_for_sals instead
> of find_condition_and_thread.
>
> gdb/testsuite/ChangeLog:
> 2020-07-31 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
>
> * gdb.base/condbreak-multi-context.cc: New file.
> * gdb.base/condbreak-multi-context.exp: New file.
>
> gdb/doc/ChangeLog:
> 2020-09-25 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
>
> * gdb.texinfo (Set Breaks): Document disabling of breakpoint
> locations for which the breakpoint condition is invalid.

OK for the documentation part.

But I have to wonder: GDB can automatically disable some conditional
breakpoints, but it leaves enabling them to the user?

Thanks.