From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27025 invoked by alias); 22 Apr 2013 12:12:55 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 27006 invoked by uid 9514); 22 Apr 2013 12:12:55 -0000 Date: Mon, 22 Apr 2013 12:12:00 -0000 Message-ID: <20130422121254.26978.qmail@sourceware.org> From: pmuldoon@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] pmuldoon/python-backtrace: Polish for submission X-Git-Refname: refs/heads/pmuldoon/python-backtrace X-Git-Reftype: branch X-Git-Oldrev: 3949aa61d650bff8309d0a9be9553cdb277a01ac X-Git-Newrev: bc81493517989311a33355d00a68bbdfa95862b9 X-SW-Source: 2013-q2/txt/msg00040.txt.bz2 List-Id: The branch, pmuldoon/python-backtrace has been updated via bc81493517989311a33355d00a68bbdfa95862b9 (commit) from 3949aa61d650bff8309d0a9be9553cdb277a01ac (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit bc81493517989311a33355d00a68bbdfa95862b9 Author: Phil Muldoon Date: Mon Apr 22 13:12:34 2013 +0100 Polish for submission ----------------------------------------------------------------------- Summary of changes: gdb/doc/gdb.texinfo | 34 +++++++++----------- gdb/mi/mi-cmds.h | 1 - gdb/mi/mi-getopt.c | 10 +----- gdb/python/lib/gdb/frames.py | 2 +- gdb/python/py-framefilter.c | 6 ++-- gdb/testsuite/gdb.python/py-framefilter-gdb.py.in | 2 +- gdb/testsuite/gdb.python/py-framefilter.exp | 2 +- gdb/testsuite/gdb.python/py-framefilter.py | 2 +- 8 files changed, 24 insertions(+), 35 deletions(-) First 500 lines of diff: diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index fab0b11..2c912dc 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -24557,7 +24557,7 @@ iterate through them all. This ends up duplicating effort as the filter can defer unwinding frames until frame decorators are executed, after the last filter has executed, it should. @xref{Frame Decorator API}, for more information on decorators. Also, there are -example for both frame decorators and filters in later chapters. +examples for both frame decorators and filters in later chapters. @xref{Writing a Frame Filter}, for more information. The Python dictionary @code{gdb.frame_filters} contains key/object @@ -24573,9 +24573,6 @@ can be found are: @code{gdb.Progspace} which contains a object which also contains a @code{frame_filters} dictionary attribute. -Each frame filter object in these dictionaries must conform to the -frame filter interface definition defined below. - When a command is executed from @value{GDBN} that is compatible with frame filters, @value{GDBN} combines the @code{global}, @code{gdb.Progspace} and all @code{gdb.Objfile} dictionaries currently @@ -24682,7 +24679,7 @@ only be used in conjunction with frame filters. The purpose of a frame decorator is to customize the printed content of each @code{gdb.Frame} in commands where frame filters are executed. This concept is called decorating a frame. Frame decorators decorate -a @code{gdb.Frame} with Python code contained with each API call. +a @code{gdb.Frame} with Python code contained within each API call. This separates the actual data contained in a @code{gdb.Frame} from the decorated data produced by a frame decorator. This abstraction is necessary to maintain integrity of the data contained in each @@ -24765,10 +24762,10 @@ any data for this field. @defun FrameDecorator.frame_args (self) @anchor{frame_args} -This method must return an iterable (an empty iterable is permitted), -or @code{None}. Returning an empty iterable, or @code{None} means -frame arguments will not be printed for this frame. This iterable -must contain objects that implement two methods, described here. +This method must return an iterable, or @code{None}. Returning an +empty iterable, or @code{None} means frame arguments will not be +printed for this frame. This iterable must contain objects that +implement two methods, described here. This object must implement a @code{argument} method which takes a single @code{self} parameter and must return a @code{gdb.Symbol} @@ -24821,9 +24818,9 @@ class SomeFrameDecorator() @defun FrameDecorator.frame_locals (self) -This method must return an iterable (an empty iterable is permitted), -or @code{None}. Returning an empty iterable, or @code{None} means -frame local arguments will not be printed for this frame. +This method must return an iterable or @code{None}. Returning an +empty iterable, or @code{None} means frame local arguments will not be +printed for this frame. The object interface, the description of the various strategies for reading frame locals, and the example are largely similar to those @@ -24855,7 +24852,7 @@ class SomeFrameDecorator() @end smallexample @end defun -@defun FrameDecorator.frame (self): +@defun FrameDecorator.inferior_frame (self): This method must return the underlying @code{gdb.Frame} that this frame decorator is decorating. @value{GDBN} requires the underlying @@ -24956,11 +24953,10 @@ utilizes a frame decorator to perform some work on the frames. decorator interface. This example works on inlined frames. It highlights frames which are -inlined by adding the function in which they are inlined into. By -applying a frame decorator to all frames with the Python -@code{itertools imap} method, the example defers actions to the frame -decorator. Frame decorators are only processed when @value{GDBN} -prints the backtrace. +inlined by tagging them with an ``[inlined]'' tag. By applying a +frame decorator to all frames with the Python @code{itertools imap} +method, the example defers actions to the frame decorator. Frame +decorators are only processed when @value{GDBN} prints the backtrace. This introduces a new decision making topic: whether to perform decision making operations at the filtering step, or at the printing @@ -25017,7 +25013,7 @@ class InlinedFrameDecorator(FrameDecorator): super(InlinedFrameDecorator, self).__init__(fobj) def function(self): - frame = super.base() + frame = fobj.inferior_frame() name = str(frame.name()) if frame.type() == gdb.INLINE_FRAME: diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h index fedd765..4b9fb7a 100644 --- a/gdb/mi/mi-cmds.h +++ b/gdb/mi/mi-cmds.h @@ -148,7 +148,6 @@ struct mi_cmd int *suppress_notification; }; - /* Lookup a command in the MI command table. */ extern struct mi_cmd *mi_lookup (const char *command); diff --git a/gdb/mi/mi-getopt.c b/gdb/mi/mi-getopt.c index be76ac1..a1e2ccc 100644 --- a/gdb/mi/mi-getopt.c +++ b/gdb/mi/mi-getopt.c @@ -29,7 +29,6 @@ mi_getopt (const char *prefix, { char *arg; const struct mi_opt *opt; - int olength = 1; /* We assume that argv/argc are ok. */ if (*oind > argc || *oind < 0) @@ -51,15 +50,10 @@ mi_getopt (const char *prefix, *oarg = NULL; return -1; } - - /* Deal with --foo options. */ - if (arg[0] == '-' && arg[1] == '-') - olength++; - /* Look the option up. */ for (opt = opts; opt->name != NULL; opt++) { - if (strcmp (opt->name, arg + olength) != 0) + if (strcmp (opt->name, arg + 1) != 0) continue; if (opt->arg_p) { @@ -77,7 +71,7 @@ mi_getopt (const char *prefix, return opt->index; } } - error (_("%s: Unknown option ``%s''"), prefix, arg + olength); + error (_("%s: Unknown option ``%s''"), prefix, arg + 1); } int diff --git a/gdb/python/lib/gdb/frames.py b/gdb/python/lib/gdb/frames.py index a530d8c..2287181 100644 --- a/gdb/python/lib/gdb/frames.py +++ b/gdb/python/lib/gdb/frames.py @@ -1,5 +1,5 @@ # Frame-filter commands. -# Copyright (C) 2012, 2013 Free Software Foundation, Inc. +# Copyright (C) 2013 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 diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c index e608bab..95cc2f2 100644 --- a/gdb/python/py-framefilter.c +++ b/gdb/python/py-framefilter.c @@ -1182,14 +1182,14 @@ py_print_frame (PyObject *filter, int flags, enum py_frame_args args_type, else if (PyLong_Check (py_func)) { CORE_ADDR addr = PyLong_AsUnsignedLongLong (py_func); - struct minimal_symbol *msymbol; + struct bound_minimal_symbol msymbol; if (PyErr_Occurred ()) goto error; msymbol = lookup_minimal_symbol_by_pc (addr); - if (msymbol != NULL) - function = SYMBOL_PRINT_NAME (msymbol); + if (msymbol.minsym != NULL) + function = SYMBOL_PRINT_NAME (msymbol.minsym); } else if (py_func != Py_None) { diff --git a/gdb/testsuite/gdb.python/py-framefilter-gdb.py.in b/gdb/testsuite/gdb.python/py-framefilter-gdb.py.in index 2d5995a..2c1d870 100644 --- a/gdb/testsuite/gdb.python/py-framefilter-gdb.py.in +++ b/gdb/testsuite/gdb.python/py-framefilter-gdb.py.in @@ -1,4 +1,4 @@ -# Copyright (C) 2012, 2013 Free Software Foundation, Inc. +# Copyright (C) 2013 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 diff --git a/gdb/testsuite/gdb.python/py-framefilter.exp b/gdb/testsuite/gdb.python/py-framefilter.exp index 6a11c43..c816321 100644 --- a/gdb/testsuite/gdb.python/py-framefilter.exp +++ b/gdb/testsuite/gdb.python/py-framefilter.exp @@ -1,4 +1,4 @@ -# Copyright (C) 2012, 2013 Free Software Foundation, Inc. +# Copyright (C) 2013 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 diff --git a/gdb/testsuite/gdb.python/py-framefilter.py b/gdb/testsuite/gdb.python/py-framefilter.py index c8b7a03..d31bbbe 100644 --- a/gdb/testsuite/gdb.python/py-framefilter.py +++ b/gdb/testsuite/gdb.python/py-framefilter.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012, 2013 Free Software Foundation, Inc. +# Copyright (C) 2013 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 hooks/post-receive -- Repository for Project Archer.