Debugging

It is common to have an issues when you write a plugin, especially if you do this for the first time. This is why debugging them is very important. The first step for debugging is to set an environment variable when running radare2 instance:

  1. R_DEBUG=yes r2 /bin/ls
  2. Loading /usr/local/lib/radare2/2.2.0-git//bin_xtr_dyldcache.so
  3. Cannot find symbol 'radare_plugin' in library '/usr/local/lib/radare2/2.2.0-git//bin_xtr_dyldcache.so'
  4. Cannot open /usr/local/lib/radare2/2.2.0-git//2.2.0-git
  5. Loading /home/user/.config/radare2/plugins/asm_mips_ks.so
  6. PLUGIN OK 0x55b205ea6070 fcn 0x7f298de08762
  7. Loading /home/user/.config/radare2/plugins/asm_sparc_ks.so
  8. PLUGIN OK 0x55b205ea6070 fcn 0x7f298de08762
  9. Cannot open /home/user/.config/radare2/plugins/pimp
  10. Cannot open /home/user/.config/radare2/plugins/yara
  11. Loading /home/user/.config/radare2/plugins/asm_arm_ks.so
  12. PLUGIN OK 0x55b205ea6070 fcn 0x7f298de08762
  13. Loading /home/user/.config/radare2/plugins/core_yara.so
  14. Module version mismatch /home/user/.config/radare2/plugins/core_yara.so (2.1.0) vs (2.2.0-git)
  15. Loading /home/user/.config/radare2/plugins/asm_ppc_ks.so
  16. PLUGIN OK 0x55b205ea6070 fcn 0x7f298de08762
  17. Loading /home/user/.config/radare2/plugins/lang_python3.so
  18. PLUGIN OK 0x55b205ea5ed0 fcn 0x7f298de08692
  19. Loading /usr/local/lib/radare2/2.2.0-git/bin_xtr_dyldcache.so
  20. Cannot find symbol 'radare_plugin' in library '/usr/local/lib/radare2/2.2.0-git/bin_xtr_dyldcache.so'
  21. Cannot open /usr/local/lib/radare2/2.2.0-git/2.2.0-git
  22. Cannot open directory '/usr/local/lib/radare2-extras/2.2.0-git'
  23. Cannot open directory '/usr/local/lib/radare2-bindings/2.2.0-git'
  24. USER CONFIG loaded from /home/user/.config/radare2/radare2rc
  25. -- In visual mode press 'c' to toggle the cursor mode. Use tab to navigate
  26. [0x00005520]>