Skip to content

Commit 48fd27c

Browse files
committed
Fix debugging of plugins
Closes #44
1 parent 2b985c6 commit 48fd27c

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

ida/idacode_utils/hooks.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@
44
getcwd_original = os.getcwd
55

66
def getcwd_hook():
7-
global script_folder
8-
9-
cwd = getcwd_original()
10-
if cwd.lower() in script_folder.lower() and script_folder.lower() != cwd.lower():
11-
cwd = script_folder
12-
return cwd
7+
# NOTE: We return the script folder here, otherwise breakpoints fail in VSCode
8+
if script_folder:
9+
return script_folder
10+
return getcwd_original()
1311

1412
def set_script_folder(folder):
1513
global script_folder
1614

1715
script_folder = folder
1816

1917
def install():
20-
os.getcwd = getcwd_hook
18+
os.getcwd = getcwd_hook

0 commit comments

Comments
 (0)