@@ -40,7 +40,8 @@ def __init__(self):
40
40
self .continue_event = False
41
41
self .variables_cache = {} # frameId -> variables
42
42
self .frame_id_counter = 1
43
- self .path_mappings : dict [str ,str ] = {} # runtime_path -> vscode_path mapping
43
+ self .path_mappings : list [tuple [str ,str ]] = [] # runtime_path -> vscode_path mapping
44
+ self .file_mappings : dict [str ,str ] = {} # runtime_path -> vscode_path mapping
44
45
45
46
def _debug_print (self , message ):
46
47
"""Print debug message only if debug logging is enabled."""
@@ -68,7 +69,7 @@ def set_trace_function(self, trace_func):
68
69
else :
69
70
raise RuntimeError ("sys.settrace not available" )
70
71
71
- def set_breakpoints (self , filename , breakpoints ):
72
+ def set_breakpoints (self , filename , breakpoints : list [ dict ] ):
72
73
"""Set breakpoints for a file."""
73
74
self .breakpoints [filename ] = {}
74
75
actual_breakpoints = []
@@ -105,7 +106,7 @@ def should_stop(self, frame, event:str, arg):
105
106
if lineno in self .breakpoints [filename ]:
106
107
self ._debug_print (f"[PDB] HIT BREAKPOINT (exact match) at { filename } :{ lineno } " )
107
108
# Record the path mapping (in this case, they're already the same)
108
- self .path_mappings [filename ] = filename
109
+ self .file_mappings [filename ] = filename
109
110
self .hit_breakpoint = True
110
111
return True
111
112
@@ -119,7 +120,7 @@ def should_stop(self, frame, event:str, arg):
119
120
if lineno in self .breakpoints [bp_file ]:
120
121
self ._debug_print (f"[PDB] HIT BREAKPOINT (fallback basename match) at { filename } :{ lineno } -> { bp_file } " )
121
122
# Record the path mapping so we can report the correct path in stack traces
122
- self .path_mappings [filename ] = bp_file
123
+ self .file_mappings [filename ] = bp_file
123
124
self .hit_breakpoint = True
124
125
return True
125
126
@@ -129,7 +130,7 @@ def should_stop(self, frame, event:str, arg):
129
130
if lineno in self .breakpoints [bp_file ]:
130
131
self ._debug_print (f"[PDB] HIT BREAKPOINT (relative path match) at { filename } :{ lineno } -> { bp_file } " )
131
132
# Record the path mapping so we can report the correct path in stack traces
132
- self .path_mappings [filename ] = bp_file
133
+ self .file_mappings [filename ] = bp_file
133
134
self .hit_breakpoint = True
134
135
return True
135
136
@@ -216,7 +217,7 @@ def get_stack_trace(self):
216
217
hint = 'normal'
217
218
218
219
# Use the VS Code path if we have a mapping, otherwise use the original path
219
- display_path = self .path_mappings .get (filename , filename )
220
+ display_path = self .file_mappings .get (filename , filename )
220
221
if filename != display_path :
221
222
self ._debug_print (f"[PDB] Stack trace path mapping: { filename } -> { display_path } " )
222
223
# Create StackFrame info
0 commit comments