From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by sourceware.org (Postfix) with ESMTPS id 465CB3858420 for ; Sun, 8 Aug 2021 22:27:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 465CB3858420 Received: by mail-pj1-x1032.google.com with SMTP id j1so24986847pjv.3 for ; Sun, 08 Aug 2021 15:27:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=Xt7bNG8my3QbKxgE9pwdUEA/TY51qM8QkL4UGCs1EyY=; b=kKvunfxuzJ1VkDMO5wR+9p/AO18JBHvtbuodlBgg9j+Av1bVBppGicQnMELWH73KKp z0IrOTkfZmbHLgtWI0PNB8Kbj4Okx0NUX6b7KJrmqmYBKC8f1VccJ6+gFsL1dLK+OW0o dVy766l6c+q3uo6ljyAjp5mJzeIW2Ww3X0iVjrmhXwzJu54gTyVDE5syFNORbqbW+n2e 2LzKd6v1rr7y21lWDczl5C2VQr8lZTQuMPIvG13WN4y/ov0dFQ0lQpDvap4xWYdSVRxy tFATSUSbTX8cM242LMcgd2efvVgolVvK/l9mY35OvXClw/eGntNa0ShAlEnh3rv4WI01 +8xQ== X-Gm-Message-State: AOAM531QK/sUfXXFNuzjHcmYe+HsfHiNf3FdqXEZEyht07juTpAlbG55 HQFv4hbMhSg2KYdHVDEAIdpA7YM6XEtdCyAhZGGUXw4YYwJyOQ== X-Google-Smtp-Source: ABdhPJxS89o6123g+2ZsBMUuzxQZZUwKoJQkHyaeQAzZjnSy0ySO7UqAbeS6bLA+vXU0BLODNqzW7adOC/lRrSh4YlM= X-Received: by 2002:a17:90a:d190:: with SMTP id fu16mr33258939pjb.157.1628461667444; Sun, 08 Aug 2021 15:27:47 -0700 (PDT) MIME-Version: 1.0 References: <767694398.211875.1628429913388.ref@mail.yahoo.com> <767694398.211875.1628429913388@mail.yahoo.com> <83k0kwgg2s.fsf@gnu.org> <863850548.219085.1628435181352@mail.yahoo.com> <877dgwc5qv.fsf@igel.home> <569018761.219127.1628438476158@mail.yahoo.com> <2120078511.233484.1628440503952@mail.yahoo.com> <1031092808.203448.1628442915048@mail.yahoo.com> In-Reply-To: <1031092808.203448.1628442915048@mail.yahoo.com> Reply-To: noloader@gmail.com From: Jeffrey Walton Date: Sun, 8 Aug 2021 18:25:24 -0400 Message-ID: Subject: Re: Error "No source file named" To: Mahmood Naderan Cc: Mahmood Naderan via Gdb Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 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 22:27:49 -0000 On Sun, Aug 8, 2021 at 1:15 PM Mahmood Naderan wrote: > > >You might also find -fdebug-prefix-map useful. It allows you to tell > >the debugger where to locate source files for object files if the > >source files have been relocated to a directory like /lib/src. It may > >help here, too. > > That gcc switch needs two paths (old and new). > I don't know what is old and new then. I use a script like the one shown below. I assume you are installing your warez into $HOME. You would use --prefix=$HOME when configuring. So binaries are in $HOME/bin, libraries are in $HOME/lib, etc. Use -fdebug-prefix-map as an option to CFLAGS and CXXFLAGS like so: -fdebug-prefix-map=${PWD}="${HOME}/src/gpu-simulator" Then, after configure, make and make install, execute the script: # run from the gpu-simulator directory, where you configure bash copy-sources.sh "${PWD}" "${HOME}/src/gpu-simulator" Here's the copy-sources.sh script: $ cat copy-sources.sh #!/usr/bin/env bash src_dir="$1" dest_dir="$2" if [[ -z "${src_dir}" ]]; then echo "Please specify a source directory" exit 1 fi if [[ ! -d "${src_dir}" ]]; then echo "Source directory is not valid" exit 1 fi if [[ -z "${dest_dir}" ]]; then echo "Please specify a destination directory" exit 1 fi cd "${src_dir}" || exit 1 rm -rf "${dest_dir}" mkdir -p "${dest_dir}" IFS= find "./" \( -name '*.h' -o -name '*.hpp' -o -name '*.hxx' -o \ -name '*.c' -o -name '*.cc' -o \ -name '*.cpp' -o -name '*.cxx' -o -name '*.CC' -o \ -name '*.s' -o -name '*.S' \) -print | while read -r file do # This trims the leading "./" in "./foo.c". file=$(echo -n "${file}" | tr -s '/' | cut -c 3-); cp --parents --preserve=timestamps "${file}" "${dest_dir}" done exit 0 Jeff