From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19110 invoked by alias); 19 Nov 2009 07:11:30 -0000 Received: (qmail 19100 invoked by uid 22791); 19 Nov 2009 07:11:28 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 Nov 2009 07:10:22 +0000 Received: from wpaz37.hot.corp.google.com (wpaz37.hot.corp.google.com [172.24.198.101]) by smtp-out.google.com with ESMTP id nAJ7AJro021712 for ; Wed, 18 Nov 2009 23:10:20 -0800 Received: from pwi21 (pwi21.prod.google.com [10.241.219.21]) by wpaz37.hot.corp.google.com with ESMTP id nAJ7AGXL007761 for ; Wed, 18 Nov 2009 23:10:17 -0800 Received: by pwi21 with SMTP id 21so1681707pwi.37 for ; Wed, 18 Nov 2009 23:10:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.55.34 with SMTP id d34mr2828953waa.225.1258614616171; Wed, 18 Nov 2009 23:10:16 -0800 (PST) In-Reply-To: <3b9893450911182243o2b078ac0w4e86ab1464aeaa0d@mail.gmail.com> References: <3b9893450911182243o2b078ac0w4e86ab1464aeaa0d@mail.gmail.com> Date: Thu, 19 Nov 2009 23:05:00 -0000 Message-ID: <8ac60eac0911182310g6edcaf0wf1940a7aafc647f9@mail.gmail.com> Subject: Re: how to set breakpoint at a particular line in cpp file From: Paul Pluzhnikov To: n179911 Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2009-11/txt/msg00162.txt.bz2 On Wed, Nov 18, 2009 at 10:43 PM, n179911 wrote: > How to set breakpoint at a particular line in cpp? > > I tried > (gdb) break HTMLParser.cpp:208 That *is* the correct way. > But I get: > No symbol table is loaded. =A0Use the "file" command. Yes, do that! In order to set a breakpoint, GDB needs to know the address of the first instruction on the given line. To find that address, GDB needs to have an executable file compiled with debugging info (usually the '-g' compiler switch). You *must* provide that executable file, or GDB will not be able to set the breakpoint. The usual way to provide such file: gdb /path/to/executable Alternatively: gdb (gdb) file /path/to/executable Hope this helps. Cheers, -- Paul Pluzhnikov