Mass rename explicit' -> explicit_loc'.

BuildBot reminded me that "explicit" is a reserved keyword in C++.
This patch simply renames all the (illegal) uses of "explicit". This should
fix the build errors with --enable-build-with-cxx bots.

gdb/ChangeLog

	* break-catch-throw.c (re_set_exception_catchpoint) Rename
	reserved C++ keyword "explicit" to "explicit_loc".
	* breakpoint.c (create_overlay_event_breakpoint)
	(create_longjmp_master_breakpoint)
	(create_std_terminate_master_breakpoint)
	(create_exception_master_breakpoint, update_static_tracepoint):
	Rename reserved C++ keyword "explicit" to "explicit_loc".
	* completer.c (collect_explicit_location_matches)
	(explicit_location_completer): Rename reserved C++ keyword
	"explicit" to "explicit_loc".
	* linespec.c (struct linespec) <explicit>: Rename to "explicit_loc".
	(canonicalize_linespec, create_sals_line_offset)
	(convert_linespec_to_sals, convert_explicit_location_to_sals)
	(event_location_to_sals, decode_objc): Rename reserved C++ keyword
	"explicit" to "explicit_loc".
	* location.c (struct event_location) <explicit>: Rename to
	"explicit_loc".
	(initialize_explicit_location, new_explicit_location)
	(explicit_location_to_string_internal, explicit_location_to_linespec):
	Rename reserved C++ keyword "explicit" to "explicit_loc".
	* location.h (explicit_location_to_string)
	(explicit_location_to_linespec, initialize_explicit_location)
	(new_explicit_location): Rename reserved C++ keyword "explicit"
	to "explicit_loc".
	* mi/mi-cmd-break.c (mi_cmd_break_insert_1): Rename reserved C++
	keyword "explicit" to "explicit_loc".
This commit is contained in:
Keith Seitz
2015-08-13 09:48:12 -07:00
parent 8efa2874ab
commit 6799407467
8 changed files with 162 additions and 127 deletions

View File

@@ -52,6 +52,35 @@
* amd64-tdep.c (amd64_displaced_step_fixup): Fix the mask used to * amd64-tdep.c (amd64_displaced_step_fixup): Fix the mask used to
compute RETADDR. compute RETADDR.
2015-08-12 Keith Seitz <keiths@redhat.com>
* break-catch-throw.c (re_set_exception_catchpoint) Rename
reserved C++ keyword "explicit" to "explicit_loc".
* breakpoint.c (create_overlay_event_breakpoint)
(create_longjmp_master_breakpoint)
(create_std_terminate_master_breakpoint)
(create_exception_master_breakpoint, update_static_tracepoint):
Rename reserved C++ keyword "explicit" to "explicit_loc".
* completer.c (collect_explicit_location_matches)
(explicit_location_completer): Rename reserved C++ keyword
"explicit" to "explicit_loc".
* linespec.c (struct linespec) <explicit>: Rename to "explicit_loc".
(canonicalize_linespec, create_sals_line_offset)
(convert_linespec_to_sals, convert_explicit_location_to_sals)
(event_location_to_sals, decode_objc): Rename reserved C++ keyword
"explicit" to "explicit_loc".
* location.c (struct event_location) <explicit>: Rename to
"explicit_loc".
(initialize_explicit_location, new_explicit_location)
(explicit_location_to_string_internal, explicit_location_to_linespec):
Rename reserved C++ keyword "explicit" to "explicit_loc".
* location.h (explicit_location_to_string)
(explicit_location_to_linespec, initialize_explicit_location)
(new_explicit_location): Rename reserved C++ keyword "explicit"
to "explicit_loc".
* mi/mi-cmd-break.c (mi_cmd_break_insert_1): Rename reserved C++
keyword "explicit" to "explicit_loc".
2015-08-12 Keith Seitz <keiths@redhat.com> 2015-08-12 Keith Seitz <keiths@redhat.com>
* python/python.c (gdbpy_decode_line): Initialize `location' to NULL * python/python.c (gdbpy_decode_line): Initialize `location' to NULL

View File

