2014-01-01 03:54:24 +00:00
|
|
|
# Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
2009-05-28 01:05:14 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
# This file is part of the GDB testsuite. It tests python pretty
|
|
|
|
# printers.
|
|
|
|
|
|
|
|
import re
|
2011-07-28 10:36:40 +00:00
|
|
|
import gdb
|
2009-05-28 01:05:14 +00:00
|
|
|
|
2012-12-10 21:22:21 +00:00
|
|
|
def _iterator (pointer, len):
|
2012-12-11 20:54:52 +00:00
|
|
|
start = pointer
|
|
|
|
end = pointer + len
|
|
|
|
while pointer != end:
|
|
|
|
yield ('[%d]' % int (pointer - start), pointer.dereference())
|
|
|
|
pointer += 1
|
|
|
|
|
|
|
|
# Same as _iterator but can be told to raise an exception.
|
|
|
|
def _iterator_except (pointer, len):
|
2012-12-10 21:22:21 +00:00
|
|
|
start = pointer
|
|
|
|
end = pointer + len
|
|
|
|
while pointer != end:
|
|
|
|
if exception_flag:
|
|
|
|
raise gdb.MemoryError ('hi bob')
|
|
|
|
yield ('[%d]' % int (pointer - start), pointer.dereference())
|
|
|
|
pointer += 1
|
|
|
|
|
2009-05-28 01:05:14 +00:00
|
|
|
# Test returning a Value from a printer.
|
2012-12-10 21:22:21 +00:00
|
|
|
class string_print (object):
|
2009-05-28 01:05:14 +00:00
|
|
|
def __init__(self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string(self):
|
|
|
|
return self.val['whybother']['contents']
|
|
|
|
|
|
|
|
# Test a class-based printer.
|
2012-12-10 21:22:21 +00:00
|
|
|
class ContainerPrinter (object):
|
2009-05-28 01:05:14 +00:00
|
|
|
|
|
|
|
def __init__(self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string(self):
|
|
|
|
return 'container %s with %d elements' % (self.val['name'], self.val['len'])
|
|
|
|
|
|
|
|
def children(self):
|
2012-12-10 21:22:21 +00:00
|
|
|
return _iterator(self.val['elements'], self.val['len'])
|
2009-05-28 01:05:14 +00:00
|
|
|
|
2012-12-06 18:59:57 +00:00
|
|
|
# Treats a container as array.
|
2012-12-11 20:54:52 +00:00
|
|
|
class ArrayPrinter (object):
|
2012-12-06 18:59:57 +00:00
|
|
|
def __init__(self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string(self):
|
|
|
|
return 'array %s with %d elements' % (self.val['name'], self.val['len'])
|
|
|
|
|
|
|
|
def children(self):
|
2012-12-11 20:54:52 +00:00
|
|
|
return _iterator(self.val['elements'], self.val['len'])
|
2012-12-06 18:59:57 +00:00
|
|
|
|
|
|
|
def display_hint (self):
|
|
|
|
return 'array'
|
|
|
|
|
2011-03-31 19:59:26 +00:00
|
|
|
# Flag to make NoStringContainerPrinter throw an exception.
|
|
|
|
exception_flag = False
|
|
|
|
|
2010-04-14 12:02:46 +00:00
|
|
|
# Test a printer where to_string is None
|
2012-12-10 21:22:21 +00:00
|
|
|
class NoStringContainerPrinter (object):
|
2010-04-14 12:02:46 +00:00
|
|
|
def __init__(self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string(self):
|
|
|
|
return None
|
|
|
|
|
|
|
|
def children(self):
|
2012-12-11 20:54:52 +00:00
|
|
|
return _iterator_except (self.val['elements'], self.val['len'])
|
2010-04-14 12:02:46 +00:00
|
|
|
|
2012-12-10 21:22:21 +00:00
|
|
|
class pp_s (object):
|
2009-05-28 01:05:14 +00:00
|
|
|
def __init__(self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string(self):
|
|
|
|
a = self.val["a"]
|
|
|
|
b = self.val["b"]
|
|
|
|
if a.address != b:
|
|
|
|
raise Exception("&a(%s) != b(%s)" % (str(a.address), str(b)))
|
|
|
|
return " a=<" + str(self.val["a"]) + "> b=<" + str(self.val["b"]) + ">"
|
|
|
|
|
2012-12-10 21:22:21 +00:00
|
|
|
class pp_ss (object):
|
2009-05-28 01:05:14 +00:00
|
|
|
def __init__(self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string(self):
|
|
|
|
return "a=<" + str(self.val["a"]) + "> b=<" + str(self.val["b"]) + ">"
|
|
|
|
|
2012-12-10 21:22:21 +00:00
|
|
|
class pp_sss (object):
|
2009-05-28 01:05:14 +00:00
|
|
|
def __init__(self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string(self):
|
|
|
|
return "a=<" + str(self.val['a']) + "> b=<" + str(self.val["b"]) + ">"
|
|
|
|
|
2012-12-10 21:22:21 +00:00
|
|
|
class pp_multiple_virtual (object):
|
2009-05-28 01:05:14 +00:00
|
|
|
def __init__ (self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string (self):
|
|
|
|
return "pp value variable is: " + str (self.val['value'])
|
|
|
|
|
2012-12-10 21:22:21 +00:00
|
|
|
class pp_vbase1 (object):
|
2009-05-28 01:05:14 +00:00
|
|
|
def __init__ (self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string (self):
|
|
|
|
return "pp class name: " + self.val.type.tag
|
|
|
|
|
2012-12-10 21:22:21 +00:00
|
|
|
class pp_nullstr (object):
|
gdb
* varobj.h (varobj_update_result_t) <new>: New field.
(varobj_get_child_range, varobj_set_child_range): Declare.
(varobj_list_children): Update.
(varobj_enable_pretty_printing, varobj_has_more)
(varobj_pretty_printed_p): Declare.
* varobj.c (pretty_printing): New global.
(varobj_enable_pretty_printing): New function.
(struct varobj_root) <from, to, constructor, child_iter,
saved_item>: New fields.
(varobj_create): Don't call install_default_visualizer.
(instantiate_pretty_printer): Don't use value_copy.
(varobj_has_more): New function.
(restrict_range): New function.
(install_dynamic_child): Likewise.
(dynamic_varobj_has_child_method): Likewise.
(update_dynamic_varobj_children): Remove 'new_and_unchanged'
argument; add 'new', 'unchanged', 'from', and 'to' arguments.
Rewrite.
(varobj_get_num_children): Call update_dynamic_varobj_children.
(varobj_list_children): Add 'from' and 'to' arguments. Ignore
result of update_dynamic_varobj_children. Don't call
install_default_visualizer. Restrict result range.
(varobj_add_child): Don't call install_default_visualizer.
(varobj_pretty_printed_p): New function.
(install_visualizer): Rewrite. Move earlier in file.
(install_default_visualizer): Likewise.
(construct_visualizer): New function.
(install_new_value_visualizer): Likewise.
(install_new_value): Don't call release_value. Special case
pretty-printed objects. Use value_incref. Rearrange "changed"
logic.
(varobj_get_child_range): New function.
(varobj_set_child_range): Likewise.
(varobj_set_visualizer): Rewrite.
(varobj_update): Rewrite pretty-printing logic.
(new_variable): Initialize new fields.
(free_variable): Destroy new fields.
(value_of_root): Copy 'from' and 'to'.
(my_value_of_variable): Handle pretty-printers.
(value_get_print_value): Rework pretty-printing logic.
(cplus_describe_child): Don't use release_value.
* mi/mi-cmds.h (mi_cmd_enable_pretty_printing)
(mi_cmd_var_set_update_range): Declare.
* mi/mi-cmds.c (mi_cmds): Add enable-pretty-printing and
var-set-update-range.
* mi/mi-cmd-var.c (print_varobj): Update. Emit "dynamic"
attribute.
(mi_cmd_var_create): Emit "has_more" attribute.
(mi_cmd_var_set_format): Plug memory leak.
(mi_print_value_p): Replace 'type' argument with 'var'. Handle
pretty-printed varobjs.
(mi_cmd_var_list_children): Accept 'from' and 'to' arguments.
Emit "has_more" attribute.
(mi_cmd_var_evaluate_expression): Plug memory leak.
(mi_cmd_var_assign): Likewise.
(varobj_update_one): Likewise. Emit "dynamic", "has_more", and
"new_children" attributes.
(mi_cmd_enable_pretty_printing): New function.
(mi_cmd_var_set_update_range): Likewise.
gdb/doc
* gdb.texinfo (GDB/MI Variable Objects): Document
-enable-pretty-printing, -var-set-update-range, dynamic varobjs.
Expand -var-update documentation.
gdb/testsuite
* lib/mi-support.exp (mi_create_varobj): Update.
(mi_create_floating_varobj): Likewise.
(mi_create_dynamic_varobj): New proc.
(mi_varobj_update): Update.
(mi_varobj_update_with_type_change): Likewise.
(mi_varobj_update_kv_helper): New proc.
(mi_varobj_update_dynamic_helper): Rewrite.
(mi_varobj_update_dynamic): New proc.
(mi_list_varobj_children): Update.
(mi_list_varobj_children_range): Add 'from' and 'to' arguments.
* gdb.python/python-prettyprint.py (pp_outer): New class.
(pp_nullstr): Likewise.
(lookup_function): Register new printers.
* gdb.python/python-prettyprint.c (struct substruct): New type.
(struct outerstruct): Likewise.
(substruct_test): New function.
(struct nullstr): New type.
(string_1, string_2): New globals.
(main): Add new tests.
* gdb.python/python-mi.exp: Added regression tests.
* gdb.mi/mi2-var-display.exp: Update.
* gdb.mi/mi2-var-cmd.exp: Update.
* gdb.mi/mi2-var-child.exp: Update.
* gdb.mi/mi2-var-block.exp: Update.
* gdb.mi/mi-var-invalidate.exp: Update.
* gdb.mi/mi-var-display.exp: Update.
* gdb.mi/mi-var-cmd.exp: Update.
* gdb.mi/mi-var-child.exp: Update.
* gdb.mi/mi-var-block.exp: Update.
* gdb.mi/mi-break.exp: Update.
* gdb.mi/gdb701.exp: Update.
2009-09-15 18:51:26 +00:00
|
|
|
def __init__(self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string(self):
|
2010-03-05 20:18:19 +00:00
|
|
|
return self.val['s'].string(gdb.target_charset())
|
gdb
* varobj.h (varobj_update_result_t) <new>: New field.
(varobj_get_child_range, varobj_set_child_range): Declare.
(varobj_list_children): Update.
(varobj_enable_pretty_printing, varobj_has_more)
(varobj_pretty_printed_p): Declare.
* varobj.c (pretty_printing): New global.
(varobj_enable_pretty_printing): New function.
(struct varobj_root) <from, to, constructor, child_iter,
saved_item>: New fields.
(varobj_create): Don't call install_default_visualizer.
(instantiate_pretty_printer): Don't use value_copy.
(varobj_has_more): New function.
(restrict_range): New function.
(install_dynamic_child): Likewise.
(dynamic_varobj_has_child_method): Likewise.
(update_dynamic_varobj_children): Remove 'new_and_unchanged'
argument; add 'new', 'unchanged', 'from', and 'to' arguments.
Rewrite.
(varobj_get_num_children): Call update_dynamic_varobj_children.
(varobj_list_children): Add 'from' and 'to' arguments. Ignore
result of update_dynamic_varobj_children. Don't call
install_default_visualizer. Restrict result range.
(varobj_add_child): Don't call install_default_visualizer.
(varobj_pretty_printed_p): New function.
(install_visualizer): Rewrite. Move earlier in file.
(install_default_visualizer): Likewise.
(construct_visualizer): New function.
(install_new_value_visualizer): Likewise.
(install_new_value): Don't call release_value. Special case
pretty-printed objects. Use value_incref. Rearrange "changed"
logic.
(varobj_get_child_range): New function.
(varobj_set_child_range): Likewise.
(varobj_set_visualizer): Rewrite.
(varobj_update): Rewrite pretty-printing logic.
(new_variable): Initialize new fields.
(free_variable): Destroy new fields.
(value_of_root): Copy 'from' and 'to'.
(my_value_of_variable): Handle pretty-printers.
(value_get_print_value): Rework pretty-printing logic.
(cplus_describe_child): Don't use release_value.
* mi/mi-cmds.h (mi_cmd_enable_pretty_printing)
(mi_cmd_var_set_update_range): Declare.
* mi/mi-cmds.c (mi_cmds): Add enable-pretty-printing and
var-set-update-range.
* mi/mi-cmd-var.c (print_varobj): Update. Emit "dynamic"
attribute.
(mi_cmd_var_create): Emit "has_more" attribute.
(mi_cmd_var_set_format): Plug memory leak.
(mi_print_value_p): Replace 'type' argument with 'var'. Handle
pretty-printed varobjs.
(mi_cmd_var_list_children): Accept 'from' and 'to' arguments.
Emit "has_more" attribute.
(mi_cmd_var_evaluate_expression): Plug memory leak.
(mi_cmd_var_assign): Likewise.
(varobj_update_one): Likewise. Emit "dynamic", "has_more", and
"new_children" attributes.
(mi_cmd_enable_pretty_printing): New function.
(mi_cmd_var_set_update_range): Likewise.
gdb/doc
* gdb.texinfo (GDB/MI Variable Objects): Document
-enable-pretty-printing, -var-set-update-range, dynamic varobjs.
Expand -var-update documentation.
gdb/testsuite
* lib/mi-support.exp (mi_create_varobj): Update.
(mi_create_floating_varobj): Likewise.
(mi_create_dynamic_varobj): New proc.
(mi_varobj_update): Update.
(mi_varobj_update_with_type_change): Likewise.
(mi_varobj_update_kv_helper): New proc.
(mi_varobj_update_dynamic_helper): Rewrite.
(mi_varobj_update_dynamic): New proc.
(mi_list_varobj_children): Update.
(mi_list_varobj_children_range): Add 'from' and 'to' arguments.
* gdb.python/python-prettyprint.py (pp_outer): New class.
(pp_nullstr): Likewise.
(lookup_function): Register new printers.
* gdb.python/python-prettyprint.c (struct substruct): New type.
(struct outerstruct): Likewise.
(substruct_test): New function.
(struct nullstr): New type.
(string_1, string_2): New globals.
(main): Add new tests.
* gdb.python/python-mi.exp: Added regression tests.
* gdb.mi/mi2-var-display.exp: Update.
* gdb.mi/mi2-var-cmd.exp: Update.
* gdb.mi/mi2-var-child.exp: Update.
* gdb.mi/mi2-var-block.exp: Update.
* gdb.mi/mi-var-invalidate.exp: Update.
* gdb.mi/mi-var-display.exp: Update.
* gdb.mi/mi-var-cmd.exp: Update.
* gdb.mi/mi-var-child.exp: Update.
* gdb.mi/mi-var-block.exp: Update.
* gdb.mi/mi-break.exp: Update.
* gdb.mi/gdb701.exp: Update.
2009-09-15 18:51:26 +00:00
|
|
|
|
2012-12-10 21:22:21 +00:00
|
|
|
class pp_ns (object):
|
2009-07-10 10:35:17 +00:00
|
|
|
"Print a std::basic_string of some kind"
|
|
|
|
|
|
|
|
def __init__(self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string(self):
|
|
|
|
len = self.val['length']
|
2010-03-05 20:18:19 +00:00
|
|
|
return self.val['null_str'].string (gdb.target_charset(), length = len)
|
2009-07-10 10:35:17 +00:00
|
|
|
|
|
|
|
def display_hint (self):
|
|
|
|
return 'string'
|
|
|
|
|
2010-10-18 19:14:03 +00:00
|
|
|
pp_ls_encoding = None
|
|
|
|
|
2012-12-10 21:22:21 +00:00
|
|
|
class pp_ls (object):
|
2010-01-14 08:03:37 +00:00
|
|
|
"Print a std::basic_string of some kind"
|
|
|
|
|
|
|
|
def __init__(self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string(self):
|
2010-10-18 19:14:03 +00:00
|
|
|
if pp_ls_encoding is not None:
|
|
|
|
return self.val['lazy_str'].lazy_string(encoding = pp_ls_encoding)
|
|
|
|
else:
|
|
|
|
return self.val['lazy_str'].lazy_string()
|
2010-01-14 08:03:37 +00:00
|
|
|
|
|
|
|
def display_hint (self):
|
|
|
|
return 'string'
|
|
|
|
|
2012-12-10 21:22:21 +00:00
|
|
|
class pp_hint_error (object):
|
2011-04-11 17:40:41 +00:00
|
|
|
"Throw error from display_hint"
|
|
|
|
|
|
|
|
def __init__(self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string(self):
|
|
|
|
return 'hint_error_val'
|
|
|
|
|
|
|
|
def display_hint (self):
|
|
|
|
raise Exception("hint failed")
|
|
|
|
|
2012-12-10 21:22:21 +00:00
|
|
|
class pp_children_as_list (object):
|
2012-08-06 18:44:45 +00:00
|
|
|
"Throw error from display_hint"
|
|
|
|
|
|
|
|
def __init__(self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string(self):
|
|
|
|
return 'children_as_list_val'
|
|
|
|
|
|
|
|
def children (self):
|
|
|
|
return [('one', 1)]
|
|
|
|
|
2012-12-10 21:22:21 +00:00
|
|
|
class pp_outer (object):
|
gdb
* varobj.h (varobj_update_result_t) <new>: New field.
(varobj_get_child_range, varobj_set_child_range): Declare.
(varobj_list_children): Update.
(varobj_enable_pretty_printing, varobj_has_more)
(varobj_pretty_printed_p): Declare.
* varobj.c (pretty_printing): New global.
(varobj_enable_pretty_printing): New function.
(struct varobj_root) <from, to, constructor, child_iter,
saved_item>: New fields.
(varobj_create): Don't call install_default_visualizer.
(instantiate_pretty_printer): Don't use value_copy.
(varobj_has_more): New function.
(restrict_range): New function.
(install_dynamic_child): Likewise.
(dynamic_varobj_has_child_method): Likewise.
(update_dynamic_varobj_children): Remove 'new_and_unchanged'
argument; add 'new', 'unchanged', 'from', and 'to' arguments.
Rewrite.
(varobj_get_num_children): Call update_dynamic_varobj_children.
(varobj_list_children): Add 'from' and 'to' arguments. Ignore
result of update_dynamic_varobj_children. Don't call
install_default_visualizer. Restrict result range.
(varobj_add_child): Don't call install_default_visualizer.
(varobj_pretty_printed_p): New function.
(install_visualizer): Rewrite. Move earlier in file.
(install_default_visualizer): Likewise.
(construct_visualizer): New function.
(install_new_value_visualizer): Likewise.
(install_new_value): Don't call release_value. Special case
pretty-printed objects. Use value_incref. Rearrange "changed"
logic.
(varobj_get_child_range): New function.
(varobj_set_child_range): Likewise.
(varobj_set_visualizer): Rewrite.
(varobj_update): Rewrite pretty-printing logic.
(new_variable): Initialize new fields.
(free_variable): Destroy new fields.
(value_of_root): Copy 'from' and 'to'.
(my_value_of_variable): Handle pretty-printers.
(value_get_print_value): Rework pretty-printing logic.
(cplus_describe_child): Don't use release_value.
* mi/mi-cmds.h (mi_cmd_enable_pretty_printing)
(mi_cmd_var_set_update_range): Declare.
* mi/mi-cmds.c (mi_cmds): Add enable-pretty-printing and
var-set-update-range.
* mi/mi-cmd-var.c (print_varobj): Update. Emit "dynamic"
attribute.
(mi_cmd_var_create): Emit "has_more" attribute.
(mi_cmd_var_set_format): Plug memory leak.
(mi_print_value_p): Replace 'type' argument with 'var'. Handle
pretty-printed varobjs.
(mi_cmd_var_list_children): Accept 'from' and 'to' arguments.
Emit "has_more" attribute.
(mi_cmd_var_evaluate_expression): Plug memory leak.
(mi_cmd_var_assign): Likewise.
(varobj_update_one): Likewise. Emit "dynamic", "has_more", and
"new_children" attributes.
(mi_cmd_enable_pretty_printing): New function.
(mi_cmd_var_set_update_range): Likewise.
gdb/doc
* gdb.texinfo (GDB/MI Variable Objects): Document
-enable-pretty-printing, -var-set-update-range, dynamic varobjs.
Expand -var-update documentation.
gdb/testsuite
* lib/mi-support.exp (mi_create_varobj): Update.
(mi_create_floating_varobj): Likewise.
(mi_create_dynamic_varobj): New proc.
(mi_varobj_update): Update.
(mi_varobj_update_with_type_change): Likewise.
(mi_varobj_update_kv_helper): New proc.
(mi_varobj_update_dynamic_helper): Rewrite.
(mi_varobj_update_dynamic): New proc.
(mi_list_varobj_children): Update.
(mi_list_varobj_children_range): Add 'from' and 'to' arguments.
* gdb.python/python-prettyprint.py (pp_outer): New class.
(pp_nullstr): Likewise.
(lookup_function): Register new printers.
* gdb.python/python-prettyprint.c (struct substruct): New type.
(struct outerstruct): Likewise.
(substruct_test): New function.
(struct nullstr): New type.
(string_1, string_2): New globals.
(main): Add new tests.
* gdb.python/python-mi.exp: Added regression tests.
* gdb.mi/mi2-var-display.exp: Update.
* gdb.mi/mi2-var-cmd.exp: Update.
* gdb.mi/mi2-var-child.exp: Update.
* gdb.mi/mi2-var-block.exp: Update.
* gdb.mi/mi-var-invalidate.exp: Update.
* gdb.mi/mi-var-display.exp: Update.
* gdb.mi/mi-var-cmd.exp: Update.
* gdb.mi/mi-var-child.exp: Update.
* gdb.mi/mi-var-block.exp: Update.
* gdb.mi/mi-break.exp: Update.
* gdb.mi/gdb701.exp: Update.
2009-09-15 18:51:26 +00:00
|
|
|
"Print struct outer"
|
|
|
|
|
|
|
|
def __init__ (self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string (self):
|
|
|
|
return "x = %s" % self.val['x']
|
|
|
|
|
|
|
|
def children (self):
|
|
|
|
yield 's', self.val['s']
|
|
|
|
yield 'x', self.val['x']
|
|
|
|
|
2012-12-10 21:22:21 +00:00
|
|
|
class MemoryErrorString (object):
|
2011-07-28 10:36:40 +00:00
|
|
|
"Raise an error"
|
|
|
|
|
|
|
|
def __init__(self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string(self):
|
2012-12-10 21:22:21 +00:00
|
|
|
raise gdb.MemoryError ("Cannot access memory.")
|
2011-07-28 10:36:40 +00:00
|
|
|
|
|
|
|
def display_hint (self):
|
|
|
|
return 'string'
|
|
|
|
|
2012-12-10 21:22:21 +00:00
|
|
|
class pp_eval_type (object):
|
2012-07-16 19:15:39 +00:00
|
|
|
def __init__(self, val):
|
|
|
|
self.val = val
|
|
|
|
|
|
|
|
def to_string(self):
|
2012-12-10 21:22:21 +00:00
|
|
|
gdb.execute("bt", to_string=True)
|
2012-07-16 19:15:39 +00:00
|
|
|
return "eval=<" + str(gdb.parse_and_eval("eval_func (123456789, 2, 3, 4, 5, 6, 7, 8)")) + ">"
|
|
|
|
|
2009-05-28 01:05:14 +00:00
|
|
|
def lookup_function (val):
|
|
|
|
"Look-up and return a pretty-printer that can print val."
|
|
|
|
|
|
|
|
# Get the type.
|
gdb
* varobj.h (varobj_update_result_t) <new>: New field.
(varobj_get_child_range, varobj_set_child_range): Declare.
(varobj_list_children): Update.
(varobj_enable_pretty_printing, varobj_has_more)
(varobj_pretty_printed_p): Declare.
* varobj.c (pretty_printing): New global.
(varobj_enable_pretty_printing): New function.
(struct varobj_root) <from, to, constructor, child_iter,
saved_item>: New fields.
(varobj_create): Don't call install_default_visualizer.
(instantiate_pretty_printer): Don't use value_copy.
(varobj_has_more): New function.
(restrict_range): New function.
(install_dynamic_child): Likewise.
(dynamic_varobj_has_child_method): Likewise.
(update_dynamic_varobj_children): Remove 'new_and_unchanged'
argument; add 'new', 'unchanged', 'from', and 'to' arguments.
Rewrite.
(varobj_get_num_children): Call update_dynamic_varobj_children.
(varobj_list_children): Add 'from' and 'to' arguments. Ignore
result of update_dynamic_varobj_children. Don't call
install_default_visualizer. Restrict result range.
(varobj_add_child): Don't call install_default_visualizer.
(varobj_pretty_printed_p): New function.
(install_visualizer): Rewrite. Move earlier in file.
(install_default_visualizer): Likewise.
(construct_visualizer): New function.
(install_new_value_visualizer): Likewise.
(install_new_value): Don't call release_value. Special case
pretty-printed objects. Use value_incref. Rearrange "changed"
logic.
(varobj_get_child_range): New function.
(varobj_set_child_range): Likewise.
(varobj_set_visualizer): Rewrite.
(varobj_update): Rewrite pretty-printing logic.
(new_variable): Initialize new fields.
(free_variable): Destroy new fields.
(value_of_root): Copy 'from' and 'to'.
(my_value_of_variable): Handle pretty-printers.
(value_get_print_value): Rework pretty-printing logic.
(cplus_describe_child): Don't use release_value.
* mi/mi-cmds.h (mi_cmd_enable_pretty_printing)
(mi_cmd_var_set_update_range): Declare.
* mi/mi-cmds.c (mi_cmds): Add enable-pretty-printing and
var-set-update-range.
* mi/mi-cmd-var.c (print_varobj): Update. Emit "dynamic"
attribute.
(mi_cmd_var_create): Emit "has_more" attribute.
(mi_cmd_var_set_format): Plug memory leak.
(mi_print_value_p): Replace 'type' argument with 'var'. Handle
pretty-printed varobjs.
(mi_cmd_var_list_children): Accept 'from' and 'to' arguments.
Emit "has_more" attribute.
(mi_cmd_var_evaluate_expression): Plug memory leak.
(mi_cmd_var_assign): Likewise.
(varobj_update_one): Likewise. Emit "dynamic", "has_more", and
"new_children" attributes.
(mi_cmd_enable_pretty_printing): New function.
(mi_cmd_var_set_update_range): Likewise.
gdb/doc
* gdb.texinfo (GDB/MI Variable Objects): Document
-enable-pretty-printing, -var-set-update-range, dynamic varobjs.
Expand -var-update documentation.
gdb/testsuite
* lib/mi-support.exp (mi_create_varobj): Update.
(mi_create_floating_varobj): Likewise.
(mi_create_dynamic_varobj): New proc.
(mi_varobj_update): Update.
(mi_varobj_update_with_type_change): Likewise.
(mi_varobj_update_kv_helper): New proc.
(mi_varobj_update_dynamic_helper): Rewrite.
(mi_varobj_update_dynamic): New proc.
(mi_list_varobj_children): Update.
(mi_list_varobj_children_range): Add 'from' and 'to' arguments.
* gdb.python/python-prettyprint.py (pp_outer): New class.
(pp_nullstr): Likewise.
(lookup_function): Register new printers.
* gdb.python/python-prettyprint.c (struct substruct): New type.
(struct outerstruct): Likewise.
(substruct_test): New function.
(struct nullstr): New type.
(string_1, string_2): New globals.
(main): Add new tests.
* gdb.python/python-mi.exp: Added regression tests.
* gdb.mi/mi2-var-display.exp: Update.
* gdb.mi/mi2-var-cmd.exp: Update.
* gdb.mi/mi2-var-child.exp: Update.
* gdb.mi/mi2-var-block.exp: Update.
* gdb.mi/mi-var-invalidate.exp: Update.
* gdb.mi/mi-var-display.exp: Update.
* gdb.mi/mi-var-cmd.exp: Update.
* gdb.mi/mi-var-child.exp: Update.
* gdb.mi/mi-var-block.exp: Update.
* gdb.mi/mi-break.exp: Update.
* gdb.mi/gdb701.exp: Update.
2009-09-15 18:51:26 +00:00
|
|
|
type = val.type
|
2009-05-28 01:05:14 +00:00
|
|
|
|
|
|
|
# If it points to a reference, get the reference.
|
|
|
|
if type.code == gdb.TYPE_CODE_REF:
|
|
|
|
type = type.target ()
|
|
|
|
|
|
|
|
# Get the unqualified type, stripped of typedefs.
|
|
|
|
type = type.unqualified ().strip_typedefs ()
|
|
|
|
|
|
|
|
# Get the type name.
|
|
|
|
typename = type.tag
|
|
|
|
|
|
|
|
if typename == None:
|
|
|
|
return None
|
|
|
|
|
|
|
|
# Iterate over local dictionary of types to determine
|
|
|
|
# if a printer is registered for that type. Return an
|
|
|
|
# instantiation of the printer if found.
|
|
|
|
for function in pretty_printers_dict:
|
|
|
|
if function.match (typename):
|
|
|
|
return pretty_printers_dict[function] (val)
|
|
|
|
|
|
|
|
# Cannot find a pretty printer. Return None.
|
|
|
|
|
|
|
|
return None
|
|
|
|
|
2010-06-04 18:18:28 +00:00
|
|
|
def disable_lookup_function ():
|
|
|
|
lookup_function.enabled = False
|
|
|
|
|
|
|
|
def enable_lookup_function ():
|
|
|
|
lookup_function.enabled = True
|
2009-05-28 01:05:14 +00:00
|
|
|
|
|
|
|
def register_pretty_printers ():
|
|
|
|
pretty_printers_dict[re.compile ('^struct s$')] = pp_s
|
|
|
|
pretty_printers_dict[re.compile ('^s$')] = pp_s
|
|
|
|
pretty_printers_dict[re.compile ('^S$')] = pp_s
|
|
|
|
|
|
|
|
pretty_printers_dict[re.compile ('^struct ss$')] = pp_ss
|
|
|
|
pretty_printers_dict[re.compile ('^ss$')] = pp_ss
|
|
|
|
pretty_printers_dict[re.compile ('^const S &$')] = pp_s
|
|
|
|
pretty_printers_dict[re.compile ('^SSS$')] = pp_sss
|
|
|
|
|
|
|
|
pretty_printers_dict[re.compile ('^VirtualTest$')] = pp_multiple_virtual
|
|
|
|
pretty_printers_dict[re.compile ('^Vbase1$')] = pp_vbase1
|
gdb
* varobj.h (varobj_update_result_t) <new>: New field.
(varobj_get_child_range, varobj_set_child_range): Declare.
(varobj_list_children): Update.
(varobj_enable_pretty_printing, varobj_has_more)
(varobj_pretty_printed_p): Declare.
* varobj.c (pretty_printing): New global.
(varobj_enable_pretty_printing): New function.
(struct varobj_root) <from, to, constructor, child_iter,
saved_item>: New fields.
(varobj_create): Don't call install_default_visualizer.
(instantiate_pretty_printer): Don't use value_copy.
(varobj_has_more): New function.
(restrict_range): New function.
(install_dynamic_child): Likewise.
(dynamic_varobj_has_child_method): Likewise.
(update_dynamic_varobj_children): Remove 'new_and_unchanged'
argument; add 'new', 'unchanged', 'from', and 'to' arguments.
Rewrite.
(varobj_get_num_children): Call update_dynamic_varobj_children.
(varobj_list_children): Add 'from' and 'to' arguments. Ignore
result of update_dynamic_varobj_children. Don't call
install_default_visualizer. Restrict result range.
(varobj_add_child): Don't call install_default_visualizer.
(varobj_pretty_printed_p): New function.
(install_visualizer): Rewrite. Move earlier in file.
(install_default_visualizer): Likewise.
(construct_visualizer): New function.
(install_new_value_visualizer): Likewise.
(install_new_value): Don't call release_value. Special case
pretty-printed objects. Use value_incref. Rearrange "changed"
logic.
(varobj_get_child_range): New function.
(varobj_set_child_range): Likewise.
(varobj_set_visualizer): Rewrite.
(varobj_update): Rewrite pretty-printing logic.
(new_variable): Initialize new fields.
(free_variable): Destroy new fields.
(value_of_root): Copy 'from' and 'to'.
(my_value_of_variable): Handle pretty-printers.
(value_get_print_value): Rework pretty-printing logic.
(cplus_describe_child): Don't use release_value.
* mi/mi-cmds.h (mi_cmd_enable_pretty_printing)
(mi_cmd_var_set_update_range): Declare.
* mi/mi-cmds.c (mi_cmds): Add enable-pretty-printing and
var-set-update-range.
* mi/mi-cmd-var.c (print_varobj): Update. Emit "dynamic"
attribute.
(mi_cmd_var_create): Emit "has_more" attribute.
(mi_cmd_var_set_format): Plug memory leak.
(mi_print_value_p): Replace 'type' argument with 'var'. Handle
pretty-printed varobjs.
(mi_cmd_var_list_children): Accept 'from' and 'to' arguments.
Emit "has_more" attribute.
(mi_cmd_var_evaluate_expression): Plug memory leak.
(mi_cmd_var_assign): Likewise.
(varobj_update_one): Likewise. Emit "dynamic", "has_more", and
"new_children" attributes.
(mi_cmd_enable_pretty_printing): New function.
(mi_cmd_var_set_update_range): Likewise.
gdb/doc
* gdb.texinfo (GDB/MI Variable Objects): Document
-enable-pretty-printing, -var-set-update-range, dynamic varobjs.
Expand -var-update documentation.
gdb/testsuite
* lib/mi-support.exp (mi_create_varobj): Update.
(mi_create_floating_varobj): Likewise.
(mi_create_dynamic_varobj): New proc.
(mi_varobj_update): Update.
(mi_varobj_update_with_type_change): Likewise.
(mi_varobj_update_kv_helper): New proc.
(mi_varobj_update_dynamic_helper): Rewrite.
(mi_varobj_update_dynamic): New proc.
(mi_list_varobj_children): Update.
(mi_list_varobj_children_range): Add 'from' and 'to' arguments.
* gdb.python/python-prettyprint.py (pp_outer): New class.
(pp_nullstr): Likewise.
(lookup_function): Register new printers.
* gdb.python/python-prettyprint.c (struct substruct): New type.
(struct outerstruct): Likewise.
(substruct_test): New function.
(struct nullstr): New type.
(string_1, string_2): New globals.
(main): Add new tests.
* gdb.python/python-mi.exp: Added regression tests.
* gdb.mi/mi2-var-display.exp: Update.
* gdb.mi/mi2-var-cmd.exp: Update.
* gdb.mi/mi2-var-child.exp: Update.
* gdb.mi/mi2-var-block.exp: Update.
* gdb.mi/mi-var-invalidate.exp: Update.
* gdb.mi/mi-var-display.exp: Update.
* gdb.mi/mi-var-cmd.exp: Update.
* gdb.mi/mi-var-child.exp: Update.
* gdb.mi/mi-var-block.exp: Update.
* gdb.mi/mi-break.exp: Update.
* gdb.mi/gdb701.exp: Update.
2009-09-15 18:51:26 +00:00
|
|
|
|
|
|
|
pretty_printers_dict[re.compile ('^struct nullstr$')] = pp_nullstr
|
|
|
|
pretty_printers_dict[re.compile ('^nullstr$')] = pp_nullstr
|
2009-05-28 01:05:14 +00:00
|
|
|
|
|
|
|
# Note that we purposely omit the typedef names here.
|
|
|
|
# Printer lookup is based on canonical name.
|
|
|
|
# However, we do need both tagged and untagged variants, to handle
|
|
|
|
# both the C and C++ cases.
|
|
|
|
pretty_printers_dict[re.compile ('^struct string_repr$')] = string_print
|
|
|
|
pretty_printers_dict[re.compile ('^struct container$')] = ContainerPrinter
|
2010-04-14 12:02:46 +00:00
|
|
|
pretty_printers_dict[re.compile ('^struct justchildren$')] = NoStringContainerPrinter
|
2009-05-28 01:05:14 +00:00
|
|
|
pretty_printers_dict[re.compile ('^string_repr$')] = string_print
|
|
|
|
pretty_printers_dict[re.compile ('^container$')] = ContainerPrinter
|
2010-04-14 12:02:46 +00:00
|
|
|
pretty_printers_dict[re.compile ('^justchildren$')] = NoStringContainerPrinter
|
2009-05-28 01:05:14 +00:00
|
|
|
|
2009-07-10 10:35:17 +00:00
|
|
|
pretty_printers_dict[re.compile ('^struct ns$')] = pp_ns
|
|
|
|
pretty_printers_dict[re.compile ('^ns$')] = pp_ns
|
gdb
* varobj.h (varobj_update_result_t) <new>: New field.
(varobj_get_child_range, varobj_set_child_range): Declare.
(varobj_list_children): Update.
(varobj_enable_pretty_printing, varobj_has_more)
(varobj_pretty_printed_p): Declare.
* varobj.c (pretty_printing): New global.
(varobj_enable_pretty_printing): New function.
(struct varobj_root) <from, to, constructor, child_iter,
saved_item>: New fields.
(varobj_create): Don't call install_default_visualizer.
(instantiate_pretty_printer): Don't use value_copy.
(varobj_has_more): New function.
(restrict_range): New function.
(install_dynamic_child): Likewise.
(dynamic_varobj_has_child_method): Likewise.
(update_dynamic_varobj_children): Remove 'new_and_unchanged'
argument; add 'new', 'unchanged', 'from', and 'to' arguments.
Rewrite.
(varobj_get_num_children): Call update_dynamic_varobj_children.
(varobj_list_children): Add 'from' and 'to' arguments. Ignore
result of update_dynamic_varobj_children. Don't call
install_default_visualizer. Restrict result range.
(varobj_add_child): Don't call install_default_visualizer.
(varobj_pretty_printed_p): New function.
(install_visualizer): Rewrite. Move earlier in file.
(install_default_visualizer): Likewise.
(construct_visualizer): New function.
(install_new_value_visualizer): Likewise.
(install_new_value): Don't call release_value. Special case
pretty-printed objects. Use value_incref. Rearrange "changed"
logic.
(varobj_get_child_range): New function.
(varobj_set_child_range): Likewise.
(varobj_set_visualizer): Rewrite.
(varobj_update): Rewrite pretty-printing logic.
(new_variable): Initialize new fields.
(free_variable): Destroy new fields.
(value_of_root): Copy 'from' and 'to'.
(my_value_of_variable): Handle pretty-printers.
(value_get_print_value): Rework pretty-printing logic.
(cplus_describe_child): Don't use release_value.
* mi/mi-cmds.h (mi_cmd_enable_pretty_printing)
(mi_cmd_var_set_update_range): Declare.
* mi/mi-cmds.c (mi_cmds): Add enable-pretty-printing and
var-set-update-range.
* mi/mi-cmd-var.c (print_varobj): Update. Emit "dynamic"
attribute.
(mi_cmd_var_create): Emit "has_more" attribute.
(mi_cmd_var_set_format): Plug memory leak.
(mi_print_value_p): Replace 'type' argument with 'var'. Handle
pretty-printed varobjs.
(mi_cmd_var_list_children): Accept 'from' and 'to' arguments.
Emit "has_more" attribute.
(mi_cmd_var_evaluate_expression): Plug memory leak.
(mi_cmd_var_assign): Likewise.
(varobj_update_one): Likewise. Emit "dynamic", "has_more", and
"new_children" attributes.
(mi_cmd_enable_pretty_printing): New function.
(mi_cmd_var_set_update_range): Likewise.
gdb/doc
* gdb.texinfo (GDB/MI Variable Objects): Document
-enable-pretty-printing, -var-set-update-range, dynamic varobjs.
Expand -var-update documentation.
gdb/testsuite
* lib/mi-support.exp (mi_create_varobj): Update.
(mi_create_floating_varobj): Likewise.
(mi_create_dynamic_varobj): New proc.
(mi_varobj_update): Update.
(mi_varobj_update_with_type_change): Likewise.
(mi_varobj_update_kv_helper): New proc.
(mi_varobj_update_dynamic_helper): Rewrite.
(mi_varobj_update_dynamic): New proc.
(mi_list_varobj_children): Update.
(mi_list_varobj_children_range): Add 'from' and 'to' arguments.
* gdb.python/python-prettyprint.py (pp_outer): New class.
(pp_nullstr): Likewise.
(lookup_function): Register new printers.
* gdb.python/python-prettyprint.c (struct substruct): New type.
(struct outerstruct): Likewise.
(substruct_test): New function.
(struct nullstr): New type.
(string_1, string_2): New globals.
(main): Add new tests.
* gdb.python/python-mi.exp: Added regression tests.
* gdb.mi/mi2-var-display.exp: Update.
* gdb.mi/mi2-var-cmd.exp: Update.
* gdb.mi/mi2-var-child.exp: Update.
* gdb.mi/mi2-var-block.exp: Update.
* gdb.mi/mi-var-invalidate.exp: Update.
* gdb.mi/mi-var-display.exp: Update.
* gdb.mi/mi-var-cmd.exp: Update.
* gdb.mi/mi-var-child.exp: Update.
* gdb.mi/mi-var-block.exp: Update.
* gdb.mi/mi-break.exp: Update.
* gdb.mi/gdb701.exp: Update.
2009-09-15 18:51:26 +00:00
|
|
|
|
2010-01-14 08:03:37 +00:00
|
|
|
pretty_printers_dict[re.compile ('^struct lazystring$')] = pp_ls
|
|
|
|
pretty_printers_dict[re.compile ('^lazystring$')] = pp_ls
|
|
|
|
|
gdb
* varobj.h (varobj_update_result_t) <new>: New field.
(varobj_get_child_range, varobj_set_child_range): Declare.
(varobj_list_children): Update.
(varobj_enable_pretty_printing, varobj_has_more)
(varobj_pretty_printed_p): Declare.
* varobj.c (pretty_printing): New global.
(varobj_enable_pretty_printing): New function.
(struct varobj_root) <from, to, constructor, child_iter,
saved_item>: New fields.
(varobj_create): Don't call install_default_visualizer.
(instantiate_pretty_printer): Don't use value_copy.
(varobj_has_more): New function.
(restrict_range): New function.
(install_dynamic_child): Likewise.
(dynamic_varobj_has_child_method): Likewise.
(update_dynamic_varobj_children): Remove 'new_and_unchanged'
argument; add 'new', 'unchanged', 'from', and 'to' arguments.
Rewrite.
(varobj_get_num_children): Call update_dynamic_varobj_children.
(varobj_list_children): Add 'from' and 'to' arguments. Ignore
result of update_dynamic_varobj_children. Don't call
install_default_visualizer. Restrict result range.
(varobj_add_child): Don't call install_default_visualizer.
(varobj_pretty_printed_p): New function.
(install_visualizer): Rewrite. Move earlier in file.
(install_default_visualizer): Likewise.
(construct_visualizer): New function.
(install_new_value_visualizer): Likewise.
(install_new_value): Don't call release_value. Special case
pretty-printed objects. Use value_incref. Rearrange "changed"
logic.
(varobj_get_child_range): New function.
(varobj_set_child_range): Likewise.
(varobj_set_visualizer): Rewrite.
(varobj_update): Rewrite pretty-printing logic.
(new_variable): Initialize new fields.
(free_variable): Destroy new fields.
(value_of_root): Copy 'from' and 'to'.
(my_value_of_variable): Handle pretty-printers.
(value_get_print_value): Rework pretty-printing logic.
(cplus_describe_child): Don't use release_value.
* mi/mi-cmds.h (mi_cmd_enable_pretty_printing)
(mi_cmd_var_set_update_range): Declare.
* mi/mi-cmds.c (mi_cmds): Add enable-pretty-printing and
var-set-update-range.
* mi/mi-cmd-var.c (print_varobj): Update. Emit "dynamic"
attribute.
(mi_cmd_var_create): Emit "has_more" attribute.
(mi_cmd_var_set_format): Plug memory leak.
(mi_print_value_p): Replace 'type' argument with 'var'. Handle
pretty-printed varobjs.
(mi_cmd_var_list_children): Accept 'from' and 'to' arguments.
Emit "has_more" attribute.
(mi_cmd_var_evaluate_expression): Plug memory leak.
(mi_cmd_var_assign): Likewise.
(varobj_update_one): Likewise. Emit "dynamic", "has_more", and
"new_children" attributes.
(mi_cmd_enable_pretty_printing): New function.
(mi_cmd_var_set_update_range): Likewise.
gdb/doc
* gdb.texinfo (GDB/MI Variable Objects): Document
-enable-pretty-printing, -var-set-update-range, dynamic varobjs.
Expand -var-update documentation.
gdb/testsuite
* lib/mi-support.exp (mi_create_varobj): Update.
(mi_create_floating_varobj): Likewise.
(mi_create_dynamic_varobj): New proc.
(mi_varobj_update): Update.
(mi_varobj_update_with_type_change): Likewise.
(mi_varobj_update_kv_helper): New proc.
(mi_varobj_update_dynamic_helper): Rewrite.
(mi_varobj_update_dynamic): New proc.
(mi_list_varobj_children): Update.
(mi_list_varobj_children_range): Add 'from' and 'to' arguments.
* gdb.python/python-prettyprint.py (pp_outer): New class.
(pp_nullstr): Likewise.
(lookup_function): Register new printers.
* gdb.python/python-prettyprint.c (struct substruct): New type.
(struct outerstruct): Likewise.
(substruct_test): New function.
(struct nullstr): New type.
(string_1, string_2): New globals.
(main): Add new tests.
* gdb.python/python-mi.exp: Added regression tests.
* gdb.mi/mi2-var-display.exp: Update.
* gdb.mi/mi2-var-cmd.exp: Update.
* gdb.mi/mi2-var-child.exp: Update.
* gdb.mi/mi2-var-block.exp: Update.
* gdb.mi/mi-var-invalidate.exp: Update.
* gdb.mi/mi-var-display.exp: Update.
* gdb.mi/mi-var-cmd.exp: Update.
* gdb.mi/mi-var-child.exp: Update.
* gdb.mi/mi-var-block.exp: Update.
* gdb.mi/mi-break.exp: Update.
* gdb.mi/gdb701.exp: Update.
2009-09-15 18:51:26 +00:00
|
|
|
pretty_printers_dict[re.compile ('^struct outerstruct$')] = pp_outer
|
|
|
|
pretty_printers_dict[re.compile ('^outerstruct$')] = pp_outer
|
|
|
|
|
2011-04-11 17:40:41 +00:00
|
|
|
pretty_printers_dict[re.compile ('^struct hint_error$')] = pp_hint_error
|
|
|
|
pretty_printers_dict[re.compile ('^hint_error$')] = pp_hint_error
|
|
|
|
|
2012-08-06 18:44:45 +00:00
|
|
|
pretty_printers_dict[re.compile ('^struct children_as_list$')] = pp_children_as_list
|
|
|
|
pretty_printers_dict[re.compile ('^children_as_list$')] = pp_children_as_list
|
|
|
|
|
2011-07-28 10:36:40 +00:00
|
|
|
pretty_printers_dict[re.compile ('^memory_error$')] = MemoryErrorString
|
|
|
|
|
2012-07-16 19:15:39 +00:00
|
|
|
pretty_printers_dict[re.compile ('^eval_type_s$')] = pp_eval_type
|
|
|
|
|
2009-05-28 01:05:14 +00:00
|
|
|
pretty_printers_dict = {}
|
|
|
|
|
|
|
|
register_pretty_printers ()
|
|
|
|
gdb.pretty_printers.append (lookup_function)
|