This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] python: Add qualified parameter to gdb.Breakpoint
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Simon Marchi <simon dot marchi at ericsson dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 08 Dec 2017 16:15:13 +0200
- Subject: Re: [PATCH] python: Add qualified parameter to gdb.Breakpoint
- Authentication-results: sourceware.org; auth=none
- References: <1512686013-24658-1-git-send-email-simon.marchi@ericsson.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Simon Marchi <simon.marchi@ericsson.com>
> CC: Simon Marchi <simon.marchi@ericsson.com>
> Date: Thu, 7 Dec 2017 17:33:33 -0500
>
> This patch adds the possibility to pass a qualified=True|False parameter
> when creating a breakpoint in Python. It is equivalent to using
> -qualified in a linespec. The parameter actually accepts any Python
> value, and converts it to boolean using Python's standard rules for
> that (https://docs.python.org/3/library/stdtypes.html#truth).
>
> Unlike the -source/-line/-function/-label parameters, it is possible to
> use -qualified with a "normal" (non-explicit) linespec. Therefore, it
> is possible (unlike these other parameters) to use this new parameter
> along with the spec parameter.
>
> I updated the py-breakpoint.exp test. To be able to test multiple
> locations using a namespace, I had to switch the test case to compile as
> C++. If we really wanted to, we could run it as both C and C++, but
> omit the C++-specific parts when running it as C.
>
> gdb/ChangeLog:
>
> * location.h (string_to_event_location): Add match_type
> parameter.
> * location.c (string_to_event_location): Likewise.
> * python/py-breakpoint.c (bppy_init): Handle qualified
> parameter.
>
> gdb/doc/ChangeLog:
>
> * python.texi (Manipulating breakpoints using Python): Document
> qualified parameter to gdb.Breakpoint.
>
> gdb/testsuite/ChangeLog:
>
> * gdb.python/py-breakpoint.c (foo_ns::multiply): New function.
> * gdb.python/py-breakpoint.exp: Compile the test case as c++,
> call test_bkpt_qualified.
> (test_bkpt_qualified): New proc.
OK for the documentation part. (Do we need a NEWS entry?)