This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

get python string from gdb.Value


Hi,

Just thought I'd give a heads up of what I'm doing (which is what I
mentioned in the archer call today):

I'm writing the in_scope convenience function in python, as an exercise
to spot rough edges and missing things that are needed for a useful real
world python script. So I have a few local smallish bugfixes and
additions to gdb.Block and gdb.Function, nothing major.

I stumbled upon the bigger problem that there's no way to get a Python
string (or unicode string, rather) object out of a gdb.Value holding an
inferior string. I'm working on implementing a gdb.Value.string method
which will return a Unicode string, and have an optional encoding
argument (defaulting to target-charset) to specify the charset of the
string in the inferior.

For that I factored out a read-string-from-inferior function out of
val_print_string, and I am starting to add an la_getstr function to
language_defn so that code in python-value.c can obtain a string from
the inferior in a language-agnostic way.
-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]