]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Reject non-string types in gdb.Value.lazy_string
authorTom Tromey <tromey@adacore.com>
Mon, 18 Nov 2024 20:47:22 +0000 (13:47 -0700)
committerTom Tromey <tromey@adacore.com>
Mon, 9 Dec 2024 21:17:21 +0000 (14:17 -0700)
commit2134b0b4a5ff493878386183dfd8a735b5334ad7
treee9b318cc897c5b3fdffbe6f37f97c8d8b29504e6
parent523a46ee9795bbec2d1d5cf7e434adc2a3044f94
Reject non-string types in gdb.Value.lazy_string

Currently, gdb.Value.lazy_string will allow the conversion of any
object to a "lazy string".  However, this was never the intent and is
weird besides.  This patch changes this code to correctly throw an
exception in the non-matching cases.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=20769
gdb/python/py-lazy-string.c
gdb/python/py-value.c
gdb/testsuite/gdb.python/py-lazy-string.c
gdb/testsuite/gdb.python/py-lazy-string.exp