+ # Function remapping all the traced objects to match their name in the local context
+ private fun remap(n: AExpr)
+ do
+ if self.aftermath then
+
+ # Trace every argument variable pre-specified
+ if self.frame_count_aftermath < frames.length and fun_call_arguments_positions.length > 0 then
+
+ var ids_in_fun_def = get_identifiers_in_current_instruction(get_function_arguments(frame.mpropdef.location.text))
+
+ for i in fun_call_arguments_positions.keys do
+ self.fun_call_arguments_positions[i].add_frame_variable(frame, ids_in_fun_def[i])
+ end
+ end
+
+ self.aftermath = false
+ end
+ end
+
+ # If the current instruction is a function call
+ # We analyse its signature and the position of traced arguments if the call
+ # For future remapping when inside the function
+ private fun check_funcall_and_traced_args(n: AExpr) do
+ # If we have a function call, we need to see if any of the arguments is traced (including the caller)
+ # if it is, next time we face an instruction, we'll trace the local version on the traced variable in the next frame
+ if n isa ACallExpr then
+ self.aftermath = true
+ self.frame_count_aftermath = frames.length
+ fun_call_arguments_positions.clear
+ var fun_arguments = get_identifiers_in_current_instruction(get_function_arguments(n.location.text))
+
+ for i in self.traces do
+ for j in [0 .. fun_arguments.length - 1] do
+ if i.is_variable_traced_in_frame(fun_arguments[j],frame) then
+ fun_call_arguments_positions[j] = i
+ end
+ end
+ end
+ end
+ end
+