From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1p5iN6-0007R9-Lb for mharc-grub-devel@gnu.org; Thu, 15 Dec 2022 02:09:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5iN4-0007Qc-BM for grub-devel@gnu.org; Thu, 15 Dec 2022 02:09:34 -0500 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5iN1-00081l-3q for grub-devel@gnu.org; Thu, 15 Dec 2022 02:09:33 -0500 Received: by mail-qt1-x82e.google.com with SMTP id c7so4484435qtw.8 for ; Wed, 14 Dec 2022 23:09:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qYNC3OlWXFWZJZSrOG/TBh0YjM0L3oPrt3e+UtplGqk=; b=AVQ9Mzzvo6qrhich5DO6ZBMRCzDuhlaUO+VrcpJ+mnzWxyGaTAmQjoLpJUoAYkkyZ/ 4C8WzNWpDvYHzRlLiudTxknqwmcoxtqCyaWcSB7mrEzVeOFoAlvCVLUl0MPGk6GxmOlT 7Gs7RBMHgBv6rlKDpwGY3BJxDQURrvI3lvlslvTj8d7PTO4q18kTvnrrvzES5xUkNdsI iMjNqUjfiJXq6q7P8xNZ4bo7SbD89fkF/qosgW6QACMjOPvQXX4XX9svw1iYjQ2FJXMY fYq8visTm6mxGsHdoy76NYnxrIdABGRYjojnnDkoNE0RlW68yXGnKmt2xUwkaiin3EPo HjHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qYNC3OlWXFWZJZSrOG/TBh0YjM0L3oPrt3e+UtplGqk=; b=eqWMZLs3IjdM2mfPXkdmtoAwJqiuSpC/lBHNxBwHAAi3jONCZUY33tAKMVVEBPqFLq R8xsSQm2etblyL80PJyCzlTpHLPj7CoEiWDSvGfUE8nlVYcg3y9CFk5MfBMX2sFLwbNJ iC4KIUibKs/HB7tygQxZEAuPMMoQb1AUjmk84WoLamnASnbFIB+IYg+Xb+/OxZasmnc3 tICXVzMdjgiF2F6/IDN97ouZwUz7T9FKEzfg0zEszNttaj1igPeT4tmt/+Nhsnrf9/mX vRqYdW0h4FVe8XzYmJ8A/7U5SE01gdBg0FuX8NbNwEKGf0UdvbSbaG6tibScVkPfnkn2 iVmA== X-Gm-Message-State: ANoB5plo1kT6/we5vGEwD13P2nQsKqV/XV8edYvMTDHXlcQRqyyfj6t3 daM3ZSJt6dhShW8me4og+5OT9MO7aHBR6vmc X-Google-Smtp-Source: AA0mqf4ifKVZ4p/38enX/Qov7Zwj6IJkwTl4dco5oVmL6Xe1ZK/oIU/ao2nG6C7ukb57g7LHXzd3Tw== X-Received: by 2002:ac8:6654:0:b0:3a7:eb78:2836 with SMTP id j20-20020ac86654000000b003a7eb782836mr40413558qtp.38.1671088168720; Wed, 14 Dec 2022 23:09:28 -0800 (PST) Received: from crass-HP-ZBook-15-G2.lan ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id fy16-20020a05622a5a1000b003a7ec97c882sm3125068qtb.6.2022.12.14.23.09.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 23:09:27 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Glenn Washburn Subject: [PATCH v3 00/15] GDB script fixes and improvements Date: Thu, 15 Dec 2022 01:07:35 -0600 Message-Id: <20221215070750.102591-1-development@efficientek.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::82e; envelope-from=development@efficientek.com; helo=mail-qt1-x82e.google.com X-Spam_score_int: 14 X-Spam_score: 1.4 X-Spam_bar: + X-Spam_report: (1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2022 07:09:34 -0000 v3 changes: Use correct automake macro for target cpu There's been a lot of changes since v1. There are more fixes and more features. The majority of the shell code has been moved to an external file named gdb_helper.sh, instead of being inline in the GDB script. The one (direct) PERL dependency in GRUB has been removed and converted to shell script. Also a section on debugging is added to the developer docs. Glenn Glenn Washburn (15): gdb: Fix redirection issue in dump_module_sections gdb: Prevent wrapping when writing to .segments.tmp gdb: If no modules have been loaded, do not try to load module symbols gdb: Move runtime module loading into runtime_load_module gdb: Get correct mod variable value gdb: Do not run load_module if module has already been loaded gdb: Add functions to make loading from dynamically positioned targets easier gdb: Remove Perl dependency for GRUB GDB script gdb: If enabled, print line used to load EFI kernel symbols when using gdb_grub script gdb: Conditionally run GDB script logic for dynamically or statically positioned GRUB gdb: Only connect to remote target once when first sourced gdb: Allow user defined "onload_" command to be run when module is loaded gdb: Allow running user-defined commands at GRUB start gdb: Add ability to turn on shell tracing for gdb helper script docs: Add debugging chapter to development documentation config.h.in | 3 + docs/grub-dev.texi | 191 ++++++++++++++++++++++++++++++++++ grub-core/Makefile.core.def | 4 +- grub-core/gdb_grub.in | 198 ++++++++++++++++++++++++++++++++---- grub-core/gdb_helper.sh.in | 108 ++++++++++++++++++++ grub-core/gmodule.pl.in | 30 ------ grub-core/kern/efi/efi.c | 4 +- grub-core/kern/efi/init.c | 19 +++- include/grub/efi/efi.h | 2 +- 9 files changed, 501 insertions(+), 58 deletions(-) create mode 100644 grub-core/gdb_helper.sh.in delete mode 100644 grub-core/gmodule.pl.in Range-diff against v2: 1: 1cc0b2564f = 1: ec2b71c403 gdb: Fix redirection issue in dump_module_sections 2: 061d29407a = 2: f350ddf3c9 gdb: Prevent wrapping when writing to .segments.tmp 3: 65d35d5c4d = 3: 75949e0d8e gdb: If no modules have been loaded, do not try to load module symbols 4: 98f623bc32 = 4: ed5599b842 gdb: Move runtime module loading into runtime_load_module 5: 901cce11e8 = 5: e00aa463bb gdb: Get correct mod variable value 6: 6ad80d3538 = 6: c1e0439012 gdb: Do not run load_module if module has already been loaded 7: 11b687f39f = 7: dc8ce82e27 gdb: Add functions to make loading from dynamically positioned targets easier 8: 5afdb8b08e = 8: dc7338f00a gdb: Remove Perl dependency for GRUB GDB script 9: 5043a2afae ! 9: 0ee5cb7cc1 gdb: If enabled, print line used to load EFI kernel symbols when using gdb_grub script @@ grub-core/kern/efi/efi.c: grub_efi_get_variable (const char *var, const grub_efi +grub_efi_section_addr (const char *section_name) { grub_efi_loaded_image_t *image; - struct grub_pe32_header *header; + struct grub_msdos_image_header *header; @@ grub-core/kern/efi/efi.c: grub_efi_modules_addr (void) i < coff_header->num_sections; i++, section++) 10: 9fb80f98b4 = 10: 7ec11bff7e gdb: Conditionally run GDB script logic for dynamically or statically positioned GRUB 11: 9645210fe5 = 11: e62defbaa7 gdb: Only connect to remote target once when first sourced 12: effc51d9f1 = 12: 0101c41233 gdb: Allow user defined "onload_" command to be run when module is loaded 13: 64797129bb ! 13: 94f4707b14 gdb: Allow running user-defined commands at GRUB start @@ grub-core/gdb_grub.in: set confirm off # fail. set $platform_efi = $_streq("@platform@", "efi") -+set $target = "@target-cpu@-@platform@" ++set $target = "@target_cpu@-@platform@" if ! $runonce if $platform_efi 14: b07b037728 = 14: 5fbef49d07 gdb: Add ability to turn on shell tracing for gdb helper script 15: 270d7722e6 = 15: b1f6f5861b docs: Add debugging chapter to development documentation -- 2.34.1