From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18625 invoked by alias); 18 Nov 2017 07:58:48 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 18612 invoked by uid 89); 18 Nov 2017 07:58:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=BAYES_00,KB_WAM_FROM_NAME_SINGLEWORD,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=toy X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 18 Nov 2017 07:58:46 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5DCD98618; Sat, 18 Nov 2017 07:58:45 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-51.ams2.redhat.com [10.36.116.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7510C5C542; Sat, 18 Nov 2017 07:58:44 +0000 (UTC) Date: Sat, 18 Nov 2017 07:58:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: Yubin Ruan , gdb@sourceware.org Subject: Re: how GDB use ptrace to return from a function Message-ID: <20171118075841.GA30204@host1.jankratochvil.net> References: <20171117161059.3oxfgipkgknfymrm@adacore.com> <20171118040311.tri7yn4alqxzc3gt@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171118040311.tri7yn4alqxzc3gt@adacore.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-SW-Source: 2017-11/txt/msg00015.txt.bz2 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