2020-01-18 09:38:21 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
2020-03-08 12:33:14 +01:00
|
|
|
#include <AK/Memory.h>
|
2020-04-03 14:50:17 +03:00
|
|
|
#include <AK/kmalloc.h>
|
2021-03-07 21:28:28 +01:00
|
|
|
#include <Kernel/Arch/x86/CPU.h>
|
2020-03-28 11:47:16 +03:00
|
|
|
#include <Kernel/ThreadTracer.h>
|
2019-04-22 18:44:45 +02:00
|
|
|
|
2020-02-16 01:27:42 +01:00
|
|
|
namespace Kernel {
|
|
|
|
|
2020-08-08 17:32:34 +02:00
|
|
|
ThreadTracer::ThreadTracer(ProcessID tracer_pid)
|
2020-03-28 11:47:16 +03:00
|
|
|
: m_tracer_pid(tracer_pid)
|
2019-04-22 18:44:45 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-03-28 11:47:16 +03:00
|
|
|
void ThreadTracer::set_regs(const RegisterState& regs)
|
2019-04-22 18:44:45 +02:00
|
|
|
{
|
2021-02-08 19:34:41 +01:00
|
|
|
PtraceRegisters r {};
|
|
|
|
copy_kernel_registers_into_ptrace_registers(r, regs);
|
2020-03-28 11:47:16 +03:00
|
|
|
m_regs = r;
|
2019-04-22 18:44:45 +02:00
|
|
|
}
|
2020-04-07 18:23:37 +03:00
|
|
|
|
2020-02-16 01:27:42 +01:00
|
|
|
}
|