From patchwork Wed Jul 31 22:12:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Terekhov, Mikhail via Gdb-patches" X-Patchwork-Id: 33884 Received: (qmail 75145 invoked by alias); 31 Jul 2019 22:12:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 74984 invoked by uid 89); 31 Jul 2019 22:12:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1109, H*MI:google X-HELO: mail-vs1-f73.google.com Received: from mail-vs1-f73.google.com (HELO mail-vs1-f73.google.com) (209.85.217.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 31 Jul 2019 22:12:56 +0000 Received: by mail-vs1-f73.google.com with SMTP id v20so18193327vsi.12 for ; Wed, 31 Jul 2019 15:12:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=mrygP4uN9gcff7ApNW6v9jLTPFHm8hXb2lF3VIOG0oM=; b=fWJNWVLsNXcxM3Bkzu8jo6s9ti4E75Qjs1GefPTNlWEP4i3p+ScsE7Hf3oPD4BHxHn QjwyEuLiCvt5origEVtZtsm39gyMGC5LnHbEWtHcljdeFWcNzWMYtJHBAjs2RCEip9LK XObTg2HfPKTxjmhkIaFO4Y7d/mR/WLAsO+uwRPwiMdakyalAwQ9Rxj/AYJ5flS0WPpTJ AQkUpVcxoJhi0jpTz6yHhTmOeHsBn6k8PcAUKzHwoeay2AgKSbcCqyaMqF8o1dfskX/d vom6g3qwd/Da6d/jX46/fRJOlMAJfvYADVi9SKtpNVm7pvR4vGJXr9czEdhPVzsG+mqa ONAg== Date: Wed, 31 Jul 2019 17:12:52 -0500 Message-Id: <20190731221252.143637-1-cbiesinger@google.com> Mime-Version: 1.0 Subject: [PATCH] Add a comment briefly explaining partial symbols X-Patchwork-Original-From: "Christian Biesinger via gdb-patches" From: "Terekhov, Mikhail via Gdb-patches" Reply-To: Christian Biesinger To: gdb-patches@sourceware.org Cc: Christian Biesinger Based on an explanation by tromey on IRC. gdb/ChangeLog: 2019-07-31 Christian Biesinger * objfiles.h (objfile): Add a comment describing partial symbols. --- gdb/objfiles.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/objfiles.h b/gdb/objfiles.h index a0c106be3d..c7e0be1955 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -382,7 +382,13 @@ private: 2. Additional symbol files added by the add-symbol-file command, 3. Shared library objfiles, added by ADD_SOLIB, 4. symbol files for modules that were loaded when GDB attached to a remote system - (see remote-vx.c). */ + (see remote-vx.c). + + GDB typically reads symbols twice -- first an initial scan which just + reads "partial symbols"; these are partial information for the + static/global symbols in a symbol file. When later looking up symbols, + objfile->sf->qf->lookup_symbol is used to check if we only have a partial + symbol and if so, read and expand the full compunit. */ struct objfile {