119370Spst# Examples of using gdb's command language to print out various gdb data
219370Spst# structures.
319370Spst
419370Spstdefine list-objfiles
519370Spst  set $obj = object_files
619370Spst  printf "objfile    bfd        msyms  name\n"
719370Spst  while $obj != 0
819370Spst    printf "0x%-8x 0x%-8x %6d %s\n", $obj, $obj->obfd, \
919370Spst      $obj->minimal_symbol_count, $obj->name
1019370Spst    set var $obj = $obj->next
1119370Spst  end
1219370Spstend
1319370Spstdocument list-objfiles
1419370SpstPrint a table of the current objfiles.
1519370Spstend
1619370Spst
1719370Spstdefine print-values
1819370Spst  printf "Location  Offset        Size  Lazy   Contents0-3  Lval\n"
1919370Spst  set $val = $arg0
2019370Spst  while $val != 0
2119370Spst    printf "%8x  %6d  %10d  %4d  %12x  ", $val->location.address, \
2219370Spst      $val->offset, \
2319370Spst      $val->type->length, $val->lazy, $val->aligner.contents[0]
2419370Spst    output $val->lval
2519370Spst    printf "\n"
2619370Spst    set $val = $val->next
2719370Spst  end
2819370Spstend
2919370Spstdocument print-values
3019370SpstPrint a list of values.
3119370SpstTakes one argument, the value to print, and prints all the values which
3219370Spstare chained through the next field.  Thus the most recently created values
3319370Spstwill be listed first.  The "Contents0-3" field gives the first "int"
3419370Spstof the VALUE_CONTENTS; not the entire contents.
3519370Spstend
36