public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Project Archer <archer@sourceware.org>
Subject: [python] fix 2 backtrace issues
Date: Fri, 07 Jan 2011 20:30:00 -0000	[thread overview]
Message-ID: <m3tyhkmp8d.fsf@fleche.redhat.com> (raw)

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:

                 reply	other threads:[~2011-01-07 20:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3tyhkmp8d.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=archer@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).