bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH binutils-gdb] Port GDB to Hurd x86_64.


From: Samuel Thibault
Subject: Re: [PATCH binutils-gdb] Port GDB to Hurd x86_64.
Date: Fri, 9 Feb 2024 01:09:24 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Flavio Cruz, le dim. 04 févr. 2024 01:43:48 -0500, a ecrit:
> +/* Recognizing signal handler frames.  */
> +
> +/* When the GNU/Hurd libc calls a signal handler, the return address points
> +   inside the trampoline assembly snippet.
> +
> +   If the trampoline function name can not be identified, we resort to 
> reading
> +   memory from the process in order to identify it.  */
> +
> +static const gdb_byte gnu_sigtramp_code[] =
> +{
> +/* rpc_wait_trampoline: */
> +  0x48, 0xc7, 0xc0, 0xe7, 0xff, 0xff, 0xff,  /* mov    $-25,%rax */
> +  0x0f, 0x05,                                        /* syscall */
> +  0x49, 0x89, 0x04, 0x24,                    /* mov    %rax,(%r12) */

   0x48, 0x89, 0xdc                /* mov    %rbx,%rsp */

is missing here?

> +      CORE_ADDR sigcontext_addr;
> +
> +      /* The sigcontext structure address is passed as the third argument to
> +      the signal handler. */
> +      read_memory (sp + 8, buf, 8);

on x86_64 it would rather be through registers

> +      sigcontext_addr = extract_unsigned_integer (buf, 8, byte_order);
> +      return sigcontext_addr + AMD64_GNU_SIGCONTEXT_THREAD_STATE_OFFSET;
> +    }
> +
> +  error (_("Couldn't recognize signal trampoline."));
> +  return 0;
> +}

> +/* From <bits/sigcontext.h>.  */
> +static int amd64_gnu_sc_reg_offset[] =

I didn't check these :o)

The rest looks sane indeed.

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]