1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:47:35 +00:00

Ports/gdb: Implement wait and mourn_inferior overrides for our target

While troubleshooting why gdb wasn't working when attempting to debug
serenity programs I noticed two things:

 - The contract of serenity'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 serenity'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.

These two patches fix the behavior of wait and mourn_inferior so that
they work as expected on serenity and allow us to attach and then wait
for a process to exit while running under gdb.
This commit is contained in:
Brian Gianforcaro 2022-02-20 00:46:03 -08:00 committed by Andreas Kling
parent f01e1d0c17
commit e56262caed
7 changed files with 195 additions and 4 deletions

View file

@ -1,7 +1,7 @@
From 7a5e11d2e9cbe98af96faa4835592686bf261a23 Mon Sep 17 00:00:00 2001
From: Brian Gianforcaro <b.gianfo@gmail.com>
Date: Tue, 28 Dec 2021 04:39:25 -0800
Subject: [PATCH 4/4] serenity: Fix compiler -fpermissive warnings from using
Subject: [PATCH 4/6] serenity: Fix compiler -fpermissive warnings from using
latest GCC
---