From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2820 invoked by alias); 7 Jan 2011 20:30:13 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 2811 invoked by uid 22791); 7 Jan 2011 20:30:12 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org From: Tom Tromey To: Project Archer Subject: [python] fix 2 backtrace issues Date: Fri, 07 Jan 2011 20:30:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2011-q1/txt/msg00008.txt.bz2 I'm checking this in on the python branch. This fixes two problems. First, PR 12119, where multiple filters failed because we didn't capture the global's value in the lambda. Second, a tab in backtrace.py. Tom diff --git a/gdb/python/lib/gdb/backtrace.py b/gdb/python/lib/gdb/backtrace.py index 2baab5f..6bb4fb1 100644 --- a/gdb/python/lib/gdb/backtrace.py +++ b/gdb/python/lib/gdb/backtrace.py @@ -1,6 +1,6 @@ # Filtering backtrace. -# Copyright (C) 2008 Free Software Foundation, Inc. +# Copyright (C) 2008, 2011 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ an iterator returning such objects.""" if frame_filter == None: frame_filter = constructor else: - frame_filter = lambda iterator: constructor (frame_filter (iterator)) + frame_filter = lambda iterator, filter = frame_filter: constructor (filter (iterator)) def create_frame_filter (iter): global frame_filter diff --git a/gdb/python/lib/gdb/command/backtrace.py b/gdb/python/lib/gdb/command/backtrace.py index ec9a527..2aa5b90 100644 --- a/gdb/python/lib/gdb/command/backtrace.py +++ b/gdb/python/lib/gdb/command/backtrace.py @@ -1,6 +1,6 @@ # New backtrace command. -# Copyright (C) 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -80,7 +80,7 @@ Use of the 'raw' qualifier avoids any filtering by loadable modules. # FIXME: provide option to start at selected frame # However, should still number as if starting from newest - newest_frame = gdb.selected_thread ().newest_frame () + newest_frame = gdb.selected_thread ().newest_frame () iter = itertools.imap (FrameWrapper, FrameIterator (newest_frame)) if filter: