5

I'm building an IDA Pro plugin (not a script) using the C++ SDK. On top of the frustration added by the lack of a proper API documentation, I cannot find a good way to debug my plugin.

I've tried printing messages to the output window of IDA Pro.

...
msg("Everything OK up to point 1\n");
...
msg("Everything OK up to point 2\n");
...

However, whenever my plugin hits an error state, IDA Pro crashes before I get a chance to read the messages that my plug-in printed in the output window.

While searching for a solution I stumbled upon the Wingware Python IDE which can be used to debug IDAPython. The drawbacks however are that it is not free and I am not developing the plugin in python.

One obvious thing to try is writing to a text file instead of writing to the IDA output window. However, that is not handy debugging. Isn't there a better way to debug an IDA Pro plugin built with C++ SDK?

Benny
  • 828
  • 7
  • 18

1 Answers1

1

Most modern IDE's allow you to specify an executable to launch when debugging, you should specify your ida executable. Or otherwise, try to attach to the running IDA process.

When you put a breakpoint in the run() function of your plugin, your IDE will stop at run, and you can singlestep, etc from there.

Also you if you enable 'break on exception' your IDE will probably figure out if the exception was in your plugin, and load the right source file for you.

Willem Hengeveld
  • 1,829
  • 11
  • 11