Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: costin_c <costin.cosoveanu@gmail.com>
To: costin_c <costin.cosoveanu@gmail.com>, gdb@sourceware.org
Subject: Re: break on a external source file
Date: Sat, 22 Sep 2007 13:52:00 -0000	[thread overview]
Message-ID: <dadde8860709220351s6e881a5dlda55c91c0240999c@mail.gmail.com> (raw)
In-Reply-To: <20070921223918.GA27875@caradoc.them.org>

On 9/22/07, Daniel Jacobowitz <drow@false.org> wrote:
> On Sat, Sep 22, 2007 at 01:21:31AM +0300, costin_c wrote:
> > How can I tell to gdb to put a breakpoint on a given line in C++
> > source file, located in directory situated other than current one ?
>
> You're doing it right.  The problem doesn't have to do with that, but
> with this:
> >      4  Print::Print(int v)
> >      5  {
> >      6      val=v+v;
> >      7  };
>
> That's a constructor.  This is a known bug in GDB, for which Vladimir
> Prus has recently posted patches.
>

For line 11 form  Print::print() in  works fine
    9  void Print::print()
   10  {
   11      std::cout<<val<<std::endl;
   12  }

break dir/print.cc:11
Breakpoint 1 at 0x80486d0: file dir/print.cc, line 11.
(gdb) info break
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x080486d0 in Print::print() at dir/print.cc:11
(gdb) r
Starting program: /home/user/print
Failed to read a valid object file image from memory.

Breakpoint 1, Print::print (this=0xbfb2c340) at dir/print.cc:11
11          std::cout<<val<<std::endl;
(gdb) n
200
12      }
(gdb) n
main () at main.cc:7
7           return 0;


  reply	other threads:[~2007-09-22 10:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-21 22:39 costin_c
2007-09-22  1:10 ` Daniel Jacobowitz
2007-09-22 13:52   ` costin_c [this message]
2007-09-22 14:08     ` Daniel Jacobowitz
2007-09-22 15:37   ` Claus Baumgartner
2007-09-23  2:36     ` Daniel Jacobowitz

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=dadde8860709220351s6e881a5dlda55c91c0240999c@mail.gmail.com \
    --to=costin.cosoveanu@gmail.com \
    --cc=gdb@sourceware.org \
    /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