From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31777 invoked by alias); 8 Jul 2005 14:19:07 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 31687 invoked by uid 22791); 8 Jul 2005 14:18:56 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 08 Jul 2005 14:18:56 +0000 Received: from drow by nevyn.them.org with local (Exim 4.51) id 1Dqtgs-0004ex-Lo; Fri, 08 Jul 2005 10:18:54 -0400 Date: Fri, 08 Jul 2005 14:19:00 -0000 From: Daniel Jacobowitz To: Klaus Zeitler Cc: gdb@sources.redhat.com Subject: Re: gdb needs full C++ function signature to set a breakpoint Message-ID: <20050708141853.GA17776@nevyn.them.org> Mail-Followup-To: Klaus Zeitler , gdb@sources.redhat.com References: <20050707185717.GA11441@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-07/txt/msg00083.txt.bz2 On Fri, Jul 08, 2005 at 04:09:44PM +0200, Klaus Zeitler wrote: > I figured out the difference between my small example and the big image. > For the example image gdb correctly recognizes the program as C++, i.e. says: > "The current source language is "auto; currently c++"." > whereas for the real image gdb claims, that it's c. > So a simple "set lang c++" is all that was needed. > > Now I would like to know why gdb thinks that this is a c image. > Could it be that gdb decides that by searching main()? GDB does not have a single impression of the language - it depends on the current location in the code. But yes, before the program is started, the current "location" used is main(). This is a wart; it'd be nice if the CLI did not depend on this for some things that it does presently, but it isn't clear how to fix it. -- Daniel Jacobowitz CodeSourcery, LLC