genode/repos/ports/src/lib/gdbserver_platform/gdbserver_platform_helper.cc
Norman Feske ca971bbfd8 Move repositories to 'repos/' subdirectory
This patch changes the top-level directory layout as a preparatory
step for improving the tools for managing 3rd-party source codes.
The rationale is described in the issue referenced below.

Issue #1082
2014-05-14 16:08:00 +02:00

48 lines
1.1 KiB
C++

/*
* \brief Genode backend for GDBServer - helper functions
* \author Christian Prochaska
* \date 2011-07-07
*/
/*
* Copyright (C) 2011-2013 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.
*/
extern "C" {
#define private _private
#include "server.h"
#include "linux-low.h"
#include "genode-low.h"
#define _private private
}
#include "cpu_session_component.h"
#include "gdb_stub_thread.h"
using namespace Genode;
using namespace Gdb_monitor;
extern Gdb_stub_thread *gdb_stub_thread();
Thread_state get_current_thread_state()
{
Cpu_session_component *csc = gdb_stub_thread()->cpu_session_component();
ptid_t ptid = ((struct inferior_list_entry*)current_inferior)->id;
return csc->state(csc->thread_cap(ptid.lwp));
}
void set_current_thread_state(Thread_state thread_state)
{
Cpu_session_component *csc = gdb_stub_thread()->cpu_session_component();
ptid_t ptid = ((struct inferior_list_entry*)current_inferior)->id;
csc->state(csc->thread_cap(ptid.lwp), thread_state);
}