From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.devel Subject: Re: improve gud-gdb completion Date: Thu, 29 Jul 2021 21:10:57 -0400 Message-ID: <87y29ovc66.fsf@md5i.com> References: <86r1fi4jd3.fsf@stephe-leake.org> <87czr2wl03.fsf@md5i.com> <86fsvwofwz.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27220"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 30 03:12:47 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9H4w-0006or-M8 for ged-emacs-devel@m.gmane-mx.org; Fri, 30 Jul 2021 03:12:47 +0200 Original-Received: from localhost ([::1]:53890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9H4u-0001D8-H8 for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Jul 2021 21:12:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9H3F-0000U9-KC for emacs-devel@gnu.org; Thu, 29 Jul 2021 21:11:01 -0400 Original-Received: from md5i.com ([75.151.244.229]:52422) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9H3D-0000xN-Qu for emacs-devel@gnu.org; Thu, 29 Jul 2021 21:11:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=md5i.com; s=dkim; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=PrwnvuoDcqgi6UtCLddO2w0I23Z5IfQZO7YfLJWIH0k=; b=uitTAyT/JyqEqVIpFc8Rd2Nwzi vwvkYGQO5KayNfsrMoV1wwWkCnKGaQ177GcEM9XZ0x4BA3WwssNUBRpDTAFwJDScFYPHpKQQF9jP7 XHx04WgRqakeZtFUto7rlZ+eO; Original-Received: from abode ([192.168.177.1] helo=miko) by md5i.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m9H3B-000UVN-UA; Thu, 29 Jul 2021 21:10:57 -0400 In-Reply-To: <86fsvwofwz.fsf@stephe-leake.org> (Stephen Leake's message of "Thu, 29 Jul 2021 16:31:56 -0700") Received-SPF: pass client-ip=75.151.244.229; envelope-from=mwd@md5i.com; helo=md5i.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:271819 Archived-At: Stephen Leake writes: > Michael Welsh Duggan writes: > >> Stephen Leake writes: >> >>> I'd like to improve completion in gud-gdb. >>> >>> Currently, it completes on names in the buffer being debugged, but it >>> doesn't include "." in the name, so if I'm trying to print >>> "Incremental_Parser.Parse_Errors.Length", it only completes to >>> "Incremental_Parser". >>> >>> However, I can't figure out exactly what elisp code is harvesting names >>> from the buffer. >>> >>> TAB is bound to completion-at-point. >>> >>> completion-at-point-functions is >>> (gud-gdb-completion-at-point comint-completion-at-point t) >>> >>> (default-value 'completion-at-point-functions) is >>> (tags-completion-at-point-function) >>> >>> None of those completion functions look at the text in buffers. >>> >>> What am I missing? >> >> Are you certain that it looks at the text in buffers at all? If you >> look at gud-gdb-completions, you'll see that it uses gdb's completion >> mechanism based on symbols in the binary. > > It finds names from my code; "Incremental_Parser" above. > > I found a workaround by replacing the completion with hippie-expand, but > I'd still like to understand how the original configuration works. I'm afraid I don't understand. If you are debugging a binary that contains the "Incremental_Parser" symbol, then gdb knows that, and its completion mechanism returns that. It's the same mechanism used by gdb when run outside of Emacs. Your statement says "it completes on names in the buffer being debugged." That would imply that it does not complete names that are from other files (not in the buffer where the $pc is). But that is not the case, no? -- Michael Welsh Duggan (md5i@md5i.com)