* printcmd.c (print_command_1): Annotate the top-level expressions
that we print. (print_frame_args): Annotate each argument. * printcmd.c, defs.h (print_value_flags): New function. * cp-valprint.c (cp_print_value_fields): Annotate each field. * valprint.c (val_print_array_elements): Annotate each array element.
This commit is contained in:
parent
71b4de6fb8
commit
96f7edbde8
5 changed files with 88 additions and 1 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
Wed Apr 20 19:41:21 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||||
|
|
||||||
|
* printcmd.c (print_command_1): Annotate the top-level expressions
|
||||||
|
that we print.
|
||||||
|
(print_frame_args): Annotate each argument.
|
||||||
|
* printcmd.c, defs.h (print_value_flags): New function.
|
||||||
|
* cp-valprint.c (cp_print_value_fields): Annotate each field.
|
||||||
|
* valprint.c (val_print_array_elements): Annotate each array element.
|
||||||
|
|
||||||
Wed Apr 20 13:18:41 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
|
Wed Apr 20 13:18:41 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
|
||||||
|
|
||||||
* findvar.c (read_var_value): Handle LOC_REPARM_ADDR case correctly,
|
* findvar.c (read_var_value): Handle LOC_REPARM_ADDR case correctly,
|
||||||
|
|
|
@ -276,11 +276,23 @@ cp_print_value_fields (type, valaddr, stream, format, recurse, pretty,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (annotation_level > 1)
|
||||||
|
printf_filtered ("\n\032\032field-name-begin\n");
|
||||||
fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
|
fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
|
||||||
language_cplus,
|
language_cplus,
|
||||||
DMGL_PARAMS | DMGL_ANSI);
|
DMGL_PARAMS | DMGL_ANSI);
|
||||||
|
if (annotation_level > 1)
|
||||||
|
printf_filtered ("\n\032\032field-name-end\n");
|
||||||
fputs_filtered (" = ", stream);
|
fputs_filtered (" = ", stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (annotation_level > 1)
|
||||||
|
{
|
||||||
|
printf_filtered ("\n\032\032field-begin ");
|
||||||
|
print_value_flags (TYPE_FIELD_TYPE (type, i));
|
||||||
|
printf_filtered ("\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (TYPE_FIELD_PACKED (type, i))
|
if (TYPE_FIELD_PACKED (type, i))
|
||||||
{
|
{
|
||||||
value_ptr v;
|
value_ptr v;
|
||||||
|
@ -313,7 +325,10 @@ cp_print_value_fields (type, valaddr, stream, format, recurse, pretty,
|
||||||
0, stream, format, 0, recurse + 1, pretty);
|
0, stream, format, 0, recurse + 1, pretty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (annotation_level > 1)
|
||||||
|
printf_filtered ("\n\032\032field-end\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pretty)
|
if (pretty)
|
||||||
{
|
{
|
||||||
fprintf_filtered (stream, "\n");
|
fprintf_filtered (stream, "\n");
|
||||||
|
|
|
@ -216,7 +216,12 @@ myread PARAMS ((int, char *, int));
|
||||||
extern int
|
extern int
|
||||||
query ();
|
query ();
|
||||||
|
|
||||||
|
/* Annotation stuff. */
|
||||||
|
|
||||||
extern int annotation_level; /* in stack.c */
|
extern int annotation_level; /* in stack.c */
|
||||||
|
|
||||||
|
/* in printcmd.c */
|
||||||
|
extern void print_value_flags PARAMS ((struct type *));
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
begin_line PARAMS ((void));
|
begin_line PARAMS ((void));
|
||||||
|
|
|
@ -87,6 +87,19 @@ int current_display_number;
|
||||||
|
|
||||||
int inspect_it = 0;
|
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
|
struct display
|
||||||
{
|
{
|
||||||
/* Chain link to next auto-display item. */
|
/* Chain link to next auto-display item. */
|
||||||
|
@ -811,6 +824,16 @@ print_command_1 (exp, inspect, voidprint)
|
||||||
{
|
{
|
||||||
int histindex = record_latest_value (val);
|
int histindex = record_latest_value (val);
|
||||||
|
|
||||||
|
if (annotation_level > 1)
|
||||||
|
{
|
||||||
|
if (histindex >= 0)
|
||||||
|
printf_filtered ("\n\032\032value-history-begin %d ", histindex);
|
||||||
|
else
|
||||||
|
printf_filtered ("\n\032\032value-begin ");
|
||||||
|
print_value_flags (VALUE_TYPE (val));
|
||||||
|
printf_filtered ("\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (inspect)
|
if (inspect)
|
||||||
printf_unfiltered ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
|
printf_unfiltered ("\031(gdb-makebuffer \"%s\" %d '(\"", exp, histindex);
|
||||||
else
|
else
|
||||||
|
@ -818,6 +841,15 @@ print_command_1 (exp, inspect, voidprint)
|
||||||
|
|
||||||
print_formatted (val, format, fmt.size);
|
print_formatted (val, format, fmt.size);
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
|
|
||||||
|
if (annotation_level > 1)
|
||||||
|
{
|
||||||
|
if (histindex >= 0)
|
||||||
|
printf_filtered ("\n\032\032value-history-end\n");
|
||||||
|
else
|
||||||
|
printf_filtered ("\n\032\032value-end\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (inspect)
|
if (inspect)
|
||||||
printf_unfiltered("\") )\030");
|
printf_unfiltered("\") )\030");
|
||||||
}
|
}
|
||||||
|
@ -1597,8 +1629,13 @@ print_frame_args (func, fi, num, stream)
|
||||||
if (! first)
|
if (! first)
|
||||||
fprintf_filtered (stream, ", ");
|
fprintf_filtered (stream, ", ");
|
||||||
wrap_here (" ");
|
wrap_here (" ");
|
||||||
|
|
||||||
|
if (annotation_level > 1)
|
||||||
|
printf_filtered ("\n\032\032arg-name-begin\n");
|
||||||
fprintf_symbol_filtered (stream, SYMBOL_SOURCE_NAME (sym),
|
fprintf_symbol_filtered (stream, SYMBOL_SOURCE_NAME (sym),
|
||||||
SYMBOL_LANGUAGE (sym), DMGL_PARAMS | DMGL_ANSI);
|
SYMBOL_LANGUAGE (sym), DMGL_PARAMS | DMGL_ANSI);
|
||||||
|
if (annotation_level > 1)
|
||||||
|
printf_filtered ("\n\032\032arg-name-end\n");
|
||||||
fputs_filtered ("=", stream);
|
fputs_filtered ("=", stream);
|
||||||
|
|
||||||
/* Avoid value_print because it will deref ref parameters. We just
|
/* Avoid value_print because it will deref ref parameters. We just
|
||||||
|
@ -1607,11 +1644,23 @@ print_frame_args (func, fi, num, stream)
|
||||||
standard indentation here is 4 spaces, and val_print indents
|
standard indentation here is 4 spaces, and val_print indents
|
||||||
2 for each recurse. */
|
2 for each recurse. */
|
||||||
val = read_var_value (sym, FRAME_INFO_ID (fi));
|
val = read_var_value (sym, FRAME_INFO_ID (fi));
|
||||||
|
|
||||||
|
if (annotation_level > 1)
|
||||||
|
{
|
||||||
|
printf_filtered ("\n\032\032arg-begin ");
|
||||||
|
print_value_flags (val == NULL ? NULL : VALUE_TYPE (val));
|
||||||
|
printf_filtered ("\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (val)
|
if (val)
|
||||||
val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
|
val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), VALUE_ADDRESS (val),
|
||||||
stream, 0, 0, 2, Val_no_prettyprint);
|
stream, 0, 0, 2, Val_no_prettyprint);
|
||||||
else
|
else
|
||||||
fputs_filtered ("???", stream);
|
fputs_filtered ("???", stream);
|
||||||
|
|
||||||
|
if (annotation_level > 1)
|
||||||
|
printf_filtered ("\n\032\032arg-end\n");
|
||||||
|
|
||||||
first = 0;
|
first = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -626,6 +626,13 @@ val_print_array_elements (type, valaddr, address, stream, format, deref_ref,
|
||||||
++rep1;
|
++rep1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (annotation_level > 1)
|
||||||
|
{
|
||||||
|
printf_filtered ("\n\032\032array-element-begin %d ", i);
|
||||||
|
print_value_flags (elttype);
|
||||||
|
printf_filtered ("\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (reps > repeat_count_threshold)
|
if (reps > repeat_count_threshold)
|
||||||
{
|
{
|
||||||
val_print (elttype, valaddr + i * eltlen, 0, stream, format,
|
val_print (elttype, valaddr + i * eltlen, 0, stream, format,
|
||||||
|
@ -640,6 +647,8 @@ val_print_array_elements (type, valaddr, address, stream, format, deref_ref,
|
||||||
deref_ref, recurse + 1, pretty);
|
deref_ref, recurse + 1, pretty);
|
||||||
things_printed++;
|
things_printed++;
|
||||||
}
|
}
|
||||||
|
if (annotation_level > 1)
|
||||||
|
printf_filtered ("\n\032\032array-element-end\n");
|
||||||
}
|
}
|
||||||
if (i < len)
|
if (i < len)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue