mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-02-09 23:30:51 +00:00
SIGINT invokes the built-in debugger.
This commit is contained in:
parent
a8f400287a
commit
c5f45c6f9a
15
main.cpp
15
main.cpp
@ -29,6 +29,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#include "utils/profiler.h"
|
||||
#include "ppcemu.h"
|
||||
#include <cinttypes>
|
||||
#include <csignal>
|
||||
#include <cstring>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
@ -40,6 +41,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
using namespace std;
|
||||
|
||||
void sigint_handler(int signum) {
|
||||
enter_debugger();
|
||||
|
||||
LOG_F(INFO, "Shutting down...");
|
||||
|
||||
delete gMachineObj.release();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
static string appDescription = string(
|
||||
"\nDingusPPC - Prototype 5bf5 (8/23/2020) "
|
||||
"\nWritten by divingkatae and maximumspatium "
|
||||
@ -118,10 +128,8 @@ int main(int argc, char** argv) {
|
||||
loguru::init(argc, argv);
|
||||
loguru::add_file("dingusppc.log", loguru::Append, 0);
|
||||
} else {
|
||||
loguru::g_preamble_uptime = false;
|
||||
loguru::g_stderr_verbosity = loguru::Verbosity_INFO;
|
||||
loguru::init(argc, argv);
|
||||
loguru::add_file("exceptions.log", loguru::Truncate, -7);
|
||||
}
|
||||
|
||||
if (*machine_opt) {
|
||||
@ -163,6 +171,9 @@ int main(int argc, char** argv) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// redirect SIGINT to our own handler
|
||||
signal(SIGINT, sigint_handler);
|
||||
|
||||
#ifdef SDL
|
||||
if (SDL_Init(SDL_INIT_AUDIO)){
|
||||
LOG_F(ERROR, "SDL_Init error: %s", SDL_GetError());
|
||||
|
Loading…
x
Reference in New Issue
Block a user