Skeleton of the debugger host.
This commit is contained in:
38
include/xenia/dbg/client.h
Normal file
38
include/xenia/dbg/client.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2013 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_KERNEL_DBG_CLIENT_H_
|
||||
#define XENIA_KERNEL_DBG_CLIENT_H_
|
||||
|
||||
#include <xenia/common.h>
|
||||
#include <xenia/core.h>
|
||||
|
||||
|
||||
namespace xe {
|
||||
namespace dbg {
|
||||
|
||||
|
||||
class Client {
|
||||
public:
|
||||
Client();
|
||||
virtual ~Client();
|
||||
|
||||
void Write(const uint8_t* buffer, const size_t length);
|
||||
virtual void Write(const uint8_t** buffers, const size_t* lengths,
|
||||
size_t count) = 0;
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
|
||||
} // namespace dbg
|
||||
} // namespace xe
|
||||
|
||||
|
||||
#endif // XENIA_KERNEL_DBG_CLIENT_H_
|
||||
46
include/xenia/dbg/content_source.h
Normal file
46
include/xenia/dbg/content_source.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2013 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_KERNEL_DBG_CONTENT_SOURCE_H_
|
||||
#define XENIA_KERNEL_DBG_CONTENT_SOURCE_H_
|
||||
|
||||
#include <xenia/common.h>
|
||||
#include <xenia/core.h>
|
||||
|
||||
#include <xenia/dbg/client.h>
|
||||
|
||||
|
||||
namespace xe {
|
||||
namespace dbg {
|
||||
|
||||
|
||||
class ContentSource {
|
||||
public:
|
||||
enum Type {
|
||||
kTypeIndexed,
|
||||
};
|
||||
|
||||
ContentSource(Type type);
|
||||
virtual ~ContentSource();
|
||||
|
||||
Type type();
|
||||
|
||||
virtual int DispatchRequest(Client* client,
|
||||
const uint8_t* data, size_t length) = 0;
|
||||
|
||||
protected:
|
||||
Type type_;
|
||||
};
|
||||
|
||||
|
||||
} // namespace dbg
|
||||
} // namespace xe
|
||||
|
||||
|
||||
#endif // XENIA_KERNEL_DBG_CONTENT_SOURCE_H_
|
||||
54
include/xenia/dbg/debugger.h
Normal file
54
include/xenia/dbg/debugger.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2013 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_KERNEL_DBG_DEBUGGER_H_
|
||||
#define XENIA_KERNEL_DBG_DEBUGGER_H_
|
||||
|
||||
#include <xenia/common.h>
|
||||
#include <xenia/core.h>
|
||||
|
||||
#include <map>
|
||||
|
||||
|
||||
namespace xe {
|
||||
namespace dbg {
|
||||
|
||||
|
||||
class Client;
|
||||
class ContentSource;
|
||||
class Listener;
|
||||
|
||||
|
||||
class Debugger {
|
||||
public:
|
||||
Debugger(xe_pal_ref pal);
|
||||
virtual ~Debugger();
|
||||
|
||||
void RegisterContentSource(std::string& name, ContentSource* content_source);
|
||||
|
||||
int Startup();
|
||||
|
||||
private:
|
||||
int DispatchRequest(Client* client, const char* source_name,
|
||||
const uint8_t* data, size_t length);
|
||||
|
||||
friend class Client;
|
||||
|
||||
private:
|
||||
xe_pal_ref pal_;
|
||||
auto_ptr<Listener> listener_;
|
||||
std::map<char*, ContentSource*> content_sources_;
|
||||
};
|
||||
|
||||
|
||||
} // namespace dbg
|
||||
} // namespace xe
|
||||
|
||||
|
||||
#endif // XENIA_KERNEL_DBG_DEBUGGER_H_
|
||||
45
include/xenia/dbg/indexed_content_source.h
Normal file
45
include/xenia/dbg/indexed_content_source.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2013 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_KERNEL_DBG_INDEXED_CONTENT_SOURCE_H_
|
||||
#define XENIA_KERNEL_DBG_INDEXED_CONTENT_SOURCE_H_
|
||||
|
||||
#include <xenia/common.h>
|
||||
#include <xenia/core.h>
|
||||
|
||||
#include <xenia/dbg/content_source.h>
|
||||
|
||||
|
||||
namespace xe {
|
||||
namespace dbg {
|
||||
|
||||
|
||||
class Client;
|
||||
|
||||
|
||||
class IndexedContentSource : public ContentSource {
|
||||
public:
|
||||
IndexedContentSource();
|
||||
virtual ~IndexedContentSource();
|
||||
|
||||
int DispatchRequest(Client* client, const uint8_t* data, size_t length);
|
||||
|
||||
protected:
|
||||
virtual int RequestIndex(Client* client, uint64_t req_id) = 0;
|
||||
virtual int RequestRange(Client* client, uint64_t req_id,
|
||||
uint64_t start_index, uint64_t end_index) = 0;
|
||||
virtual int RequestEntry(Client* client, uint64_t req_id, uint64_t index) = 0;
|
||||
};
|
||||
|
||||
|
||||
} // namespace dbg
|
||||
} // namespace xe
|
||||
|
||||
|
||||
#endif // XENIA_KERNEL_DBG_INDEXED_CONTENT_SOURCE_H_
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <xenia/core.h>
|
||||
#include <xenia/gpu.h>
|
||||
#include <xenia/kernel.h>
|
||||
|
||||
int some_function(int x);
|
||||
#include <xenia/dbg/debugger.h>
|
||||
|
||||
#endif // XENIA_H_
|
||||
|
||||
Reference in New Issue
Block a user