aboutsummaryrefslogtreecommitdiff
path: root/gdb/ch-typeprint.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1993-02-24 15:49:47 +0000
committerFred Fish <fnf@specifix.com>1993-02-24 15:49:47 +0000
commit8fbdca53aaf4d6d794f66496171d4b9aea8272d4 (patch)
tree761ccb19c3760899409912a82332e028fd6abd60 /gdb/ch-typeprint.c
parent0cca30f32ad8731612637e7885650726382f4561 (diff)
downloadfsf-binutils-gdb-8fbdca53aaf4d6d794f66496171d4b9aea8272d4.zip
fsf-binutils-gdb-8fbdca53aaf4d6d794f66496171d4b9aea8272d4.tar.gz
fsf-binutils-gdb-8fbdca53aaf4d6d794f66496171d4b9aea8272d4.tar.bz2
**** start-sanitize-chill ****
* ch-typeprint.c (chill_print_type_base): Name changed to chill_type_print_base to match pattern for C and C++ names. * ch-typeprint.c (chill_print_type): Change "char" to "CHAR" to be consistent with other usages. * ch-typeprint.c (chill_type_print_base): Add support for printing Chill STRUCT types. * ch-valprint.c: Include values.h. * ch-valprint.c (chill_print_value_fields): New function and prototype for printing Chill STRUCT values. * ch-valprint.c (chill_val_print): Fix call to val_print_string that was being called with two args instead of three. * ch-valprint.c (chill_val_print): Call chill_print_value_fields to print Chill STRUCT values. **** end-sanitize-chill ****
Diffstat (limited to 'gdb/ch-typeprint.c')
-rw-r--r--gdb/ch-typeprint.c71
1 files changed, 61 insertions, 10 deletions
diff --git a/gdb/ch-typeprint.c b/gdb/ch-typeprint.c
index f4119ca..e016baf 100644
--- a/gdb/ch-typeprint.c
+++ b/gdb/ch-typeprint.c
@@ -35,8 +35,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <string.h>
#include <errno.h>
-void
-chill_print_type_base PARAMS ((struct type *, FILE *, int, int));
+static void
+chill_type_print_base PARAMS ((struct type *, FILE *, int, int));
void
chill_print_type (type, varstring, stream, show, level)
@@ -75,13 +75,13 @@ chill_print_type (type, varstring, stream, show, level)
range_type = TYPE_FIELD_TYPE (type, 0);
index_type = TYPE_TARGET_TYPE (range_type);
high_bound = TYPE_FIELD_BITPOS (range_type, 1);
- fputs_filtered ("char (", stream);
+ fputs_filtered ("CHAR (", stream);
print_type_scalar (index_type, high_bound + 1, stream);
- fputs_filtered (") ", stream);
+ fputs_filtered (")", stream);
break;
default:
- chill_print_type_base (type, stream, show, level);
+ chill_type_print_base (type, stream, show, level);
break;
}
}
@@ -98,13 +98,17 @@ chill_print_type (type, varstring, stream, show, level)
LEVEL is the depth to indent by.
We increase it for some recursive calls. */
-void
-chill_print_type_base (type, stream, show, level)
+static void
+chill_type_print_base (type, stream, show, level)
struct type *type;
FILE *stream;
int show;
int level;
{
+ char *name;
+ register int len;
+ register int i;
+
QUIT;
wrap_here (" ");
@@ -130,7 +134,55 @@ chill_print_type_base (type, stream, show, level)
case TYPE_CODE_MEMBER:
case TYPE_CODE_REF:
case TYPE_CODE_FUNC:
- chill_print_type_base (TYPE_TARGET_TYPE (type), stream, show, level);
+ chill_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level);
+ break;
+
+ case TYPE_CODE_STRUCT:
+ fprintf_filtered (stream, "STRUCT ");
+ if ((name = type_name_no_tag (type)) != NULL)
+ {
+ fputs_filtered (name, stream);
+ fputs_filtered (" ", stream);
+ wrap_here (" ");
+ }
+ if (show < 0)
+ {
+ fprintf_filtered (stream, "(...)");
+ }
+ else
+ {
+ check_stub_type (type);
+ fprintf_filtered (stream, "(\n");
+ if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0))
+ {
+ if (TYPE_FLAGS (type) & TYPE_FLAG_STUB)
+ {
+ fprintfi_filtered (level + 4, stream, "<incomplete type>\n");
+ }
+ else
+ {
+ fprintfi_filtered (level + 4, stream, "<no data fields>\n");
+ }
+ }
+ else
+ {
+ len = TYPE_NFIELDS (type);
+ for (i = TYPE_N_BASECLASSES (type); i < len; i++)
+ {
+ QUIT;
+ print_spaces_filtered (level + 4, stream);
+ chill_print_type (TYPE_FIELD_TYPE (type, i),
+ TYPE_FIELD_NAME (type, i),
+ stream, show - 1, level + 4);
+ if (i < (len - 1))
+ {
+ fputs_filtered (",", stream);
+ }
+ fputs_filtered ("\n", stream);
+ }
+ }
+ fprintfi_filtered (level, stream, ")");
+ }
break;
case TYPE_CODE_VOID:
@@ -139,9 +191,8 @@ chill_print_type_base (type, stream, show, level)
case TYPE_CODE_RANGE:
case TYPE_CODE_ENUM:
case TYPE_CODE_UNION:
- case TYPE_CODE_STRUCT:
case TYPE_CODE_METHOD:
- error ("missing language support in chill_print_type_base");
+ error ("missing language support in chill_type_print_base");
break;
default: