1, /* raw */
1, /* print_methods */
1, /* print_typedefs */
+ 0, /* print_offsets */
0, /* print_nested_type_limit */
NULL, /* local_typedefs */
NULL, /* global_table */
0, /* raw */
1, /* print_methods */
1, /* print_typedefs */
+ 0, /* print_offsets */
0, /* print_nested_type_limit */
NULL, /* local_typedefs */
NULL, /* global_table */
case 'T':
flags.print_typedefs = 1;
break;
+ case 'o':
+ {
+ /* Filter out languages which don't implement the
+ feature. */
+ if (show > 0 &&
+ (current_language->la_language == language_c
+ || current_language->la_language == language_cplus))
+ {
+ flags.print_offsets = 1;
+ flags.print_typedefs = 0;
+ flags.print_methods = 0;
+ }
+ break;
+ }
default:
error (_("unrecognized flag '%c'"), *exp);
}
real_type = value_rtti_type (val, &full, &top, &using_enc);
}
+ if (flags.print_offsets
+ && (TYPE_CODE (type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (type) == TYPE_CODE_UNION))
+ fprintf_filtered (gdb_stdout, "/* offset | size */ ");
+
printf_filtered ("type = ");
if (!flags.raw)
/m do not print methods defined in a class\n\
/M print methods defined in a class\n\
/t do not print typedefs defined in a class\n\
- /T print typedefs defined in a class"));
+ /T print typedefs defined in a class\n\
+ /o print offsets and sizes of fields in a struct (like pahole)\n"));
set_cmd_completer (c, expression_completer);
c = add_com ("whatis", class_vars, whatis_command,