[Bug exp/25287] New: Inconvenience: no way to remove convenience variables

stefan.tauner at gmx dot at sourceware-bugzilla@sourceware.org
Mon Dec 16 15:41:00 GMT 2019


            Bug ID: 25287
           Summary: Inconvenience: no way to remove convenience variables
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: exp
          Assignee: unassigned at sourceware dot org
          Reporter: stefan.tauner at gmx dot at
  Target Milestone: ---

When testing some code for gdb-python I noticed that I was not able to remove
convenience variables once added. The plain GDB documentation on convenience
variables does not mention something like that at all but the python
documentation suggests that this is possible: "If @var{value} is @code{None},
then the convenience variable is removed".
However, looking at the actual code in value.c suggests that removal was never
considered: create_internalvar() simply creates another variable and prepends
it to the singly-linked list internalvars.

Adding this functionality should be relatively easy by iterating to the right
object in the list (as lookup_internalvar() does) and splicing the right
pointers together before deleting the object. I could probably implement it and
contribute it if you like. The only worry I have ATM is concurrency but this
does not seem to be an issue in this context (or the whole value.c is rather
broken :)

If the behavior is correct and no removal should be possible then the wording
of the gdb-python docs should be refined IMHO.

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

More information about the Gdb-prs mailing list