From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10729 invoked by alias); 11 Jun 2007 17:22:36 -0000 Received: (qmail 10716 invoked by uid 22791); 11 Jun 2007 17:22:35 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 11 Jun 2007 17:22:33 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id D56FA982DC; Mon, 11 Jun 2007 17:22:30 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 98E39982D1; Mon, 11 Jun 2007 17:22:30 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1HxnbI-0003rc-N8; Mon, 11 Jun 2007 13:22:44 -0400 Date: Mon, 11 Jun 2007 17:22:00 -0000 From: Daniel Jacobowitz To: kdsfinger@gmail.com Cc: gdb@sourceware.org Subject: Re: gdb breakpoint problem Message-ID: <20070611172244.GA14695@caradoc.them.org> Mail-Followup-To: kdsfinger@gmail.com, gdb@sourceware.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.15 (2007-04-09) 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: 2007-06/txt/msg00081.txt.bz2 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