Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: kdsfinger@gmail.com
Cc: gdb@sourceware.org
Subject: Re: gdb breakpoint problem
Date: Mon, 11 Jun 2007 17:22:00 -0000	[thread overview]
Message-ID: <20070611172244.GA14695@caradoc.them.org> (raw)
In-Reply-To: <cac7ac540706110959rec252b8kc210f4ef8b4fe204@mail.gmail.com>

On Mon, Jun 11, 2007 at 12:59:57PM -0400, kdsfinger@gmail.com wrote:
> 	int *a;  //line 24
> 	int i; //line 25
> 	a = (int *)malloc((argc - 1) * sizeof(int)); // line 26

> As you can see, the program did not stop at the breakpoint on line24.
> It stops at line26. If I add another breakpoint on line25, this 2nd
> breakpoint is skipped as well and the program stops at line26. Why is
> that? How can I correct it?

A variable declaration does not require any machine instructions.  So
the compiler does not emit any, and there is nowhere that the program
can stop.

> On my own program which is rather big, it got the same problem. When I
> use info break xxx, it sometimes point to a different place in "What".
> For example, I placed the breakpoint in main line 100, but the "what"
> points to other functions in different line.

That is probably a bug in GDB, but we would need a test case to be
sure.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2007-06-11 17:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-11 17:00 kdsfinger
2007-06-11 17:22 ` Daniel Jacobowitz [this message]
2007-06-11 17:36 ` Jim Blandy
2007-06-11 20:21   ` Eli Zaretskii
2007-06-12  3:33   ` kdsfinger
2007-06-12 11:19     ` Daniel Jacobowitz
2007-06-12 11:29       ` Dave Korn

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=20070611172244.GA14695@caradoc.them.org \
    --to=drow@false.org \
    --cc=gdb@sourceware.org \
    --cc=kdsfinger@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