Commit Graph

8 Commits

Author SHA1 Message Date
Tim Schumacher
d426c5a4b2 Ports: Format patches without numbering, commit hash or version number 2022-06-08 17:58:36 +01:00
Brian Gianforcaro
213df97b55 Ports/gdb: Upgrade gdb to version 11.2 2022-03-19 11:55:08 -07:00
Brian Gianforcaro
e56262caed 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.
2022-02-20 11:49:41 +01:00
Brian Gianforcaro
f01e1d0c17 Ports/gdb: Add descriptions to all gdb patches and remove dead code
Before working on the gdb port some more, I wanted to get these patches
cleaned up to have a good base to build upon.
2022-02-20 11:49:41 +01:00
Brian Gianforcaro
e308536005 Ports/gdb: Add basic ptrace based native target for SerenityOS/i386
This patch adds a ptrace based gdb backend, which is then enlightended
to known how to read the serenity i386 registers via ptrace.

This is just a basic implementation to get the port bootstrapped.
2021-12-29 03:17:41 -08:00
Brian Gianforcaro
6137b9f272 Ports/gdb: Fix compiler -fpermissive warnings from using latest GCC
These are compilation errors coming form upstream gdb.
2021-12-29 03:17:41 -08:00
Daniel Bertalan
9f2e8683de Ports/gdb: Use mmap instead of malloc for sigaltstack()
Stack regions can't be made volatile, which makes it impossible for
malloc to manage memory that's used for `sigaltstack()`. Let's use mmap
instead.

Co-authored-by: Idan Horowitz <idan.horowitz@gmail.com>
2021-12-29 03:17:41 -08:00
Brian Gianforcaro
bd3bbd0329 Ports: Add initial GDB 11.1 port
This builds and runs, but crashes when you attempt to try to debug
something at the moment.
2021-12-29 03:17:41 -08:00