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. */
33 /* An address in the inferior. */
36 /* A probe location. */
40 /* Return the type of the given event location. */
42 extern enum event_location_type
43 event_location_type (const struct event_location
*);
45 /* Return a string representation of the LOCATION.
46 This function may return NULL for unspecified linespecs,
47 e.g, LOCATION_LINESPEC and addr_string is NULL.
49 The result is cached in LOCATION. */
52 event_location_to_string (struct event_location
*location
);
54 /* Create a new linespec location. The return result is malloc'd
55 and should be freed with delete_event_location. */
57 extern struct event_location
*
58 new_linespec_location (char **linespec
);
60 /* Return the linespec location (a string) of the given event_location
61 (which must be of type LINESPEC_LOCATION). */
64 get_linespec_location (const struct event_location
*location
);
66 /* Create a new address location. The return result is malloc'd
67 and should be freed with delete_event_location. */
69 extern struct event_location
*
70 new_address_location (CORE_ADDR addr
);
72 /* Return the address location (a CORE_ADDR) of the given event_location
73 (which must be of type ADDRESS_LOCATION). */
76 get_address_location (const struct event_location
*location
);
78 /* Create a new probe location. The return result is malloc'd
79 and should be freed with delete_event_location. */
81 extern struct event_location
*
82 new_probe_location (const char *probe
);
84 /* Return the probe location (a string) of the given event_location
85 (which must be of type PROBE_LOCATION). */
88 get_probe_location (const struct event_location
*location
);
90 /* Free an event location and any associated data. */
92 extern void delete_event_location (struct event_location
*location
);
94 /* Make a cleanup to free LOCATION. */
96 extern struct cleanup
*
97 make_cleanup_delete_event_location (struct event_location
*location
);
99 /* Return a copy of the given SRC location. */
101 extern struct event_location
*
102 copy_event_location (const struct event_location
*src
);
104 /* Attempt to convert the input string in *ARGP into an event_location.
105 ARGP is advanced past any processed input. Returns an event_location
106 (malloc'd) if an event location was successfully found in *ARGP,
109 This function may call error() if *ARGP looks like properly formed,
110 but invalid, input, e.g., if it is called with missing argument parameters
113 The return result must be freed with delete_event_location. */
115 extern struct event_location
*
116 string_to_event_location (char **argp
,
117 const struct language_defn
*langauge
);
119 /* A convenience function for testing for unset locations. */
121 extern int event_location_empty_p (const struct event_location
*location
);
123 /* Set the location's string representation. If STRING is NULL, clear
124 the string representation. */
127 set_event_location_string (struct event_location
*location
,
129 #endif /* LOCATIONS_H */
This page took 0.035193 seconds and 5 git commands to generate.