From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id o6oyO3MCZWWtBhEAWB0awg (envelope-from ) for ; Mon, 27 Nov 2023 15:56:19 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=h7ZnRMTx; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E33CD1E11B; Mon, 27 Nov 2023 15:56:19 -0500 (EST) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id CFBD61E091 for ; Mon, 27 Nov 2023 15:56:17 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4CB8E3861818 for ; Mon, 27 Nov 2023 20:56:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4CB8E3861818 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1701118577; bh=WRqyw+taUvUdOuMeWL+ELF5HAaCbtxsmNju+qj4+z1M=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=h7ZnRMTx5c+84Qikz45R1p49zp/nUH4OIIqk6bWgIxyseHMlkOepNV1Hsv2bgfVgj 7kVeT7tIG5fmnxwbWCcBfiydsKl7a0uxI3AWkqByHWkSVKymn8mKCw2GOrJJKwFnoU 4EVlnFkbiY1N45v5BVquStCBq2YpXKDjE5isfHHQ= Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) by sourceware.org (Postfix) with ESMTPS id D59CE3858C2D for ; Mon, 27 Nov 2023 20:55:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D59CE3858C2D ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D59CE3858C2D ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701118535; cv=none; b=Af8NSXHQ6cuBTgwtuGA+RlODAJmiOlPBTT5Q04Qi0EoNDJOPak16ZTfIo2C2pMz+XbT0NEigetbubTQTWdU5t6F3g+SHXDJOBbwbNJqu/Z0AuQEVgtlcmRrsfvre1hSHlezuHi6Qyd0bNQIANwlWIfEvYp4KO/OXM81KrAsQJU4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701118535; c=relaxed/simple; bh=WRqyw+taUvUdOuMeWL+ELF5HAaCbtxsmNju+qj4+z1M=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=l88WM1VVa2WsAUyyHMsQpHpQeW9PJB/z9ljpmaVs6BNmYbRnyBiMi4gBhIvNGI7d7UYszEhB2HXMDlRJeGSqe3/kAPSsQ7HRwX7spPxIzfiaD3+gM6Hlc1AtyyWCLFxdy6peOhYdYqZr4Q7TRAaNIaX21TlbJtIOq/FM8kc3qas= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-5ccf74a2445so9274787b3.1 for ; Mon, 27 Nov 2023 12:55:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701118531; x=1701723331; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=WRqyw+taUvUdOuMeWL+ELF5HAaCbtxsmNju+qj4+z1M=; b=aAFX9aFz7C5Cxpmr0SBYRpWtsBpenlp5ml8Ba0ETnURC+eLpElP4Tno4wJu4Ka9D5L 24LK4CrDAzHC5LEgEal8AsydfkujLTOjBVO9WftGFOrO0ims2E0e6uE71ke5BvOnbKqR tjwcCQUnxPqwS44wSx5YusupSJ8ZptB974F+13tkKL8idwQcatYg/Us2hpd+AHDKNwp1 CCZD148L2UIlPAdrdery8t7Z3KguDubtE3wfl80qE0H69kwAHTeHKcZmIvjrunwlNRYj 1Brr9jfyBwHW5fxoiMWI2WkkfO08hVJ469hQvFoTxzUvAV8TSPW492qYmqcu2nYlx0FZ qLOg== X-Gm-Message-State: AOJu0YwWOuoQMt8/bJgLxr+KfC9KFw4PNgxIQ8oxZ3E70VGPnPDfKjmR Fw0ESTmDf6gm3FeNoLB+7NOETjZb2vNpVbRyz92U/BO2jos= X-Google-Smtp-Source: AGHT+IHPK8KUH93h7qpVrquLlKivNdnLMU2JbjhLEUIYJww5zXe7xcnbLympLqWvqJ2mgdA7QGTF/7OK4Jvf1VSDt8g= X-Received: by 2002:a0d:d64a:0:b0:5cc:87d0:7b64 with SMTP id y71-20020a0dd64a000000b005cc87d07b64mr8257156ywd.3.1701118530728; Mon, 27 Nov 2023 12:55:30 -0800 (PST) MIME-Version: 1.0 Date: Mon, 27 Nov 2023 12:55:19 -0800 Message-ID: Subject: set sysroot and debug-file-directory don't work together? To: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=0.4 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mike Tsai via Gdb Reply-To: Mike Tsai Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" Greetings everyone, I have a dummy question regarding using "set sysroot LOCAL_DIR" and "set debug-file-directory SOME_OTHER_DIR" together to find symbols for a debug session. I was under the impression, gdb is able to fallback to debug-file-directory and do build-id style lookup if symbols cannot be found in "sysroot", but it does not seem to be doing that so I am curious if it's I am doing something wrong or this is not "supported". A little context, we are doing embedded device debugging for Linux based platform hence, the target device will not have sufficient space to host all debug symbols. We have most of the debug symbols in the "sysroot", and for something that is built outside, we want to export additional symbols look up through debug-file-directory and debug over gdb+gdbserver. I will share my gdbinit as well. It isn't terribly sophisticated :) and I am on GNU gdb (GDB) 11.2 ``` set verbose on set pagination off set sysroot /path/to/rootfs set debug-file-directory /path/to/more-debug/ set substitute-path /usr/src/debug /path/to/rootfs/usr/src/debug set detach-on-fork on set follow-fork-mode child target remote :5039 where ``` I am trying to debug a binary whose symbols do not exist in the "sysroot", so I expect the symbols to be picked up from debug-file-directory, but above isn't working as it seems if sysroot is specified, it will not fallback to debug-file-directory. If I comment out sysroot line, GDB will attempt to load the debug symbols through the local build-id/ mechanism as I would expect, but then it will not have additional libs debug provided by the "sysroot". So yap, this is what I am struggling with currently and would like to know if I am not configuring something right or this is expected behavior and how to get it to work the way I intend to use this. Thanks, Mike