gdb.gdb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Examples of using gdb's command language to print out various gdb data
  2. # structures.
  3. define list-objfiles
  4. set $obj = object_files
  5. printf "objfile bfd msyms name\n"
  6. while $obj != 0
  7. printf "0x%-8x 0x%-8x %6d %s\n", $obj, $obj->obfd, \
  8. $obj->minimal_symbol_count, $obj->name
  9. set var $obj = $obj->next
  10. end
  11. end
  12. document list-objfiles
  13. Print a table of the current objfiles.
  14. end
  15. define print-values
  16. printf "Location Offset Size Lazy Contents0-3 Lval\n"
  17. set $val = $arg0
  18. while $val != 0
  19. printf "%8x %6d %10d %4d %12x ", $val->location.address, \
  20. $val->offset, \
  21. $val->type->length, $val->lazy, $val->aligner.contents[0]
  22. output $val->lval
  23. printf "\n"
  24. set $val = $val->next
  25. end
  26. end
  27. document print-values
  28. Print a list of values.
  29. Takes one argument, the value to print, and prints all the values which
  30. are chained through the next field. Thus the most recently created values
  31. will be listed first. The "Contents0-3" field gives the first "int"
  32. of the VALUE_CONTENTS; not the entire contents.
  33. end