Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Yubin Ruan <ablacktshirt@gmail.com>, gdb@sourceware.org
Subject: Re: how GDB use ptrace to return from a function
Date: Sat, 18 Nov 2017 07:58:00 -0000	[thread overview]
Message-ID: <20171118075841.GA30204@host1.jankratochvil.net> (raw)
In-Reply-To: <20171118040311.tri7yn4alqxzc3gt@adacore.com>

On Sat, 18 Nov 2017 05:03:11 +0100, Joel Brobecker wrote:
> > what break point events are common for X86?
> 
> IIRC, the breakpoint instruction on x86 is the int3 instruction.
> It should generate a SIGTRAP upon execution, just like any user-
> inserted breakpoints.

A toy debugger should have available also a hardware breakpoint (hbreak) using
the hardware registers commonly used only for hardware watchpoints.

Then the return address can be arbitrary as the debugger does not have to
write anything into that address.


Jan


      parent reply	other threads:[~2017-11-18  7:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-17  6:44 Yubin Ruan
2017-11-17 16:11 ` Joel Brobecker
2017-11-18  3:46   ` Yubin Ruan
2017-11-18  4:03     ` Joel Brobecker
2017-11-18  4:20       ` Yubin Ruan
2017-11-18  7:58       ` Jan Kratochvil [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171118075841.GA30204@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=ablacktshirt@gmail.com \
    --cc=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox