NetBSD Problem Report #53715

From  Sat Nov 10 13:12:46 2018
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id 89C067A111
	for <>; Sat, 10 Nov 2018 13:12:46 +0000 (UTC)
Message-Id: <>
Date: Sat, 10 Nov 2018 15:12:42 +0200 (EET)
From: (Andreas Gustafsson)
Reply-To: (Andreas Gustafsson)
Subject: gdb can't step into indirect calls because retpolines
X-Send-Pr-Version: 3.95

>Number:         53715
>Category:       port-i386
>Synopsis:       gdb can't step into indirect calls because retpolines
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 10 13:15:00 +0000 2018
>Last-Modified:  Sat Nov 10 13:35:01 +0000 2018
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date 2018.

System: NetBSD
Architecture: i386
Machine: i386

When debugging a kernel issue using a remote kgdb setup as in I was unable to
single-step into a function called indirectly through a function
pointer.  Instead, gdb continued straight to the following line
in the calling function:

(gdb) s
422                             error = dkd->d_diskstart(dksc->sc_dev, bp);
(gdb) s
423                             mutex_enter(&dksc->sc_iolock);

Disassembling the caller shows

   0xc0c68906 <dk_start+263>:   call   0xc114263b <__x86_indirect_thunk_eax>

which I assume is retpoline stuff.



Subject: Re: port-i386/53715: gdb can't step into indirect calls because
Date: Sat, 10 Nov 2018 13:32:16 +0000

 I suspect upstream GDB has done this work already (or is close).

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.