[PATCH v6 2/9] Explicit locations: introduce new struct event_location-based API

Doug Evans xdje42@gmail.com
Mon Aug 10 17:34:00 GMT 2015

Keith Seitz <keiths@redhat.com> writes:
> Differences in this revision:
> 1. Fixed typos
> 2. Changed error-handling in linespec_lex_to_end.
> 3. Remove unused references to copy_event_location_tmp.
> --
> This patch introduces the new breakpoint/"linespec" API based on
> a new struct event_location.  This API currently only supports
> traditional linespecs, maintaining the status quo of the code base.
> Future patches will add additional functionality for other location
> types such as address locations.
> gdb/ChangeLog:
> 	* Makefile.in (SFILES): Add location.c.
> 	(HFILES_NO_SRCDIR): Add location.h.
> 	(COMMON_OBS): Add location.o.
> 	* linespec.c (linespec_lex_to_end): New function.
> 	* linespec.h (linespec_lex_to_end): Declare.
> 	* location.c: New file.
> 	* location.h: New file.

I'm going to try to minimize the number of requested changes.
I'd really like to get this checked in,
and I'm sure you would too. :-)

This patch is ok as is, though there is one change I would make.
This change *can* be deferred for later, but feel free to make it now.

The requested change is: Remove event_location_to_string_const
from location.h and make it static in location.c.
I didn't check any intermediate state of applying the patch series,
but after I apply all the patches event_location_to_string_const
is only used in location.c.

Later (not now, let's get this sucker checked in, unless of course
you really want to), let's make event_location_to_string take a
const struct event_location *, and make the cached copy
"mutable in the c++ sense".

More information about the Gdb-patches mailing list