Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pUXO1-0001w0-BJ for mharc-grub-devel@gnu.org; Tue, 21 Feb 2023 13:29:09 -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 1pUXO0-0001vT-00 for grub-devel@gnu.org; Tue, 21 Feb 2023 13:29:08 -0500 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUXNy-0004AZ-IZ for grub-devel@gnu.org; Tue, 21 Feb 2023 13:29:07 -0500 Received: by mail-qt1-x832.google.com with SMTP id d7so5258492qtr.12 for ; Tue, 21 Feb 2023 10:29:06 -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=uRli4vr9ZduPvwXb7toQBgmYLOPHRML6a4lLcZ4ztVW8EmRLA5WIlagrwU0XWMjn53 ICPywr2T24Ew/IJCa+gyIlHJ7xsnlmYw7NXyuETKWFYnOK1SjcIpNu7qLnHcArdHNlH3 zukRqsr9g3A+zoG3dJCsC4MblyaiuF9bhUlKgVVkvAutya4IVJOHGZk4x5UpiVpiehzo ZOnX7I1I6fmD+vQ2iQ5uuLkwMdaoxXuDvmOAD/bnyrwRM7n4JyAxGamKse8V5g2oL7hV 4HfOvGsZFpyixtLhchptzaCPQe2sjmnC57E9+bU4mQCJLNFyjYCIfkoV4q9dWhErOQgs Dixg== 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=cYgSQj5mM7FITU3JEaNTMMApMA/Bru+3JL0ap6rLkG5KL6/b9L91SJhZaC8l3hGuRK 1sD6ow4dnLCU29NayPRLgwomLzGGbS+ZC3kKF10lXLyI/n1sJIspHlghTrSSjVosjJA4 TTo2E8+X++GyOCbd/sBu3mfJxoRoCAiPzaF+BVpWdMgjvwNIeIMbYP/FDOAiBIg+Ls81 OzfJUGC5g22xW7YItgVHvUiYHnjH6hfS0JCu4IcWeW75qoINxpRepTYQC6TI2fDl64kG BBH06wuR1+6SlKBR9LjIyFaRETVsEjIduTIW0M9VyEan3QQdk+8v98jPsSoWiRHrmu3Y wvrQ== X-Gm-Message-State: AO0yUKUyy/TukGheOdqE6jtjtn1aqKMvDp6V2WVcPvzbjy59z1nac9Hz AuzHFXSETwbOA2/uZk8TuvLDQYAxsu4MgDRi X-Google-Smtp-Source: AK7set9agzTT0r6z23AO7LM5KROWf0edNTUEpptIy47IX1hUiZu4/cQGypGgJ7yryWD/IWx87hZTmw== X-Received: by 2002:ac8:57c1:0:b0:3bf:a6db:6108 with SMTP id w1-20020ac857c1000000b003bfa6db6108mr2512765qta.53.1677004145305; Tue, 21 Feb 2023 10:29:05 -0800 (PST) Received: from localhost.localdomain ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id h5-20020ac85045000000b003bd1a464346sm9339118qtm.9.2023.02.21.10.29.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 10:29:04 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Glenn Washburn Subject: [PATCH 3/3] gdb: If no modules have been loaded, do not try to load module symbols Date: Tue, 21 Feb 2023 12:28:48 -0600 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::832; envelope-from=development@efficientek.com; helo=mail-qt1-x832.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, 21 Feb 2023 18:29:08 -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