binutils-gdb/gdb/gdbsupport
Christian Biesinger 87f34879e5 Add a string_view version of startswith
Makes sure that the string is longer than prefix, so that strncmp will
do the right thing even if the string is not null-terminated.

For use in my string_view conversion patch:
https://sourceware.org/ml/gdb-patches/2019-10/msg00030.html
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/125

gdb/ChangeLog:

2019-10-28  Christian Biesinger  <cbiesinger@google.com>

	* gdbsupport/common-utils.h (startswith): Add an overloaded version
	that takes gdb::string_view arguments.

Change-Id: I5389855de2fd70e7065a789a79374b0693651b71
2019-10-28 12:20:13 -05:00
..
agent.c
agent.h
array-view.h
ax.def
break-common.h
btrace-common.c gdb: Remove whitespace in 'std::vector <...>' 2019-10-03 09:42:42 +01:00
btrace-common.h gdb: Remove whitespace in 'std::vector <...>' 2019-10-03 09:42:42 +01:00
buffer.c
buffer.h
byte-vector.h
cleanups.c
cleanups.h
common-debug.c
common-debug.h
common-defs.h
common-exceptions.c
common-exceptions.h
common-gdbthread.h
common-inferior.c Fix type of startup_with_shell in gdbserver 2019-10-02 13:43:41 -06:00
common-inferior.h Fix type of startup_with_shell in gdbserver 2019-10-02 13:43:41 -06:00
common-regcache.c
common-regcache.h
common-types.h
common-utils.c
common-utils.h Add a string_view version of startswith 2019-10-28 12:20:13 -05:00
common.host
common.m4 Check for sigprocmask in common.m4 2019-10-23 09:06:21 -06:00
create-version.sh
def-vector.h
default-init-alloc.h
enum-flags.h
environ.c
environ.h
errors.c
errors.h
fileio.c
fileio.h
filestuff.c
filestuff.h
filtered-iterator.h
format.c Introduce gdb-specific %p format suffixes 2019-10-01 15:12:38 -06:00
format.h Introduce gdb-specific %p format suffixes 2019-10-01 15:12:38 -06:00
forward-scope-exit.h
function-view.h
gdb_assert.h Add missing includes to gdb_assert.h and gdb_string_view.h 2019-10-02 13:33:09 -05:00
gdb_locale.h
gdb_optional.h
gdb_proc_service.h
gdb_ref_ptr.h
gdb_setjmp.h Allow not saving the signal state in SIGSETJMP 2019-10-16 16:13:43 -05:00
gdb_signals.h
gdb_splay_tree.h
gdb_string_view.h Add missing includes to gdb_assert.h and gdb_string_view.h 2019-10-02 13:33:09 -05:00
gdb_string_view.tcc
gdb_sys_time.h
gdb_tilde_expand.c
gdb_tilde_expand.h
gdb_unique_ptr.h
gdb_unlinker.h
gdb_vecs.c
gdb_vecs.h gdb: Remove vec.{c,h} and update code to not include vec.h 2019-10-15 21:31:55 +01:00
gdb_wait.h
gdb-dlfcn.c
gdb-dlfcn.h
hash_enum.h
host-defs.h
job-control.c
job-control.h
mingw-strerror.c
netstuff.c
netstuff.h
new-op.c
next-iterator.h
observable.h
offset-type.h
pathstuff.c
pathstuff.h
poison.h
posix-strerror.c
preprocessor.h
print-utils.c
print-utils.h Improve comments in print-utils.h. 2019-10-11 11:28:35 -07:00
ptid.c
ptid.h
refcounted-object.h
rsp-low.c
rsp-low.h
run-time-clock.c
run-time-clock.h
safe-iterator.h
scope-exit.h
scoped_fd.h
scoped_mmap.c
scoped_mmap.h
scoped_restore.h
selftest.c
selftest.h
signals-state-save-restore.c
signals-state-save-restore.h
signals.c
symbol.h
tdesc.c
tdesc.h
traits.h
underlying.h
valid-expr.h
version.h
x86-xstate.h
xml-utils.c
xml-utils.h