* config/m68k/monitor.mt (TDEPFILE): Add remote-es.o.
[deliverable/binutils-gdb.git] / gdb / c-valprint.c
index b370db9f67b04e677963a5e326c66065d32c01b1..bee764d5376ea3cbd173d91c990c2a4a75560043 100644 (file)
@@ -1,5 +1,6 @@
 /* Support for printing C values for GDB, the GNU debugger.
-   Copyright 1986, 1988, 1989, 1991 Free Software Foundation, Inc.
+   Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994
+   Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -171,7 +172,7 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
 
          if (addressprint && format != 's')
            {
-             fprintf_filtered (stream, "0x%lx", (unsigned long)addr);
+             print_address_numeric (addr, stream);
            }
 
          /* For a pointer to char or unsigned char, also print the string
@@ -250,8 +251,10 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
        }
       if (addressprint)
         {
-         fprintf_filtered (stream, "@0x%lx",
-                           unpack_long (builtin_type_int, valaddr));
+         fprintf_filtered (stream, "@");
+         print_address_numeric
+           (extract_address (valaddr,
+                             TARGET_PTR_BIT / HOST_CHAR_BIT), stream);
          if (deref_ref)
            fputs_filtered (": ", stream);
         }
@@ -340,6 +343,16 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
       /* Do something at least vaguely reasonable, for example if the
         language is set wrong.  */
 
+    case TYPE_CODE_RANGE:
+      /* FIXME: create_range_type does not set the unsigned bit in a
+        range type (I think it probably should copy it from the target
+        type), so we won't print values which are too large to
+        fit in a signed integer correctly.  */
+      /* FIXME: Doesn't handle ranges of enums correctly.  (Can't just
+        print with the target type, though, because the size of our type
+        and the target type might differ).  */
+      /* FALLTHROUGH */
+
     case TYPE_CODE_INT:
       format = format ? format : output_format;
       if (format)
@@ -396,11 +409,6 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
       fprintf_filtered (stream, "<error type>");
       break;
 
-    case TYPE_CODE_RANGE:
-      /* FIXME, we should not ever have to print one of these yet.  */
-      fprintf_filtered (stream, "<range type>");
-      break;
-
     case TYPE_CODE_UNDEF:
       /* This happens (without TYPE_FLAG_STUB set) on systems which don't use
         dbx xrefs (NO_DBX_XREFS in gcc) if a file has a "struct foo *bar"
This page took 0.02387 seconds and 4 git commands to generate.