Add support to force-debug applications before they start running code

This commit is contained in:
TuxSH
2019-03-31 20:01:16 +02:00
parent 219f38169f
commit fb800bd4c9
8 changed files with 138 additions and 21 deletions

View File

@@ -63,6 +63,7 @@ typedef enum GDBFlags
GDB_FLAG_USED = 2,
GDB_FLAG_PROCESS_CONTINUING = 4,
GDB_FLAG_TERMINATE_PROCESS = 8,
GDB_FLAG_ATTACHED_AT_START = 16,
} GDBFlags;
typedef enum GDBState
@@ -94,8 +95,8 @@ typedef struct GDBContext
Handle debug;
ThreadInfo threadInfos[MAX_DEBUG_THREAD];
u32 nbThreads;
u32 currentThreadId, selectedThreadId, selectedThreadIdForContinuing;
u32 totalNbCreatedThreads;
Handle clientAcceptedEvent, continuedEvent;
Handle eventToWaitFor;

View File

@@ -31,5 +31,7 @@
extern Menu debuggerMenu;
void debuggerSetNextApplicationDebugHandle(Handle debug);
void DebuggerMenu_EnableDebugger(void);
void DebuggerMenu_DisableDebugger(void);
void DebuggerMenu_DebugNextApplicationByForce(void);

View File

@@ -31,7 +31,7 @@
#include <poll.h>
#include <netinet/in.h>
#define MAX_PORTS 3
#define MAX_PORTS (3+1)
#define MAX_CTXS (2 * MAX_PORTS)
struct sock_server;