Convert set_location_spec_string to a method

This converts set_location_spec_string to a method of location_spec,
and makes the location_spec::as_string field protected, renaming it to
m_as_string along the way.

Change-Id: Iccfb1654e9fa7808d0512df89e775f9eacaeb9e0
This commit is contained in:
Pedro Alves
2022-05-27 16:53:49 +01:00
parent 709438c75a
commit dac9773e17
3 changed files with 19 additions and 27 deletions

View File

@ -2015,7 +2015,7 @@ canonicalize_linespec (struct linespec_state *state, const linespec *ls)
/* If this location originally came from a linespec, save a string
representation of it for display and saving to file. */
if (state->is_linespec)
set_location_spec_string (explicit_loc, explicit_loc->to_linespec ());
explicit_loc->set_string (explicit_loc->to_linespec ());
}
/* Given a line offset in LS, construct the relevant SALs. */