unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* improve gud-gdb completion
@ 2021-07-28 14:13 Stephen Leake
  2021-07-28 14:50 ` Michael Welsh Duggan
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Leake @ 2021-07-28 14:13 UTC (permalink / raw)
  To: emacs-devel

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?

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: improve gud-gdb completion
  2021-07-28 14:13 improve gud-gdb completion Stephen Leake
@ 2021-07-28 14:50 ` Michael Welsh Duggan
  2021-07-29 23:31   ` Stephen Leake
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Welsh Duggan @ 2021-07-28 14:50 UTC (permalink / raw)
  To: Stephen Leake; +Cc: emacs-devel

Stephen Leake <stephen_leake@stephe-leake.org> 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.

-- 
Michael Welsh Duggan
(md5i@md5i.com)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: improve gud-gdb completion
  2021-07-28 14:50 ` Michael Welsh Duggan
@ 2021-07-29 23:31   ` Stephen Leake
  2021-07-30  1:10     ` Michael Welsh Duggan
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Leake @ 2021-07-29 23:31 UTC (permalink / raw)
  To: Michael Welsh Duggan; +Cc: emacs-devel

Michael Welsh Duggan <mwd@md5i.com> writes:

> Stephen Leake <stephen_leake@stephe-leake.org> 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.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: improve gud-gdb completion
  2021-07-29 23:31   ` Stephen Leake
@ 2021-07-30  1:10     ` Michael Welsh Duggan
  2021-07-30 18:51       ` Stephen Leake
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Welsh Duggan @ 2021-07-30  1:10 UTC (permalink / raw)
  To: Stephen Leake; +Cc: emacs-devel

Stephen Leake <stephen_leake@stephe-leake.org> writes:

> Michael Welsh Duggan <mwd@md5i.com> writes:
>
>> Stephen Leake <stephen_leake@stephe-leake.org> 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)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: improve gud-gdb completion
  2021-07-30  1:10     ` Michael Welsh Duggan
@ 2021-07-30 18:51       ` Stephen Leake
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Leake @ 2021-07-30 18:51 UTC (permalink / raw)
  To: Michael Welsh Duggan; +Cc: emacs-devel

Michael Welsh Duggan <mwd@md5i.com> writes:

> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>
>> Michael Welsh Duggan <mwd@md5i.com> writes:
>>
>>> Stephen Leake <stephen_leake@stephe-leake.org> 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.  

Ah, sorry, I misread what you wrote. Ok, that answers my question, and to
fix my original problem, I'd have to modify gdb itself.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-30 18:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-28 14:13 improve gud-gdb completion Stephen Leake
2021-07-28 14:50 ` Michael Welsh Duggan
2021-07-29 23:31   ` Stephen Leake
2021-07-30  1:10     ` Michael Welsh Duggan
2021-07-30 18:51       ` Stephen Leake

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).