From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1180 invoked by alias); 20 Jun 2011 17:40:29 -0000 Received: (qmail 918 invoked by uid 22791); 20 Jun 2011 17:40:26 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from quechua.inka.de (HELO mail.inka.de) (193.197.184.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Jun 2011 17:40:10 +0000 Received: from raven.inka.de (uucp@[127.0.0.1]) by mail.inka.de with uucp (rmailwrap 0.5) id 1QYiSG-0003Gk-6D; Mon, 20 Jun 2011 19:40:08 +0200 Received: by raven.inka.de (Postfix, from userid 1000) id E8084760EA; Mon, 20 Jun 2011 19:39:58 +0200 (CEST) Date: Mon, 20 Jun 2011 17:40:00 -0000 From: Josef Wolf To: gdb@sourceware.org Subject: Gdb shows wrong line numbers for the sourcecode Message-ID: <20110620173958.GA28683@raven.wolf.lan> Mail-Followup-To: Josef Wolf , gdb@sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2011-06/txt/msg00122.txt.bz2 Hello, I have built a toolchain for ARM Cortex-M3 based on binutils-2.20 gcc-4.4.3 gdb-6.0 openocd-0.4.0 With this combination, gdb shows wrong line numbers and wrong lines in the source listings and in the backtrace like this: (gdb) bt #0 0x080004a6 in main (argc=536891392, argv=0x20005000) at main.c:45 (gdb) cont Continuing. Breakpoint 2, 0x080003a4 in send_char (ch=19 '\023') at main.c:45 45 while (RCC_GetFlagStatus (RCC_FLAG_PLLRDY) == RESET) { (gdb) bt #0 0x080003a4 in send_char (ch=19 '\023') at main.c:45 #1 0x080004ca in main (argc=536891392, argv=0x20005000) at main.c:45 In reality, the main function begins at line 91 and the send_char function begins at line 84. The source code line shown at the breakpoint is a totally different function. Any ideas what could cause gdb to get confused?