From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 08:00:55 2023 Received: (at submit) by debbugs.gnu.org; 16 Oct 2023 12:00:55 +0000 Received: from localhost ([127.0.0.1]:55411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsMHH-0006uw-8I for submit@debbugs.gnu.org; Mon, 16 Oct 2023 08:00:55 -0400 Received: from lists.gnu.org ([2001:470:142::17]:53606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsMHD-0006ua-1p for submit@debbugs.gnu.org; Mon, 16 Oct 2023 08:00:54 -0400 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 1qsMGd-0007Rb-4w for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2023 08:00:17 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qsMGb-0006JR-4G for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2023 08:00:14 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9ada2e6e75fso775741966b.2 for ; Mon, 16 Oct 2023 05:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697457611; x=1698062411; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=PFawMLNC1yvW9Zht80p7HTVr6OWpghEkQarI9XrgGj0=; b=Rf9+8q8SX2EHyI4DX3q4LiQlB5fjFuUjZDLV8ZQnkRW+AVw0YUNIMv8TFF2E5B187f 0aGpG5pQt3ofFIVuwIoAZtV1PCY/ZFboOROdfAr+QVbNx7zvAdUGv1wH1upguYziCw36 bWlAZsh1qPwRCjYyh8pXAyZEF+7ZSdPQMQVvnYXNxYpyhNXKCO/VHtKAEJ2bhNHtLUg4 0u6AvtNonizC5T3B8BqdKLMdqmWwt3SXJlB2WhKYEIeVbkc3aRTz4rIhX38Ynf/tqoG1 LxTJeYbpxu+c+vRKQ44vNHclcpQL36DzLja0m0vi/sT8J0BvuPwSpYA6kPiPtJFvFwFv FelQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697457611; x=1698062411; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=PFawMLNC1yvW9Zht80p7HTVr6OWpghEkQarI9XrgGj0=; b=tzFhegwUwE34Dr/wRbAW34Vd5iHtBIQMqyxESIfwGtCOBwFzY1x4q9QVmwgvnddd4G y5BF74mMQs/mLQeczrji07crBJu3s6btcwRtoyK64Wunldq+B+eHX6tzj3zabEI4DEnT T0fgug8lt+YCCHQ+a/vPqV6iuqNnPI7KCJc/apaDA5e/4AY1W7Hc0zVwXfwMdFum6qHv zCTNCiHhibbvC4infNE1F3K7XpAgYfK3YsQ5JbwyjLaKTFhaBMdH3RJZtqtANyPl+Qs5 pePLKIq5YirtSOj4lwzyZ/qlFelgCDrfbirTTT+Oih4vs0sEOcDXvzcI8QJGNIvUzXCu OnJw== X-Gm-Message-State: AOJu0Yz/seQ/y2u5EtXR0SwJ4XSNqD4NxBOr0TKly+7qLkUSiatVaJ3m CZxzdFUliBz2EYu2QCloSq9LkRzrCUg= X-Google-Smtp-Source: AGHT+IGRbxDxfXxuPqdHqGhsv/ThtM2Ztz8Ko6UWzscWOWxRNjdY6lIE4g+AhewnsfnrVnN1GWYW3Q== X-Received: by 2002:a17:906:3298:b0:9ae:701a:6efa with SMTP id 24-20020a170906329800b009ae701a6efamr27109061ejw.69.1697457610754; Mon, 16 Oct 2023 05:00:10 -0700 (PDT) Received: from Mini.fritz.box (p4fe3a7d3.dip0.t-ipconnect.de. [79.227.167.211]) by smtp.gmail.com with ESMTPSA id og41-20020a1709071de900b009adce1c97ccsm3852525ejc.53.2023.10.16.05.00.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 05:00:09 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: bug-gnu-emacs@gnu.org Subject: [PATCH] Gud lldb support Date: Mon, 16 Oct 2023 14:00:07 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=gerd.moellmann@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, 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-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain Tags: patch The attached patch implements LLDB support in Gud, based on gud-gdb. No MI support, because lldb-mi is no longer part of LLVM. It's probably not needless to emphasize that this is entirely my work alone :-). --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Gud-lldb-support.patch >From b1a721304fb285eae30405ab7d03c9b9fe200c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Mon, 16 Oct 2023 13:54:02 +0200 Subject: [PATCH] Gud lldb support * lisp/progmodes/gud.el (lldb): New function. --- lisp/progmodes/gud.el | 143 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index d4b954a7203..e33c7942933 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -40,6 +40,7 @@ ;;; Code: (require 'comint) +(eval-when-compile (require 'rx)) (defvar gdb-active-process) (defvar gdb-define-alist) @@ -973,6 +974,7 @@ gud-gdb-fetch-lines-filter (setq gud-gdb-fetch-lines-string string) ""))) + ;; gdb speedbar functions ;; Part of the macro expansion of dframe-with-attached-buffer. @@ -3840,6 +3842,147 @@ gud-tooltip-tips (gud-basic-call cmd)) expr)))))))) + +;; 'gud-lldb-history' and 'gud-gud-lldb-command-name' are required +;; because gud-symbol uses their values if they are present. Tehir +;; names are deducded from the minor-mode name. +(defvar gud-lldb-history nil) + +(defcustom gud-gud-lldb-command-name "lldb" + "Default command to run an executable under LLDB in text command mode." + :type 'string) + +(defun gud-lldb-marker-filter (string) + "Deduce interesting stuff from output STRING." + (cond (;; Process 72668 stopped + ;; * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 + ;; frame #0: ...) at emacs.c:1310:9 [opt] + (string-match (rx (and line-start (0+ blank) "frame" + (0+ not-newline) " at " + (group (1+ (not (any ":")))) + ":" + (group (1+ digit)))) + string) + (setq gud-last-frame + (cons (match-string 1 string) + (string-to-number (match-string 2 string))))) + (;; Process 72874 exited with status = 9 (0x00000009) killed + (string-match (rx "Process " (1+ digit) " exited with status") + string) + (setq gud-last-last-frame nil) + (setq gud-overlay-arrow-position nil))) + string) + +;;;###autoload +(defun lldb (command-line) + "Run lldb passing it COMMAND-LINE as arguments. +If COMMAND-LINE names a program FILE to debug, lldb will run in +a buffer named *gud-FILE*, and the directory containing FILE +becomes the initial working directory and source-file directory +for your debugger. If you don't want `default-directory' to +change to the directory of FILE, specify FILE without leading +directories, in which case FILE should reside either in the +directory of the buffer from which this command is invoked, or +it can be found by searching PATH. + +If COMMAND-LINE requests that lldb attaches to a process PID, lldb +will run in *gud-PID*, otherwise it will run in *gud*; in these +cases the initial working directory is the `default-directory' of +the buffer in which this command was invoked." + (interactive (list (gud-query-cmdline 'lldb))) + + (when (and gud-comint-buffer + (buffer-name gud-comint-buffer) + (get-buffer-process gud-comint-buffer) + (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gud-lldb))) + (gdb-restore-windows) + ;; FIXME: Copied from gud-gdb, but what does that even say? + (error "Multiple debugging requires restarting in text command mode")) + + (gud-common-init command-line nil 'gud-lldb-marker-filter) + (setq-local gud-minor-mode 'lldb) + + (gud-def gud-break + "breakpoint set -joint-specifier %f:%l" + "\C-b" + "Set breakpoint at current line.") + (gud-def gud-tbreak + "_regexp-break %f:%l" + "\C-t" + "Set temporary breakpoint at current line.") + (gud-def gud-remove + "breakpoint clear --line %l --file %f" + "\C-d" + "Remove breakpoint at current line") + (gud-def gud-step "thread step-in --count %p" + "\C-s" + "Step one source line with display.") + (gud-def gud-stepi + "thread step-inst --count %p" + "\C-i" + "Step one instruction with display.") + (gud-def gud-next + "thread step-over --count %p" + "\C-n" + "Step one line (skip functions).") + (gud-def gud-nexti + "thread step-inst-over --count %p" + nil + "Step one instruction (skip functions).") + (gud-def gud-cont + "process continue --ignore-count %p" + "\C-r" + "Continue with display.") + (gud-def gud-finish + "thread step-out" + "\C-f" + "Finish executing current function.") + (gud-def gud-jump + (progn + (gud-call "_regexp-break %f:%l" arg) + (gud-call "_regexp-jump %f:%l")) + "\C-j" + "Set execution address to current line.") + (gud-def gud-up + "_regexp-up up %p" + "<" + "Up N stack frames (numeric arg).") + (gud-def gud-down + "_regexp-down %p" + ">" + "Down N stack frames (numeric arg).") + (gud-def gud-print + "dwim-print %e" + "\C-p" + "Evaluate C expression at point.") + (gud-def gud-pstar + "dwim-print *%e" + nil + "Evaluate C dereferenced pointer expression at point.") + + ;; For debugging Emacs only. + (gud-def gud-pv + "xprint %e" + "\C-v" + "Print the value of the lisp variable.") + + (gud-def gud-until + "thread until %l" + "\C-u" + "Continue to current line.") + (gud-def gud-run + ;; Extension for process launch --tty? + "process launch -X true" + nil + "Run the program.") + + (gud-set-repeat-map-property 'gud-gdb-repeat-map) + (setq comint-prompt-regexp "^(lldb) *") + (setq paragraph-start comint-prompt-regexp) + (setq gud-running nil) + (setq gud-filter-pending-text nil) + (run-hooks 'gud-lldb-mode-hook)) + (provide 'gud) ;;; gud.el ends here -- 2.42.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 09:30:59 2023 Received: (at 66575) by debbugs.gnu.org; 16 Oct 2023 13:30:59 +0000 Received: from localhost ([127.0.0.1]:55491 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsNgQ-0001MQ-Et for submit@debbugs.gnu.org; Mon, 16 Oct 2023 09:30:58 -0400 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]:61610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsNgO-0001M8-8K for 66575@debbugs.gnu.org; Mon, 16 Oct 2023 09:30:57 -0400 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2b9c907bc68so55071071fa.2 for <66575@debbugs.gnu.org>; Mon, 16 Oct 2023 06:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697463025; x=1698067825; darn=debbugs.gnu.org; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=m7/5sJ3gMrzt2NVZ1g6jcRQWEppocsb/xSs0vtFtNk8=; b=dM2HIuTah3vC4OedyBIRAr/7fNPtvFYv/v87XPPSGJSyF4y7h1bNjGP4JrVHAZ3O1B deEAa+EaHeWlthiek3LnQnwO5kL2/si2ELPimgmDZM4x5z/tJmMbz4YKKWblOf/+WsLf 4Sc61dDtNd5nqCROspcJo9YX4Gum8lou+xjS/8A5ib4bEKgoEGNV3hC8EnPVjyHRYL+X 2DsJofxQoyRKeeDiSVKZzeFuq6YpmUQKAWPe3RKdHACjYMoByyqB1nZhoFd63mEAt/tB psO6xg1BZZQvZ1+qE2nA5bZnnBMAlhXuuruD3ol/+7xZZjHEtXHufftBUvHNnpWpokMf mnSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697463025; x=1698067825; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m7/5sJ3gMrzt2NVZ1g6jcRQWEppocsb/xSs0vtFtNk8=; b=H1WGTj52fGZA1J3UzRgB8KbdBVfTyx4OfBpzmKX5QePNxKKDcIyO6GYouXayB/QelT 6TWCBYHrkVhtXCLkrDxsmk7vlxrumw6XH5ymZTl1brsruZRIT+jQP80JoIW8YPB9hjX+ 17RJ4oL4hQ0e/Hjasuamp9Cm7plgi8M8aJCYqIGGz+ZQXXLWPHhTHdNBRK2+0oCG5CL0 bFrgRVGZdYSlKBp4YhpGyYoSmClL/9Fj6ABhukyI/YIP0HlLEsfABOygNAd4PJkLdoLp R5T3QzkDkF6LasCiemJCxWDmXvAiqjtFLS+HDnsXGnDgDSDXAJTBPxDYHCpLtv3aG5L6 yUVQ== X-Gm-Message-State: AOJu0Yyi9TUlx85syiwb1inLkEo3vyJbrW/1gmonwgRiK1qk6v0SdX+n zJgmuajvHnjKF+jZ06dirxE= X-Google-Smtp-Source: AGHT+IFG6LXrEEJxFJSR9v/X957886mgHQyqp+R1D/VE9vfPXBnfVz6jImVc6AFEqQLsuv/+d3qFug== X-Received: by 2002:a2e:a7d2:0:b0:2c5:1490:1687 with SMTP id x18-20020a2ea7d2000000b002c514901687mr6028251ljp.33.1697463024528; Mon, 16 Oct 2023 06:30:24 -0700 (PDT) Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id m12-20020a2e910c000000b002c5122f13b8sm1324720ljg.30.2023.10.16.06.30.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2023 06:30:24 -0700 (PDT) From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: bug#66575: [PATCH] Gud lldb support Message-Id: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> Date: Mon, 16 Oct 2023 15:30:23 +0200 To: =?utf-8?Q?Gerd_M=C3=B6llmann?= X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > No MI support, because lldb-mi is no longer part of LLVM. So what is the currently blessed way to communicate with LLDB? I only have comments about trivialities here; someone else should deal = with the serious stuff. > +(eval-when-compile (require 'rx)) There is usually no need to import rx explicitly. The necessary macros = and functions are autoloaded. > +;; because gud-symbol uses their values if they are present. Tehir > +;; names are deducded from the minor-mode name. 'Their', 'deduced'. > + ;; frame #0: ...) at emacs.c:1310:9 [opt] > + (string-match (rx (and line-start (0+ blank) "frame" > + (0+ not-newline) " at " > + (group (1+ (not (any ":")))) > + ":" (You can write (not ":") instead of (not (any ":")) if you like.) If the file name can have an absolute directory part, then it may run = into trouble on Windows (C:\Some\Dir\File.c). Sad that we throw away the column number here, but perhaps that's just a = limitation of gud.el. Anyway, a big step up from not having any support at all. Thank you! Would you include a NEWS entry as well? From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 09:57:55 2023 Received: (at 66575) by debbugs.gnu.org; 16 Oct 2023 13:57:55 +0000 Received: from localhost ([127.0.0.1]:57434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsO6V-0002gc-CG for submit@debbugs.gnu.org; Mon, 16 Oct 2023 09:57:55 -0400 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]:44109) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsO6R-0002gK-TE for 66575@debbugs.gnu.org; Mon, 16 Oct 2023 09:57:53 -0400 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-507b9408c61so132841e87.0 for <66575@debbugs.gnu.org>; Mon, 16 Oct 2023 06:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697464640; x=1698069440; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=bK64JI4p3rqx3kWs3owPR2JIWvi6unkQjaM6jnWIvz4=; b=amtsn+5fcl/UAZ+DM16rZx4nFKoH3g5xLcAP6TDuC32NCQNaTZAXwio5MIPT60X/QH NElbwO3Q6jY8Ru+Hl6JK8CvnhmbDsOm7FksfD8386Mebl/pLvVR6KqwnrCSmmCZcIGb3 RpmkJwz0creOS28MqKHF1WxXh3EXehXVikTtjefpQzPKRnEhW6JoDn032DdN/ufhHWGx GtTFM/giWQ0/Us4Zzh/yRB/PmeX0XmwYG+tgmDOhPjuxPRMjFmXDAvEGAG/n16N7W5v1 V8Xw79XVeRQZIWe4xuc6guJMgkRK2ew0+qziIA0fpRwQPwOqX/s925ado2POQ9M3OF0J 0PZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697464640; x=1698069440; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bK64JI4p3rqx3kWs3owPR2JIWvi6unkQjaM6jnWIvz4=; b=O5Oz39DS1WChUrGSPUPJn1QZOncAtWfQPLBLVNNhQFcZoPD7AK/Yx7dyEUwubFy0QE 8N57V0xaL/KiZdxcEEFxpDmZpx3XJzUko7yC5Jq49AvwxKzg3W/OrTwh6Ocx5RIZTp6q q7qg1UKZByfV0AsUQXgVH8tGzVxhZFU/6k8jma6eOR+fHllbkuqVpOAV9JwtERSHnlnl B03/tisFdvKMf6cd+kCv8tIeWB15VzOI4oZ29xqso0aV4VvVsg+DVJGBEQbCBR/qckT1 UrXDGcMscSBLm2Ne1wqKRYpAYzrU8UtGzRqdEW1jzmwqU8kBevfMXzhxww9ZuYIbKIGo tKOg== X-Gm-Message-State: AOJu0YxEBT6SuKUuW3y5AQAKa4uRCWNKDQU0xAZvQ15YKuQEAoF6i921 BRHIxasRM51xkdIG5PWGiuSBFTb9OzSVxA== X-Google-Smtp-Source: AGHT+IFG5nm7/qyUuTXDSu7ihZSJGFa8p1YjUcEnHB+wGzfYV9sfdlsIrR8MWHz2poyApZ/qMVKUhg== X-Received: by 2002:a05:6512:318a:b0:503:1bb0:a658 with SMTP id i10-20020a056512318a00b005031bb0a658mr34942045lfe.32.1697464640374; Mon, 16 Oct 2023 06:57:20 -0700 (PDT) Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id o17-20020ac24e91000000b0050574829e48sm710339lfr.298.2023.10.16.06.57.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2023 06:57:19 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: bug#66575: [PATCH] Gud lldb support From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> Date: Mon, 16 Oct 2023 15:57:17 +0200 Content-Transfer-Encoding: 7bit Message-Id: <7BA2E212-EA25-4F47-9A1E-C521448A75FE@gmail.com> References: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> To: =?utf-8?Q?Gerd_M=C3=B6llmann?= X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) You probably want to include 'lldb' in more places in gud.el. For example: > (defgroup gud nil > "The \"Grand Unified Debugger\" interface. > Supported debuggers include gdb, sdb, dbx, xdb, perldb, > pdb (Python), and jdb." and in gud-text-menu-bar-map, gud-menu-map, etc. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 10:10:14 2023 Received: (at 66575) by debbugs.gnu.org; 16 Oct 2023 14:10:14 +0000 Received: from localhost ([127.0.0.1]:57465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsOIP-000398-Uw for submit@debbugs.gnu.org; Mon, 16 Oct 2023 10:10:14 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]:58824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsOIN-00038t-Vw for 66575@debbugs.gnu.org; Mon, 16 Oct 2023 10:10:12 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-99c3c8adb27so715123766b.1 for <66575@debbugs.gnu.org>; Mon, 16 Oct 2023 07:09:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697465380; x=1698070180; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=tUl7k4tNz2d4S/iELzuKp0YXHlYwDyk+YvlOnf9bwOo=; b=HBtX97y++KQDcSWjGXUkeU+sFah7jkahaqnZ3FnFhm//tAZcWA1Juslyhd8jA+1jPK Aa6QlgnMWGwapTJPUcgYYCgcpTVZwp4wsvvUnygVojo4Vux08Rs2vRxo2WopnrPk8VZ/ jmFD85PDDibaRRDSBn+Y7LXfZokvMBiZfa2nTIni7GQVgptAKoyZSBiFnZ4RJi3+cPzZ bjTqtYoOALbS5xWZR/2e0bBJF59qZz1f9SMDhvrjhiJzTw4TNrMVHCBi8ZZqRxwhIlvs Ub1su0nwTk3CPSvmUONBAa7N+M3Jok9AyYE2YtMp//rzUV7xtWE7wrbwRPvNzrKzRR4s 4dMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697465380; x=1698070180; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tUl7k4tNz2d4S/iELzuKp0YXHlYwDyk+YvlOnf9bwOo=; b=YLV5jjM08bCnrgR997enmoP8wB63lP/U92NcZKtsiOqRmtIC/QjJTrkI88FeuU2san uQe0ASgscRDd0wdfFjaZcXnk3Hulg7orvMnmzowCKRF6E5WU8wslSOJKtg1nmVa6e8DP /qCEwJlWPnNADXNobDaiwGUMrb41tMXnMoZHVtzBmYKXYCwA4SOujJ8UAsgM67XHcAhM M+mnz6qkLX3XnKwLI5Mfql2O5JSZxmgegFNVPwxtrEBOOEz43f//Z1LLLnN2bFxU+Rbd mlQNqNf3oSJRineZ1rJ/MbufrWapCGpOODq36e9rmr/56Ain+DIzjQSqiDZSEbyCKCHo 3xgw== X-Gm-Message-State: AOJu0Yz8gjWZHvMY2Q0Cq7yfyM0mKPC806Pec0qtSqwQEgZlfHlBW3qH l8xtKFewe2uLPa8cpuv3bCCJbvC4YUE= X-Google-Smtp-Source: AGHT+IGOLASTKt5Ik0Ucpz/B45rhTy1NfhTbR8yh4Zn3i6ZR4FN8gM9EtfhqS3jzYm6s1YQcb+rY2w== X-Received: by 2002:a17:907:7d92:b0:9be:946d:bd43 with SMTP id oz18-20020a1709077d9200b009be946dbd43mr6000011ejc.0.1697465380053; Mon, 16 Oct 2023 07:09:40 -0700 (PDT) Received: from Mini.fritz.box (p4fe3a7d3.dip0.t-ipconnect.de. [79.227.167.211]) by smtp.gmail.com with ESMTPSA id t18-20020a1709063e5200b009a0955a7ad0sm4115112eji.128.2023.10.16.07.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 07:09:39 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Subject: Re: bug#66575: [PATCH] Gud lldb support In-Reply-To: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> ("Mattias =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Mon, 16 Oct 2023 15:30:23 +0200") References: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> Date: Mon, 16 Oct 2023 16:09:38 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mattias Engdeg=C3=A5rd writes: >> No MI support, because lldb-mi is no longer part of LLVM. > > So what is the currently blessed way to communicate with LLDB? Don't really know, I'm afraid. > I only have comments about trivialities here; someone else should deal > with the serious stuff. > >> +(eval-when-compile (require 'rx)) > > There is usually no need to import rx explicitly. The necessary macros > and functions are autoloaded. > >> +;; because gud-symbol uses their values if they are present. Tehir >> +;; names are deducded from the minor-mode name. > > 'Their', 'deduced'. > >> + ;; frame #0: ...) at emacs.c:1310:9 [opt] >> + (string-match (rx (and line-start (0+ blank) "frame" >> + (0+ not-newline) " at " >> + (group (1+ (not (any ":")))) >> + ":" > > > (You can write (not ":") instead of (not (any ":")) if you like.) Both Fixed in the attached patch. I also found another spelling error in an option passed to 'breakpoint set -joint...'. > If th=C3=B1e file name can have an absolute directory part, then it may r= un > into trouble on Windows (C:\Some\Dir\File.c). I guess I'll leave that as an exercise for someone having Windows :-). > > Sad that we throw away the column number here, but perhaps that's just > a limitation of gud.el. Indeed. > > Anyway, a big step up from not having any support at all. Thank you! =F0=9F=91=8D > > Would you include a NEWS entry as well? When I get this into master, yes of course. I'm not yet convinced of that :-). --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Gud-lldb-support.patch Content-Description: patch version 2 >From 8cbbe82f715876a26736f1380908b0ebb3356f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Mon, 16 Oct 2023 13:54:02 +0200 Subject: [PATCH] Gud lldb support * lisp/progmodes/gud.el (lldb): New function. --- lisp/progmodes/gud.el | 142 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index d4b954a7203..cff2d7034e4 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -973,6 +973,7 @@ gud-gdb-fetch-lines-filter (setq gud-gdb-fetch-lines-string string) ""))) + ;; gdb speedbar functions ;; Part of the macro expansion of dframe-with-attached-buffer. @@ -3840,6 +3841,147 @@ gud-tooltip-tips (gud-basic-call cmd)) expr)))))))) + +;; 'gud-lldb-history' and 'gud-gud-lldb-command-name' are required +;; because gud-symbol uses their values if they are present. Their +;; names are deduced from the minor-mode name. +(defvar gud-lldb-history nil) + +(defcustom gud-gud-lldb-command-name "lldb" + "Default command to run an executable under LLDB in text command mode." + :type 'string) + +(defun gud-lldb-marker-filter (string) + "Deduce interesting stuff from output STRING." + (cond (;; Process 72668 stopped + ;; * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 + ;; frame #0: ...) at emacs.c:1310:9 [opt] + (string-match (rx (and line-start (0+ blank) "frame" + (0+ not-newline) " at " + (group (1+ (not ":"))) + ":" + (group (1+ digit)))) + string) + (setq gud-last-frame + (cons (match-string 1 string) + (string-to-number (match-string 2 string))))) + (;; Process 72874 exited with status = 9 (0x00000009) killed + (string-match (rx "Process " (1+ digit) " exited with status") + string) + (setq gud-last-last-frame nil) + (setq gud-overlay-arrow-position nil))) + string) + +;;;###autoload +(defun lldb (command-line) + "Run lldb passing it COMMAND-LINE as arguments. +If COMMAND-LINE names a program FILE to debug, lldb will run in +a buffer named *gud-FILE*, and the directory containing FILE +becomes the initial working directory and source-file directory +for your debugger. If you don't want `default-directory' to +change to the directory of FILE, specify FILE without leading +directories, in which case FILE should reside either in the +directory of the buffer from which this command is invoked, or +it can be found by searching PATH. + +If COMMAND-LINE requests that lldb attaches to a process PID, lldb +will run in *gud-PID*, otherwise it will run in *gud*; in these +cases the initial working directory is the `default-directory' of +the buffer in which this command was invoked." + (interactive (list (gud-query-cmdline 'lldb))) + + (when (and gud-comint-buffer + (buffer-name gud-comint-buffer) + (get-buffer-process gud-comint-buffer) + (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gud-lldb))) + (gdb-restore-windows) + ;; FIXME: Copied from gud-gdb, but what does that even say? + (error "Multiple debugging requires restarting in text command mode")) + + (gud-common-init command-line nil 'gud-lldb-marker-filter) + (setq-local gud-minor-mode 'lldb) + + (gud-def gud-break + "breakpoint set --joint-specifier %f:%l" + "\C-b" + "Set breakpoint at current line.") + (gud-def gud-tbreak + "_regexp-break %f:%l" + "\C-t" + "Set temporary breakpoint at current line.") + (gud-def gud-remove + "breakpoint clear --line %l --file %f" + "\C-d" + "Remove breakpoint at current line") + (gud-def gud-step "thread step-in --count %p" + "\C-s" + "Step one source line with display.") + (gud-def gud-stepi + "thread step-inst --count %p" + "\C-i" + "Step one instruction with display.") + (gud-def gud-next + "thread step-over --count %p" + "\C-n" + "Step one line (skip functions).") + (gud-def gud-nexti + "thread step-inst-over --count %p" + nil + "Step one instruction (skip functions).") + (gud-def gud-cont + "process continue --ignore-count %p" + "\C-r" + "Continue with display.") + (gud-def gud-finish + "thread step-out" + "\C-f" + "Finish executing current function.") + (gud-def gud-jump + (progn + (gud-call "_regexp-break %f:%l" arg) + (gud-call "_regexp-jump %f:%l")) + "\C-j" + "Set execution address to current line.") + (gud-def gud-up + "_regexp-up up %p" + "<" + "Up N stack frames (numeric arg).") + (gud-def gud-down + "_regexp-down %p" + ">" + "Down N stack frames (numeric arg).") + (gud-def gud-print + "dwim-print %e" + "\C-p" + "Evaluate C expression at point.") + (gud-def gud-pstar + "dwim-print *%e" + nil + "Evaluate C dereferenced pointer expression at point.") + + ;; For debugging Emacs only. + (gud-def gud-pv + "xprint %e" + "\C-v" + "Print the value of the lisp variable.") + + (gud-def gud-until + "thread until %l" + "\C-u" + "Continue to current line.") + (gud-def gud-run + ;; Extension for process launch --tty? + "process launch -X true" + nil + "Run the program.") + + (gud-set-repeat-map-property 'gud-gdb-repeat-map) + (setq comint-prompt-regexp "^(lldb) *") + (setq paragraph-start comint-prompt-regexp) + (setq gud-running nil) + (setq gud-filter-pending-text nil) + (run-hooks 'gud-lldb-mode-hook)) + (provide 'gud) ;;; gud.el ends here -- 2.42.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 10:47:32 2023 Received: (at 66575) by debbugs.gnu.org; 16 Oct 2023 14:47:32 +0000 Received: from localhost ([127.0.0.1]:57495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsOsW-0004F1-Ew for submit@debbugs.gnu.org; Mon, 16 Oct 2023 10:47:32 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]:54325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsOsT-0004Ej-TN for 66575@debbugs.gnu.org; Mon, 16 Oct 2023 10:47:31 -0400 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-507a3b8b113so2390892e87.0 for <66575@debbugs.gnu.org>; Mon, 16 Oct 2023 07:47:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697467619; x=1698072419; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=ujA7AKsnmGsB/VlbIrYoKORUYOGnr2NWVmCEk10a3PY=; b=TCfZHeABSN9kC0s9fg1xJmoDpBiuW4JIdcVuGsgaopd0HW27gyhxFbIOgLMI7hwFlr dyWuIVDxbWQwOjGBiVi0AXky7ZMuK/vax27ssjnOidEuGmcRQXzT4GL4QEYw4n1ojgqm 0lZRk0W0f8MTXzh+lT8OjXoLbIbmjXIMO5JaashWR2eyz0028n4hiHygNZdLVqu1eVip mesQ6AfK23n8d9SI1Bnk2rvyYtFbZUAH32jUh6fB5xvuvW87F2qWMrFUg34wmt++zduk eXg4ouJhqUnKArIK897tSCfB58TEv0HSKD2HS5TqYpBNRJOAV6Ztgb4MHMzq6oDvdaK6 4wHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697467619; x=1698072419; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ujA7AKsnmGsB/VlbIrYoKORUYOGnr2NWVmCEk10a3PY=; b=WSNbEJ6VMa5cSdER2FEpXtGIKLVYP684/fMHavW4l+HB4SV//aPoll/4J4OZ5Hq0sQ DDyYujsdjoL/Gdiua0fT4dyfT865KNt6BiSwd+Y/8jvum/iSNPN4JHfxjNmNMXNqhaZZ W9Ydp8EE5jnpOmNoIiF8U6GZg3WdhdI1JMwHMDOsPKCicDU1pwjcF25tgGi82z7JOV5u +7guEMR4ZIX+UrEShe371/ppAcFrHC+9Uj9rWg0lPu0hhOkEueJ5vuCMf4fcsAc8nYXG Kff/e08SFrzOBlQ4gY6ej6m5FXeTjEQKgvEW0iXuFqU0a4r6yhJ0Sb5q4N0QgfyCsG9k Zvxg== X-Gm-Message-State: AOJu0YxpcNSaKjYWmDedq+0SgKUz1FsM5u0iTxm8W+ZO3Z/bdNxMuCU/ 60udNhWj1byQT0bi2I8IXbE= X-Google-Smtp-Source: AGHT+IGsRed9whm/tk47GslMQkV8lrA5QC/eZAZ1ZJk3OA6AU603dP6LiVDlfjtSrrc92f0+A0uI0Q== X-Received: by 2002:a19:4f09:0:b0:503:3700:7ec3 with SMTP id d9-20020a194f09000000b0050337007ec3mr26395057lfb.39.1697467618383; Mon, 16 Oct 2023 07:46:58 -0700 (PDT) Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id c7-20020a056512324700b004fb7848bacbsm1342237lfr.46.2023.10.16.07.46.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2023 07:46:57 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: bug#66575: [PATCH] Gud lldb support From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <7BA2E212-EA25-4F47-9A1E-C521448A75FE@gmail.com> Date: Mon, 16 Oct 2023 16:46:57 +0200 Content-Transfer-Encoding: 7bit Message-Id: <7F2D50C0-FE09-424A-80DB-5F377F3B18A3@gmail.com> References: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> <7BA2E212-EA25-4F47-9A1E-C521448A75FE@gmail.com> To: =?utf-8?Q?Gerd_M=C3=B6llmann?= X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > You probably want to include 'lldb' in more places in gud.el. For example: > >> (defgroup gud nil >> "The \"Grand Unified Debugger\" interface. >> Supported debuggers include gdb, sdb, dbx, xdb, perldb, >> pdb (Python), and jdb." > > and in gud-text-menu-bar-map, gud-menu-map, etc. And gud-tooltip-print-command, and probably more places. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 04:16:35 2023 Received: (at 66575) by debbugs.gnu.org; 17 Oct 2023 08:16:35 +0000 Received: from localhost ([127.0.0.1]:58490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsfFi-0002J5-Qd for submit@debbugs.gnu.org; Tue, 17 Oct 2023 04:16:35 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:53308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsfFf-0002IZ-V9 for 66575@debbugs.gnu.org; Tue, 17 Oct 2023 04:16:33 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-53db1fbee70so9087701a12.2 for <66575@debbugs.gnu.org>; Tue, 17 Oct 2023 01:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697530560; x=1698135360; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=cyJqSm09E/mRezHSVBkZVAOVlRsOvgIdAv8DpmCajPQ=; b=GSFi4UFy3X3PzVMux9EaBWzBBfmer1Vd/xC43X2jOrn2GYq2HD0YCLLwvQpmMiwV3M 1eeOJI6HkH5ziC91+K5Gs3pLhkWfE5MI9BQ464ZgWi9unOKrhPvuwH4Gi/6LbX3vygqF pnOvWeSaOL+J91dkB1zAE35Kvt14OOG3xy9HEi6yqY0vRx0frWbXvYL7kkOLGLXlPCX3 8cQmPNbQO7nqAoVkqWuOG2QW8diO7aRh00x5Uu0ZW6pTUgZ5hdWWyZkxfHBba9KL0F9k 2/KV/pYmmnHQg9p5uZRgqirGBe4ovY6XUwxsHFw0dLuGiLFxNADMad5ZtEDM+5Tgb7rH K9LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697530560; x=1698135360; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cyJqSm09E/mRezHSVBkZVAOVlRsOvgIdAv8DpmCajPQ=; b=ClTWPcwFvLbxxhK1m6YOz54acekQ4bHS9bipwcMiGUgPlPn5OhhST0RgPDxmK7Kl0V 1+dZ4gptQ2rfTzs35iHHggIOXh7lj3iyatPxB6Z+zkZ+Qu65dKPktGLOzHmcSsd0o4qc AudMpalDFwrN888hqO4gJVVV5IHl8P5+QQZ9CsflIyIYlOHGZK1B9JwwLjoLiLV0RvSl k/F6rTXshzhOnqQM0pfvf7XNUV82ra10sz5DrSgK6LJFDvL8SRR/caHBklCVda0l/nw4 9dDXE8Uuvuf5/9REli4qeF96AM5nQ7av9RngodduJJ7bGUXSGn2V01IcjQYg0M+MwzLX XcmA== X-Gm-Message-State: AOJu0YzcoN8ekfdGcAe7RIaPGdAGvXDxkE2SO1fkmiJY1wTsJBTIfgiQ pFTTcrD/6dcD2uc/9esJRi7znGyQwcU= X-Google-Smtp-Source: AGHT+IEkwOTrxg2xvNecwt7BwPJgTxbxKrksxo18zMFW6UVhBn/AUx4wrKY7HNn4g2WPtsHuK36IRg== X-Received: by 2002:a17:907:eab:b0:9b2:abda:2543 with SMTP id ho43-20020a1709070eab00b009b2abda2543mr1259994ejc.65.1697530560238; Tue, 17 Oct 2023 01:16:00 -0700 (PDT) Received: from Mini.fritz.box (p4fe3a123.dip0.t-ipconnect.de. [79.227.161.35]) by smtp.gmail.com with ESMTPSA id d1-20020a170906544100b009adc81bb544sm761011ejp.106.2023.10.17.01.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 01:15:59 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Subject: Re: bug#66575: [PATCH] Gud lldb support In-Reply-To: <7F2D50C0-FE09-424A-80DB-5F377F3B18A3@gmail.com> ("Mattias =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Mon, 16 Oct 2023 16:46:57 +0200") References: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> <7BA2E212-EA25-4F47-9A1E-C521448A75FE@gmail.com> <7F2D50C0-FE09-424A-80DB-5F377F3B18A3@gmail.com> Date: Tue, 17 Oct 2023 10:15:58 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mattias Engdeg=C3=A5rd writes: >> You probably want to include 'lldb' in more places in gud.el. For exampl= e: >>=20 >>> (defgroup gud nil >>> "The \"Grand Unified Debugger\" interface. >>> Supported debuggers include gdb, sdb, dbx, xdb, perldb, >>> pdb (Python), and jdb." >>=20 >> and in gud-text-menu-bar-map, gud-menu-map, etc. > > And gud-tooltip-print-command, and probably more places. Thanks. Please find a "final" patch attached. This includes NEWS, manual, what you mentioned and some other stuff. I can't imagine that gud tooltips for non-gdbmi have worked in the last decade or so... Fortunately, I don't have a system where I could test that :-). --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Gud-lldb-support-bug-66575.patch Content-Description: "final" patch >From d32d5b85c48a05e886224a7b20fab8846ad5c78f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Mon, 16 Oct 2023 13:54:02 +0200 Subject: [PATCH] Gud lldb support (bug#66575) * lisp/progmodes/gud.el (lldb): New command. * etc/NEWS: Mention M-x lldb. * src/.lldbinit: Show no souece lines on stop. * doc/building.texi: Mention LLDB. --- doc/emacs/building.texi | 6 +- etc/NEWS | 9 ++ lisp/progmodes/gud.el | 195 +++++++++++++++++++++++++++++++++++----- src/.lldbinit | 4 + 4 files changed, 189 insertions(+), 25 deletions(-) diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 2a98bffdc2d..a2639ce6d3e 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -567,7 +567,7 @@ Debuggers The GUD (Grand Unified Debugger) library provides an Emacs interface to a wide variety of symbolic debuggers. It can run the GNU Debugger -(GDB), as well as DBX, SDB, XDB, Guile REPL debug commands, Perl's +(GDB), as well as LLDB, DBX, SDB, XDB, Guile REPL debug commands, Perl's debugging mode, the Python debugger PDB, and the Java Debugger JDB. Emacs provides a special interface to GDB, which uses extra Emacs @@ -609,6 +609,10 @@ Starting GUD The other commands in this list do the same, for other debugger programs. +@item M-x lldb +@findex lldb +Run the LLDB debugger. + @item M-x perldb @findex perldb Run the Perl interpreter in debug mode. diff --git a/etc/NEWS b/etc/NEWS index 3bd47a0112b..2111f8daba4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -197,6 +197,15 @@ displayed on the mode line when 'appt-display-mode-line' is non-nil. * Editing Changes in Emacs 30.1 ++++ +** New command 'lldb'. +Run the LLDB debugger, analogous to the 'gud-gdb' command. Note that +might want to add these settings to your .lldbinit file, to reduce the +output in the LLDB output when stepping through source files. + +settings set stop-line-count-before 0 +settings set stop-line-count-after 0 + +++ ** New user option 'gud-highlight-current-line'. When enabled, Gud will visually emphasize the line being executed upon diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index d4b954a7203..526a7e5c2ac 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -80,7 +80,7 @@ hl-line-sticky-flag (defgroup gud nil "The \"Grand Unified Debugger\" interface. -Supported debuggers include gdb, sdb, dbx, xdb, perldb, +Supported debuggers include gdb, lldb, sdb, dbx, xdb, perldb, pdb (Python), and jdb." :group 'processes :group 'tools) @@ -173,13 +173,13 @@ gud-text-menu-bar-map "" `(,(propertize "next" 'face 'font-lock-doc-face) . gud-next) "" `(menu-item ,(propertize "until" 'face 'font-lock-doc-face) gud-until - :visible (memq gud-minor-mode '(gdbmi gdb perldb))) + :visible (memq gud-minor-mode '(gdbmi gdb lldb perldb))) "" `(menu-item ,(propertize "cont" 'face 'font-lock-doc-face) gud-cont :visible (not (eq gud-minor-mode 'gdbmi))) "" `(menu-item ,(propertize "run" 'face 'font-lock-doc-face) gud-run - :visible (memq gud-minor-mode '(gdbmi gdb dbx jdb))) + :visible (memq gud-minor-mode '(gdbmi gdb lldb dbx jdb))) "" `(menu-bar-item ,(propertize " go " 'face 'font-lock-doc-face) gud-go :visible (and (eq gud-minor-mode 'gdbmi) @@ -231,13 +231,13 @@ gud-menu-map :enable (not gud-running)] ["Next Instruction" gud-nexti :enable (not gud-running) - :visible (memq gud-minor-mode '(gdbmi gdb dbx))] + :visible (memq gud-minor-mode '(gdbmi gdb lldb dbx))] ["Step Instruction" gud-stepi :enable (not gud-running) - :visible (memq gud-minor-mode '(gdbmi gdb dbx))] + :visible (memq gud-minor-mode '(gdbmi gdb lldb dbx))] ["Finish Function" gud-finish :enable (not gud-running) - :visible (memq gud-minor-mode '(gdbmi gdb guiler xdb jdb pdb))] + :visible (memq gud-minor-mode '(gdbmi gdb lldb guiler xdb jdb pdb))] ["Watch Expression" gud-watch :enable (not gud-running) :visible (eq gud-minor-mode 'gdbmi)] @@ -248,7 +248,7 @@ gud-menu-map "Dump object" "Print Dereference") :enable (not gud-running) - :visible (memq gud-minor-mode '(gdbmi gdb jdb))] + :visible (memq gud-minor-mode '(gdbmi gdb lldb jdb))] ["Print S-expression" gud-pp :enable (and (not gud-running) (bound-and-true-p gdb-active-process)) @@ -259,23 +259,23 @@ gud-menu-map (eq gud-minor-mode 'gdbmi))] ["Down Stack" gud-down :enable (not gud-running) - :visible (memq gud-minor-mode '(gdbmi gdb guiler dbx xdb jdb pdb))] + :visible (memq gud-minor-mode '(gdbmi gdb lldb guiler dbx xdb jdb pdb))] ["Up Stack" gud-up :enable (not gud-running) :visible (memq gud-minor-mode - '(gdbmi gdb guiler dbx xdb jdb pdb))] + '(gdbmi gdb lldb guiler dbx xdb jdb pdb))] ["Set Breakpoint" gud-break :enable (or (not gud-running) gud-async-running) :visible (gud-tool-bar-item-visible-no-fringe)] ["Temporary Breakpoint" gud-tbreak :enable (or (not gud-running) gud-async-running) - :visible (memq gud-minor-mode '(gdbmi gdb sdb xdb))] + :visible (memq gud-minor-mode '(gdbmi gdb lldb sdb xdb))] ["Remove Breakpoint" gud-remove :enable (or (not gud-running) gud-async-running) :visible (gud-tool-bar-item-visible-no-fringe)] ["Continue to selection" gud-until :enable (not gud-running) - :visible (and (memq gud-minor-mode '(gdbmi gdb perldb)) + :visible (and (memq gud-minor-mode '(gdbmi gdb lldb perldb)) (gud-tool-bar-item-visible-no-fringe))] ["Stop" gud-stop-subjob :visible (or (not (memq gud-minor-mode '(gdbmi pdb))) @@ -288,7 +288,7 @@ gud-menu-map (gdb-show-run-p))] ["Run" gud-run :enable (or (not gud-running) gud-async-running) - :visible (or (memq gud-minor-mode '(gdb dbx jdb)) + :visible (or (memq gud-minor-mode '(gdb lldb dbx jdb)) (and (eq gud-minor-mode 'gdbmi) (or (not (gdb-show-run-p)) (bound-and-true-p @@ -299,7 +299,7 @@ gud-menu-map (display-graphic-p) (fboundp 'x-show-tip)) :visible (memq gud-minor-mode - '(gdbmi guiler dbx sdb xdb pdb)) + '(gdbmi lldb guiler dbx sdb xdb pdb)) :button (:toggle . gud-tooltip-mode)] ["Info (debugger)" gud-goto-info])) @@ -973,6 +973,7 @@ gud-gdb-fetch-lines-filter (setq gud-gdb-fetch-lines-string string) ""))) + ;; gdb speedbar functions ;; Part of the macro expansion of dframe-with-attached-buffer. @@ -2702,10 +2703,12 @@ gud-delete-prompt-marker (define-derived-mode gud-mode comint-mode "Debugger" "Major mode for interacting with an inferior debugger process. - You start it up with one of the commands \\[gdb], \\[sdb], \\[dbx], -\\[perldb], \\[xdb], or \\[jdb]. Each entry point finishes by executing a -hook; `gdb-mode-hook', `sdb-mode-hook', `dbx-mode-hook', -`perldb-mode-hook', `xdb-mode-hook', or `jdb-mode-hook' respectively. + You start it up with one of the commands \\[gdb], \\[lldb], +\\[sdb], \\[dbx], \\[perldb], \\[xdb], or \\[jdb]. Each entry +point finishes by executing a hook; `gdb-mode-hook', +`lldb-mode-hook' `sdb-mode-hook', `dbx-mode-hook', +`perldb-mode-hook', `xdb-mode-hook', or `jdb-mode-hook' +respectively. After startup, the following commands are available in both the GUD interaction buffer and any source buffer GUD visits due to a breakpoint stop @@ -2735,11 +2738,11 @@ gud-mode except that the breakpoint is temporary; that is, it is removed when execution stops on it. -Under gdb, dbx, and xdb, \\[gud-up] pops up through an enclosing stack -frame. \\[gud-down] drops back down through one. +Under gdb, lldb, dbx, and xdb, \\[gud-up] pops up through an +enclosing stack frame. \\[gud-down] drops back down through one. -If you are using gdb or xdb, \\[gud-finish] runs execution to the return from -the current function and stops. +If you are using gdb, lldb, or xdb, \\[gud-finish] runs execution +to the return from the current function and stops. All the keystrokes above are accessible in the GUD buffer with the prefix C-c, and in all buffers through the prefix C-x C-a. @@ -3767,13 +3770,18 @@ gud-tooltip-dereference ; gdb-mi.el gets around this problem. (defun gud-tooltip-process-output (process output) "Process debugger output and show it in a tooltip window." - (remove-function (process-filter process) #'gud-tooltip-process-output) - (tooltip-show (tooltip-strip-prompt process output) - (or gud-tooltip-echo-area (not tooltip-mode)))) + ;; First line is the print command itself. + (unless (string-match (regexp-quote (gud-tooltip-print-command "")) + output) + (remove-function (process-filter process) + #'gud-tooltip-process-output) + (tooltip-show (tooltip-strip-prompt process output) + (or gud-tooltip-echo-area (not tooltip-mode))))) (defun gud-tooltip-print-command (expr) "Return a suitable command to print the expression EXPR." (pcase gud-minor-mode + ('lldb (format "dwim-print -- %s" expr)) ('gdbmi (concat "-data-evaluate-expression \"" expr "\"")) ('guiler expr) ('dbx (concat "print " expr)) @@ -3835,11 +3843,150 @@ gud-tooltip-tips (gdb-input (concat cmd "\n") (lambda () (gdb-tooltip-print expr)))) + ;; Not gdbmi. (add-function :override (process-filter process) #'gud-tooltip-process-output) (gud-basic-call cmd)) expr)))))))) + +;; 'gud-lldb-history' and 'gud-gud-lldb-command-name' are required +;; because gud-symbol uses their values if they are present. Their +;; names are deduced from the minor-mode name. +(defvar gud-lldb-history nil) + +(defcustom gud-gud-lldb-command-name "lldb" + "Default command to run an executable under LLDB in text command mode." + :type 'string) + +(defun gud-lldb-marker-filter (string) + "Deduce interesting stuff from output STRING." + (cond (;; Process 72668 stopped + ;; * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 + ;; frame #0: ...) at emacs.c:1310:9 [opt] + (string-match (rx (and line-start (0+ blank) "frame" + (0+ not-newline) " at " + (group (1+ (not ":"))) + ":" + (group (1+ digit)))) + string) + (setq gud-last-frame + (cons (match-string 1 string) + (string-to-number (match-string 2 string))))) + (;; Process 72874 exited with status = 9 (0x00000009) killed + (string-match (rx "Process " (1+ digit) " exited with status") + string) + (setq gud-last-last-frame nil) + (setq gud-overlay-arrow-position nil))) + string) + +;;;###autoload +(defun lldb (command-line) + "Run lldb passing it COMMAND-LINE as arguments. +If COMMAND-LINE names a program FILE to debug, lldb will run in +a buffer named *gud-FILE*, and the directory containing FILE +becomes the initial working directory and source-file directory +for your debugger. If you don't want `default-directory' to +change to the directory of FILE, specify FILE without leading +directories, in which case FILE should reside either in the +directory of the buffer from which this command is invoked, or +it can be found by searching PATH. + +If COMMAND-LINE requests that lldb attaches to a process PID, lldb +will run in *gud-PID*, otherwise it will run in *gud*; in these +cases the initial working directory is the `default-directory' of +the buffer in which this command was invoked." + (interactive (list (gud-query-cmdline 'lldb))) + + (when (and gud-comint-buffer + (buffer-name gud-comint-buffer) + (get-buffer-process gud-comint-buffer) + (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gud-lldb))) + (gdb-restore-windows) + ;; FIXME: Copied from gud-gdb, but what does that even say? + (error "Multiple debugging requires restarting in text command mode")) + + (gud-common-init command-line nil 'gud-lldb-marker-filter) + (setq-local gud-minor-mode 'lldb) + + (gud-def gud-break + "breakpoint set --joint-specifier %f:%l" + "\C-b" + "Set breakpoint at current line.") + (gud-def gud-tbreak + "_regexp-break %f:%l" + "\C-t" + "Set temporary breakpoint at current line.") + (gud-def gud-remove + "breakpoint clear --line %l --file %f" + "\C-d" + "Remove breakpoint at current line") + (gud-def gud-step "thread step-in --count %p" + "\C-s" + "Step one source line with display.") + (gud-def gud-stepi + "thread step-inst --count %p" + "\C-i" + "Step one instruction with display.") + (gud-def gud-next + "thread step-over --count %p" + "\C-n" + "Step one line (skip functions).") + (gud-def gud-nexti + "thread step-inst-over --count %p" + nil + "Step one instruction (skip functions).") + (gud-def gud-cont + "process continue --ignore-count %p" + "\C-r" + "Continue with display.") + (gud-def gud-finish + "thread step-out" + "\C-f" + "Finish executing current function.") + (gud-def gud-jump + (progn + (gud-call "_regexp-break %f:%l" arg) + (gud-call "_regexp-jump %f:%l")) + "\C-j" + "Set execution address to current line.") + (gud-def gud-up + "_regexp-up %p" + "<" + "Up N stack frames (numeric arg).") + (gud-def gud-down + "_regexp-down %p" + ">" + "Down N stack frames (numeric arg).") + (gud-def gud-print + "dwim-print %e" + "\C-p" + "Evaluate C expression at point.") + (gud-def gud-pstar + "dwim-print *%e" + nil + "Evaluate C dereferenced pointer expression at point.") + (gud-def gud-pv + "xprint %e" + "\C-v" + "Print value of lisp variable (for debugging Emacs only).") + (gud-def gud-until + "thread until %l" + "\C-u" + "Continue to current line.") + (gud-def gud-run + ;; Extension for process launch --tty? + "process launch -X true" + nil + "Run the program.") + + (gud-set-repeat-map-property 'gud-gdb-repeat-map) + (setq comint-prompt-regexp (rx line-start "(lldb)" (0+ blank))) + (setq paragraph-start comint-prompt-regexp) + (setq gud-running nil) + (setq gud-filter-pending-text nil) + (run-hooks 'lldb-mode-hook)) + (provide 'gud) ;;; gud.el ends here diff --git a/src/.lldbinit b/src/.lldbinit index a5789f49122..430c48f91f0 100644 --- a/src/.lldbinit +++ b/src/.lldbinit @@ -33,4 +33,8 @@ command script import emacs_lldb # Print with children provider, depth 2. command alias xprint frame variable -P 2 +# This is for M-x lldb: don't show source lines when stopping. +settings set stop-line-count-before 0 +settings set stop-line-count-after 0 + # end. -- 2.42.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 05:01:11 2023 Received: (at 66575) by debbugs.gnu.org; 17 Oct 2023 09:01:11 +0000 Received: from localhost ([127.0.0.1]:58575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsfwt-0006Ov-3m for submit@debbugs.gnu.org; Tue, 17 Oct 2023 05:01:11 -0400 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]:45383) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsfwq-0006OT-M1 for 66575@debbugs.gnu.org; Tue, 17 Oct 2023 05:01:09 -0400 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c5039d4e88so59918831fa.3 for <66575@debbugs.gnu.org>; Tue, 17 Oct 2023 02:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697533237; x=1698138037; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=91G+BMn/mhp/hhHp2vD3rEQvQbMRH9RPxkNdDnUsb+o=; b=bcrIYKWS9oB0M3HmjNTWyLxDgkWh3EInhCUh0ZW1J8ygcXG3ReceqvbOClXKFd6Lnj x1m3GEZj045QQsDrrkBDVwISHGmM+0ZWqpdUdmsvqvtniDxHy2WqvsH6ail/Gr6y3DpT XNjZiGTprRDRleifSbGBdoSzxlTxgt8hcOV2jfN5/nxeHdFWqF7urSxQTo6IyAznbius Pg8stYzA2PpRRS/F9p41MCNvol3jINJii49A/feD+D3kXCOc/4BKfDq6Y361QzgmojFE 86poXiPnW+ZkojzjFpLrEPhJCzRw2jnkYkonl59H+R2rkR0rGRZck7IwVkG2fDJkno3u L5hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697533237; x=1698138037; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=91G+BMn/mhp/hhHp2vD3rEQvQbMRH9RPxkNdDnUsb+o=; b=bM0G8RYclnthNFL2c9sT5R8KZzUVtnASQwVj8zW9NDvK6EGXaH3YSbylLCa+BU96oo /Aepd3EjVJBr1N2HVEUAjBzKzXYWUCBJrKvv4nYhRtMxdcaGPYiDt7+1HZM1UmGVja9Z XLAnhKqfxUbVbegMgLYLIA5n21Rrkwpxs7AB1/OG2XZSrZDq6Pz4i+wegBtELUK/M1On FFlSuc17y7L/ZA4YBzb9L6nJm4Fd/+URZQYoVTKlaaeJimuiRcOvZv+bKPo52H1B4xsN 9FnlnbPHGt0PdWjmkC4sbbMh44sr2NemiYJA6PsDsPwbPrfnwkuFIEyyp9I7SnhucYdR Xw8Q== X-Gm-Message-State: AOJu0YwVxaO85Axd+ycYfK8ySTVORfMxZsDHmpt8/vOfTD3KZ1tQfQ5q x9kR45NEh9jh3BqcYBVOgt9w5TAHp43G6Q== X-Google-Smtp-Source: AGHT+IG6wazEJsazdcB4QTRLRrSSiAZwZBTuUWfcEcRr0ybxABWTst/0TSEcvobMSVtDqsJtrXi+4w== X-Received: by 2002:ac2:5049:0:b0:505:6eef:cf2d with SMTP id a9-20020ac25049000000b005056eefcf2dmr1163332lfm.17.1697533237127; Tue, 17 Oct 2023 02:00:37 -0700 (PDT) Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id v10-20020a056512348a00b00505a20d070asm193100lfr.78.2023.10.17.02.00.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Oct 2023 02:00:36 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: bug#66575: [PATCH] Gud lldb support From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: Date: Tue, 17 Oct 2023 11:00:35 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <19FFB7CA-6501-4E62-9EC6-D5F2DB680D70@gmail.com> References: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> To: =?utf-8?Q?Gerd_M=C3=B6llmann?= X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 16 okt. 2023 kl. 16.09 skrev Gerd M=C3=B6llmann = : >> So what is the currently blessed way to communicate with LLDB? >=20 > Don't really know, I'm afraid. Maybe it's worth a try anyway, since lldb-mi still seems maintained as a = separate tool. (But don't let it hold up your contribution -- it's useful on its own.) >> If th=C3=B1e file name can have an absolute directory part, then it = may run >> into trouble on Windows (C:\Some\Dir\File.c). >=20 > I guess I'll leave that as an exercise for someone having Windows :-). I don't, but we could try to be nice anyway. What about replacing (group (1+ (not ":"))) with something like (group (opt (opt "\\\\?\\") ; Windows fun (in "a-zA-Z") ":") ; floppy letter (1+ (not ":"))) and ignore NTFS Alternate Data Streams, as we ignore the possibility of = colons in file names on other systems? Onto your most recent patch -- looks fine in general, only a few notes: > * Editing Changes in Emacs 30.1 > =20 > ++++ > +** New command 'lldb'. The text can be rearranged later on but this entry probably belongs = under 'Changes in Specialized Modes and Packages'. > +Run the LLDB debugger, analogous to the 'gud-gdb' command. Note that > +might want to add these settings to your .lldbinit file, to reduce = the Missing 'you' in the second sentence? > +output in the LLDB output when stepping through source files. > + > +settings set stop-line-count-before 0 > +settings set stop-line-count-after 0 Indent these lines by 4 spaces (NEWS has its own formatting rules). But shouldn't your new code issue these commands to lldb automatically? = The user might not always run lldb under Emacs. > + ;; First line is the print command itself. > + (unless (string-match (regexp-quote (gud-tooltip-print-command "")) Isn't this just (string-search ...) ? Or did you want a more precise = match, in which case it probably should be anchored in some way and not = just a substring search? > +# This is for M-x lldb: don't show source lines when stopping. > +settings set stop-line-count-before 0 > +settings set stop-line-count-after 0 As mentioned above, I'd hope we could do without this. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 06:03:40 2023 Received: (at 66575) by debbugs.gnu.org; 17 Oct 2023 10:03:40 +0000 Received: from localhost ([127.0.0.1]:58688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsgvL-0005Da-3Z for submit@debbugs.gnu.org; Tue, 17 Oct 2023 06:03:40 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]:61585) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsgvI-0005DM-I6 for 66575@debbugs.gnu.org; Tue, 17 Oct 2023 06:03:38 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-99c1c66876aso888624166b.2 for <66575@debbugs.gnu.org>; Tue, 17 Oct 2023 03:03:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697536985; x=1698141785; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=xQVEp3xOpjF2EyfPpiQpgIvRdCxp4fFXT47FCHEM6Ws=; b=A4MaDiMQDwb4KUauq84zWHPC3Cvmp4Y/ESfeI0brfngKCkPoR8+IeU3vTqRcI1d9yI feyr0+qWZkQJM3zmldCTPwNzxGbuJ1DOsehiyf2gDBpLfD/5O/FEEjZ5NgqTDIq1B76p +2WbudghfHAw/2dEeKkG0DAynGozHZKs7RuzzDe5RyghSF7gkbF+xHK032EFFiE/SJVl PviALZ4Eh9nD0Mt9boiHaKy4N+s9/J4+fvJQHdWtUhmRRUPBhibZdswC6ArAvnz6ksID CmjUN3APN2dXALDT8YTqo4uajlgeyUsEK5JZp7BvqsWvqhKtR7ol1D64nI+XAOFCvMIb 5DFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697536985; x=1698141785; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xQVEp3xOpjF2EyfPpiQpgIvRdCxp4fFXT47FCHEM6Ws=; b=DZS1NhcYnuN8y8oXRsc7wSLPH6hDM1ZB4CJ/bVbhrslymUn+AwtjsSWmwTLd+VPhIz ZLyL3l2rjie+YFFPHBgdLkt80wtjqSXA+PhX9D5gj256BaX2PqN8RVZEOYa616CMQDfW gCvXjvqUVf64DzohTibltoZoYgbwLPs3fnW+pIuobS3rinDwLgNXL55R9ajEW3hZSVBk XmziEDcx+eLqOkiN3ctrAlPDOYh+D8HBeI1JwTY8qbvDqKzY/sMxlM6wpfT7HchMao3m Oq8LeArTGLDWzb7Ps6xSSPOntcH4osmhj2uKv+ULbG8ClXFDDoLcOohMfiIWPSzOHY9+ wDIQ== X-Gm-Message-State: AOJu0Yw/VB5pwJtnL7lRLQJl212KOzb2n44fRzd4eZPepGlI6X/TjP+2 tHdQaD4NTtb8NVyhFan0zikETYzIIh0= X-Google-Smtp-Source: AGHT+IFYPCxtnAXqlXRQn/k3/jLedWsTHz7QihjR5YGKxeu7zXnNfXMoop8s0+kXZyve/5XQiciC1w== X-Received: by 2002:a17:907:7fa4:b0:9a5:b878:7336 with SMTP id qk36-20020a1709077fa400b009a5b8787336mr1486637ejc.7.1697536984456; Tue, 17 Oct 2023 03:03:04 -0700 (PDT) Received: from Mini.fritz.box (p4fe3a123.dip0.t-ipconnect.de. [79.227.161.35]) by smtp.gmail.com with ESMTPSA id l8-20020a1709061c4800b009944e955e19sm945342ejg.30.2023.10.17.03.03.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 03:03:02 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Subject: Re: bug#66575: [PATCH] Gud lldb support In-Reply-To: <19FFB7CA-6501-4E62-9EC6-D5F2DB680D70@gmail.com> ("Mattias =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Tue, 17 Oct 2023 11:00:35 +0200") References: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> <19FFB7CA-6501-4E62-9EC6-D5F2DB680D70@gmail.com> Date: Tue, 17 Oct 2023 12:03:01 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mattias Engdeg=C3=A5rd writes: > 16 okt. 2023 kl. 16.09 skrev Gerd M=C3=B6llmann : > >>> So what is the currently blessed way to communicate with LLDB? >>=20 >> Don't really know, I'm afraid. > > Maybe it's worth a try anyway, since lldb-mi still seems maintained as a = separate tool. > (But don't let it hold up your contribution -- it's useful on its > own.) Maybe it would be worth it, don't know, but lldb-mi isn't even installable via Homebrew at the moment... >>> If th=C3=B1e file name can have an absolute directory part, then it may= run >>> into trouble on Windows (C:\Some\Dir\File.c). >>=20 >> I guess I'll leave that as an exercise for someone having Windows :-). > > I don't, but we could try to be nice anyway. What about replacing > > (group (1+ (not ":"))) > > with something like > > (group (opt (opt "\\\\?\\") ; Windows fun > (in "a-zA-Z") ":") ; floppy letter > (1+ (not ":"))) > > and ignore NTFS Alternate Data Streams, as we ignore the possibility > of colons in file names on other systems? Hm. I'd rather see someone run lldb on Windows, and tell us if it even prints absolute file names. It doesn't seem to do that on macOS. > Onto your most recent patch -- looks fine in general, only a few notes: > >> * Editing Changes in Emacs 30.1 >>=20=20 >> ++++ >> +** New command 'lldb'. > > The text can be rearranged later on but this entry probably belongs under= 'Changes in Specialized Modes and Packages'. > >> +Run the LLDB debugger, analogous to the 'gud-gdb' command. Note that >> +might want to add these settings to your .lldbinit file, to reduce the > > Missing 'you' in the second sentence? > >> +output in the LLDB output when stepping through source files. >> + >> +settings set stop-line-count-before 0 >> +settings set stop-line-count-after 0 > > Indent these lines by 4 spaces (NEWS has its own formatting rules). Fixed, and moved. Thanks. > But shouldn't your new code issue these commands to lldb automatically? T= he user might not always run lldb under Emacs. > I've thought about doing that as an initialization, but then it would have to be manually undone once lldb is running, since .lldbinit is loaded first, AFAIK, if enabled (default =3D no), which one could suppress and load it later, but that might also not be what the user wants. And so on... So, to keep things simple, I'd rather leave the user's settings alone. It doesn't make a difference, functionally. >> + ;; First line is the print command itself. >> + (unless (string-match (regexp-quote (gud-tooltip-print-command "")) > > Isn't this just (string-search ...) ? Or did you want a more precise > match, in which case it probably should be anchored in some way and > not just a substring search? That's true. I was too lazy to change that after experimenting with this stuff :-). I've changed that. >> +# This is for M-x lldb: don't show source lines when stopping. >> +settings set stop-line-count-before 0 >> +settings set stop-line-count-after 0 > > As mentioned above, I'd hope we could do without this. New version attached. I guess I'll commit that soon :-). --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Gud-lldb-support-bug-66575.patch Content-Description: Final final patch >From 2172061b1f73705bce22970cc0921657912e0b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Mon, 16 Oct 2023 13:54:02 +0200 Subject: [PATCH] Gud lldb support (bug#66575) * lisp/progmodes/gud.el (lldb): New command. * etc/NEWS: Mention M-x lldb. * src/.lldbinit: Show no souece lines on stop. * doc/building.texi: Mention LLDB. --- doc/emacs/building.texi | 6 +- etc/NEWS | 9 ++ lisp/progmodes/gud.el | 194 +++++++++++++++++++++++++++++++++++----- src/.lldbinit | 4 + 4 files changed, 188 insertions(+), 25 deletions(-) diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 2a98bffdc2d..a2639ce6d3e 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -567,7 +567,7 @@ Debuggers The GUD (Grand Unified Debugger) library provides an Emacs interface to a wide variety of symbolic debuggers. It can run the GNU Debugger -(GDB), as well as DBX, SDB, XDB, Guile REPL debug commands, Perl's +(GDB), as well as LLDB, DBX, SDB, XDB, Guile REPL debug commands, Perl's debugging mode, the Python debugger PDB, and the Java Debugger JDB. Emacs provides a special interface to GDB, which uses extra Emacs @@ -609,6 +609,10 @@ Starting GUD The other commands in this list do the same, for other debugger programs. +@item M-x lldb +@findex lldb +Run the LLDB debugger. + @item M-x perldb @findex perldb Run the Perl interpreter in debug mode. diff --git a/etc/NEWS b/etc/NEWS index 3bd47a0112b..83612f84e17 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -283,6 +283,15 @@ functions in CJK locales. * Changes in Specialized Modes and Packages in Emacs 30.1 ++++ +** New command 'lldb'. +Run the LLDB debugger, analogous to the 'gud-gdb' command. Note that +you might want to add these settings to your .lldbinit file, to reduce +the output in the LLDB output when stepping through source files. + + settings set stop-line-count-before 0 + settings set stop-line-count-after 0 + ** gdb-mi --- diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index d4b954a7203..ea5a3580629 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -80,7 +80,7 @@ hl-line-sticky-flag (defgroup gud nil "The \"Grand Unified Debugger\" interface. -Supported debuggers include gdb, sdb, dbx, xdb, perldb, +Supported debuggers include gdb, lldb, sdb, dbx, xdb, perldb, pdb (Python), and jdb." :group 'processes :group 'tools) @@ -173,13 +173,13 @@ gud-text-menu-bar-map "" `(,(propertize "next" 'face 'font-lock-doc-face) . gud-next) "" `(menu-item ,(propertize "until" 'face 'font-lock-doc-face) gud-until - :visible (memq gud-minor-mode '(gdbmi gdb perldb))) + :visible (memq gud-minor-mode '(gdbmi gdb lldb perldb))) "" `(menu-item ,(propertize "cont" 'face 'font-lock-doc-face) gud-cont :visible (not (eq gud-minor-mode 'gdbmi))) "" `(menu-item ,(propertize "run" 'face 'font-lock-doc-face) gud-run - :visible (memq gud-minor-mode '(gdbmi gdb dbx jdb))) + :visible (memq gud-minor-mode '(gdbmi gdb lldb dbx jdb))) "" `(menu-bar-item ,(propertize " go " 'face 'font-lock-doc-face) gud-go :visible (and (eq gud-minor-mode 'gdbmi) @@ -231,13 +231,13 @@ gud-menu-map :enable (not gud-running)] ["Next Instruction" gud-nexti :enable (not gud-running) - :visible (memq gud-minor-mode '(gdbmi gdb dbx))] + :visible (memq gud-minor-mode '(gdbmi gdb lldb dbx))] ["Step Instruction" gud-stepi :enable (not gud-running) - :visible (memq gud-minor-mode '(gdbmi gdb dbx))] + :visible (memq gud-minor-mode '(gdbmi gdb lldb dbx))] ["Finish Function" gud-finish :enable (not gud-running) - :visible (memq gud-minor-mode '(gdbmi gdb guiler xdb jdb pdb))] + :visible (memq gud-minor-mode '(gdbmi gdb lldb guiler xdb jdb pdb))] ["Watch Expression" gud-watch :enable (not gud-running) :visible (eq gud-minor-mode 'gdbmi)] @@ -248,7 +248,7 @@ gud-menu-map "Dump object" "Print Dereference") :enable (not gud-running) - :visible (memq gud-minor-mode '(gdbmi gdb jdb))] + :visible (memq gud-minor-mode '(gdbmi gdb lldb jdb))] ["Print S-expression" gud-pp :enable (and (not gud-running) (bound-and-true-p gdb-active-process)) @@ -259,23 +259,23 @@ gud-menu-map (eq gud-minor-mode 'gdbmi))] ["Down Stack" gud-down :enable (not gud-running) - :visible (memq gud-minor-mode '(gdbmi gdb guiler dbx xdb jdb pdb))] + :visible (memq gud-minor-mode '(gdbmi gdb lldb guiler dbx xdb jdb pdb))] ["Up Stack" gud-up :enable (not gud-running) :visible (memq gud-minor-mode - '(gdbmi gdb guiler dbx xdb jdb pdb))] + '(gdbmi gdb lldb guiler dbx xdb jdb pdb))] ["Set Breakpoint" gud-break :enable (or (not gud-running) gud-async-running) :visible (gud-tool-bar-item-visible-no-fringe)] ["Temporary Breakpoint" gud-tbreak :enable (or (not gud-running) gud-async-running) - :visible (memq gud-minor-mode '(gdbmi gdb sdb xdb))] + :visible (memq gud-minor-mode '(gdbmi gdb lldb sdb xdb))] ["Remove Breakpoint" gud-remove :enable (or (not gud-running) gud-async-running) :visible (gud-tool-bar-item-visible-no-fringe)] ["Continue to selection" gud-until :enable (not gud-running) - :visible (and (memq gud-minor-mode '(gdbmi gdb perldb)) + :visible (and (memq gud-minor-mode '(gdbmi gdb lldb perldb)) (gud-tool-bar-item-visible-no-fringe))] ["Stop" gud-stop-subjob :visible (or (not (memq gud-minor-mode '(gdbmi pdb))) @@ -288,7 +288,7 @@ gud-menu-map (gdb-show-run-p))] ["Run" gud-run :enable (or (not gud-running) gud-async-running) - :visible (or (memq gud-minor-mode '(gdb dbx jdb)) + :visible (or (memq gud-minor-mode '(gdb lldb dbx jdb)) (and (eq gud-minor-mode 'gdbmi) (or (not (gdb-show-run-p)) (bound-and-true-p @@ -299,7 +299,7 @@ gud-menu-map (display-graphic-p) (fboundp 'x-show-tip)) :visible (memq gud-minor-mode - '(gdbmi guiler dbx sdb xdb pdb)) + '(gdbmi lldb guiler dbx sdb xdb pdb)) :button (:toggle . gud-tooltip-mode)] ["Info (debugger)" gud-goto-info])) @@ -973,6 +973,7 @@ gud-gdb-fetch-lines-filter (setq gud-gdb-fetch-lines-string string) ""))) + ;; gdb speedbar functions ;; Part of the macro expansion of dframe-with-attached-buffer. @@ -2702,10 +2703,12 @@ gud-delete-prompt-marker (define-derived-mode gud-mode comint-mode "Debugger" "Major mode for interacting with an inferior debugger process. - You start it up with one of the commands \\[gdb], \\[sdb], \\[dbx], -\\[perldb], \\[xdb], or \\[jdb]. Each entry point finishes by executing a -hook; `gdb-mode-hook', `sdb-mode-hook', `dbx-mode-hook', -`perldb-mode-hook', `xdb-mode-hook', or `jdb-mode-hook' respectively. + You start it up with one of the commands \\[gdb], \\[lldb], +\\[sdb], \\[dbx], \\[perldb], \\[xdb], or \\[jdb]. Each entry +point finishes by executing a hook; `gdb-mode-hook', +`lldb-mode-hook' `sdb-mode-hook', `dbx-mode-hook', +`perldb-mode-hook', `xdb-mode-hook', or `jdb-mode-hook' +respectively. After startup, the following commands are available in both the GUD interaction buffer and any source buffer GUD visits due to a breakpoint stop @@ -2735,11 +2738,11 @@ gud-mode except that the breakpoint is temporary; that is, it is removed when execution stops on it. -Under gdb, dbx, and xdb, \\[gud-up] pops up through an enclosing stack -frame. \\[gud-down] drops back down through one. +Under gdb, lldb, dbx, and xdb, \\[gud-up] pops up through an +enclosing stack frame. \\[gud-down] drops back down through one. -If you are using gdb or xdb, \\[gud-finish] runs execution to the return from -the current function and stops. +If you are using gdb, lldb, or xdb, \\[gud-finish] runs execution +to the return from the current function and stops. All the keystrokes above are accessible in the GUD buffer with the prefix C-c, and in all buffers through the prefix C-x C-a. @@ -3767,13 +3770,17 @@ gud-tooltip-dereference ; gdb-mi.el gets around this problem. (defun gud-tooltip-process-output (process output) "Process debugger output and show it in a tooltip window." - (remove-function (process-filter process) #'gud-tooltip-process-output) - (tooltip-show (tooltip-strip-prompt process output) - (or gud-tooltip-echo-area (not tooltip-mode)))) + ;; First line is the print command itself. + (unless (string-search (gud-tooltip-print-command "") output) + (remove-function (process-filter process) + #'gud-tooltip-process-output) + (tooltip-show (tooltip-strip-prompt process output) + (or gud-tooltip-echo-area (not tooltip-mode))))) (defun gud-tooltip-print-command (expr) "Return a suitable command to print the expression EXPR." (pcase gud-minor-mode + ('lldb (format "dwim-print -- %s" expr)) ('gdbmi (concat "-data-evaluate-expression \"" expr "\"")) ('guiler expr) ('dbx (concat "print " expr)) @@ -3835,11 +3842,150 @@ gud-tooltip-tips (gdb-input (concat cmd "\n") (lambda () (gdb-tooltip-print expr)))) + ;; Not gdbmi. (add-function :override (process-filter process) #'gud-tooltip-process-output) (gud-basic-call cmd)) expr)))))))) + +;; 'gud-lldb-history' and 'gud-gud-lldb-command-name' are required +;; because gud-symbol uses their values if they are present. Their +;; names are deduced from the minor-mode name. +(defvar gud-lldb-history nil) + +(defcustom gud-gud-lldb-command-name "lldb" + "Default command to run an executable under LLDB in text command mode." + :type 'string) + +(defun gud-lldb-marker-filter (string) + "Deduce interesting stuff from output STRING." + (cond (;; Process 72668 stopped + ;; * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 + ;; frame #0: ...) at emacs.c:1310:9 [opt] + (string-match (rx (and line-start (0+ blank) "frame" + (0+ not-newline) " at " + (group (1+ (not ":"))) + ":" + (group (1+ digit)))) + string) + (setq gud-last-frame + (cons (match-string 1 string) + (string-to-number (match-string 2 string))))) + (;; Process 72874 exited with status = 9 (0x00000009) killed + (string-match (rx "Process " (1+ digit) " exited with status") + string) + (setq gud-last-last-frame nil) + (setq gud-overlay-arrow-position nil))) + string) + +;;;###autoload +(defun lldb (command-line) + "Run lldb passing it COMMAND-LINE as arguments. +If COMMAND-LINE names a program FILE to debug, lldb will run in +a buffer named *gud-FILE*, and the directory containing FILE +becomes the initial working directory and source-file directory +for your debugger. If you don't want `default-directory' to +change to the directory of FILE, specify FILE without leading +directories, in which case FILE should reside either in the +directory of the buffer from which this command is invoked, or +it can be found by searching PATH. + +If COMMAND-LINE requests that lldb attaches to a process PID, lldb +will run in *gud-PID*, otherwise it will run in *gud*; in these +cases the initial working directory is the `default-directory' of +the buffer in which this command was invoked." + (interactive (list (gud-query-cmdline 'lldb))) + + (when (and gud-comint-buffer + (buffer-name gud-comint-buffer) + (get-buffer-process gud-comint-buffer) + (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gud-lldb))) + (gdb-restore-windows) + ;; FIXME: Copied from gud-gdb, but what does that even say? + (error "Multiple debugging requires restarting in text command mode")) + + (gud-common-init command-line nil 'gud-lldb-marker-filter) + (setq-local gud-minor-mode 'lldb) + + (gud-def gud-break + "breakpoint set --joint-specifier %f:%l" + "\C-b" + "Set breakpoint at current line.") + (gud-def gud-tbreak + "_regexp-break %f:%l" + "\C-t" + "Set temporary breakpoint at current line.") + (gud-def gud-remove + "breakpoint clear --line %l --file %f" + "\C-d" + "Remove breakpoint at current line") + (gud-def gud-step "thread step-in --count %p" + "\C-s" + "Step one source line with display.") + (gud-def gud-stepi + "thread step-inst --count %p" + "\C-i" + "Step one instruction with display.") + (gud-def gud-next + "thread step-over --count %p" + "\C-n" + "Step one line (skip functions).") + (gud-def gud-nexti + "thread step-inst-over --count %p" + nil + "Step one instruction (skip functions).") + (gud-def gud-cont + "process continue --ignore-count %p" + "\C-r" + "Continue with display.") + (gud-def gud-finish + "thread step-out" + "\C-f" + "Finish executing current function.") + (gud-def gud-jump + (progn + (gud-call "_regexp-break %f:%l" arg) + (gud-call "_regexp-jump %f:%l")) + "\C-j" + "Set execution address to current line.") + (gud-def gud-up + "_regexp-up %p" + "<" + "Up N stack frames (numeric arg).") + (gud-def gud-down + "_regexp-down %p" + ">" + "Down N stack frames (numeric arg).") + (gud-def gud-print + "dwim-print %e" + "\C-p" + "Evaluate C expression at point.") + (gud-def gud-pstar + "dwim-print *%e" + nil + "Evaluate C dereferenced pointer expression at point.") + (gud-def gud-pv + "xprint %e" + "\C-v" + "Print value of lisp variable (for debugging Emacs only).") + (gud-def gud-until + "thread until %l" + "\C-u" + "Continue to current line.") + (gud-def gud-run + ;; Extension for process launch --tty? + "process launch -X true" + nil + "Run the program.") + + (gud-set-repeat-map-property 'gud-gdb-repeat-map) + (setq comint-prompt-regexp (rx line-start "(lldb)" (0+ blank))) + (setq paragraph-start comint-prompt-regexp) + (setq gud-running nil) + (setq gud-filter-pending-text nil) + (run-hooks 'lldb-mode-hook)) + (provide 'gud) ;;; gud.el ends here diff --git a/src/.lldbinit b/src/.lldbinit index a5789f49122..430c48f91f0 100644 --- a/src/.lldbinit +++ b/src/.lldbinit @@ -33,4 +33,8 @@ command script import emacs_lldb # Print with children provider, depth 2. command alias xprint frame variable -P 2 +# This is for M-x lldb: don't show source lines when stopping. +settings set stop-line-count-before 0 +settings set stop-line-count-after 0 + # end. -- 2.42.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 07:22:25 2023 Received: (at 66575) by debbugs.gnu.org; 17 Oct 2023 11:22:25 +0000 Received: from localhost ([127.0.0.1]:58747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsi9Y-0007qS-QC for submit@debbugs.gnu.org; Tue, 17 Oct 2023 07:22:25 -0400 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]:59641) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsi9P-0007nT-HM for 66575@debbugs.gnu.org; Tue, 17 Oct 2023 07:22:23 -0400 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c515527310so37701121fa.2 for <66575@debbugs.gnu.org>; Tue, 17 Oct 2023 04:21:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697541703; x=1698146503; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=JLJ4iBfm2ix1ixfIXE1RSTBBS8LhYu3lnpyHZNcGddA=; b=d4WDGg2hCp41sP5IiyAYClwFCIPA7Z8M+s46/ADhUXbeCQruP8rOZqsT6GDGTVmDhk gw+4SwZRkaJNpTitwsyvs4VLV6quT6rHwO32qAI0XCMuLz0K1+3RUzIM89w6s2vbGAS8 tlUFMJQgXPvhbDP2FhVkJ6gqv5hoLng8Li3zMnS8F1fM00pCpNQC93/ROknGdeTwg03y 6LKePt5WFdqV2JR/sBOH+4ngUqVl5jdFYrQqphgYZNvMgLoXjugq6R+OcOKRgVEKHIpH j0ZlATxY7V14GSf60MadmE9L1J4wEhzz1Lfvd4+xaRJVpiwiHks+R5czEBmzrIqz4PLQ TaOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697541703; x=1698146503; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=JLJ4iBfm2ix1ixfIXE1RSTBBS8LhYu3lnpyHZNcGddA=; b=XqMyGQb+/4Ia9RofADo/tTrqOTkMpARRCewGzlAnBeKQ3udlYHAUJsgSlEMasjLWi/ li4X8owPRbe1hcxXqbtFwnKmLuU6kG1gUU93MXBiVFtQIahteC1EKJ9wj49X4Dqit0KK 4JQ6ajD3YePTFp/MAa/LWJBWSRkU069bQF0/mp9UtufdKltGfej5py7ZeRnPybXqGJZ0 t+SaF4w/1ZNgaBUf9vJQyx4LL8Td58gmcqB+vj4SF8nVobM5GgM/Iz4LBL+t50vbj830 R59i2xpgwzGtsgzXG6F1gNSj06s7PLUtSrcQWbY2DQwu12Ml1hmQHvn6xV7HVIiB8Y5+ 0QzQ== X-Gm-Message-State: AOJu0YyxYL+8q+SYQ1zkGy7we/6+bloqpXgluEbQkrb1CnzARJjjeCXe bIv4MtDhxvRtWD0WOOtOBWo= X-Google-Smtp-Source: AGHT+IHy6bZ5DHBA0Lg0nVKtiKxBWYb928uv1DGqnK6x+QCVhKk1+7d8MVqDYaFNJqjHnMmVMlObTw== X-Received: by 2002:a2e:a552:0:b0:2c5:23e3:ed11 with SMTP id e18-20020a2ea552000000b002c523e3ed11mr1669461ljn.30.1697541703293; Tue, 17 Oct 2023 04:21:43 -0700 (PDT) Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id v14-20020a2ea44e000000b002b9f03729e2sm220105ljn.36.2023.10.17.04.21.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Oct 2023 04:21:42 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: bug#66575: [PATCH] Gud lldb support From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: Date: Tue, 17 Oct 2023 13:21:41 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <76E471C3-4926-4B71-B945-0C87BB04B0CD@gmail.com> References: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> <19FFB7CA-6501-4E62-9EC6-D5F2DB680D70@gmail.com> To: =?utf-8?Q?Gerd_M=C3=B6llmann?= X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 17 okt. 2023 kl. 12.03 skrev Gerd M=C3=B6llmann = : > Hm. I'd rather see someone run lldb on Windows, and tell us if it = even > prints absolute file names. It doesn't seem to do that on macOS. So it seems. Odd. All right, let's use the simple pattern for now. But doesn't this severely limit the ability of Emacs to locate the = source file? Surely there must be a way to retrieve the directory? > I've thought about doing that as an initialization, but then it would > have to be manually undone once lldb is running, since .lldbinit is > loaded first, AFAIK, if enabled (default =3D no), which one could > suppress and load it later, but that might also not be what the user > wants. And so on... Would you please explain this slowly to someone who's even less alert = than usual this morning? I got as far as understanding that the commands turn off the emission of = source lines around the stopping position. Fine, and this is in general = what we want if the source position is shown in an Emacs window. But the user may have fine reasons for wanting to run lldb outside Emacs = from time to time, and would then probably prefer the source lines in = that case. (Besides, I often don't see the position being tracked in a source = buffer with your patch. Is this a matter of missing directory in the = stop text?) And here's a completely unrelated problem: the lldb command-line = provides tab-completion on which I rely a lot as the command set is vast = and my knowledge of it is spotty. Could it be provided in Emacs? From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 08:31:19 2023 Received: (at 66575) by debbugs.gnu.org; 17 Oct 2023 12:31:19 +0000 Received: from localhost ([127.0.0.1]:58792 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsjEF-0004A0-2L for submit@debbugs.gnu.org; Tue, 17 Oct 2023 08:31:19 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:49337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsjEB-00049k-Nx for 66575@debbugs.gnu.org; Tue, 17 Oct 2023 08:31:18 -0400 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-53e70b0a218so4996432a12.2 for <66575@debbugs.gnu.org>; Tue, 17 Oct 2023 05:30:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697545844; x=1698150644; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cLXahRWAb3P87h2b5/AmbzAXGHnR0fNC2ik0naK40sE=; b=jVSDZk8vTt1B9zJM8/9vCIGB6/qexeeiqppHQr6DkEFu90fqA2XHEL1OUiXNhUS+HW zvpvPCFhCpPCtJrBpY2qithAM5mwATPV+v5SCKyYYSxDwLCla4yjM8p5kEydRGeVvlAA pf/7YrzVVum5SLCRXctzeddG0B/FTde4nFOSskB9MC9Ttg7mvOROEmjclBfq0vKmhtsc 1vk6wrJrvIY5pDrlxURGiFtmFRFNs9MKlCSLaC9mIr68Q33lxDXxoLAWpCimJsJtTOoL eHfuSKYrOLFRf1BOJcsc80dRaZdYIeDOj1hzqkE2RkwEtnnytZd37QLBrHph81aVXs3V OBTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697545844; x=1698150644; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cLXahRWAb3P87h2b5/AmbzAXGHnR0fNC2ik0naK40sE=; b=sjtnUxONUDQLokpgIyro0TR+s0iZ175P2Q6fgdX07rFRcL0MfeCsgS+dVCzfwgF5Pm omyKN/F86ymecmzp2X3JAWHMr47eVnMImLTCJg0dCUWh3akNRDwT+hY74M81qu24nENy uxf9zJy4aiGVOe2mDm/tdmxKc2CAbHbDtaB2i4Tl4xiLyPaquujGf3DKhUaf47Iejs+L FaOX7Xk/uUzLu52W4w8x7LTZWMxcMjmPCODBSAqZXmgWj8Vk+A0gU/rJ2Vka5EiOCov1 Sh2rylLTy5KqNm0LEkMvWxfU1KIt27VATj7xMuTsfFIeNT07pkBy3j3GSZEqeLxNLDmf siXQ== X-Gm-Message-State: AOJu0Yy+Yu2BDkGGMxg2EH4Eo6L0xSpcqEUMNcCa2Jzi0p6buuxmngQC XeyAr3IZPR5zizGGpqneXOA48Wqwqhk= X-Google-Smtp-Source: AGHT+IFSyHjCOqHH/AK3uub6PA2Dw7v4qFdYMwdlJ6ezZRnqZUfWsAWAB6ESRp86wris/6DU+InhPQ== X-Received: by 2002:a50:8719:0:b0:533:9df5:ede with SMTP id i25-20020a508719000000b005339df50edemr1676846edb.14.1697545843873; Tue, 17 Oct 2023 05:30:43 -0700 (PDT) Received: from Pro.fritz.box (p4fe3a123.dip0.t-ipconnect.de. [79.227.161.35]) by smtp.gmail.com with ESMTPSA id m23-20020aa7d357000000b0052348d74865sm1114212edr.61.2023.10.17.05.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:30:43 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Subject: Re: bug#66575: [PATCH] Gud lldb support In-Reply-To: <76E471C3-4926-4B71-B945-0C87BB04B0CD@gmail.com> ("Mattias =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Tue, 17 Oct 2023 13:21:41 +0200") References: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> <19FFB7CA-6501-4E62-9EC6-D5F2DB680D70@gmail.com> <76E471C3-4926-4B71-B945-0C87BB04B0CD@gmail.com> Date: Tue, 17 Oct 2023 14:30:41 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mattias Engdeg=C3=A5rd writes: > 17 okt. 2023 kl. 12.03 skrev Gerd M=C3=B6llmann : > >> Hm. I'd rather see someone run lldb on Windows, and tell us if it even >> prints absolute file names. It doesn't seem to do that on macOS. > > So it seems. Odd. All right, let's use the simple pattern for now. > But doesn't this severely limit the ability of Emacs to locate the source= file? > Surely there must be a way to retrieve the directory? There is this: https://lldb.llvm.org/use/formatting.html TLDR is that one can customize what LLDB prints in certain situations. The default is, AFAIU, and I'm not an LLDB expert at all, relative paths. >> I've thought about doing that as an initialization, but then it would >> have to be manually undone once lldb is running, since .lldbinit is >> loaded first, AFAIK, if enabled (default =3D no), which one could >> suppress and load it later, but that might also not be what the user >> wants. And so on... > > Would you please explain this slowly to someone who's even less alert. > than usual this morning? Sorry :-) > I got as far as understanding that the commands turn off the emission > of source lines around the stopping position. Correct. > Fine, and this is in > general what we want if the source position is shown in an Emacs > window. At least that's what I find prettier, so I added my (our) personal preferences to src/.lldbinit :-). I didn't want to forsee what users want, that's all. In general, I find it always surprising what scenarios users come up with, and I dont't want to get into anyone's way. You get from LLDB what you configure for LLDB. > But the user may have fine reasons for wanting to run lldb > outside Emacs from time to time, and would then probably prefer the > source lines in that case. Could be, yes. In that case they could use different init files, or different LLDB config files, or write some Python (INSIDE_EMACS should be in the environment when in Emacs), or... > (Besides, I often don't see the position being tracked in a source > buffer with your patch. Is this a matter of missing directory in the > stop text?) Can you give me an example that I can try to reproduce? LLDB version and output in these cases would be also be interesting. I'm using 17.0.2 here on macOS 14.0. > And here's a completely unrelated problem: the lldb command-line > provides tab-completion on which I rely a lot as the command set is > vast and my knowledge of it is spotty. You're describing my situation :-). > Could it be provided in Emacs? Possibly. Indeed, I've started looking at this, see etc/emacs_lldb.py, function xcomplete, but I'm not there yet, because I don't fully understand what the Python API used there guarantees to return, and the documentation is silent, as usual. (Although it did get better in many areas recently, I have to admit.) So, I'm either left with guessing, or looking at the C++ sources. Anyway--chances are that I either find out, or pretend to have found out at some point :-). That would then come after the current stuff is committed, of course. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 11:40:39 2023 Received: (at 66575) by debbugs.gnu.org; 17 Oct 2023 15:40:39 +0000 Received: from localhost ([127.0.0.1]:60856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsmBS-000585-VI for submit@debbugs.gnu.org; Tue, 17 Oct 2023 11:40:39 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:56513) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsmBQ-00057o-I0 for 66575@debbugs.gnu.org; Tue, 17 Oct 2023 11:40:37 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-52bd9ddb741so10235653a12.0 for <66575@debbugs.gnu.org>; Tue, 17 Oct 2023 08:40:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697557204; x=1698162004; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gh9PHWdZMFKpQJYMBqimkjgeqp14b0FnJLIUyBITb38=; b=QPR3ysMYYmgI1jdDBTe8Ss0EMnClC/SIb+81MCqjMdFKG/8D2WnhB8QO+6xn3lQXLb M1lgZu/tkTKA5zIKebo5BJC4aSWQr1Wh9UVGul9QjRUOuHAEIs82KTiijgQvMjNvlnub XGWPkz8KH8Ha5HfoWzPDOanfEGiImzQjPL6anotNAhFU58mM1B7q60ytDPgsLy9l5Ax0 2toXm+8YgULVh5aaEATvb9uDT3Gtb5F8CC/NHU5zi/ykOSPudVHIh3Al7OZOoBxO6cay qGsCxSQqiF1bFtxxkT2MJiTXW7KfmesNllfOZ+vit+yz1OR+r+FOuu1y2xzk6Vq9yt5p mmLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697557204; x=1698162004; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=gh9PHWdZMFKpQJYMBqimkjgeqp14b0FnJLIUyBITb38=; b=Ex+0UIqJdlLWb41tEhuX1Ah3X9PSheoFO4lbLZbQIcat6DwBRovxG8aMgNLIt/NstR gNyBEmKwHvdk/KRMaUlIPqfCYc8dwES+WNU7w8qBqFYABarhD3twYCcDGmW1vXGNrCT2 F/pxdALvulswZ1LzEn1dDAitsQLOYHE9xE3npAy4miUUS0n1XWqPADRPMHzWVBfYTT+/ P15x4AlCr7Mfdb/RMfjd7ZbrjR82wA1Zn+vYPW/AmtTvdt+PS4SyKprt/yxswmSxcEjo wNWiTeqU3c6BpYZX1YLCWsKrwillHX4EDUtMYW3ZQSaKvmgFLzV9QQ4ofcyDnvs5pzDY gglQ== X-Gm-Message-State: AOJu0Yz2vv6XCDBhWlI6e37Bw7hV4jCirca1JJu66tmtIlbyWoKmLiEc Bn3HgXCpWW+qYx5uo7kDvzTeXpxk2yQ= X-Google-Smtp-Source: AGHT+IENdshmIdcMW5HLEbjcb1te+99evmbcMmO8cDnHdqTl0KiLzsYv6scpuSYi6wkJuMjXKCOVog== X-Received: by 2002:a17:907:9618:b0:9a2:185b:5375 with SMTP id gb24-20020a170907961800b009a2185b5375mr1938749ejc.18.1697557204134; Tue, 17 Oct 2023 08:40:04 -0700 (PDT) Received: from Pro.fritz.box (p4fe3a123.dip0.t-ipconnect.de. [79.227.161.35]) by smtp.gmail.com with ESMTPSA id u4-20020a17090617c400b009b29553b648sm21164eje.206.2023.10.17.08.40.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 08:40:03 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Subject: Re: bug#66575: [PATCH] Gud lldb support In-Reply-To: <76E471C3-4926-4B71-B945-0C87BB04B0CD@gmail.com> ("Mattias =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Tue, 17 Oct 2023 13:21:41 +0200") References: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> <19FFB7CA-6501-4E62-9EC6-D5F2DB680D70@gmail.com> <76E471C3-4926-4B71-B945-0C87BB04B0CD@gmail.com> Date: Tue, 17 Oct 2023 17:40:02 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mattias Engdeg=C3=A5rd writes: > And here's a completely unrelated problem: the lldb command-line > provides tab-completion on which I rely a lot as the command set is > vast and my knowledge of it is spotty. Could it be provided in Emacs? I've looked through LLDB's sources, and I've found out what the return value of HandleCompletions means (see new comment in emacs_lldb.py in master. So, I'll definitely add that later. I also kind of found what the preferred API of LLDB is, which I think you asked earlier: I think it's C++. LLDB is actually a library, and the lldb executable itself is a thin wrapper using LLDB's C++ API to do its job. Likewise for other tools using LLDB. I think the whole API is also available through Python, i.e. the classes in the lldb module, like lldb.SBValue. The API is pretty under-documented though, also in C++. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 12:19:03 2023 Received: (at 66575) by debbugs.gnu.org; 17 Oct 2023 16:19:03 +0000 Received: from localhost ([127.0.0.1]:60882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsmmd-0006IF-2P for submit@debbugs.gnu.org; Tue, 17 Oct 2023 12:19:03 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]:60925) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsmmb-0006Hi-2p for 66575@debbugs.gnu.org; Tue, 17 Oct 2023 12:19:02 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-5079eed8bfbso5325243e87.1 for <66575@debbugs.gnu.org>; Tue, 17 Oct 2023 09:18:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697559509; x=1698164309; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=ExK326woj6sA3Z1FB7hbG4E7xBGyk+TmmDxluLwh5ig=; b=cFQ0AhGr/fsVLfacZZNpTkvwENZKQ+26YX2Z4sDup/9nB+bhpl4D6NhCq1SxwjwZSR lPVE5GL5JiYYM6mskK0RYTgjZJNb1yo4ZNt5H0gsQAyTN6sFw5D4ilY+qefE5YWsXvr3 YN2iMEH0CQb+Ogi2xTpO0iVuwcA2NUOVn3bI0mJaAfSszKYDq4EPWzhB+cR5l7MTO02M W45+xQHEU69Ltp5fZyUNRXphETde/AhQbbcIdCsJlOyL51KHZ5uK2ZapNnFDjOCdk2aJ FSyrExp5dQ3mWNuj30p8NUaOF32eE0yLRalWdy8o88g6vF3Eh/ffO0Ef7CymgfriB9zm BmNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697559509; x=1698164309; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ExK326woj6sA3Z1FB7hbG4E7xBGyk+TmmDxluLwh5ig=; b=g0SS3gUv/Rrout6hC2pJSxgBFxD9HVmeoh0MmMOjnSfTgdCYqoabIrfN4Bn1aZs9Vl UjAMgOfkGoJ5S4evGFaNtOOHWzzAwlWVzClgledqhY/BwrDJdGJY7OH00n6QKYuIJgKi uE0ko644b4hcbNsR+GDuMtJ/LhiTw3OFsC+UkYqC1VIv4wLITjhxo/R/nfr9HkpmMkuL cSgTSjcReZU1NrKVqIHDhBSnVdov5x7u81O7jd3rCG3uI4H+BzM2rf2yH8xNZlIt8/g7 RHxVQKkP2xg2KhpSuMz3Oqlyig7z1lHEMD09YgRxKwOzi75PdgdVzanjZlT/2QCZOuCC FSAA== X-Gm-Message-State: AOJu0YzWCJz7RuZzxIlqAPBAgwce2KZvceXaYXMqf2Vy6sTf/aKL5M9H o7Q6ZJ8/L+cWD8V+dhkTmtA= X-Google-Smtp-Source: AGHT+IHhcpB7CNwRL5fCYQJCpWAP91+d2AvDH6VxLGZCL9b5F5Jh6k53Chgg36l8Ai6q+Mb32JLfJw== X-Received: by 2002:ac2:55b9:0:b0:507:9640:f256 with SMTP id y25-20020ac255b9000000b005079640f256mr2120926lfg.36.1697559508888; Tue, 17 Oct 2023 09:18:28 -0700 (PDT) Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id f21-20020ac251b5000000b005079db81105sm339068lfk.116.2023.10.17.09.18.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Oct 2023 09:18:27 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: bug#66575: [PATCH] Gud lldb support From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: Date: Tue, 17 Oct 2023 18:18:26 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> <19FFB7CA-6501-4E62-9EC6-D5F2DB680D70@gmail.com> <76E471C3-4926-4B71-B945-0C87BB04B0CD@gmail.com> To: =?utf-8?Q?Gerd_M=C3=B6llmann?= X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 17 okt. 2023 kl. 14.30 skrev Gerd M=C3=B6llmann = : > There is this: https://lldb.llvm.org/use/formatting.html That's excellent! > The default is, AFAIU, and I'm not an LLDB expert at all, relative > paths. Indeed: (lldb) settings show frame-format frame-format (format-string) =3D "frame #${frame.index}: = ${ansi.fg.yellow}${frame.pc}${ansi.normal}{ = ${module.file.basename}{\`${function.name-with-args}{${frame.no-debug}${fu= nction.pc-offset}}}}{ at = ${ansi.fg.cyan}${line.file.basename}${ansi.normal}:${ansi.fg.yellow}${line= .number}${ansi.normal}{:${ansi.fg.yellow}${line.column}${ansi.normal}}}{${= function.is-optimized} [opt]}{${frame.is-artificial} [artificial]}\n" in which we note line.file.basename. We could modify frame-format and = thread-stop-format to convey all the useful information in a format that = is easy to parse. > In general, I find it always surprising what scenarios users come up > with, and I dont't want to get into anyone's way. You get from LLDB > what you configure for LLDB. Sure, but not all settings are alike in that respect. The user = definitely expects Emacs to take care of those that are pertinent to the = interface.=20 > Could be, yes. In that case they could use different init files, or > different LLDB config files, or write some Python (INSIDE_EMACS should > be in the environment when in Emacs), or... No, the source-attached init files should contain settings pertaining to = peculiarities of the project, not to the lldb interaction mode. > Can you give me an example that I can try to reproduce? LLDB version > and output in these cases would be also be interesting. I'm using > 17.0.2 here on macOS 14.0. I have older macOS and LLDB versions but starting an empty emacs, M-x = lldb attaching to another Emacs process and stopping somewhere that = doesn't correspond to an open source buffer (eval.c, say) won't cause = that file to be opened. Presumably it doesn't know where to look, given = the use of line.file.basename in frame-format. Anyway, your patch is fine to be committed -- any further improvement = can be made later on, and actual users mean more people complaining. We = shall give all of them your home address and telephone number. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 12:28:25 2023 Received: (at 66575) by debbugs.gnu.org; 17 Oct 2023 16:28:25 +0000 Received: from localhost ([127.0.0.1]:60900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsmvh-0006ec-JR for submit@debbugs.gnu.org; Tue, 17 Oct 2023 12:28:25 -0400 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]:56467) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsmve-0006eM-S5 for 66575@debbugs.gnu.org; Tue, 17 Oct 2023 12:28:24 -0400 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2c5071165d5so36451fa.0 for <66575@debbugs.gnu.org>; Tue, 17 Oct 2023 09:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697560071; x=1698164871; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=xsY6mOfdljvF+hdWJvlR5gecxbNzdKPC8b0oVTUg5po=; b=N7GMsHwQj5f8vcw4kV6QmAvMRX37QbWiEevHrqiACqAepheuExCJuOJBAn9PpTEPkm hyypogPfmpTklsaiTsm320fag4AOVAupKDqazZS4cCNqotGpDWKxoEsl10hHIaGBjouK KFgYLR+jA/AkniRdRqVp3sNIkBjc9gxRhAUveVoQkihFfbCUqFD0/T7qK+acujprI7ll fGqSP4PhKC+6MoZovwc3yJRNHP1ItT+KJrVPSLTVoY21/FeJMGt7x0BHAv4JcKV2sULN soMYdU4kIACiHyCBXqVxbhWcfjnMrQUlpn5tgArSkGFEAdDwWmJ0Loj4XejpXBpJufjr myjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697560071; x=1698164871; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xsY6mOfdljvF+hdWJvlR5gecxbNzdKPC8b0oVTUg5po=; b=I+GQJL4ZvfWYhlAx8+oAPZ/z2YTGIWXtiOhpDChSbq66HOYP6d4XLl9OTxgXObKKV3 AToVpEP+oX4EhErfQuG8j0pqLkhyYI9Sb4u9oBzoinpuifcQEP25ETQ3RcBFD/fw8b+Y 4MiPkixZlubIH5iypnexAeE1jbzuSEsfXRiMawChC37C0Sb8tHM7X4hFQ77SEwrzcWhI xjpSmSQhQU7REZ73caxWcIqv7GjTtgaNbMomoiYr0jLvXoKXYbDLJOeju4azqiy0yosx k4RaHzthOwK69mWcMJrvQ+CN97xQ5lkfmI20zZYAiRx6rMai10ndM7LgIP0HY0pp5FHh b1Aw== X-Gm-Message-State: AOJu0YwVB2lBldiYodlbvNrc8WEe3bIAy2Fq+btAjWJsr1gOvY2VGQ6n dG4CSLz6QybaSLuyb+PjOaTpvG5Zt1j0iw== X-Google-Smtp-Source: AGHT+IHYfabYiUyxcz5LzMs/01vH3MOJwjxOvUviXC9mKJRTkBUbzZZUZaWF7FWZVsOYWGJCVuaSpg== X-Received: by 2002:a2e:a613:0:b0:2c0:122a:322b with SMTP id v19-20020a2ea613000000b002c0122a322bmr1829672ljp.48.1697560070702; Tue, 17 Oct 2023 09:27:50 -0700 (PDT) Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id x22-20020a2e8816000000b002c5038e11cdsm327438ljh.53.2023.10.17.09.27.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Oct 2023 09:27:49 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: bug#66575: [PATCH] Gud lldb support From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: Date: Tue, 17 Oct 2023 18:27:48 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> <19FFB7CA-6501-4E62-9EC6-D5F2DB680D70@gmail.com> <76E471C3-4926-4B71-B945-0C87BB04B0CD@gmail.com> To: =?utf-8?Q?Gerd_M=C3=B6llmann?= X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 17 okt. 2023 kl. 17.40 skrev Gerd M=C3=B6llmann = : > I've looked through LLDB's sources, and I've found out what the return > value of HandleCompletions means (see new comment in emacs_lldb.py in > master. So, I'll definitely add that later. Sounds promising! > I also kind of found what the preferred API of LLDB is, which I think > you asked earlier: I think it's C++. LLDB is actually a library, and > the lldb executable itself is a thin wrapper using LLDB's C++ API to = do > its job. Likewise for other tools using LLDB. There is a DAP module for LLDB, apparently mostly written in Rust: https://github.com/vadimcn/codelldb From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 12:56:11 2023 Received: (at 66575) by debbugs.gnu.org; 17 Oct 2023 16:56:11 +0000 Received: from localhost ([127.0.0.1]:60946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsnMY-0007cD-QI for submit@debbugs.gnu.org; Tue, 17 Oct 2023 12:56:11 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:57678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsnMU-0007bl-Uy for 66575@debbugs.gnu.org; Tue, 17 Oct 2023 12:56:09 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-9c41e95efcbso372149466b.3 for <66575@debbugs.gnu.org>; Tue, 17 Oct 2023 09:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697561735; x=1698166535; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IpJWMmCDrTK7EBX26ntQOAWZE/KzK5nFV+uhX7I3zOE=; b=OAaTCcdNz5k6N5OiYyhUR11sYGX3/KHqmUHMsHhDZ70W68vtt5UdudabsVtWF0QEMA OMzpNMB4jFOQUWH3edhee7x6jnvrjsKtOxEl6/vxoSkEStQPjEaWIvpHfCXwPkMi+j3v lPCKUwIxtcFSe0eyoctKacZ0Ur/9Ki55QmGmIS9S59yP3OcxfkvkmbOExAUONlGJUrO+ qP3DV3vvyGDgd5n/FwvmPMFEJ3C638+CV8BaDDd6bIFicKtX/XptFkMztBzmR0m/OxaO hB84++IWour5bxFUwVGSxUIegYBr0GdLoFmMRIURMdD60HNgQdYpi2NReZDBYagL43rB 26Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697561735; x=1698166535; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=IpJWMmCDrTK7EBX26ntQOAWZE/KzK5nFV+uhX7I3zOE=; b=r3umT2Z+vv6/gTMu8PviX7e/YU+6HsdOr5fbUFAzOm95pPiqTZBhOQke6M5MhF3Eou osvHO/TWlp2B1j4WWMlvGy4KNQiNwn5uzIc+MHCw59sZTr9dHtuFoZgK9xnBUhawmkqs e0ZgHimbtr+fKJ9mrKOq8MgaOuHOcMn9EJRv65rsdu8JnBwVadwn4IV1pOzCfWk9QrUd BXhgIcNB3kqfxD4MySTqFRcMFlxVX+BZ9imTqoylnqZkyzc/GSwpO5mJpkiAHA51uqyM lVceifHkqYG5b2PZA/jQczjRJ5JFps7F9PyVvKl0kciR1N/RZ14fWKVxoxjZhGZo9GS5 9u2Q== X-Gm-Message-State: AOJu0YwDRzi0RjQJsGG69WmB3B4rPVX16ICy+iW+JCRfxXkUrxZ/XQ6c frJ1Wxb/q27TAarJiHrVxjz16C7pX5s= X-Google-Smtp-Source: AGHT+IFet9Tcb4zOw7j+nu3F6sdb5CyR4bFCm22uzZUY/pwWcvqK0cUGw4WDiD6ksYAscyOPXojifA== X-Received: by 2002:a17:907:9444:b0:9ad:eb9c:dd00 with SMTP id dl4-20020a170907944400b009adeb9cdd00mr1629692ejc.12.1697561734612; Tue, 17 Oct 2023 09:55:34 -0700 (PDT) Received: from Pro.fritz.box (p4fe3a123.dip0.t-ipconnect.de. [79.227.161.35]) by smtp.gmail.com with ESMTPSA id lh22-20020a170906f8d600b009b94c545678sm120393ejb.153.2023.10.17.09.55.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 09:55:34 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Subject: Re: bug#66575: [PATCH] Gud lldb support In-Reply-To: ("Mattias =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Tue, 17 Oct 2023 18:18:26 +0200") References: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> <19FFB7CA-6501-4E62-9EC6-D5F2DB680D70@gmail.com> <76E471C3-4926-4B71-B945-0C87BB04B0CD@gmail.com> Date: Tue, 17 Oct 2023 18:55:32 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mattias Engdeg=C3=A5rd writes: > I have older macOS and LLDB versions but starting an empty emacs, M-x > lldb attaching to another Emacs process and stopping somewhere that > doesn't correspond to an open source buffer (eval.c, say) won't cause > that file to be opened. Presumably it doesn't know where to look, > given the use of line.file.basename in frame-format. Not sure, but that could also be in Gud itself. Do you have a Gdb running so that we could check what gud-gdb does? > Anyway, your patch is fine to be committed -- any further improvement > can be made later on, and actual users mean more people > complaining. We shall give all of them your home address and telephone > number. :-) From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 13:01:55 2023 Received: (at 66575) by debbugs.gnu.org; 17 Oct 2023 17:01:55 +0000 Received: from localhost ([127.0.0.1]:60953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsnS6-0007mq-Qw for submit@debbugs.gnu.org; Tue, 17 Oct 2023 13:01:55 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:55453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsnS4-0007ma-RX for 66575@debbugs.gnu.org; Tue, 17 Oct 2023 13:01:53 -0400 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-53e751aeb3cso5814455a12.2 for <66575@debbugs.gnu.org>; Tue, 17 Oct 2023 10:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697562080; x=1698166880; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W3LuamAEsDIahAeFvJgutAeLkuXqFetaKu91e3V4aUk=; b=KcJffRd5XFTZxqasjR2JSfIw87RmH3SuhXiZiZvw7/rNljcssgo1NCe9y4dzWb1mU2 zosXL0awxt9TCMlRcMMpjJpCHvpLiJBxRRnBaWrFxNBZKoWe9LM71LXUj/bklG+1G+vb 8ITqcfoFFL96yWA1Fx0JXUuDoAOYxBB3Sdpa/5v1IlpLOk9vKxVgYTlG7gC36qid6GpZ fwAn4yq9IuH1Nkm2lAp7etDqLBp/hRMElhjA4nxKRkFmpdhwlu7DPqh1Erje7c8TqOQj LNoibleMmZmG0yvXL/PkoOOCmgQfPWY380ULwXoB9ANqGpDm8QLKhEh7ux4DBv5PJR86 M6YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697562080; x=1698166880; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=W3LuamAEsDIahAeFvJgutAeLkuXqFetaKu91e3V4aUk=; b=A6egZEaX6hG3jWfwHnSbPEQIkydSB45vIHPk0vgmMgwJoJnCFsontDxGRToqurwLYJ udRIF/VDkWsm+orSYq0XWjmrg2rWC6t2d8Zu2r5Xy+7mb64GPmThAWbe4vMrBb/JgdZr C4A+9PnF2CGdwK7MTg4VO2bJZSIlYr1D3bqqStvu1GOq92WTqeuhNDwrCND5cd239DPO noxfxnqybiwHDX5WlhJ3vA2h8ULVkI+Us1IpREFS7l/84qOe4MvvI/QQ9d7bYs6sXone f3y2B87TffanzPfsa/KSM5Yu9FC/Dv5yA7xWVMby2bTvxl8LoJgTbZo+4FJF0bDETA/8 LZvw== X-Gm-Message-State: AOJu0YySb/MWvkkbQ2IpPi5v8OXaZuBIfBRTeXPYh9oQUl3+9k15U49A 7OmUEw3gQqF8GQfICyz2AnPjUHDO4aM= X-Google-Smtp-Source: AGHT+IG3IJustL0yfdoomou3JgjZ8qcDcyO25jnoaSO5TRgVUJg21/oMUTRvQpk3wpx8OvPKrKuiag== X-Received: by 2002:a50:c30a:0:b0:53f:381a:a25f with SMTP id a10-20020a50c30a000000b0053f381aa25fmr633016edb.23.1697562080504; Tue, 17 Oct 2023 10:01:20 -0700 (PDT) Received: from Pro.fritz.box (p4fe3a123.dip0.t-ipconnect.de. [79.227.161.35]) by smtp.gmail.com with ESMTPSA id em6-20020a056402364600b0053e37d13f4fsm1518957edb.52.2023.10.17.10.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 10:01:20 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Subject: Re: bug#66575: [PATCH] Gud lldb support In-Reply-To: ("Mattias =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Tue, 17 Oct 2023 18:27:48 +0200") References: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> <19FFB7CA-6501-4E62-9EC6-D5F2DB680D70@gmail.com> <76E471C3-4926-4B71-B945-0C87BB04B0CD@gmail.com> Date: Tue, 17 Oct 2023 19:01:19 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mattias Engdeg=C3=A5rd writes: >> I also kind of found what the preferred API of LLDB is, which I think >> you asked earlier: I think it's C++. LLDB is actually a library, and >> the lldb executable itself is a thin wrapper using LLDB's C++ API to do >> its job. Likewise for other tools using LLDB. > > There is a DAP module for LLDB, apparently mostly written in Rust: > > https://github.com/vadimcn/codelldb AFAIK, llvm-vscode, which is part of LLDB, is also a DAP module. But that's C++, of course, so I'm not surprised that it needed a Rust rewrite :-). From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 13:18:48 2023 Received: (at 66575) by debbugs.gnu.org; 17 Oct 2023 17:18:48 +0000 Received: from localhost ([127.0.0.1]:60959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsniS-0008KS-Gs for submit@debbugs.gnu.org; Tue, 17 Oct 2023 13:18:48 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]:52488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsniN-0008K5-LH for 66575@debbugs.gnu.org; Tue, 17 Oct 2023 13:18:47 -0400 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-507bd64814fso1363379e87.1 for <66575@debbugs.gnu.org>; Tue, 17 Oct 2023 10:18:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697563092; x=1698167892; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fmJHxrs27FxHN9taDt46iUz9yxX7V0XMXV7ZOtuBzgs=; b=ZTTfAUHPTuWBva8QwRNQ4pfwvVys+cDdV3Qj/E1Vu4IdUzNoTQV/afJVS+ezYkSwTs QnQxmpQOXjDS0tGcid5UJEfUK1g2XSBn0jtcAiPyipqXV5ACj1Ratl1wCEhacds+7bot KY419QLE/IzMETJ64NtK9qlly3Mn6VXdaG7QuMNtE0liutfayEVDvS30q5vEAJ6l7UaG w50E7FRFCF6AWr+rRozN9XMIgn+Ymd2YdpD15hswAJSFg4RrVVwNM7FW4NfR0wa/V7DJ Gb46/PDwsdYoRys7ygVguTQBt1N9AJybSYJmZIDg4JWtla21e2h9xGsht5AqPIP/qS2m GFaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697563092; x=1698167892; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fmJHxrs27FxHN9taDt46iUz9yxX7V0XMXV7ZOtuBzgs=; b=TuJdYHgZyqQ1u9MDW8Ree+1WBr9OXy+eHjBi26OHT+1EalI3PVQev5x0/YkkfIIjgx 2K9iW44Y87rxR+forjYQapiqKuW4CPgn/nkXmzkXyi5pGJpP8bIy+3DflN3HEbUHGliU wy3yU6K9+Xwb112MB3iM3uCNoL5wPh/ntG2yfDlLv8Hx8RjDycHUDQlpdyrm/F1g2Etk nZOTWqgdTW6ma/tRubYb9Prb6UZZQGPP9GrmWKTmjVE7XY7h9W7hHYYwB661KeczHNO3 WehC1RNXcFrn+7Fjyqk90BRUFJxLjn0mM1NKAt59i1en0QXswFtKdcAXDYoKgesgjAPJ pJjg== X-Gm-Message-State: AOJu0YxM0+/oaUZhSZxt54U/Hcbb+l3dRL9/wg3qt91PwcuCBovz5Q4S Cj+ZsICxr42BMrGt04ZOPfx1A+sCa/o= X-Google-Smtp-Source: AGHT+IG9NuDypNQyO0+0ptBl03S70/6C2DtjK+fFrPh7AnTMyjAxgj676XYRV2krk1qE4d4TC8MksA== X-Received: by 2002:a05:6512:39c5:b0:507:a1df:1408 with SMTP id k5-20020a05651239c500b00507a1df1408mr2682227lfu.55.1697563091399; Tue, 17 Oct 2023 10:18:11 -0700 (PDT) Received: from Mini.fritz.box (p4fe3a123.dip0.t-ipconnect.de. [79.227.161.35]) by smtp.gmail.com with ESMTPSA id m23-20020aa7d357000000b0052348d74865sm1505541edr.61.2023.10.17.10.18.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 10:18:10 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Subject: Re: bug#66575: [PATCH] Gud lldb support In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llmann?= =?utf-8?Q?=22's?= message of "Tue, 17 Oct 2023 18:55:32 +0200") References: <7A4E9221-C0A4-4A98-A80A-5FD58C95C014@gmail.com> <19FFB7CA-6501-4E62-9EC6-D5F2DB680D70@gmail.com> <76E471C3-4926-4B71-B945-0C87BB04B0CD@gmail.com> Date: Tue, 17 Oct 2023 19:18:10 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66575 Cc: 66575@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: > >> Anyway, your patch is fine to be committed -- any further improvement >> can be made later on, and actual users mean more people >> complaining. We shall give all of them your home address and telephone >> number. > > :-) Committed to master just now, and closing. Thanks for the review, Matthias! From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 13:18:58 2023 Received: (at control) by debbugs.gnu.org; 17 Oct 2023 17:18:58 +0000 Received: from localhost ([127.0.0.1]:60965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsnic-0008Ky-3Z for submit@debbugs.gnu.org; Tue, 17 Oct 2023 13:18:58 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:47474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsniZ-0008Kh-6Z for control@debbugs.gnu.org; Tue, 17 Oct 2023 13:18:56 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-9b2f73e3af3so905187266b.3 for ; Tue, 17 Oct 2023 10:18:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697563103; x=1698167903; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:subject:from:to:message-id :date:from:to:cc:subject:date:message-id:reply-to; bh=m4lBMqd0bsJ3Mv+LLAjKKXUAR6E5ERVcXJWbvm2y+j8=; b=F5fmZJNXWSoSDM75y1Bk4VK1sS0ThuEF9nxPTEZ6oeUAX4c0eoobBCeUQNRIcVUNlg AUuusRI7GruoMs+iqQRwWTqKWALmyCDdP4MbuzbXPy96PctgV3fR85xjeJ5E5EXNPrXW C6xGotN8PhbWHdkOKaGhOHoKmk8qTlye3msFht9nA9OYYspQM0NTwldI+Eq6X/diCoDo rAEGfo0EhRDiNo0cZ03FBCbGneeAtlqpzoPP9A+YaIlIyp45V8qgkUC/C5es32S3BUqc 0KthxC5eJOi3wmQFDl7dS4SRg3UI0eAC6hPQsKOmvzpbWq5NpfwkSJom7plydpJMUO8c /yow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697563103; x=1698167903; h=content-transfer-encoding:mime-version:subject:from:to:message-id :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=m4lBMqd0bsJ3Mv+LLAjKKXUAR6E5ERVcXJWbvm2y+j8=; b=HNTk3KObdPoZ34ULtV8DH1vL6iPwnMVmUADqDer5IXu+CW+4QHglQATOYcMd+cXFbn vF9peo3qDwaAzfToncyd/3MalxBIUAW8tEWJFhGED40Cj47gy9xvSMBVXPt5cRfQU79K b4Y19udngom1izP2WgGKWWCforYvZK8j9/TJ409wxKluokG9ELQBRz96THmG/w9Jyrtu dQk5EOSWjmWJCevaP94lQ5Z7N3Ooc6Bwc7oSVfeUBlZV9ZCMjTRvIGfFG/g1NmR9RdLQ bz93XRlAjAmjEJFZO8Iktfg1byuVUgxe5lAEP8xKzfM75lKXhk+TsTRfUv3XwySVCfhy 62fw== X-Gm-Message-State: AOJu0YzIe4zgbDbBRSlvsfz6zXv4aUe1TX2nM0Jij4/BMiJg/D/RfWQH L+Y5Yns5qhbQPICEQ3WiffxN0hcvfyo= X-Google-Smtp-Source: AGHT+IF1xvqOFYeQthYMjc0QFQ4X7sCH2fqiQEQR80B0RE16GQ/SywjG8gmB2esN9Ggz803K2WOqjA== X-Received: by 2002:a17:907:9705:b0:9be:6050:7f1b with SMTP id jg5-20020a170907970500b009be60507f1bmr2250457ejc.0.1697563103340; Tue, 17 Oct 2023 10:18:23 -0700 (PDT) Received: from Mini.fritz.box (p4fe3a123.dip0.t-ipconnect.de. [79.227.161.35]) by smtp.gmail.com with ESMTPSA id f18-20020a170906739200b0099bc8bd9066sm148228ejl.150.2023.10.17.10.18.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 10:18:23 -0700 (PDT) Date: Tue, 17 Oct 2023 19:18:22 +0200 Message-Id: To: control@debbugs.gnu.org From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Subject: control message for bug #66575 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 66575 30.1 quit From unknown Wed Aug 20 06:39:53 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 16 Nov 2023 12:24:13 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator