diff options
author | Tom Tromey <tromey@redhat.com> | 2011-01-26 20:58:49 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2011-01-26 20:58:49 +0000 |
commit | a81766d88fb4f4be52357e186146752b47cf3b58 (patch) | |
tree | c094f6f18555eb1608350b7e6b74d4bea952fa6f /gdb/python | |
parent | 74aedc4602913e330a1ec0cf5e9b8c8fe2b19a48 (diff) | |
download | gdb-a81766d88fb4f4be52357e186146752b47cf3b58.zip gdb-a81766d88fb4f4be52357e186146752b47cf3b58.tar.gz gdb-a81766d88fb4f4be52357e186146752b47cf3b58.tar.bz2 |
gdb
* python/py-prettyprint.c (print_string_repr): Clear
'addressprint' option when calling val_print_string.
(print_children): Handle Val_pretty_default. Clear 'addressprint'
option when calling val_print_string.
gdb/testsuite
* gdb.python/py-prettyprint.exp (run_lang_tests): Ensure no blank
space before string output. Add test for "set print pretty off"
case.
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/py-prettyprint.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c index 7532aa5..916492e 100644 --- a/gdb/python/py-prettyprint.c +++ b/gdb/python/py-prettyprint.c @@ -325,13 +325,15 @@ print_string_repr (PyObject *printer, const char *hint, long length; struct type *type; char *encoding = NULL; + struct value_print_options local_opts = *options; make_cleanup (free_current_contents, &encoding); gdbpy_extract_lazy_string (py_str, &addr, &type, &length, &encoding); + local_opts.addressprint = 0; val_print_string (type, encoding, addr, (int) length, - stream, options); + stream, &local_opts); } else { @@ -499,7 +501,15 @@ print_children (PyObject *printer, const char *hint, /* Use the prettyprint_arrays option if we are printing an array, and the pretty option otherwise. */ - pretty = is_array ? options->prettyprint_arrays : options->pretty; + if (is_array) + pretty = options->prettyprint_arrays; + else + { + if (options->pretty == Val_prettyprint) + pretty = 1; + else + pretty = options->prettyprint_structs; + } /* Manufacture a dummy Python frame to work around Python 2.4 bug, where it insists on having a non-NULL tstate->frame when @@ -598,12 +608,14 @@ print_children (PyObject *printer, const char *hint, struct type *type; long length; char *encoding = NULL; + struct value_print_options local_opts = *options; make_cleanup (free_current_contents, &encoding); gdbpy_extract_lazy_string (py_v, &addr, &type, &length, &encoding); + local_opts.addressprint = 0; val_print_string (type, encoding, addr, (int) length, stream, - options); + &local_opts); do_cleanups (inner_cleanup); } |