From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95547 invoked by alias); 18 Nov 2017 03:46:26 -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 95537 invoked by uid 89); 18 Nov 2017 03:46:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KB_WAM_FROM_NAME_SINGLEWORD,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=enlighten, H*r:sk:gdb@sou X-HELO: mail-wm0-f52.google.com Received: from mail-wm0-f52.google.com (HELO mail-wm0-f52.google.com) (74.125.82.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 18 Nov 2017 03:46:24 +0000 Received: by mail-wm0-f52.google.com with SMTP id y80so9704882wmd.0 for ; Fri, 17 Nov 2017 19:46:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RWnuaD0hphG5Fsq5M+rLNHfzJtFRxwpweyNWysowE5o=; b=Eh+iXCvht6V9IYGW3WHg88En/WXeZOWmsR1uSlAKFFD8bROu3fOmEZiPKsWuErq5vT x/ugl/GGJU+RVfFUE4ZxKBWeYHu2HBCEnmvOsm1Vt5CTAqDpMB1t4E7B8j+jeEBcgr5c +KZvzLVnCluZLzU81tX8KMEdExBxvFxS9lG2YB+LJkqKA2MioWptKKzzudfHEHteNmkg d1wsguup6bXW+8ti5SWvNUq8/XPol4SZtwbWV9trhZ/sOIZVNk30V7xJfnJcMMTK51Nd XdQmM/gNivwTht9gnzYCg6BOYv0tdHf3Myw2ZZzwMrVSRekzYuOF2sy437/WBj8X+2T7 KzEQ== X-Gm-Message-State: AJaThX5BgisCZQL1Dk1XTdqtAX1znOch3tef8DvMxG9tTtcxqak/NmaE OLy1iCobwH5eCiHksoW8BicTXAoq7Lqk5BiK8Q== X-Google-Smtp-Source: AGs4zMb9igH4NrJrU5vNJksFEWV1k37kPSw8Yohd9S7NKFRgKgLo9OzEVmHvxMuzhY3E3u9ZBFX2lYzLz9v2In6sRr0= X-Received: by 10.80.182.148 with SMTP id d20mr4966960ede.63.1510976781848; Fri, 17 Nov 2017 19:46:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.135.140 with HTTP; Fri, 17 Nov 2017 19:46:21 -0800 (PST) In-Reply-To: <20171117161059.3oxfgipkgknfymrm@adacore.com> References: <20171117161059.3oxfgipkgknfymrm@adacore.com> From: Yubin Ruan Date: Sat, 18 Nov 2017 03:46:00 -0000 Message-ID: Subject: Re: how GDB use ptrace to return from a function To: Joel Brobecker Cc: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00012.txt.bz2 Thanks Joel, 2017-11-18 0:10 GMT+08:00 Joel Brobecker : >> I don't know whether GDB is using this kind of technique. If anyone >> know that, can you enlighten me, and probably point me to the source? > > GDB sets the call up so that the return address is at specific > location (usually the program's entry point, but that's arch- > dependent), and then places a breakpoint at that address. It > then knows, when receiving the corresponding breakpoint event, > that a breakpoint at that address corresponds to the end of > the function that we called. what break point events are common for X86? Yubin