@@ -229,12 +229,12 @@ re_set_exception_catchpoint (struct breakpoint *self)
catchpoint mode. */ catchpoint mode. */
TRY TRY
{ {
struct explicit_location explicit; struct explicit_location explicit_loc;
initialize_explicit_location (&explicit); initialize_explicit_location (&explicit_loc);
explicit.function_name explicit_loc.function_name
= ASTRDUP (exception_functions[kind].function); = ASTRDUP (exception_functions[kind].function);
location = new_explicit_location (&explicit); location = new_explicit_location (&explicit_loc);
cleanup = make_cleanup_delete_event_location (location); cleanup = make_cleanup_delete_event_location (location);
self->ops->decode_location (self, location, &sals); self->ops->decode_location (self, location, &sals);
do_cleanups (cleanup); do_cleanups (cleanup);

View File

@@ -3424,7 +3424,7 @@ create_overlay_event_breakpoint (void)
struct breakpoint *b; struct breakpoint *b;
struct breakpoint_objfile_data *bp_objfile_data; struct breakpoint_objfile_data *bp_objfile_data;
CORE_ADDR addr; CORE_ADDR addr;
struct explicit_location explicit; struct explicit_location explicit_loc;
bp_objfile_data = get_breakpoint_objfile_data (objfile); bp_objfile_data = get_breakpoint_objfile_data (objfile);
@@ -3449,9 +3449,9 @@ create_overlay_event_breakpoint (void)
b = create_internal_breakpoint (get_objfile_arch (objfile), addr, b = create_internal_breakpoint (get_objfile_arch (objfile), addr,
bp_overlay_event, bp_overlay_event,
&internal_breakpoint_ops); &internal_breakpoint_ops);
initialize_explicit_location (&explicit); initialize_explicit_location (&explicit_loc);
explicit.function_name = ASTRDUP (func_name); explicit_loc.function_name = ASTRDUP (func_name);
b->location = new_explicit_location (&explicit); b->location = new_explicit_location (&explicit_loc);
if (overlay_debugging == ovly_auto) if (overlay_debugging == ovly_auto)
{ {
@@ -3548,7 +3548,7 @@ create_longjmp_master_breakpoint (void)
struct breakpoint *b; struct breakpoint *b;
const char *func_name; const char *func_name;
CORE_ADDR addr; CORE_ADDR addr;
struct explicit_location explicit; struct explicit_location explicit_loc;
if (msym_not_found_p (bp_objfile_data->longjmp_msym[i].minsym)) if (msym_not_found_p (bp_objfile_data->longjmp_msym[i].minsym))
continue; continue;
@@ -3571,9 +3571,9 @@ create_longjmp_master_breakpoint (void)
addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->longjmp_msym[i]); addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->longjmp_msym[i]);
b = create_internal_breakpoint (gdbarch, addr, bp_longjmp_master, b = create_internal_breakpoint (gdbarch, addr, bp_longjmp_master,
&internal_breakpoint_ops); &internal_breakpoint_ops);
initialize_explicit_location (&explicit); initialize_explicit_location (&explicit_loc);
explicit.function_name = ASTRDUP (func_name); explicit_loc.function_name = ASTRDUP (func_name);
b->location = new_explicit_location (&explicit); b->location = new_explicit_location (&explicit_loc);
b->enable_state = bp_disabled; b->enable_state = bp_disabled;
} }
} }
@@ -3604,7 +3604,7 @@ create_std_terminate_master_breakpoint (void)
{ {
struct breakpoint *b; struct breakpoint *b;
struct breakpoint_objfile_data *bp_objfile_data; struct breakpoint_objfile_data *bp_objfile_data;
struct explicit_location explicit; struct explicit_location explicit_loc;
bp_objfile_data = get_breakpoint_objfile_data (objfile); bp_objfile_data = get_breakpoint_objfile_data (objfile);
@@ -3630,9 +3630,9 @@ create_std_terminate_master_breakpoint (void)
b = create_internal_breakpoint (get_objfile_arch (objfile), addr, b = create_internal_breakpoint (get_objfile_arch (objfile), addr,
bp_std_terminate_master, bp_std_terminate_master,
&internal_breakpoint_ops); &internal_breakpoint_ops);
initialize_explicit_location (&explicit); initialize_explicit_location (&explicit_loc);
explicit.function_name = ASTRDUP (func_name); explicit_loc.function_name = ASTRDUP (func_name);
b->location = new_explicit_location (&explicit); b->location = new_explicit_location (&explicit_loc);
b->enable_state = bp_disabled; b->enable_state = bp_disabled;
} }
} }
@@ -3656,7 +3656,7 @@ create_exception_master_breakpoint (void)
struct gdbarch *gdbarch; struct gdbarch *gdbarch;
struct breakpoint_objfile_data *bp_objfile_data; struct breakpoint_objfile_data *bp_objfile_data;
CORE_ADDR addr; CORE_ADDR addr;
struct explicit_location explicit; struct explicit_location explicit_loc;
bp_objfile_data = get_breakpoint_objfile_data (objfile); bp_objfile_data = get_breakpoint_objfile_data (objfile);
@@ -3737,9 +3737,9 @@ create_exception_master_breakpoint (void)
&current_target); &current_target);
b = create_internal_breakpoint (gdbarch, addr, bp_exception_master, b = create_internal_breakpoint (gdbarch, addr, bp_exception_master,
&internal_breakpoint_ops); &internal_breakpoint_ops);
initialize_explicit_location (&explicit); initialize_explicit_location (&explicit_loc);
explicit.function_name = ASTRDUP (func_name); explicit_loc.function_name = ASTRDUP (func_name);
b->location = new_explicit_location (&explicit); b->location = new_explicit_location (&explicit_loc);
b->enable_state = bp_disabled; b->enable_state = bp_disabled;
} }
@@ -13947,7 +13947,7 @@ update_static_tracepoint (struct breakpoint *b, struct symtab_and_line sal)
struct symbol *sym; struct symbol *sym;
struct static_tracepoint_marker *tpmarker; struct static_tracepoint_marker *tpmarker;
struct ui_out *uiout = current_uiout; struct ui_out *uiout = current_uiout;
struct explicit_location explicit; struct explicit_location explicit_loc;
tpmarker = VEC_index (static_tracepoint_marker_p, markers, 0); tpmarker = VEC_index (static_tracepoint_marker_p, markers, 0);
@@ -13989,12 +13989,12 @@ update_static_tracepoint (struct breakpoint *b, struct symtab_and_line sal)
b->loc->symtab = sym != NULL ? sal2.symtab : NULL; b->loc->symtab = sym != NULL ? sal2.symtab : NULL;
delete_event_location (b->location); delete_event_location (b->location);
initialize_explicit_location (&explicit); initialize_explicit_location (&explicit_loc);
explicit.source_filename explicit_loc.source_filename
= ASTRDUP (symtab_to_filename_for_display (sal2.symtab)); = ASTRDUP (symtab_to_filename_for_display (sal2.symtab));
explicit.line_offset.offset = b->loc->line_number; explicit_loc.line_offset.offset = b->loc->line_number;
explicit.line_offset.sign = LINE_OFFSET_NONE; explicit_loc.line_offset.sign = LINE_OFFSET_NONE;
b->location = new_explicit_location (&explicit); b->location = new_explicit_location (&explicit_loc);
/* Might be nice to check if function changed, and warn if /* Might be nice to check if function changed, and warn if
so. */ so. */

