mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-15 05:01:13 +08:00
New common function "startswith"
This commit introduces a new inline common function "startswith" which takes two string arguments and returns nonzero if the first string starts with the second. It also updates the 295 places where this logic was written out longhand to use the new function. gdb/ChangeLog: * common/common-utils.h (startswith): New inline function. All places where this logic was used updated to use the above.
This commit is contained in:
@ -233,8 +233,8 @@ unpack_mangled_go_symbol (const char *mangled_name,
|
||||
libgo_.*: used by gccgo's runtime
|
||||
|
||||
Thus we don't support -fgo-prefix (except as used by the runtime). */
|
||||
if (strncmp (mangled_name, "go.", 3) != 0
|
||||
&& strncmp (mangled_name, "libgo_", 6) != 0)
|
||||
if (!startswith (mangled_name, "go.")
|
||||
&& !startswith (mangled_name, "libgo_"))
|
||||
return NULL;
|
||||
|
||||
/* Quick check for whether a search may be fruitful. */
|
||||
|
Reference in New Issue
Block a user