+Tue May 17 11:08:22 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * utils.c (vfprintf_maybe_filtered, vfprintf_unfiltered): Call
+ fputs_unfiltered and exit directly, rather than fatal. The latter
+ calls vfprintf_unfiltered!
+
+ * gdbtypes.h, gdbtypes.c (can_dereference): New function.
+ * value.h, printcmd.c (print_value_flags): Move from here...
+ * annotate.c: ...to here, and make it use can_dereference.
+
Sat May 14 15:13:52 1994 Stan Shebs (shebs@andros.cygnus.com)
* inflow.c (job_control, attach_flag, generic_mourn_inferior):
#include "annotate.h"
#include "value.h"
#include "target.h"
+#include "gdbtypes.h"
+\f
+static void print_value_flags PARAMS ((struct type *));
+static void
+print_value_flags (t)
+ struct type *t;
+{
+ if (can_dereference (t))
+ printf_filtered ("*");
+ else
+ printf_filtered ("-");
+}
+\f
void
breakpoints_changed ()
{
return (*typep);
}
+int
+can_dereference (t)
+ struct type *t;
+{
+ /* FIXME: Should we return true for references as well as pointers? */
+ return
+ (t != NULL
+ && TYPE_CODE (t) == TYPE_CODE_PTR
+ && TYPE_CODE (TYPE_TARGET_TYPE (t)) != TYPE_CODE_VOID);
+}
+
#if MAINTENANCE_CMDS
static void
extern void
print_scalar_formatted PARAMS ((char *, struct type *, int, int, GDB_FILE *));
+extern int can_dereference PARAMS ((struct type *));
+
#if MAINTENANCE_CMDS
extern void maintenance_print_type PARAMS ((char *, int));
#endif
int inspect_it = 0;
-void
-print_value_flags (t)
- struct type *t;
-{
- /* FIXME: Should we be printing * for references as well as pointers? */
- if (t != NULL
- && TYPE_CODE (t) == TYPE_CODE_PTR
- && TYPE_CODE (TYPE_TARGET_TYPE (t)) != TYPE_CODE_VOID)
- printf_filtered ("*");
- else
- printf_filtered ("-");
-}
-
struct display
{
/* Chain link to next auto-display item. */
vasprintf (&linebuffer, format, args);
if (linebuffer == NULL)
- fatal ("virtual memory exhausted.");
+ {
+ fputs_unfiltered ("\ngdb: virtual memory exhausted.\n", gdb_stderr);
+ exit (1);
+ }
old_cleanups = make_cleanup (free, linebuffer);
fputs_maybe_filtered (linebuffer, stream, filter);
do_cleanups (old_cleanups);
vasprintf (&linebuffer, format, args);
if (linebuffer == NULL)
- fatal ("virtual memory exhausted.");
+ {
+ fputs_unfiltered ("\ngdb: virtual memory exhausted.\n", gdb_stderr);
+ exit (1);
+ }
old_cleanups = make_cleanup (free, linebuffer);
fputs_unfiltered (linebuffer, stream);
do_cleanups (old_cleanups);