View File

@@ -358,14 +358,15 @@ collect_explicit_location_matches (struct event_location *location,
const char *word) const char *word)
{ {
VEC (char_ptr) *matches = NULL; VEC (char_ptr) *matches = NULL;
const struct explicit_location *explicit = get_explicit_location (location); const struct explicit_location *explicit_loc
= get_explicit_location (location);
switch (what) switch (what)
{ {
case MATCH_SOURCE: case MATCH_SOURCE:
{ {
const char *text = (explicit->source_filename == NULL const char *text = (explicit_loc->source_filename == NULL
? "" : explicit->source_filename); ? "" : explicit_loc->source_filename);
matches = make_source_files_completion_list (text, word); matches = make_source_files_completion_list (text, word);
} }
@@ -373,14 +374,14 @@ collect_explicit_location_matches (struct event_location *location,
case MATCH_FUNCTION: case MATCH_FUNCTION:
{ {
const char *text = (explicit->function_name == NULL const char *text = (explicit_loc->function_name == NULL
? "" : explicit->function_name); ? "" : explicit_loc->function_name);
if (explicit->source_filename != NULL) if (explicit_loc->source_filename != NULL)
{ {
matches const char *filename = explicit_loc->source_filename;
= make_file_symbol_completion_list (text, word,
explicit->source_filename); matches = make_file_symbol_completion_list (text, word, filename);
} }
else else
matches = make_symbol_completion_list (text, word); matches = make_symbol_completion_list (text, word);
@@ -451,7 +452,8 @@ explicit_location_completer (struct cmd_list_element *ignore,
size_t len, offset; size_t len, offset;
const char *new_word, *end; const char *new_word, *end;
enum explicit_location_match_type what; enum explicit_location_match_type what;
struct explicit_location *explicit = get_explicit_location (location); struct explicit_location *explicit_loc
= get_explicit_location (location);
/* Backup P to the previous word, which should be the option /* Backup P to the previous word, which should be the option
the user is attempting to complete. */ the user is attempting to complete. */
@@ -463,17 +465,17 @@ explicit_location_completer (struct cmd_list_element *ignore,
if (strncmp (p, "-source", len) == 0) if (strncmp (p, "-source", len) == 0)
{ {
what = MATCH_SOURCE; what = MATCH_SOURCE;
new_word = explicit->source_filename + offset; new_word = explicit_loc->source_filename + offset;
} }
else if (strncmp (p, "-function", len) == 0) else if (strncmp (p, "-function", len) == 0)
{ {
what = MATCH_FUNCTION; what = MATCH_FUNCTION;
new_word = explicit->function_name + offset; new_word = explicit_loc->function_name + offset;
} }
else if (strncmp (p, "-label", len) == 0) else if (strncmp (p, "-label", len) == 0)
{ {
what = MATCH_LABEL; what = MATCH_LABEL;
new_word = explicit->label_name + offset; new_word = explicit_loc->label_name + offset;
} }
else else
{ {

View File

@@ -72,7 +72,7 @@ DEF_VEC_O (bound_minimal_symbol_d);
struct linespec struct linespec
{ {
/* An explicit location describing the SaLs. */ /* An explicit location describing the SaLs. */
struct explicit_location explicit; struct explicit_location explicit_loc;
/* The list of symtabs to search to which to limit the search. May not /* The list of symtabs to search to which to limit the search. May not
be NULL. If explicit.SOURCE_FILENAME is NULL (no user-specified be NULL. If explicit.SOURCE_FILENAME is NULL (no user-specified
@@ -256,7 +256,7 @@ typedef struct ls_parser linespec_parser;
/* A convenience macro for accessing the explicit location result of /* A convenience macro for accessing the explicit location result of
the parser. */ the parser. */
#define PARSER_EXPLICIT(PPTR) (&PARSER_RESULT ((PPTR))->explicit) #define PARSER_EXPLICIT(PPTR) (&PARSER_RESULT ((PPTR))->explicit_loc)
/* Prototypes for local functions. */ /* Prototypes for local functions. */
@@ -1769,21 +1769,22 @@ static void
canonicalize_linespec (struct linespec_state *state, const linespec_p ls) canonicalize_linespec (struct linespec_state *state, const linespec_p ls)
{ {
struct event_location *canon; struct event_location *canon;
struct explicit_location *explicit; struct explicit_location *explicit_loc;
/* If canonicalization was not requested, no need to do anything. */ /* If canonicalization was not requested, no need to do anything. */
if (!state->canonical) if (!state->canonical)
return; return;
/* Save everything as an explicit location. */ /* Save everything as an explicit location. */
canon = state->canonical->location = new_explicit_location (&ls->explicit); canon = state->canonical->location
explicit = get_explicit_location (canon); = new_explicit_location (&ls->explicit_loc);
explicit_loc = get_explicit_location (canon);
if (explicit->label_name != NULL) if (explicit_loc->label_name != NULL)
{ {
state->canonical->special_display = 1; state->canonical->special_display = 1;
if (explicit->function_name == NULL) if (explicit_loc->function_name == NULL)
{ {
struct symbol *s; struct symbol *s;
@@ -1792,7 +1793,7 @@ canonicalize_linespec (struct linespec_state *state, const linespec_p ls)
&& (VEC_length (symbolp, ls->labels.function_symbols) && (VEC_length (symbolp, ls->labels.function_symbols)
== 1)); == 1));
s = VEC_index (symbolp, ls->labels.function_symbols, 0); s = VEC_index (symbolp, ls->labels.function_symbols, 0);
explicit->function_name = xstrdup (SYMBOL_NATURAL_NAME (s)); explicit_loc->function_name = xstrdup (SYMBOL_NATURAL_NAME (s));
} }
} }
@@ -1800,7 +1801,7 @@ canonicalize_linespec (struct linespec_state *state, const linespec_p ls)
representation of it for display and saving to file. */ representation of it for display and saving to file. */
if (state->is_linespec) if (state->is_linespec)
{ {
char *linespec = explicit_location_to_linespec (explicit); char *linespec = explicit_location_to_linespec (explicit_loc);
set_event_location_string (canon, linespec); set_event_location_string (canon, linespec);
xfree (linespec); xfree (linespec);
@@ -1844,18 +1845,18 @@ create_sals_line_offset (struct linespec_state *self,
use_default = 1; use_default = 1;
} }
val.line = ls->explicit.line_offset.offset; val.line = ls->explicit_loc.line_offset.offset;
switch (ls->explicit.line_offset.sign) switch (ls->explicit_loc.line_offset.sign)
{ {
case LINE_OFFSET_PLUS: case LINE_OFFSET_PLUS:
if (ls->explicit.line_offset.offset == 0) if (ls->explicit_loc.line_offset.offset == 0)
val.line = 5; val.line = 5;
if (use_default) if (use_default)
val.line = self->default_line + val.line; val.line = self->default_line + val.line;
break; break;
case LINE_OFFSET_MINUS: case LINE_OFFSET_MINUS:
if (ls->explicit.line_offset.offset == 0) if (ls->explicit_loc.line_offset.offset == 0)
val.line = 15; val.line = 15;
if (use_default) if (use_default)
val.line = self->default_line - val.line; val.line = self->default_line - val.line;
@@ -1947,9 +1948,9 @@ create_sals_line_offset (struct linespec_state *self,
if (values.nelts == 0) if (values.nelts == 0)
{ {
if (ls->explicit.source_filename) if (ls->explicit_loc.source_filename)
throw_error (NOT_FOUND_ERROR, _("No line %d in file \"%s\"."), throw_error (NOT_FOUND_ERROR, _("No line %d in file \"%s\"."),
val.line, ls->explicit.source_filename); val.line, ls->explicit_loc.source_filename);
else else
throw_error (NOT_FOUND_ERROR, _("No line %d in the current file."), throw_error (NOT_FOUND_ERROR, _("No line %d in the current file."),
val.line); val.line);
@@ -2046,13 +2047,13 @@ convert_linespec_to_sals (struct linespec_state *state, linespec_p ls)
} }
} }
} }
else if (ls->explicit.line_offset.sign != LINE_OFFSET_UNKNOWN) else if (ls->explicit_loc.line_offset.sign != LINE_OFFSET_UNKNOWN)
{ {
/* Only an offset was specified. */ /* Only an offset was specified. */
sals = create_sals_line_offset (state, ls); sals = create_sals_line_offset (state, ls);
/* Make sure we have a filename for canonicalization. */ /* Make sure we have a filename for canonicalization. */
if (ls->explicit.source_filename == NULL) if (ls->explicit_loc.source_filename == NULL)
{ {
const char *fullname = symtab_to_fullname (state->default_symtab); const char *fullname = symtab_to_fullname (state->default_symtab);
@@ -2060,7 +2061,7 @@ convert_linespec_to_sals (struct linespec_state *state, linespec_p ls)
form so that displaying SOURCE_FILENAME can follow the current form so that displaying SOURCE_FILENAME can follow the current
FILENAME_DISPLAY_STRING setting. But as it is used only rarely FILENAME_DISPLAY_STRING setting. But as it is used only rarely
it has been kept for code simplicity only in absolute form. */ it has been kept for code simplicity only in absolute form. */
ls->explicit.source_filename = xstrdup (fullname); ls->explicit_loc.source_filename = xstrdup (fullname);
} }
} }
else else
@@ -2077,29 +2078,30 @@ convert_linespec_to_sals (struct linespec_state *state, linespec_p ls)
return sals; return sals;
} }
/* Convert the explicit location EXPLICIT into SaLs. */ /* Convert the explicit location EXPLICIT_LOC into SaLs. */
static struct symtabs_and_lines static struct symtabs_and_lines
convert_explicit_location_to_sals (struct linespec_state *self, convert_explicit_location_to_sals (struct linespec_state *self,
linespec_p result, linespec_p result,
const struct explicit_location *explicit) const struct explicit_location *explicit_loc)
{ {
VEC (symbolp) *symbols, *labels; VEC (symbolp) *symbols, *labels;
VEC (bound_minimal_symbol_d) *minimal_symbols; VEC (bound_minimal_symbol_d) *minimal_symbols;
if (explicit->source_filename != NULL) if (explicit_loc->source_filename != NULL)
{ {
TRY TRY
{ {
result->file_symtabs result->file_symtabs
= symtabs_from_filename (explicit->source_filename); = symtabs_from_filename (explicit_loc->source_filename);
} }
CATCH (except, RETURN_MASK_ERROR) CATCH (except, RETURN_MASK_ERROR)
{ {
source_file_not_found_error (explicit->source_filename); source_file_not_found_error (explicit_loc->source_filename);
} }
END_CATCH END_CATCH
result->explicit.source_filename = xstrdup (explicit->source_filename); result->explicit_loc.source_filename
= xstrdup (explicit_loc->source_filename);
} }
else else
{ {
@@ -2107,38 +2109,39 @@ convert_explicit_location_to_sals (struct linespec_state *self,
VEC_safe_push (symtab_ptr, result->file_symtabs, NULL); VEC_safe_push (symtab_ptr, result->file_symtabs, NULL);
} }
if (explicit->function_name != NULL) if (explicit_loc->function_name != NULL)
{ {
find_linespec_symbols (self, result->file_symtabs, find_linespec_symbols (self, result->file_symtabs,
explicit->function_name, &symbols, explicit_loc->function_name, &symbols,
&minimal_symbols); &minimal_symbols);
if (symbols == NULL && minimal_symbols == NULL) if (symbols == NULL && minimal_symbols == NULL)
symbol_not_found_error (explicit->function_name, symbol_not_found_error (explicit_loc->function_name,
result->explicit.source_filename); result->explicit_loc.source_filename);
result->explicit.function_name = xstrdup (explicit->function_name); result->explicit_loc.function_name
= xstrdup (explicit_loc->function_name);
result->function_symbols = symbols; result->function_symbols = symbols;
result->minimal_symbols = minimal_symbols; result->minimal_symbols = minimal_symbols;
} }
if (explicit->label_name != NULL) if (explicit_loc->label_name != NULL)
{ {
symbols = NULL; symbols = NULL;
labels = find_label_symbols (self, result->function_symbols, labels = find_label_symbols (self, result->function_symbols,
&symbols, explicit->label_name); &symbols, explicit_loc->label_name);
if (labels == NULL) if (labels == NULL)
undefined_label_error (result->explicit.function_name, undefined_label_error (result->explicit_loc.function_name,
explicit->label_name); explicit_loc->label_name);
result->explicit.label_name = xstrdup (explicit->label_name); result->explicit_loc.label_name = xstrdup (explicit_loc->label_name);
result->labels.label_symbols = labels; result->labels.label_symbols = labels;
result->labels.function_symbols = symbols; result->labels.function_symbols = symbols;
} }
if (explicit->line_offset.sign != LINE_OFFSET_UNKNOWN) if (explicit_loc->line_offset.sign != LINE_OFFSET_UNKNOWN)
result->explicit.line_offset = explicit->line_offset; result->explicit_loc.line_offset = explicit_loc->line_offset;
return convert_linespec_to_sals (self, result); return convert_linespec_to_sals (self, result);
} }
@@ -2501,12 +2504,12 @@ event_location_to_sals (linespec_parser *parser,
case EXPLICIT_LOCATION: case EXPLICIT_LOCATION:
{ {
const struct explicit_location *explicit; const struct explicit_location *explicit_loc;
explicit = get_explicit_location_const (location); explicit_loc = get_explicit_location_const (location);
result = convert_explicit_location_to_sals (PARSER_STATE (parser), result = convert_explicit_location_to_sals (PARSER_STATE (parser),
PARSER_RESULT (parser), PARSER_RESULT (parser),
explicit); explicit_loc);
} }
break; break;
@@ -2759,7 +2762,7 @@ decode_objc (struct linespec_state *self, linespec_p ls, const char *arg)
memcpy (saved_arg, arg, new_argptr - arg); memcpy (saved_arg, arg, new_argptr - arg);
saved_arg[new_argptr - arg] = '\0'; saved_arg[new_argptr - arg] = '\0';
ls->explicit.function_name = xstrdup (saved_arg); ls->explicit_loc.function_name = xstrdup (saved_arg);
ls->function_symbols = info.result.symbols; ls->function_symbols = info.result.symbols;
ls->minimal_symbols = info.result.minimal_symbols; ls->minimal_symbols = info.result.minimal_symbols;
values = convert_linespec_to_sals (self, ls); values = convert_linespec_to_sals (self, ls);
@@ -2770,10 +2773,10 @@ decode_objc (struct linespec_state *self, linespec_p ls, const char *arg)
self->canonical->pre_expanded = 1; self->canonical->pre_expanded = 1;
if (ls->explicit.source_filename) if (ls->explicit_loc.source_filename)
{ {
str = xstrprintf ("%s:%s", str = xstrprintf ("%s:%s",
ls->explicit.source_filename, saved_arg); ls->explicit_loc.source_filename, saved_arg);
} }
else else
str = xstrdup (saved_arg); str = xstrdup (saved_arg);

View File

@@ -52,8 +52,8 @@ struct event_location
#define EL_ADDRESS(PTR) (PTR)->u.address #define EL_ADDRESS(PTR) (PTR)->u.address
/* An explicit location. */ /* An explicit location. */
struct explicit_location explicit; struct explicit_location explicit_loc;
#define EL_EXPLICIT(PTR) (&((PTR)->u.explicit)) #define EL_EXPLICIT(PTR) (&((PTR)->u.explicit_loc))
} u; } u;
/* Cached string representation of this location. This is used, e.g., to /* Cached string representation of this location. This is used, e.g., to
@@ -73,10 +73,10 @@ event_location_type (const struct event_location *location)
/* See description in location.h. */ /* See description in location.h. */
void void
initialize_explicit_location (struct explicit_location *explicit) initialize_explicit_location (struct explicit_location *explicit_loc)
{ {
memset (explicit, 0, sizeof (struct explicit_location)); memset (explicit_loc, 0, sizeof (struct explicit_location));
explicit->line_offset.sign = LINE_OFFSET_UNKNOWN; explicit_loc->line_offset.sign = LINE_OFFSET_UNKNOWN;
} }
/* See description in location.h. */ /* See description in location.h. */
@@ -158,30 +158,30 @@ get_probe_location (const struct event_location *location)
/* See description in location.h. */ /* See description in location.h. */
struct event_location * struct event_location *
new_explicit_location (const struct explicit_location *explicit) new_explicit_location (const struct explicit_location *explicit_loc)
{ {
struct event_location tmp; struct event_location tmp;
memset (&tmp, 0, sizeof (struct event_location)); memset (&tmp, 0, sizeof (struct event_location));
EL_TYPE (&tmp) = EXPLICIT_LOCATION; EL_TYPE (&tmp) = EXPLICIT_LOCATION;
initialize_explicit_location (EL_EXPLICIT (&tmp)); initialize_explicit_location (EL_EXPLICIT (&tmp));
if (explicit != NULL) if (explicit_loc != NULL)
{ {
if (explicit->source_filename != NULL) if (explicit_loc->source_filename != NULL)
{ {
EL_EXPLICIT (&tmp)->source_filename EL_EXPLICIT (&tmp)->source_filename
= explicit->source_filename; = explicit_loc->source_filename;
} }
if (explicit->function_name != NULL) if (explicit_loc->function_name != NULL)
EL_EXPLICIT (&tmp)->function_name EL_EXPLICIT (&tmp)->function_name
= explicit->function_name; = explicit_loc->function_name;
if (explicit->label_name != NULL) if (explicit_loc->label_name != NULL)
EL_EXPLICIT (&tmp)->label_name = explicit->label_name; EL_EXPLICIT (&tmp)->label_name = explicit_loc->label_name;
if (explicit->line_offset.sign != LINE_OFFSET_UNKNOWN) if (explicit_loc->line_offset.sign != LINE_OFFSET_UNKNOWN)
EL_EXPLICIT (&tmp)->line_offset = explicit->line_offset; EL_EXPLICIT (&tmp)->line_offset = explicit_loc->line_offset;
} }
return copy_event_location (&tmp); return copy_event_location (&tmp);
@@ -206,14 +206,14 @@ get_explicit_location_const (const struct event_location *location)
} }
/* This convenience function returns a malloc'd string which /* This convenience function returns a malloc'd string which
represents the location in EXPLICIT. represents the location in EXPLICIT_LOC.
AS_LINESPEC is non-zero if this string should be a linespec. AS_LINESPEC is non-zero if this string should be a linespec.
Otherwise it will be output in explicit form. */ Otherwise it will be output in explicit form. */
static char * static char *
explicit_to_string_internal (int as_linespec, explicit_to_string_internal (int as_linespec,
const struct explicit_location *explicit) const struct explicit_location *explicit_loc)
{ {
struct ui_file *buf; struct ui_file *buf;
char space, *result; char space, *result;
@@ -224,45 +224,45 @@ explicit_to_string_internal (int as_linespec,
buf = mem_fileopen (); buf = mem_fileopen ();
cleanup = make_cleanup_ui_file_delete (buf); cleanup = make_cleanup_ui_file_delete (buf);
if (explicit->source_filename != NULL) if (explicit_loc->source_filename != NULL)
{ {
if (!as_linespec) if (!as_linespec)
fputs_unfiltered ("-source ", buf); fputs_unfiltered ("-source ", buf);
fputs_unfiltered (explicit->source_filename, buf); fputs_unfiltered (explicit_loc->source_filename, buf);
need_space = 1; need_space = 1;
} }
if (explicit->function_name != NULL) if (explicit_loc->function_name != NULL)
{ {
if (need_space) if (need_space)
fputc_unfiltered (space, buf); fputc_unfiltered (space, buf);
if (!as_linespec) if (!as_linespec)
fputs_unfiltered ("-function ", buf); fputs_unfiltered ("-function ", buf);
fputs_unfiltered (explicit->function_name, buf); fputs_unfiltered (explicit_loc->function_name, buf);
need_space = 1; need_space = 1;
} }
if (explicit->label_name != NULL) if (explicit_loc->label_name != NULL)
{ {
if (need_space) if (need_space)
fputc_unfiltered (space, buf); fputc_unfiltered (space, buf);
if (!as_linespec) if (!as_linespec)
fputs_unfiltered ("-label ", buf); fputs_unfiltered ("-label ", buf);
fputs_unfiltered (explicit->label_name, buf); fputs_unfiltered (explicit_loc->label_name, buf);
need_space = 1; need_space = 1;
} }
if (explicit->line_offset.sign != LINE_OFFSET_UNKNOWN) if (explicit_loc->line_offset.sign != LINE_OFFSET_UNKNOWN)
{ {
if (need_space) if (need_space)
fputc_unfiltered (space, buf); fputc_unfiltered (space, buf);
if (!as_linespec) if (!as_linespec)
fputs_unfiltered ("-line ", buf); fputs_unfiltered ("-line ", buf);
fprintf_filtered (buf, "%s%d", fprintf_filtered (buf, "%s%d",
(explicit->line_offset.sign == LINE_OFFSET_NONE ? "" (explicit_loc->line_offset.sign == LINE_OFFSET_NONE ? ""
: (explicit->line_offset.sign : (explicit_loc->line_offset.sign
== LINE_OFFSET_PLUS ? "+" : "-")), == LINE_OFFSET_PLUS ? "+" : "-")),
explicit->line_offset.offset); explicit_loc->line_offset.offset);
} }
result = ui_file_xstrdup (buf, NULL); result = ui_file_xstrdup (buf, NULL);
@@ -273,17 +273,17 @@ explicit_to_string_internal (int as_linespec,
/* See description in location.h. */ /* See description in location.h. */
char * char *
explicit_location_to_string (const struct explicit_location *explicit) explicit_location_to_string (const struct explicit_location *explicit_loc)
{ {
return explicit_to_string_internal (0, explicit); return explicit_to_string_internal (0, explicit_loc);
} }
/* See description in location.h. */ /* See description in location.h. */
char * char *
explicit_location_to_linespec (const struct explicit_location *explicit) explicit_location_to_linespec (const struct explicit_location *explicit_loc)
{ {
return explicit_to_string_internal (1, explicit); return explicit_to_string_internal (1, explicit_loc);
} }
/* See description in location.h. */ /* See description in location.h. */

View File

@@ -97,13 +97,13 @@ extern enum event_location_type
explicit location. The location must already be canonicalized/valid. */ explicit location. The location must already be canonicalized/valid. */
extern char * extern char *
explicit_location_to_string (const struct explicit_location *explicit); explicit_location_to_string (const struct explicit_location *explicit_loc);
/* Return a malloc'd linespec string representation of the given /* Return a malloc'd linespec string representation of the given
explicit location. The location must already be canonicalized/valid. */ explicit location. The location must already be canonicalized/valid. */
extern char * extern char *
explicit_location_to_linespec (const struct explicit_location *explicit); explicit_location_to_linespec (const struct explicit_location *explicit_loc);
/* Return a string representation of the LOCATION. /* Return a string representation of the LOCATION.
This function may return NULL for unspecified linespecs, This function may return NULL for unspecified linespecs,
@@ -152,7 +152,8 @@ extern const char *
/* Initialize the given explicit location. */ /* Initialize the given explicit location. */
extern void initialize_explicit_location (struct explicit_location *explicit); extern void
initialize_explicit_location (struct explicit_location *explicit_loc);
/* Create a new explicit location. If not NULL, EXPLICIT is checked for /* Create a new explicit location. If not NULL, EXPLICIT is checked for
validity. If invalid, an exception is thrown. validity. If invalid, an exception is thrown.
@@ -161,7 +162,7 @@ extern void initialize_explicit_location (struct explicit_location *explicit);
delete_event_location. */ delete_event_location. */
extern struct event_location * extern struct event_location *
new_explicit_location (const struct explicit_location *explicit); new_explicit_location (const struct explicit_location *explicit_loc);
/* Return the explicit location of the given event_location /* Return the explicit location of the given event_location
(which must be of type EXPLICIT_LOCATION). */ (which must be of type EXPLICIT_LOCATION). */

View File

@@ -183,7 +183,7 @@ mi_cmd_break_insert_1 (int dprintf, char *command, char **argv, int argc)
struct event_location *location; struct event_location *location;
struct breakpoint_ops *ops; struct breakpoint_ops *ops;
int is_explicit = 0; int is_explicit = 0;
struct explicit_location explicit; struct explicit_location explicit_loc;
char *extra_string = NULL; char *extra_string = NULL;
enum opt enum opt
@@ -216,7 +216,7 @@ mi_cmd_break_insert_1 (int dprintf, char *command, char **argv, int argc)
int oind = 0; int oind = 0;
char *oarg; char *oarg;
initialize_explicit_location (&explicit); initialize_explicit_location (&explicit_loc);
while (1) while (1)
{ {
@@ -252,19 +252,19 @@ mi_cmd_break_insert_1 (int dprintf, char *command, char **argv, int argc)
break; break;
case EXPLICIT_SOURCE_OPT: case EXPLICIT_SOURCE_OPT:
is_explicit = 1; is_explicit = 1;
explicit.source_filename = oarg; explicit_loc.source_filename = oarg;
break; break;
case EXPLICIT_FUNC_OPT: case EXPLICIT_FUNC_OPT:
is_explicit = 1; is_explicit = 1;
explicit.function_name = oarg; explicit_loc.function_name = oarg;
break; break;
case EXPLICIT_LABEL_OPT: case EXPLICIT_LABEL_OPT:
is_explicit = 1; is_explicit = 1;
explicit.label_name = oarg; explicit_loc.label_name = oarg;
break; break;
case EXPLICIT_LINE_OPT: case EXPLICIT_LINE_OPT:
is_explicit = 1; is_explicit = 1;
explicit.line_offset = linespec_parse_line_offset (oarg); explicit_loc.line_offset = linespec_parse_line_offset (oarg);
break; break;
} }
} }
@@ -330,14 +330,14 @@ mi_cmd_break_insert_1 (int dprintf, char *command, char **argv, int argc)
{ {
/* Error check -- we must have one of the other /* Error check -- we must have one of the other
parameters specified. */ parameters specified. */
if (explicit.source_filename != NULL if (explicit_loc.source_filename != NULL
&& explicit.function_name == NULL && explicit_loc.function_name == NULL
&& explicit.label_name == NULL && explicit_loc.label_name == NULL
&& explicit.line_offset.sign == LINE_OFFSET_UNKNOWN) && explicit_loc.line_offset.sign == LINE_OFFSET_UNKNOWN)
error (_("-%s-insert: --source option requires --function, --label," error (_("-%s-insert: --source option requires --function, --label,"
" or --line"), dprintf ? "dprintf" : "break"); " or --line"), dprintf ? "dprintf" : "break");
location = new_explicit_location (&explicit); location = new_explicit_location (&explicit_loc);
} }
else else
{ {