internal CallbackFrame GetCallbackFrame(TargetAddress stack_pointer, bool exact_match)
{
IntPtr buffer = IntPtr.Zero;
try {
int count = arch.CountRegisters;
int buffer_size = 32 + count * 8;
buffer = Marshal.AllocHGlobal (buffer_size);
TargetError result = mono_debugger_server_get_callback_frame (
server_handle, stack_pointer.Address, exact_match, buffer);
if (result == TargetError.NoCallbackFrame)
return null;
check_error (result);
return new CallbackFrame (this, buffer);
} finally {
if (buffer != IntPtr.Zero)
Marshal.FreeHGlobal (buffer);
}
}