Re: [PATCH v4] Change some arguments to gdb::string_view instead of name+len

Tom Tromey
2019-10-01T17:18:40Z

>>>>> "Christian" == Christian Biesinger via gdb-patches <gdb-patches@sourceware.org> writes:

Christian> [This version also replaces an instance of strcmp with string_view's
Christian> operator==, so that the length is correctly respected]

Thanks.

Unfortunately I found / remembered another weirdness.

Christian> - if (linkage_name[len] != '\0')
Christian> + if (linkage_name[linkage_name.length ()] != '\0')

This code let the caller pass in a possibly-unterminated string, and
then made a local copy with the terminating \0 in that case.

However, this was always a bad idea, and now is probably a libstdc++
debug-mode assertion failure (<- just guessing but if it isn't, it
should be!).

Tom