From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1p8w1E-0002nM-2m for mharc-grub-devel@gnu.org; Fri, 23 Dec 2022 23:20:20 -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 1p8w15-0002li-0Z for grub-devel@gnu.org; Fri, 23 Dec 2022 23:20:11 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p8w13-0000Wi-CK for grub-devel@gnu.org; Fri, 23 Dec 2022 23:20:10 -0500 Received: by mail-pg1-x530.google.com with SMTP id v3so4362521pgh.4 for ; Fri, 23 Dec 2022 20:20:07 -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=fwDzlPRo8lmdVS4F1jYDFg6sBPyOqynWQOsIW+zYeCA=; b=7NZSdNmybmazdajrtwqBbllCHVMEFkebUuVy+/dGdrZM1za5p8AgCLBv0W9XykoL5Q eMT6gDr/T744BY7Ed2oqy4gLkanuJkp84Qh75lXaJJWB0nK58Efs3TAqPBP2MP7idr/V /pd0UZ125thl7jgoUcGpKU4IR1FBymyK59tFuPBPRYTJpeGSbkjE+TgCBioTdVTWFs8S Fck8dCSqTY3S42FSsNLBmMcmuPr/uXVBG+xGLoO318yjbHH7bGqyg7kDjwoMJ540LhYO h5woVEKg+4iU4DSalmjGQvkZbQgY3y52PXycBwb7ryJMMT14+BNPGEFnHJfkXXIvSs2f XUzQ== 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=fwDzlPRo8lmdVS4F1jYDFg6sBPyOqynWQOsIW+zYeCA=; b=lyaTgUvVzVKUNwS3GGIzJl3ThSmgXaaSxJVjvLpLxyte8sMBXn6foL0dd52Iw/4Hwj Nw99Oxyumxxf8B+Xm5ne1k2EddjhcJYeey6eUiVQBZiqo9W7MBbLsDMTz+e9WAoM2P/q wO3zXjXGTdrFKIgvgkMw/dU2sKRYH72T1UHzF5VgWC3wYDG6LRSRZViG83ZQOkm3kC2b Bo62Grh6Wx7mASgyNr0qFS/8ij8Y8oi6dS45OaGPQnzU0Uf5nZte2sGWOwMoLqxPsnbP DfxQ49dP5jxR6UQUQWWIpNT7+GZw8yTAGTU32K20wOFuxIi3gASx2hthrFxUdHchAkvS AKJA== X-Gm-Message-State: AFqh2kqtCK3rky99ZUQNmLmKUDREURLyzlnt2+jfpjK0Hk5zzW3ZxE88 ep77DdV8CmgaiXzfTBxnUOq2ZXZlJSyZP05c X-Google-Smtp-Source: AMrXdXv/O8fS/KQks9q3xxQBZ/skT5eNrRFwYUblaSqOFXKC5hyZyJ/LAA3BBHn++XoF3dD17buPcw== X-Received: by 2002:a62:648b:0:b0:57a:a199:93e7 with SMTP id y133-20020a62648b000000b0057aa19993e7mr13525408pfb.28.1671855606351; Fri, 23 Dec 2022 20:20:06 -0800 (PST) Received: from localhost.localdomain ([204.13.164.84]) by smtp.gmail.com with ESMTPSA id x19-20020aa79413000000b005743b5ebd7csm3324185pfo.92.2022.12.23.20.20.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Dec 2022 20:20:05 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Robbie Harwood , Peter Jones , Glenn Washburn Subject: [PATCH v5 04/14] gdb: Move runtime module loading into runtime_load_module Date: Fri, 23 Dec 2022 22:19:25 -0600 Message-Id: <20221224041935.787292-5-development@efficientek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221224041935.787292-1-development@efficientek.com> References: <20221224041935.787292-1-development@efficientek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=development@efficientek.com; helo=mail-pg1-x530.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: Sat, 24 Dec 2022 04:20:11 -0000 By moving this code into a function, it can be run re-utilized while gdb is running, not just when loading the script. This will also be useful in some following changes which will make a separate script path for targets which statically vs dynamically position GRUB code. Signed-off-by: Glenn Washburn --- grub-core/gdb_grub.in | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/grub-core/gdb_grub.in b/grub-core/gdb_grub.in index fc17e3d899..d525a5a11f 100644 --- a/grub-core/gdb_grub.in +++ b/grub-core/gdb_grub.in @@ -71,16 +71,22 @@ document load_all_modules Load debugging information for all loaded modules. end +define runtime_load_module + break grub_dl_add + commands + silent + load_module mod + cont + end +end +document runtime_load_module + Load module symbols at runtime as they are loaded. +end + ### set confirm off file kernel.exec target remote :1234 -# inform when module is loaded -break grub_dl_add -commands - silent - load_module mod - cont -end +runtime_load_module -- 2.34.1