aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-breakpoint.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2016-02-09 10:02:53 -0800
committerKeith Seitz <keiths@redhat.com>2016-02-09 14:27:50 -0800
commit9f61929fd82fb632ee7c3be883d7086afc5c65d0 (patch)
tree3f79fb369acd0eee4807b678ba92f9cc13f37f23 /gdb/python/py-breakpoint.c
parenteeb1af437c6f1ca111bc31b63eefc5344b553681 (diff)
downloadgdb-9f61929fd82fb632ee7c3be883d7086afc5c65d0.zip
gdb-9f61929fd82fb632ee7c3be883d7086afc5c65d0.tar.gz
gdb-9f61929fd82fb632ee7c3be883d7086afc5c65d0.tar.bz2
python/19506 -- gdb.Breakpoint address location regression
Now that "legacy" linespecs benefit from consolidated support in string_to_event_location_basic, python's Breakpoint command should use this function to turn strings into event locations. As a result, this patch fixes python/19506. Before: (gdb) python gdb.Breakpoint("*main") Traceback (most recent call last): File "<string>", line 1, in <module> RuntimeError: Function "*main" not defined. Error while executing Python code. After: (gdb) python gdb.Breakpoint("*main") Breakpoint 1 at 0x4005fb: file ../../../src/gdb/testsuite/gdb.python/py-breakpoint.c, line 32. gdb/ChangeLog PR python/19506 * python/py-breakpoint.c (bppy_init): Use string_to_event_location_basic instead of new_linespec_location. gdb/testsuite/ChangeLog PR python/19506 * gdb.python/py-breakpoint.exp (test_bkpt_address): New procedure. (toplevel): Call test_bkpt_address.
Diffstat (limited to 'gdb/python/py-breakpoint.c')
-rw-r--r--gdb/python/py-breakpoint.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index 85b17d5..964ec62 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -663,7 +663,7 @@ bppy_init (PyObject *self, PyObject *args, PyObject *kwargs)
TRY
{
- char *copy = xstrdup (spec);
+ char *copy = xstrdup (skip_spaces_const (spec));
struct cleanup *cleanup = make_cleanup (xfree, copy);
switch (type)
@@ -672,7 +672,8 @@ bppy_init (PyObject *self, PyObject *args, PyObject *kwargs)
{
struct event_location *location;
- location = new_linespec_location (&copy);
+ location
+ = string_to_event_location_basic (&copy, current_language);
make_cleanup_delete_event_location (location);
create_breakpoint (python_gdbarch,
location, NULL, -1, NULL,