aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1992-09-03 05:03:47 +0000
committerPer Bothner <per@bothner.com>1992-09-03 05:03:47 +0000
commit546014f750f2c561be41eed79e5030dd8255cca0 (patch)
tree05d93bf94813bd3c2c8d8a11c1372e64f42221b0 /gdb/utils.c
parent82eabd43a8e52ecaff314ee169cea870a12457e1 (diff)
downloadgdb-546014f750f2c561be41eed79e5030dd8255cca0.zip
gdb-546014f750f2c561be41eed79e5030dd8255cca0.tar.gz
gdb-546014f750f2c561be41eed79e5030dd8255cca0.tar.bz2
* utils.c (strcmp_iw): Add a hack to allow "FOO(ARGS)" to
match "FOO". This allows 'break Foo' to work when Foo is a mangled C++ function. (See comment before function.)
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c58
1 files changed, 55 insertions, 3 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 2e0a1f8..b99e4f9 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -699,6 +699,8 @@ query (va_alist)
while (1)
{
+ wrap_here (""); /* Flush any buffered output */
+ fflush (stdout);
va_start (args);
ctlstr = va_arg (args, char *);
vfprintf_filtered (stdout, ctlstr, args);
@@ -1215,13 +1217,38 @@ void
fprintf_filtered (va_alist)
va_dcl
{
+ va_list args;
FILE *stream;
char *format;
+
+ va_start (args);
+ stream = va_arg (args, FILE *);
+ format = va_arg (args, char *);
+
+ /* This won't blow up if the restrictions described above are
+ followed. */
+ vfprintf_filtered (stream, format, args);
+ va_end (args);
+}
+
+/* Like fprintf_filtered, but prints it's result indent.
+ Called as fprintfi_filtered (spaces, format, arg1, arg2, ...); */
+
+/* VARARGS */
+void
+fprintfi_filtered (va_alist)
+ va_dcl
+{
va_list args;
+ int spaces;
+ FILE *stream;
+ char *format;
va_start (args);
+ spaces = va_arg (args, int);
stream = va_arg (args, FILE *);
format = va_arg (args, char *);
+ print_spaces_filtered (spaces, stream);
/* This won't blow up if the restrictions described above are
followed. */
@@ -1244,6 +1271,26 @@ printf_filtered (va_alist)
va_end (args);
}
+/* Like printf_filtered, but prints it's result indented.
+ Called as printfi_filtered (spaces, format, arg1, arg2, ...); */
+
+/* VARARGS */
+void
+printfi_filtered (va_alist)
+ va_dcl
+{
+ va_list args;
+ int spaces;
+ char *format;
+
+ va_start (args);
+ spaces = va_arg (args, int);
+ format = va_arg (args, char *);
+ print_spaces_filtered (spaces, stdout);
+ vfprintf_filtered (stdout, format, args);
+ va_end (args);
+}
+
/* Easy */
void
@@ -1325,9 +1372,14 @@ fprint_symbol (stream, name)
/* Do a strcmp() type operation on STRING1 and STRING2, ignoring any
differences in whitespace. Returns 0 if they match, non-zero if they
- don't (slightly different than strcmp()'s range of return values). */
+ don't (slightly different than strcmp()'s range of return values).
+
+ As an extra hack, string1=="FOO(ARGS)" matches string2=="FOO".
+ This "feature" is useful for demangle_and_match(), which is used
+ when searching for matching C++ function names (such as if the
+ user types 'break FOO', where FOO is a mangled C++ function). */
-int
+static int
strcmp_iw (string1, string2)
const char *string1;
const char *string2;
@@ -1352,7 +1404,7 @@ strcmp_iw (string1, string2)
string2++;
}
}
- return (!((*string1 == '\0') && (*string2 == '\0')));
+ return (*string1 != '\0' && *string1 != '(') || (*string2 != '\0');
}
/* Demangle NAME and compare the result with LOOKFOR, ignoring any differences