From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117590 invoked by alias); 23 Aug 2019 21:33:29 -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 117579 invoked by uid 89); 23 Aug 2019 21:33:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=sun, Sun, breakpoints, H*Ad:U*gdb X-HELO: mail-lf1-f47.google.com Received: from mail-lf1-f47.google.com (HELO mail-lf1-f47.google.com) (209.85.167.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Aug 2019 21:33:28 +0000 Received: by mail-lf1-f47.google.com with SMTP id c9so8143472lfh.4 for ; Fri, 23 Aug 2019 14:33:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EfxZS82wWpsEWAxAHnHMF2GY5JtvBVlX7/V7QiIAWW8=; b=hf9h2P85MWVKoNQglJXCmdyi6Mz+BLj7i3pQi8Yd2pVzw2MHkrGyNFTV2KTIKcMdbx 1A4BFnRwRqfApQYEZMhchfzm9JkHyL8mGn7cESPpgYgt/BJ5pLYii3L+ObYKUXJSvXbN bwH84DLnJXfgjFvSLaGDm3It+vwcpRtDyFvJC1iSb0v75BI9QfGTu/XFk2qJ07FMMRe7 YXzzNMBs1KtAzBtKsOltmvZ+POh0yHKl6MX3NX4bySihrADxhCTKIhPiYrCYT4qrxHYy nyFCmyuWajfW0A7Lk2A754Qmz/x/gmOnyprCcAhskb96Ifjj/F65t8PAcGipwzQNitI+ svaw== MIME-Version: 1.0 References: <20190818041556.GA11323@host1.jankratochvil.net> <20190818090556.GA19968@host1.jankratochvil.net> In-Reply-To: <20190818090556.GA19968@host1.jankratochvil.net> From: William Tambe Date: Fri, 23 Aug 2019 21:33:00 -0000 Message-ID: Subject: Re: gdb command "next" wrongly working as command "step" To: Jan Kratochvil Cc: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2019-08/txt/msg00031.txt.bz2 On Sun, Aug 18, 2019 at 4:06 AM Jan Kratochvil wrote: > > On Sun, 18 Aug 2019 10:31:54 +0200, William Tambe wrote: > > Can I have suggestions of locations within the gdb code where I could > > put breakpoints to trace where the issue I am having is occurring ? > > Check what "set debug infrun 1" says and grep the sources for the displayed > messages. > Using "set debug infrun 1", I can see that GDB stops only after printing the following message: infrun: stepped to a different line. When the above event happens, GDB has stepped inside the function, which is obviously going to be on a different line; however, I am expecting GDB to step over the function. Within the single-step function gdbarch_software_single_step_ftype() is there a way to tell whether GDB is stepping-into or stepping-over a function ? In fact within my implementation of gdbarch_software_single_step_ftype() when the instruction jump-and-link (used when calling a function) is decoded, the breakpoint is placed at the jump target; I could instead place the breakpoint after the instruction jump-and-link if I could tell whether the GDB command "step"/"stepi" or "next"/"nexti" was used. So within gdbarch_software_single_step_ftype(), is there a way to tell whether GDB is stepping-into or stepping-over a function ? > > Jan