autoconfig
cgi
cross_compile
flex
gdb_pretty_print
main.c
main.cpp
myString.py
mybs.py
.gitignore
1st_day_of_month.cpp
alternatice_bracket.c
ascii_injection.py
ascii_nn_input_helper.py
bind_test.sh
blumba.html
bootrap.html
brython_hw.html
c.php
c_old_argument_notation.c
cnn.c
comp.c
conditional_const.c
const.c
cpp_regex_error.cpp
current_year.cpp
dda2.cpp
dog.jpg
dog2.jpg
dpt.py
dropdown.html
else_while.c
example.m4
extension_cut.Makefile
fddl.js
fizzbuzz.f90
for_ctags.cpp
format.py
free_null.c
gcc_include_next.c
gdb_graph.c
getopt_test.c
gnu_decimals.c
29 lines
512 B
Python
29 lines
512 B
Python
class mybsPrinter:
|
|
def __init__(self, val):
|
|
self.val = val
|
|
def to_string(self):
|
|
s = ""
|
|
char_ptr = gdb.lookup_type("char").pointer()
|
|
char_ptr_ptr = char_ptr.pointer()
|
|
v = self.val['v']
|
|
for i in range(0, v['element_count']):
|
|
s += (
|
|
str(
|
|
(
|
|
v['data'].cast(char_ptr_ptr)
|
|
+
|
|
i
|
|
).dereference()
|
|
)
|
|
+
|
|
", "
|
|
)
|
|
return s
|
|
|
|
def mylookup(val):
|
|
if str(val.type) == 'mybs':
|
|
return mybsPrinter(val)
|
|
return None
|
|
|
|
gdb.pretty_printers.append(mylookup)
|