This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/18494] New: Python gdb.Command#complete is provided with wrong parameters


https://sourceware.org/bugzilla/show_bug.cgi?id=18494

            Bug ID: 18494
           Summary: Python gdb.Command#complete is provided with wrong
                    parameters
           Product: gdb
           Version: 7.9
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: arma2ff0 at gmail dot com
  Target Milestone: ---

Created attachment 8344
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8344&action=edit
Test to used to show the problem

While fixing my gdb-python scripts I noticed that the auto-completion I wrote
was not properly working anymore after the last system updates. After debugging
my code I noticed that the problem looks more like a bug.

Essentially, when extending gdb.Command one should be able to override
"complete" to provide custom completion. Based on documentation, "text holds
the complete command line up to the cursor's location, while word holds the
last word of the command line". In fact, previously "text" was holding the part
of the command that was defined as command in the constructor of the
self-defined constructor. Differently, "word" was holding the "parameters" of
the command. In gdb 7.9.1 this is reversed.

How to replicate the problem:
a) download "test.py" attached to this bug report
b) move test.py to /tmp
c) execute

   gdb -x /tmp/test.py
   (gdb) bug-test

d) start triggering auto completion by pressing tab

expected:
"text" should contain "bug-test", while "word" should contain an empty string
""

result:
the output is reversed compered to what expected.

I am not completely sure whether this is a bug, but since the behavior has
changed since 7.9 and the documentation has not changed, I am signaling it as a
bug.

Thanks && Cheers.
A.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]