GDBStub: Support watchpoints on linux (#1030)

* GDBStub: Support watchpoints on linux
* GDBStub: Use `TCP_NODELAY`
This commit is contained in:
GaryOderNichts 2023-12-24 00:25:01 +01:00 committed by GitHub
parent bab1616565
commit 4405116324
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 371 additions and 197 deletions

View file

@ -6,6 +6,9 @@
#include "util/helpers/StringHelpers.h"
#include "ExceptionHandler.h"
#include "Cafe/HW/Espresso/Debugger/GDBStub.h"
#include "Cafe/HW/Espresso/Debugger/GDBBreakpoints.h"
#if BOOST_OS_LINUX
#include "ELFSymbolTable.h"
#endif
@ -61,6 +64,16 @@ void DemangleAndPrintBacktrace(char** backtrace, size_t size)
// handle signals that would dump core, print stacktrace and then dump depending on config
void handlerDumpingSignal(int sig, siginfo_t *info, void *context)
{
#if defined(ARCH_X86_64) && BOOST_OS_LINUX
// Check for hardware breakpoints
if (info->si_signo == SIGTRAP && info->si_code == TRAP_HWBKPT)
{
uint64 dr6 = _ReadDR6();
g_gdbstub->HandleAccessException(dr6);
return;
}
#endif
if(!CrashLog_Create())
return; // give up if crashlog was already created