summaryrefslogtreecommitdiff
path: root/gdb/python/python.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/python.c')
-rw-r--r--gdb/python/python.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c
index e0c05f1d068..d6f7f99c457 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -810,6 +810,15 @@ gdbpy_decode_line (PyObject *self, PyObject *args)
if (! PyArg_ParseTuple (args, "|s", &arg))
return NULL;
+ /* Treat a string consisting of just whitespace the same as
+ NULL. */
+ if (arg != NULL)
+ {
+ arg = skip_spaces (arg);
+ if (*arg == '\0')
+ arg = NULL;
+ }
+
if (arg != NULL)
location = string_to_event_location_basic (&arg, python_language,
symbol_name_match_type::WILD);