1 /* Data structures and API for event locations in GDB.
2 Copyright (C) 2013-2015 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 struct event_location;
25 /* An enumeration of the various ways to specify a stop event
26 location (used with create_breakpoint). */
28 enum event_location_type
30 /* A traditional linespec. */
34 /* Return the type of the given event location. */
36 extern enum event_location_type
37 event_location_type (const struct event_location *);
39 /* Return a string representation of the LOCATION.
40 This function may return NULL for unspecified linespecs,
41 e.g, LOCATION_LINESPEC and addr_string is NULL.
43 The result is cached in LOCATION. */
46 event_location_to_string (struct event_location *location);
48 /* Create a new linespec location. The return result is malloc'd
49 and should be freed with delete_event_location. */
51 extern struct event_location *
52 new_linespec_location (char **linespec);
54 /* Return the linespec location (a string) of the given event_location
55 (which must be of type LINESPEC_LOCATION). */
58 get_linespec_location (const struct event_location *location);
60 /* Free an event location and any associated data. */
62 extern void delete_event_location (struct event_location *location);
64 /* Make a cleanup to free LOCATION. */
66 extern struct cleanup *
67 make_cleanup_delete_event_location (struct event_location *location);
69 /* Return a copy of the given SRC location. */
71 extern struct event_location *
72 copy_event_location (const struct event_location *src);
74 /* Attempt to convert the input string in *ARGP into an event_location.
75 ARGP is advanced past any processed input. Returns an event_location
76 (malloc'd) if an event location was successfully found in *ARGP,
79 This function may call error() if *ARGP looks like properly formed,
80 but invalid, input, e.g., if it is called with missing argument parameters
83 The return result must be freed with delete_event_location. */
85 extern struct event_location *
86 string_to_event_location (char **argp,
87 const struct language_defn *langauge);
89 /* A convenience function for testing for unset locations. */
91 extern int event_location_empty_p (const struct event_location *location);
93 /* Set the location's string representation. If STRING is NULL, clear
94 the string representation. */
97 set_event_location_string (struct event_location *location,
99 #endif /* LOCATIONS_H */