mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-25 03:34:25 +00:00
Enable gdb_monitor for NOVA
This commit is contained in:
parent
28402eb085
commit
39957d17b2
3
ports/lib/mk/nova_x86_32/gdbserver_platform.mk
Normal file
3
ports/lib/mk/nova_x86_32/gdbserver_platform.mk
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
SRC_CC = nova_x86_32_low.cc
|
||||||
|
|
||||||
|
include $(REP_DIR)/lib/mk/x86_32/gdbserver_platform_x86_32.inc
|
@ -6,10 +6,14 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# Only Genode/Fiasco.OC supports all the tested features at this time
|
# Only Genode/Fiasco.OC and Genode/NOVA supports all the tested features
|
||||||
|
# at this time
|
||||||
#
|
#
|
||||||
|
|
||||||
assert_spec foc
|
if {![have_spec foc] && ![have_spec nova]} {
|
||||||
|
puts "Run script requires foc or nova"; exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build
|
# Build
|
||||||
|
49
ports/src/lib/gdbserver_platform/nova_x86_32_low.cc
Normal file
49
ports/src/lib/gdbserver_platform/nova_x86_32_low.cc
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* \brief NOVA specific helper functions for GDB server
|
||||||
|
* \author Alexander Boettcher
|
||||||
|
* \date 2012-08-09
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2012-2012 Genode Labs GmbH
|
||||||
|
*
|
||||||
|
* This file is part of the Genode OS framework, which is distributed
|
||||||
|
* under the terms of the GNU General Public License version 2.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "i386.h"
|
||||||
|
#include "cpu_session_component.h"
|
||||||
|
#include "gdbserver_platform_helper.h"
|
||||||
|
#include "gdb_stub_thread.h"
|
||||||
|
|
||||||
|
using namespace Genode;
|
||||||
|
|
||||||
|
extern "C" int genode_fetch_register(int regno, unsigned long *reg_content)
|
||||||
|
{
|
||||||
|
Thread_state thread_state;
|
||||||
|
|
||||||
|
if (!get_current_thread_state(thread_state))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
switch((enum reg_index)regno)
|
||||||
|
{
|
||||||
|
case EAX: *reg_content = thread_state.eax; return 0;
|
||||||
|
case ECX: *reg_content = thread_state.ecx; return 0;
|
||||||
|
case EDX: *reg_content = thread_state.edx; return 0;
|
||||||
|
case EBX: *reg_content = thread_state.ebx; return 0;
|
||||||
|
case UESP: *reg_content = thread_state.sp; return 0;
|
||||||
|
case EBP: *reg_content = thread_state.ebp; return 0;
|
||||||
|
case ESI: *reg_content = thread_state.esi; return 0;
|
||||||
|
case EDI: *reg_content = thread_state.edi; return 0;
|
||||||
|
case EIP: *reg_content = thread_state.ip; return 0;
|
||||||
|
case EFL: *reg_content = thread_state.eflags; return 0;
|
||||||
|
case CS: return -1;
|
||||||
|
case SS: return -1;
|
||||||
|
case DS: return -1;
|
||||||
|
case ES: return -1;
|
||||||
|
case FS: *reg_content = thread_state.fs; return 0;
|
||||||
|
case GS: *reg_content = thread_state.gs; return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user