Start GDB work (broken rn)

This commit is contained in:
CrashOveride95
2021-04-16 20:50:06 -04:00
parent cf77e2db67
commit 4068afb39f
7 changed files with 67 additions and 43 deletions

View File

@@ -18,6 +18,9 @@
#include "usb/usb.h"
#include "usb/debug.h"
#endif
#ifdef GDB
#include "gdb/debugger.h"
#endif
// Message IDs
#define MESG_SP_COMPLETE 100
@@ -312,6 +315,10 @@ void handle_dp_complete(void) {
extern void crash_screen_init(void);
void thread3_main(UNUSED void *arg) {
#ifdef GDB
OSPiHandle *gdbpihandle;
gdbpihandle = osCartRomInit();
#endif
setup_mesg_queues();
alloc_pool();
load_engine_code_segment();
@@ -331,6 +338,11 @@ void thread3_main(UNUSED void *arg) {
create_thread(&gGameLoopThread, 5, thread5_game_loop, NULL, gThread5Stack + 0x2000, 10);
osStartThread(&gGameLoopThread);
#ifdef GDB
OSThread* threadPtr = &gMainThread;
gdbInitDebugger(gdbpihandle, &gDmaMesgQueue, &threadPtr, 1);
#endif
while (TRUE) {
OSMesg msg;

View File

@@ -3,6 +3,7 @@
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <stddef.h>
#define MAX_PACKET_SIZE 0x4000
#define MAX_DEBUGGER_THREADS 8

View File

@@ -4,7 +4,7 @@
u8 (*gdbSerialCanRead)();
#if USE_UNF_LOADER
#include "usb.h"
#include <usb/usb.h>
u32 gdbPendingUNFHeader;
u32 gdbPendingUNFData;

View File

@@ -4,7 +4,7 @@
#include <ultra64.h>
// #define USE_UNF_LOADER 1
//#define USE_UNF_LOADER 1
enum GDBError {
GDBErrorNone,