aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorgdb-2.8 <gdb@fsf.org>1988-09-03 08:00:00 +0100
committerPedro Alves <palves@redhat.com>2012-06-03 15:36:31 +0100
commit3bf57d210832b28e9361990830eb722a619f031b (patch)
treeba506d293bde0f6500d0cee3e643ebf8890d9cf7 /gdb/utils.c
parent7c75bab3d3ef344a6a0b13b9ab59ecd5855aceb5 (diff)
downloadgdb-3bf57d210832b28e9361990830eb722a619f031b.zip
gdb-3bf57d210832b28e9361990830eb722a619f031b.tar.gz
gdb-3bf57d210832b28e9361990830eb722a619f031b.tar.bz2
gdb-2.8
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index c8f5c06..2a0b943 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -19,8 +19,13 @@ anyone else from sharing it farther. Help stamp out software hoarding!
*/
#include <stdio.h>
+#include <signal.h>
#include <sys/ioctl.h>
#include "defs.h"
+#include "param.h"
+#ifdef HAVE_TERMIO
+#include <termio.h>
+#endif
void error ();
void fatal ();
@@ -191,8 +196,16 @@ void
quit ()
{
fflush (stdout);
+#ifdef HAVE_TERMIO
+ ioctl (fileno (stdout), TCFLSH, 1);
+#else /* not HAVE_TERMIO */
ioctl (fileno (stdout), TIOCFLUSH, 0);
+#endif /* not HAVE_TERMIO */
+#ifdef TIOCGPGRP
error ("Quit");
+#else
+ error ("Quit (expect signal %d when inferior is resumed)", SIGINT);
+#endif /* TIOCGPGRP */
}
/* Control C comes here */
@@ -386,10 +399,14 @@ parse_escape (string_ptr)
}
}
+/* Print the character CH on STREAM as part of the contents
+ of a literal string whose delimiter is QUOTER. */
+
void
-printchar (ch, stream)
+printchar (ch, stream, quoter)
unsigned char ch;
FILE *stream;
+ int quoter;
{
register int c = ch;
if (c < 040 || c >= 0177)
@@ -413,7 +430,7 @@ printchar (ch, stream)
}
else
{
- if (c == '\\' || c == '"' || c == '\'')
+ if (c == '\\' || c == quoter)
fputc ('\\', stream);
fputc (c, stream);
}