static int update(void* userData, PDUI* uiFuncs, PDReader* inEvents, PDWriter* outEvents) { uint32_t event = 0; while ((event = PDRead_getEvent(inEvents)) != 0) { switch (event) { case PDEventType_setLocals: { showInUI((LocalsData*)userData, inEvents, uiFuncs); break; } } } // Request callstack data // TODO: Dont' request locals all the time PDWrite_eventBegin(outEvents, PDEventType_getLocals); PDWrite_u8(outEvents, "dummy_remove", 0); // TODO: Remove me PDWrite_eventEnd(outEvents); return 0; }
static int update(void* userData, PDUI* uiFuncs, PDReader* inEvents, PDWriter* outEvents) { ConsoleData* consoleData = (ConsoleData*)userData; uint32_t event = 0; (void)event; // test working build /*while ((event = PDRead_getEvent(inEvents)) != 0) { switch (event) { case PDEventType_setConsole: { //showInUI((ConsoleData*)userData, inEvents, uiFuncs); break; } } }*/ showInUI(consoleData, inEvents, uiFuncs); for (size_t i = 0; i < consoleData->scripts.size(); ++i) { PDWrite_eventBegin(outEvents, PDEventType_executeConsole); PDWrite_string(outEvents, "command", consoleData->scripts[i]); // TODO: Remove me PDWrite_eventEnd(outEvents); //free(consoleData->scripts[i]); } consoleData->scripts.clear(); // Request console data PDWrite_eventBegin(outEvents, PDEventType_getConsole); PDWrite_u8(outEvents, "dummy_remove", 0); // TODO: Remove me PDWrite_eventEnd(outEvents); return 0; }
static int update(void* user_data, PDUI* uiFuncs, PDReader* inEvents, PDWriter* outEvents) { uint32_t event = 0; ThreadsData* data = (ThreadsData*)user_data; data->requestData = false; data->setSelectedThread = false; while ((event = PDRead_get_event(inEvents)) != 0) { switch (event) { case PDEventType_SetThreads: { showInUI((ThreadsData*)user_data, inEvents, uiFuncs); break; } case PDEventType_SetExceptionLocation: { data->requestData = true; break; } } } // Request threads data if (data->setSelectedThread) { PDWrite_event_begin(outEvents, PDEventType_SelectThread); printf("writing thread id %d\n", data->threadId); PDWrite_u32(outEvents, "thread_id", (uint32_t)data->threadId); PDWrite_event_end(outEvents); } if (data->requestData) { PDWrite_event_begin(outEvents, PDEventType_GetThreads); PDWrite_event_end(outEvents); } return 0; }