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/11765] New: Pretty printer lookup fails with lambda functions


When multiple lambda functions are added to the current objfile's pretty
printers, all but one are never invoked.  (It appears that the second-to-last
lambda function added is instead invoked once for each function added.)

To reproduce:

simple.c:
  int main(int argc, char *argv[]) { return 0; }

a.out-gdb.py:
  def test(i):
    print 'test(%d)' % i
    return None

  for i in range(0, 5):
    gdb.current_objfile().pretty_printers.append(lambda val: test(i))

run:
gcc -g simple.c && gdb -ex 'b main' -ex r a.out

-- 
           Summary: Pretty printer lookup fails with lambda functions
           Product: gdb
           Version: 7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: python
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: wittman at acm dot org
                CC: gdb-prs at sourceware dot org
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=11765

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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