1 # Copyright (C) 2021-2022 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 from gdb
.FrameDecorator
import FrameDecorator
21 # A FrameDecorator that just returns gdb.Frame.pc () from 'function'.
22 # We want to ensure that GDB correctly handles this case.
23 class Function_Returns_Address(FrameDecorator
):
24 def __init__(self
, fobj
):
25 super(Function_Returns_Address
, self
).__init
__(fobj
)
29 frame
= self
.inferior_frame()
35 self
.name
= "function_returns_address"
38 gdb
.frame_filters
[self
.name
] = self
40 def filter(self
, frame_iter
):
41 # Python 3.x moved the itertools.imap functionality to map(),
42 # so check if it is available.
43 if hasattr(itertools
, "imap"):
44 frame_iter
= itertools
.imap(Function_Returns_Address
, frame_iter
)
46 frame_iter
= map(Function_Returns_Address
, frame_iter
)
This page took 0.02947 seconds and 4 git commands to generate.