From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id AD201386186E for ; Wed, 8 Nov 2023 15:49:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AD201386186E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AD201386186E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699458548; cv=none; b=VXdj7JpH0alfzgDPiZVPOJ0XaX4gauE/Qou0I6SD9fSoh1zZLunLRd4s5V0/DC3bpnxUH72R6UN5htr4uONnG6wiCxHTm1pEezlVNPaHVg3QwhpyNgoxUc0ry0SOWuy/xcluZBbdfmXiG9HW3y4pGIoeWQ/8NyVq5YB4bOT/++k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699458548; c=relaxed/simple; bh=7+HXbAWOv3mn8g7Z+6s9x/w3ErjF29Pi5Bj1A3Jq59o=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=F2oGb5jC4Re8c/CBBx83mufaGl/hbBlNZxYrpvItvdxY/zhDvtu8vW+iLQcbY72L1bG+GatohcYMHMj/JtcZYaioDS5CTqyWJigpHIFHZOcIrS7BOjd1YwG4bB8fet1NlWZDnw4+vEcPHPtUVkESaPNY6C9yWcZ/dEnZnIFpook= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699458546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uT549q1tr/Atx8tl2MO5QT8Bj4wrh4Pln9wv2FIjBak=; b=gB5pBSP5XhL+/BpzUlp+Kl9ydSk2vZ7dNiHLk1E6kPJs4VhO0EuNj6ZdN6o/f+szDyW5Am oIlE1BASGb8OOTQ9GmPy8rlaunIl7bxIioXuX3fBNZQxyScGwAXjZuWUAAHmSf5WQe6/HG iqxHvyorGq2Zr0vVOslTBMhJmQsqJcg= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-510-we3_fRzyP8yR31vdaNJQ5w-1; Wed, 08 Nov 2023 10:49:05 -0500 X-MC-Unique: we3_fRzyP8yR31vdaNJQ5w-1 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-507be692ce4so6924892e87.2 for ; Wed, 08 Nov 2023 07:49:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699458543; x=1700063343; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uT549q1tr/Atx8tl2MO5QT8Bj4wrh4Pln9wv2FIjBak=; b=WnS1aM8D9fgjwt/emjTSPzCMIi8fwjhZ8TAdcLXjU4kx9SiKXGnbc8Bc2HZZa0la/N N1L/HEq2rLHevLtUMr/Uc1HIYElBdT+oRo184iL4jy7O2xlCyL+prA+uWG0bwJKqjiek usP+XnM/P9yPsKpsWItJRLl7b2rT15S7tFNBoy7Qa4JXycDlsKFBPxd5X7Vw6QYlkhRz lQPY8BOrpR2Vf9tE4YopxNhLGNhjCC3ynlIP4apxRxtE9sP0RN8cx6yE/A+fKdF5Svku MleI6HB2EqDmS6BWxWnbMJjwrsM8+HV4kCOcrpLWRBFJzqjoxXWxBXIL6KSmoHeAdYhx xQWA== X-Gm-Message-State: AOJu0Yw91nbGt+V0IU32h4JAZ5ZIqIVM6W5Sx5Sc6+qVwPygf3Pz/1dJ B9NN7sk3n+drn71zpKIgbZ854ywd6OLpwVHywCdY4m8jevZmz/F+Yr5PxhszWmaEJ8ELL6yNv4y K/nZlkLhfov40KBkpBjWwCtQofUy84YEJV3Q4aDacXQ4/d7inD3PmIrh5dfAxpM/prcJ0cdyBZU XozyZbTw== X-Received: by 2002:a2e:680f:0:b0:2c5:13e8:e6d5 with SMTP id c15-20020a2e680f000000b002c513e8e6d5mr1919434lja.23.1699458543662; Wed, 08 Nov 2023 07:49:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFudjnwTuV/J6EI+2DSenLK4IpEy5MGb3xbOk9fZbVAUUob7uLTLkiZlBXdpCC7Z8mVS1WHbg== X-Received: by 2002:a2e:680f:0:b0:2c5:13e8:e6d5 with SMTP id c15-20020a2e680f000000b002c513e8e6d5mr1919415lja.23.1699458543270; Wed, 08 Nov 2023 07:49:03 -0800 (PST) Received: from localhost (105.226.159.143.dyn.plus.net. [143.159.226.105]) by smtp.gmail.com with ESMTPSA id m17-20020adff391000000b0032cc35c2ef7sm5248041wro.29.2023.11.08.07.49.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 07:49:02 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess , Tom Tromey Subject: [PATCHv2 0/5] New Python hook for missing debug information Date: Wed, 8 Nov 2023 15:48:54 +0000 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: This series adds a new Python hook to GDB, this hook allows a user to register a handler object which will be called whenever GDB fails to locate any debug information for an objfile it is loading. These handler objects can (potentially) perform host or project specific actions to help GDB locate the missing debug information. Commits #1 and #2 are refactoring. These merge the separate debug information lookup code from coffread.c and elfread.c. Commit #3 is more refactoring, this simplifies the now merged code. Commit #4 implements the framework for the new hook within GDB, but doesn't implement the Python side of things yet. Commit #5 is where I add the Python side of things, it's only at this point that a user can actually hook into GDB. --- Changes in v2: - Rebased onto current HEAD, - Make use of std::tie in patch #3, - Addressed Eli's doc comments in patch #5. --- Andrew Burgess (5): gdb/coffread: bring separate debug file logic into line with elfread.c gdb: merge debug symbol file lookup code from coffread & elfread paths gdb: refactor objfile::find_and_add_separate_symbol_file gdb: add an extension language hook for missing debug info gdb: implement missing debug handler hook for Python gdb/NEWS | 26 + gdb/coffread.c | 28 +- gdb/data-directory/Makefile.in | 2 + gdb/doc/python.texi | 140 ++++++ gdb/elfread.c | 57 +-- gdb/extension-priv.h | 7 + gdb/extension.c | 19 + gdb/extension.h | 62 +++ gdb/objfiles.h | 10 + gdb/python/lib/gdb/__init__.py | 41 ++ gdb/python/lib/gdb/command/missing_debug.py | 226 +++++++++ gdb/python/lib/gdb/missing_debug.py | 169 +++++++ gdb/python/py-progspace.c | 51 ++ gdb/python/python.c | 83 ++- gdb/symfile-debug.c | 157 ++++++ gdb/testsuite/gdb.python/py-missing-debug.c | 22 + gdb/testsuite/gdb.python/py-missing-debug.exp | 473 ++++++++++++++++++ gdb/testsuite/gdb.python/py-missing-debug.py | 120 +++++ 18 files changed, 1615 insertions(+), 78 deletions(-) create mode 100644 gdb/python/lib/gdb/command/missing_debug.py create mode 100644 gdb/python/lib/gdb/missing_debug.py create mode 100644 gdb/testsuite/gdb.python/py-missing-debug.c create mode 100644 gdb/testsuite/gdb.python/py-missing-debug.exp create mode 100644 gdb/testsuite/gdb.python/py-missing-debug.py base-commit: 3c09fd57e6f825672964581e152bd50b507e5630 -- 2.25.4