From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 6D888385802D for ; Sun, 8 Aug 2021 14:35:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6D888385802D Received: from fencepost.gnu.org ([2001:470:142:3::e]:36856) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCjtD-0005sl-QY; Sun, 08 Aug 2021 10:34:59 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2174 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCjtD-0004J3-DX; Sun, 08 Aug 2021 10:34:59 -0400 Date: Sun, 08 Aug 2021 17:35:07 +0300 Message-Id: <83k0kwgg2s.fsf@gnu.org> From: Eli Zaretskii To: Mahmood Naderan Cc: gdb@sourceware.org In-Reply-To: <767694398.211875.1628429913388@mail.yahoo.com> (message from Mahmood Naderan via Gdb on Sun, 8 Aug 2021 13:38:33 +0000 (UTC)) Subject: Re: Error "No source file named" References: <767694398.211875.1628429913388.ref@mail.yahoo.com> <767694398.211875.1628429913388@mail.yahoo.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP, WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 14:35:01 -0000 > Date: Sun, 8 Aug 2021 13:38:33 +0000 (UTC) > From: Mahmood Naderan via Gdb > > When I want to set a breakpoint at a specific line number, I get the following error: > > (gdb) break /home/mahmood/accel-sim-framework/gpu-simulator/gpgpu-sim/src/gpgpu-sim/shader.cc:1656 > No source file named /home/mahmood/accel-sim-framework/gpu-simulator/gpgpu-sim/src/gpgpu-sim/shader.cc. > Make breakpoint pending on future shared library load? (y or [n]) > > > However, that line exists. > > $ sed -n 1656p /home/mahmood/accel-sim-framework/gpu-simulator/gpgpu-sim/src/gpgpu-sim/shader.cc >     printf("[Mahmood:shader.cc:1655] %" PRIu64 "\n", localaddr); Try using the command "info sources" to see what GDB knows about source file names of your program. And why don't you use just the base name of the file, i.e. just "shader.cc"?