#endif /* !defined(__GO32__) && !defined(_MSC_VER) */
-void
-pollquit()
-{
- notice_quit ();
- if (quit_flag || immediate_quit)
- quit ();
-}
-
/* Control C comes here */
void
register int n;
register GDB_FILE *file;
{
- if (file->ts_streamtype == astring)
- {
- char *p;
-
- gdb_file_adjust_strbuf (n, file);
- p = file->ts_strbuf + strlen (file->ts_strbuf);
-
- memset (p, ' ', n);
- p[n] = '\000';
- }
- else
- {
- while (n-- > 0)
- fputc (' ', file->ts_filestream);
- }
+ fputs_unfiltered (n_spaces (n), file);
}
/* Print a host address. */
}
}
-
-
-
-static char * hexlate = "0123456789abcdef" ;
-int fmthex(inbuf,outbuff,length,linelength)
- unsigned char * inbuf ;
- unsigned char * outbuff;
- int length;
- int linelength;
-{
- unsigned char byte , nib ;
- int outlength = 0 ;
-
- while (length)
- {
- if (outlength >= linelength) break ;
- byte = *inbuf ;
- inbuf++ ;
- nib = byte >> 4 ;
- *outbuff++ = hexlate[nib] ;
- nib = byte &0x0f ;
- *outbuff++ = hexlate[nib] ;
- *outbuff++ = ' ' ;
- length-- ;
- outlength += 3 ;
- }
- *outbuff = '\0' ; /* null terminate our output line */
- return outlength ;
-}
-
\f
/* Number of lines per page or UINT_MAX if paging is disabled. */
static unsigned int lines_per_page;
GDB_FILE *stream;
{
int non_null_chars;
+
+ if (stream->ts_streamtype != astring)
+ return;
- non_null_chars = strlen(stream->ts_strbuf);
-
- if (n > (stream->ts_buflen - non_null_chars - 1))
+ if (stream->ts_strbuf)
{
- stream->ts_buflen = n + non_null_chars + 1;
- stream->ts_strbuf = xrealloc (stream->ts_strbuf, stream->ts_buflen);
+ /* There is already a buffer allocated */
+ non_null_chars = strlen(stream->ts_strbuf);
+
+ if (n > (stream->ts_buflen - non_null_chars - 1))
+ {
+ stream->ts_buflen = n + non_null_chars + 1;
+ stream->ts_strbuf = xrealloc (stream->ts_strbuf, stream->ts_buflen);
+ }
}
+ else
+ /* No buffer yet, so allocate one of the desired size */
+ stream->ts_strbuf = xmalloc ((n + 1) * sizeof (char));
}
GDB_FILE *
n_spaces (n)
int n;
{
- register char *t;
- static char *spaces;
- static int max_spaces;
+ char *t;
+ static char *spaces = 0;
+ static int max_spaces = -1;
if (n > max_spaces)
{
}
return preg_str;
}
+
+/* Helper functions for INNER_THAN */
+int
+core_addr_lessthan (lhs, rhs)
+ CORE_ADDR lhs;
+ CORE_ADDR rhs;
+{
+ return (lhs < rhs);
+}
+
+int
+core_addr_greaterthan (lhs, rhs)
+ CORE_ADDR lhs;
+ CORE_ADDR rhs;
+{
+ return (lhs > rhs);
+}
+
+