From owner-freebsd-hackers@freebsd.org Mon Dec 19 22:19:03 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B3A7C884B5 for ; Mon, 19 Dec 2016 22:19:03 +0000 (UTC) (envelope-from grog@lemis.com) Received: from www.lemis.com (www.lemis.com [208.86.226.86]) by mx1.freebsd.org (Postfix) with ESMTP id 296B41907 for ; Mon, 19 Dec 2016 22:19:02 +0000 (UTC) (envelope-from grog@lemis.com) Received: from eureka.lemis.com (www.lemis.com [208.86.226.86]) by www.lemis.com (Postfix) with ESMTP id 733911B72803; Mon, 19 Dec 2016 22:18:56 +0000 (UTC) Received: by eureka.lemis.com (Postfix, from userid 1004) id 2BB384494B1; Tue, 20 Dec 2016 09:18:55 +1100 (AEDT) Date: Tue, 20 Dec 2016 09:18:55 +1100 From: Greg 'groggy' Lehey To: Bertram Scharpf Cc: freebsd-hackers@freebsd.org Subject: Re: Where is Gdb's start command? Message-ID: <20161219221855.GB16173@eureka.lemis.com> References: <20161219215115.GA8918@becker.bs.l> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yEPQxsgoJgBvi8ip" Content-Disposition: inline In-Reply-To: <20161219215115.GA8918@becker.bs.l> Organization: The FreeBSD Project Phone: +61-3-5346-1370, +61-3-5309-0418 Mobile: 0401 265 606. Use only as instructed. WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 22:19:03 -0000 --yEPQxsgoJgBvi8ip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Monday, 19 December 2016 at 22:51:15 +0100, Bertram Scharpf wrote: > Hi, > > I do not actually want to debug something but rather write > some Gdb examples for a tutorial. I would like the program > to stop at the first instruction of main(). Normally I do > this using the command "start". I've never seen this before. > But on my FreeBSD this command doesn't seem to exist. > > (gdb) n > The program is not being run. > (gdb) start > Undefined command: "start". Try "help". > (gdb) help start > Undefined command: "start". Try "help". > > Why isn't it defined? What should I say instead? It is defined, just not in terms that you're expecting. run or r. But that will run the program. First you need to set a breakpoint where you want to stop: (gdb) b main (gbb) r Greg -- Sent from my desktop computer. Finger grog@FreeBSD.org for PGP public key. See complete headers for address and phone numbers. This message is digitally signed. If your Microsoft mail program reports problems, please read http://lemis.com/broken-MUA --yEPQxsgoJgBvi8ip Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAlhYXM8ACgkQIubykFB6QiPRrwCgq+09zvPB1epzHNHbyoJXUBo/ +zEAoJ24mK0jWKHpG0dMbs21J44ZPuq0 =Ouyk -----END PGP SIGNATURE----- --yEPQxsgoJgBvi8ip--