idacode icon indicating copy to clipboard operation
idacode copied to clipboard

Does setting breakpoint from vsc supported ?

Open puppywang opened this issue 5 years ago • 12 comments

Thanks for this wonderful extension ,it do make wrting ida python script much faster, I can step in, step out code, one strange thing I found is that I can't make break point from vsc, it said can't find the break point line, but I can make breakpoint inside idacode_utils, is there something with my config ? Thanks

puppywang avatar Aug 10 '20 16:08 puppywang

To break in the code make sure to call breakpoint before you attempt to break on VS Code's "dots". https://github.com/ioncodes/idacode#debugging

ioncodes avatar Aug 11 '20 16:08 ioncodes

I'll close this for now, if there's still an issue feel free to reopen the issue!

ioncodes avatar Aug 11 '20 16:08 ioncodes

To break in the code make sure to call breakpoint before you attempt to break on VS Code's "dots". https://github.com/ioncodes/idacode#debugging

@ioncodes I did add breakpoint first, and then create dot breakpoint on VSC, but those breakpoint turn gray immediately, I found that I can set breakpoint outside call to execfile, but not the code inside execfile. I am using python 2.7 shipped with IDA 7.0, I attach the debugpy log, thanks.

debugpy.server-34804.log debugpy.adapter-44868.log

puppywang avatar Aug 13 '20 19:08 puppywang

Are you debugging an IDA plugin? Can you show me parts of the source code?

ioncodes avatar Aug 14 '20 09:08 ioncodes

From the adapter logs:

             Client[1] <-- {
                 "seq": 6, 
                 "type": "response", 
                 "request_seq": 3, 
                 "success": true, 
                 "command": "setBreakpoints", 
                 "body": {
                     "breakpoints": [
                         {
                             "source": {
                                 "path": "D:\\idacode\\objc2_xrefs_helper.py", 
                                 "name": "d:\\idacode\\objc2_xrefs_helper.py", 
                                 "sourceReference": 1
                             }, 
                             "message": "Breakpoint in file that does not exist.", 
                             "verified": false, 
                             "line": 568
                         }
                     ]
                 }
             }

Is the path in that JSON correct?

ioncodes avatar Aug 14 '20 09:08 ioncodes

I just create a directory named idacode, not debug plugin code, here is the files in that directory, please check.

idacode.zip

Yes, I can confirm that the directory is correct on windows, thanks.

puppywang avatar Aug 14 '20 10:08 puppywang

I just tried this on IDA 7.5 with Python 3, where did you put the "breakpoint" line?

image

ioncodes avatar Aug 14 '20 17:08 ioncodes

I put the same line as yours, but it is not working, maybe something todo with python version? I use python2.7 shipped with IDA 7.0.

puppywang avatar Aug 17 '20 05:08 puppywang

It may indeed be an issue with Python 2.7 and IDA 7.0. I'll check whether it works for me on that version.

ioncodes avatar Aug 17 '20 09:08 ioncodes

How did you load the plugin in that version of IDA? I placed the files in the plugin directory but it isn't being loaded.

ioncodes avatar Aug 17 '20 09:08 ioncodes

Place it in plugin folder, and change some code due to python 2.7 don't have asyncio. You can find the change here: https://github.com/ioncodes/idacode/pull/13/files/0319005853db6e2b126fd0b731abdf8380f438ae

puppywang avatar Aug 17 '20 12:08 puppywang

Same to me, Python 3.8.10 and IDA 7.5.

Screenshot 2021-11-09 105853

wallds avatar Nov 09 '21 03:11 wallds