event_location_up new_linespec_location (char **linespec) { struct event_location *location; location = XCNEW (struct event_location); EL_TYPE (location) = LINESPEC_LOCATION; if (*linespec != NULL) { char *p; char *orig = *linespec; linespec_lex_to_end (linespec); p = remove_trailing_whitespace (orig, *linespec); if ((p - orig) > 0) EL_LINESPEC (location) = savestring (orig, p - orig); } return event_location_up (location); }
event_location_up new_linespec_location (const char **linespec, symbol_name_match_type match_type) { struct event_location *location; location = XCNEW (struct event_location); EL_TYPE (location) = LINESPEC_LOCATION; EL_LINESPEC (location)->match_type = match_type; if (*linespec != NULL) { const char *p; const char *orig = *linespec; linespec_lex_to_end (linespec); p = remove_trailing_whitespace (orig, *linespec); if ((p - orig) > 0) EL_LINESPEC (location)->spec_string = savestring (orig, p - orig); } return event_location_up (location); }