dump_gcov.gdb 746 B

123456789101112131415161718
  1. # Please call gcov_collect(0); in your c code after the code needs coverage
  2. # call this script in Nuclei Studio IDE Debugger Console like this below
  3. # source nuclei_sdk/Components/profiling/dump_gcov.gdb
  4. define dump_gcov_data
  5. set $node=gcov_data_head
  6. if $node == 0
  7. printf "WARNING: No gcov data found, did you call gcov_collect(0) in your c code after the code you want to coverage!"
  8. end
  9. while ($node != 0)
  10. set $filename=$node->filename
  11. set $bufstart=$node->buffer
  12. set $bufend=$node->buffer + $node->size
  13. printf "dump binary memory %s 0x%lx 0x%lx\n", $filename, $bufstart, $bufend
  14. eval "dump binary memory %s 0x%lx 0x%lx\n", $filename, $bufstart, $bufend
  15. set $node=$node->next
  16. end
  17. end
  18. dump_gcov_data