libdebug: add riscv64 support

Change-Id: I9d9d1697bc67d2ab674f2fbe0dbf3a37ead58595
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4062
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
This commit is contained in:
X512 2021-06-06 23:07:20 +09:00 committed by Alex von Gluck IV
parent 9d2cc33a64
commit 56ac584a91

View File

@ -20,17 +20,14 @@ status_t
arch_debug_get_instruction_pointer(debug_context *context, thread_id thread,
void **ip, void **stackFrameAddress)
{
#warning TODO RISCV64 get instruction pointer
#if 0
// get the CPU state
debug_cpu_state cpuState;
status_t error = debug_get_cpu_state(context, thread, NULL, &cpuState);
if (error != B_OK)
return error;
*ip = (void*)cpuState.rip;
*stackFrameAddress = (void*)cpuState.rbp;
#endif
*ip = (void*)cpuState.pc;
*stackFrameAddress = (void*)cpuState.x[7];
return B_OK;
}
@ -40,11 +37,11 @@ status_t
arch_debug_get_stack_frame(debug_context *context, void *stackFrameAddress,
debug_stack_frame_info *stackFrameInfo)
{
#warning TODO RISCV64 get stack frame
#if 0
stack_frame stackFrame;
ssize_t bytesRead = debug_read_memory(context, stackFrameAddress,
ssize_t bytesRead = debug_read_memory(context,
(uint8*)stackFrameAddress - sizeof(stackFrame),
&stackFrame, sizeof(stackFrame));
if (bytesRead < B_OK)
return bytesRead;
if (bytesRead != sizeof(stackFrame))
@ -53,7 +50,6 @@ arch_debug_get_stack_frame(debug_context *context, void *stackFrameAddress,
stackFrameInfo->frame = stackFrameAddress;
stackFrameInfo->parent_frame = stackFrame.previous;
stackFrameInfo->return_address = stackFrame.return_address;
#endif
return B_OK;
}