From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D59CE3858C2D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1131 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701118531; x=1701723331; darn=sourceware.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=WRqyw+taUvUdOuMeWL+ELF5HAaCbtxsmNju+qj4+z1M=; b=daNirSHeSl13HaoYHzmdHPFhdb7jxyS/Eyu+Z4ZztocEQBJi5uHyADK0KPqwhgZsg0 +ACtUDuaGWQ4PGYAnbYF2zaOsL2ZGm1qwCtlFOBT4WFkHTyohWF6CggQ+gAuBWFRMBu2 FY8PSLstKGyg9wvEG6tDuXWETSW+PeL7QdWLbuiEqdLulGNB1xTqNqKSS5A1agf4t646 C3zDgs5Xeh0AFSIR92184SSZzuDXYqHzmRl0BBsQTv3gITkinXfFQa0WI6h30q5pfvVc yRsIgQhyBhRdtX+yX8qDUo2vyMr3MrDWztCWIm5nKkafC35UerMJqocUKacTaJ3sCau2 57kQ== 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 From: Mike Tsai 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 List-Id: 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