From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20074 invoked by alias); 20 Mar 2015 07:59:51 -0000 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 Received: (qmail 20063 invoked by uid 89); 20 Mar 2015 07:59:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_20,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout27.012.net.il Received: from mtaout27.012.net.il (HELO mtaout27.012.net.il) (80.179.55.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Mar 2015 07:59:48 +0000 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NLI00O002YDAK00@mtaout27.012.net.il> for gdb@sourceware.org; Fri, 20 Mar 2015 09:54:28 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NLI00JMP3AS1W50@mtaout27.012.net.il>; Fri, 20 Mar 2015 09:54:28 +0200 (IST) Date: Fri, 20 Mar 2015 07:59:00 -0000 From: Eli Zaretskii Subject: Re: No source file named getopt.c. In-reply-to: To: Fei Ding Cc: gdb@sourceware.org Reply-to: Eli Zaretskii Message-id: <83a8z8w13l.fsf@gnu.org> References: X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00073.txt.bz2 > Date: Fri, 20 Mar 2015 14:09:00 +0800 > From: Fei Ding > > I want to set a break point on some code in getopt.c, but I just got: > > //////////////////////////////////////////// > (gdb) b getopt.c:100 > No source file named getopt.c. > //////////////////////////////////////////// > > then, I did this to add the source directory of that code, as: > > //////////////////////////////////////////// > (gdb) directory /home/dingaaa/test/gdb-7.6/libiberty/ > Source directories searched: /home/dingaaa/test/gdb-7.6/libiberty:$cdir:$cwd > //////////////////////////////////////////// > > but still, I get > //////////////////////////////////////////// > (gdb) b getopt.c:100 > No source file named getopt.c. > //////////////////////////////////////////// > > BTW: I've changed Makefiles, with `-g -O0` > > What's the problem? You can only do this when debugging a program that has getopt.c compiled in. Since you give no details on how you built that program, it's hard to say something more intelligent.