@@ -40,7 +40,8 @@ def __init__(self):
4040 self .continue_event = False
4141 self .variables_cache = {} # frameId -> variables
4242 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
4445
4546 def _debug_print (self , message ):
4647 """Print debug message only if debug logging is enabled."""
@@ -68,7 +69,7 @@ def set_trace_function(self, trace_func):
6869 else :
6970 raise RuntimeError ("sys.settrace not available" )
7071
71- def set_breakpoints (self , filename , breakpoints ):
72+ def set_breakpoints (self , filename , breakpoints : list [ dict ] ):
7273 """Set breakpoints for a file."""
7374 self .breakpoints [filename ] = {}
7475 actual_breakpoints = []
@@ -105,7 +106,7 @@ def should_stop(self, frame, event:str, arg):
105106 if lineno in self .breakpoints [filename ]:
106107 self ._debug_print (f"[PDB] HIT BREAKPOINT (exact match) at { filename } :{ lineno } " )
107108 # Record the path mapping (in this case, they're already the same)
108- self .path_mappings [filename ] = filename
109+ self .file_mappings [filename ] = filename
109110 self .hit_breakpoint = True
110111 return True
111112
@@ -119,7 +120,7 @@ def should_stop(self, frame, event:str, arg):
119120 if lineno in self .breakpoints [bp_file ]:
120121 self ._debug_print (f"[PDB] HIT BREAKPOINT (fallback basename match) at { filename } :{ lineno } -> { bp_file } " )
121122 # 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
123124 self .hit_breakpoint = True
124125 return True
125126
@@ -129,7 +130,7 @@ def should_stop(self, frame, event:str, arg):
129130 if lineno in self .breakpoints [bp_file ]:
130131 self ._debug_print (f"[PDB] HIT BREAKPOINT (relative path match) at { filename } :{ lineno } -> { bp_file } " )
131132 # 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
133134 self .hit_breakpoint = True
134135 return True
135136
@@ -216,7 +217,7 @@ def get_stack_trace(self):
216217 hint = 'normal'
217218
218219 # 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 )
220221 if filename != display_path :
221222 self ._debug_print (f"[PDB] Stack trace path mapping: { filename } -> { display_path } " )
222223 # Create StackFrame info
0 commit comments