Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nJSHN-0007V2-U7 for mharc-grub-devel@gnu.org; Sun, 13 Feb 2022 22:43:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJSHN-0007Te-6O for grub-devel@gnu.org; Sun, 13 Feb 2022 22:43:57 -0500 Received: from [2607:f8b0:4864:20::833] (port=38626 helo=mail-qt1-x833.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJSHK-0005ZC-7q for grub-devel@gnu.org; Sun, 13 Feb 2022 22:43:55 -0500 Received: by mail-qt1-x833.google.com with SMTP id r14so14439978qtt.5 for ; Sun, 13 Feb 2022 19:43:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eWGkf9u0/qTSyz0JqcTXBQGhTZ+5SxJbhetfm5WUzro=; b=Y3/XZ00A00B8OtqOyJimxyzk3Ryxq/xyLlYRgbBTzSSZ30YvGj4Yr1QgyOE7IUYZKk OeGG3LxX84RqPMNSlXE0i7W6nx/ePVqc2uMuTMLA4fRLpr9fy6Hj82tXk5q/q/R2yS+T jwtw1e7ebhwT53eBXL95pefnVDAgoX+DUpMnFtGm/NG1LUjkOJb0+FlIVLleUJs9Yp9C 9NoOyFA/0c6VC2Os0kngn01yPH9XJPqrCxAPAw3Q7pV0IB6IdlGbWeTuM/9IaZuTHHuI RakPLhs6FvYW2WwOBVwTDXgNlIMqng305DtmC24r19vhSGJfDFsaVsKgBZyy2ZuARFG0 kShA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eWGkf9u0/qTSyz0JqcTXBQGhTZ+5SxJbhetfm5WUzro=; b=qJopYOOmV+Kyr2LZlSREtCxmsLII9vMwUc0wTje0ZibEJT2/mAFCHHbhA+wY+Efvkh Ta7OgFxnmx7h4bAQaXbBODz4PZvPbcUMfBu90yT+6QGK2KddFV9T5Gdwc8rN+Gk1MT0T m6769GWcul1HPCmvNqTOeEjv11QnteOqXVwptiDkFaRGAHkeGae+CUMto40ks4VaVR5s RuXbsuEeuqfSBZ0mQQbovq94eIU8swr94c+R3Hjq3s/Cxs38lxtJuwevyUOLLZpIO0wF O20j2fY5iJcWFvDH9Y0JW/dzrdsA14tY3XcI0ZeTVsGwWY7hKPoiaotaYr6gXUjwZebl nYWg== X-Gm-Message-State: AOAM532VhHfp+EQj+LP/gYfC/cQpFmqAuSQ5JOfEJgt5GETEu6pwD6To ZA4QdmHKGANjiEe+cJqflYyDgA== X-Google-Smtp-Source: ABdhPJwGQZjOlc7Btp1Po2ruk1sK7AccdImJAXVSA9eH/z4TAV/u9qteI3Qg8Voy9Q32czwQUEa9Eg== X-Received: by 2002:ac8:5906:: with SMTP id 6mr8047976qty.663.1644810233468; Sun, 13 Feb 2022 19:43:53 -0800 (PST) Received: from localhost.localdomain (garza.riseup.net. [198.252.153.109]) by smtp.gmail.com with ESMTPSA id z19sm17755800qtj.77.2022.02.13.19.43.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Feb 2022 19:43:49 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Peter Jones , Robbie Harwood , Glenn Washburn Subject: [PATCH 2/8] gdb: If no modules have been loaded, do not try to load module symbols Date: Sun, 13 Feb 2022 21:42:39 -0600 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::833 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::833; envelope-from=development@efficientek.com; helo=mail-qt1-x833.google.com X-Spam_score_int: -2 X-Spam_score: -0.3 X-Spam_bar: / X-Spam_report: (-0.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.785, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: Mon, 14 Feb 2022 03:43:57 -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 b0e8d1ed1..3a0593610 100644 --- a/grub-core/gdb_grub.in +++ b/grub-core/gdb_grub.in @@ -64,7 +64,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.27.0