aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/python.c')
-rw-r--r--gdb/python/python.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c
index a26c373..fcd367f 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -460,13 +460,11 @@ gdbpy_parameter_value (const setting &var)
case var_enum:
{
const char *str;
- if (var.type () == var_enum)
- str = var.get<const char *> ();
- else
- str = var.get<char *> ();
+ if (var.type () == var_enum)
+ str = var.get<const char *> ();
+ else
+ str = var.get<std::string> ().c_str ();
- if (str == nullptr)
- str = "";
return host_string_to_python_string (str).release ();
}