Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Paul Pluzhnikov <ppluzhnikov@google.com>
To: n179911 <n179911@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: how to set breakpoint at a particular line in cpp file
Date: Thu, 19 Nov 2009 23:05:00 -0000	[thread overview]
Message-ID: <8ac60eac0911182310g6edcaf0wf1940a7aafc647f9@mail.gmail.com> (raw)
In-Reply-To: <3b9893450911182243o2b078ac0w4e86ab1464aeaa0d@mail.gmail.com>

On Wed, Nov 18, 2009 at 10:43 PM, n179911 <n179911@gmail.com> 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.  Use 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


  reply	other threads:[~2009-11-19  7:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-19  7:30 n179911
2009-11-19 23:05 ` Paul Pluzhnikov [this message]
2009-11-20  6:20   ` n179911
2009-11-20 13:56     ` Paul Pluzhnikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ac60eac0911182310g6edcaf0wf1940a7aafc647f9@mail.gmail.com \
    --to=ppluzhnikov@google.com \
    --cc=gdb@sourceware.org \
    --cc=n179911@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox