1 # Copyright (C) 2018-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/>.
20 # Following is for Python 3 compatibility...
21 if sys
.version_info
[0] > 2:
25 class cons_pp(object):
26 def __init__(self
, val
):
30 if long(self
._val
) == 0:
32 elif long(self
._val
["type"]) == 0:
35 return "%d" % self
._val
["atom"]["ival"]
38 if long(self
._val
) == 0:
40 elif long(self
._val
["type"]) == 0:
41 return [("atom", self
._val
["atom"])]
44 ("car", self
._val
["slots"][0]),
45 ("cdr", self
._val
["slots"][1]),
49 def cons_pp_lookup(val
):
50 if str(val
.type) == "struct cons *":
56 del gdb
.pretty_printers
[1:]
57 gdb
.pretty_printers
.append(cons_pp_lookup
)
This page took 0.043773 seconds and 4 git commands to generate.