aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-12-07 08:10:55 -0700
committerTom Tromey <tromey@adacore.com>2022-12-07 08:12:03 -0700
commit3567f2bd6619cfabc58626075be068923483e4d3 (patch)
tree088b8de5aff0e775ffd7a9e922c65555815642a5 /gdb/python
parent3198c863f62ab2253a3405e677489b90c403cf1c (diff)
downloadfsf-binutils-gdb-3567f2bd6619cfabc58626075be068923483e4d3.zip
fsf-binutils-gdb-3567f2bd6619cfabc58626075be068923483e4d3.tar.gz
fsf-binutils-gdb-3567f2bd6619cfabc58626075be068923483e4d3.tar.bz2
Remove unnecessary xstrdup from bppy_init
I saw that bppy_init used a non-const "char *". Fixing this revealed that the xstrdup here was also unnecessary, so this patch removes it.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-breakpoint.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index 7a75743..63b18bd 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -938,16 +938,14 @@ bppy_init (PyObject *self, PyObject *args, PyObject *kwargs)
}
case bp_watchpoint:
{
- gdb::unique_xmalloc_ptr<char>
- copy_holder (xstrdup (skip_spaces (spec)));
- char *copy = copy_holder.get ();
+ spec = skip_spaces (spec);
if (access_type == hw_write)
- watch_command_wrapper (copy, 0, internal_bp);
+ watch_command_wrapper (spec, 0, internal_bp);
else if (access_type == hw_access)
- awatch_command_wrapper (copy, 0, internal_bp);
+ awatch_command_wrapper (spec, 0, internal_bp);
else if (access_type == hw_read)
- rwatch_command_wrapper (copy, 0, internal_bp);
+ rwatch_command_wrapper (spec, 0, internal_bp);
else
error(_("Cannot understand watchpoint access type."));
break;