mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-19 01:19:41 +08:00
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
This commit is contained in:
@@ -264,9 +264,7 @@ stpy_lazy_string_elt_type (lazy_string_object *lazy)
|
||||
case TYPE_CODE_ARRAY:
|
||||
return check_typedef (realtype->target_type ());
|
||||
default:
|
||||
/* This is done to preserve existing behavior. PR 20769.
|
||||
E.g., gdb.parse_and_eval("my_int_variable").lazy_string().type. */
|
||||
return realtype;
|
||||
gdb_assert_not_reached ("invalid lazy string");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user