# Patches for gdb on Minerva ## `0001-gdb-Disable-xmalloc-for-alternate_signal_stack-for-s.patch` gdb: Disable xmalloc for alternate_signal_stack for minerva ## `0002-minerva-Add-basic-ptrace-based-native-target-for-Se.patch` minerva: Add basic ptrace based native target for Minerva/i386 ## `0003-gdb-Add-build-support-for-Minerva.patch` gdb: Add build support for Minerva ## `0004-minerva-Fix-compiler-fpermissive-warnings-from-usin.patch` minerva: Fix compiler -fpermissive warnings from using latest GCC ## `0005-minerva-Implement-custom-wait-override-for-the-sere.patch` minerva: Implement custom wait override for the minerva_nat_target While troubleshooting why gdb wasn't working when attempting to debug minerva programs I noticed two things: - The contract of minerva's `waitpid(..)` appears to be slightly different than the generic ptrace target expects. We need to make sure we pass `WSTOPPED`, and it can return different errno values that we would want to re-try on. - The contract of minerva's `ptrace(..)` implementation appears to diverge as well, as we are expected to call `PT_ATTACH` before we call `PT_CONTINUE`, otherwise `ptrace(..)` will just error out. Allow gdb to understand these differences, I've overloaded the minerva_nat_target::wait(..) method and added the logic there. ## `0006-minerva-Implement-mourn_inferior-override-for-the-s.patch` minerva: Implement mourn_inferior override for the minerva_nat_target We need to pass `WNOHANG` to our `waitpid(..)` call on Minerva, otherwise we will wait forever.