From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pFMWW-0004bz-6f for mharc-grub-devel@gnu.org; Tue, 10 Jan 2023 16:51:12 -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 1pFMWU-0004b6-Ss for grub-devel@gnu.org; Tue, 10 Jan 2023 16:51:10 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFMWT-0002LH-9I for grub-devel@gnu.org; Tue, 10 Jan 2023 16:51:10 -0500 Received: by mail-pl1-x62b.google.com with SMTP id w3so14665393ply.3 for ; Tue, 10 Jan 2023 13:51:08 -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:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aTHZ5jwn+0RHFH4/dk7uWX8F0EF4dPOSIsyuKUfcy4s=; b=DYgbvZ583p8jKX9Z5OhQmijpZ0CtDL/FIk8gOkmv17TJw9hfVR808PczNIfwWpWQ/p kpSqMrbsLwhA55KO9J/049oxiYYK5oQZ3/3sir7aIDARN8RSDRljukXuGyTHbzBpNIrq 71taUoeFvB421kVjGAnCjvE6VEcPpOFEpCthmA0VHrI/lKxmzuJgZfG32O9+22c4UfIn XUyTmcjDAEsyiqVmRpffpC7zUSpz8JmPBX8keUXS5aUkvbQVplpQ9CAgx+t/FN+uGYdn 4nWKfwpCMNTxlbCIIzLzgJt8Y5ad9OXcKa0hfq8fw1JQjIYyjZYJYtfjmRIWjJPo3HEC otmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=aTHZ5jwn+0RHFH4/dk7uWX8F0EF4dPOSIsyuKUfcy4s=; b=Qv2qG3LTasfhu2quX9sljHNTIXbUhw7VG06J7Oiz8hFYULYAY8hRRMnvnJMg9T5hP8 qK0Y6Fm/byZr4eIXBeeXkAmgmGMsPl3m+JsttyvVbxDzhWaCVgzjDcTI0cRynDUzdF7Z qRcnOb2ogk4u5CsMsbcLLkDi+KdYtx8E0TbNTc52Sl4wj74XEUDDcQqZLzABV5WyE/2m ziZhqQNWwEPcjl3Mx50LhAyv6MT+JtyIpV1yprSBsq25OaEmwAh5gq3dpOek9/9Udf8A gy7QKOXMoNSKnwl+X8aPHkEpTl2ics5rqVP0mjrBkbPivOdO0iG1Vz/1vFUO8HuH8qmP XXFg== X-Gm-Message-State: AFqh2kri1+B7Zi4ExqAbIjaMe56iRPEYyFVnUyLxS+zM7r2mRMGCwewf Jg4bw9fLc8pxqnOqK4N3tnC18b9RYsG2pBHY X-Google-Smtp-Source: AMrXdXu5ypPSt2G3smQWy17aphfudTJQ9oede0OpcKY9rqKlaVaXBAXzNCR6iSvO58fGGoSGtFhTnw== X-Received: by 2002:a17:902:f78e:b0:186:a43b:a5 with SMTP id q14-20020a170902f78e00b00186a43b00a5mr77713255pln.13.1673387467507; Tue, 10 Jan 2023 13:51:07 -0800 (PST) Received: from crass-HP-ZBook-15-G2.lan ([199.254.238.56]) by smtp.gmail.com with ESMTPSA id u15-20020a1709026e0f00b00186c3af9644sm7760798plk.273.2023.01.10.13.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 13:51:06 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Robbie Harwood , Peter Jones , Glenn Washburn Subject: [PATCH v6 03/14] gdb: If no modules have been loaded, do not try to load module symbols Date: Tue, 10 Jan 2023 15:50:30 -0600 Message-Id: <20230110215041.1247699-4-development@efficientek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230110215041.1247699-1-development@efficientek.com> References: <20230110215041.1247699-1-development@efficientek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=development@efficientek.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: Tue, 10 Jan 2023 21:51:11 -0000 This prevents load_all_modules from failing when called before any modules have been loaded. Failures in GDB user-defined functions cause any function which called them to also fail. Signed-off-by: Glenn Washburn --- grub-core/gdb_grub.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grub-core/gdb_grub.in b/grub-core/gdb_grub.in index edb5a8872c..fc17e3d899 100644 --- a/grub-core/gdb_grub.in +++ b/grub-core/gdb_grub.in @@ -63,7 +63,9 @@ define load_all_modules dump_module_sections $this set $this = $this->next end - match_and_load_symbols + if (grub_dl_head != 0) + match_and_load_symbols + end end document load_all_modules Load debugging information for all loaded modules. -- 2.34.1