]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/spu-tdep.c
Explicit locations: use new location API
[thirdparty/binutils-gdb.git] / gdb / spu-tdep.c
index e2cd91f7722144b709d2eef5c8740a097ddcbbd4..58d66710c40c23c2aa5ed2d491bb2524fd91a7da 100644 (file)
@@ -45,7 +45,7 @@
 #include "dwarf2-frame.h"
 #include "ax.h"
 #include "spu-tdep.h"
-
+#include "location.h"
 
 /* The list of available "set spu " and "show spu " commands.  */
 static struct cmd_list_element *setspucmdlist = NULL;
@@ -1953,8 +1953,10 @@ spu_catch_start (struct objfile *objfile)
 {
   struct bound_minimal_symbol minsym;
   struct compunit_symtab *cust;
+  char buf[32], *p;
   CORE_ADDR pc;
-  char buf[32];
+  struct event_location *location;
+  struct cleanup *back_to;
 
   /* Do this only if requested by "set spu stop-on-load on".  */
   if (!spu_stop_on_load_p)
@@ -1999,7 +2001,10 @@ spu_catch_start (struct objfile *objfile)
   /* Use a numerical address for the set_breakpoint command to avoid having
      the breakpoint re-set incorrectly.  */
   xsnprintf (buf, sizeof buf, "*%s", core_addr_to_string (pc));
-  create_breakpoint (get_objfile_arch (objfile), buf /* arg */,
+  p = buf;
+  location = new_linespec_location (&p);
+  back_to = make_cleanup_delete_event_location (location);
+  create_breakpoint (get_objfile_arch (objfile), location,
                     NULL /* cond_string */, -1 /* thread */,
                     NULL /* extra_string */,
                     0 /* parse_condition_and_thread */, 1 /* tempflag */,
@@ -2008,6 +2013,7 @@ spu_catch_start (struct objfile *objfile)
                     AUTO_BOOLEAN_FALSE /* pending_break_support */,
                     &bkpt_breakpoint_ops /* ops */, 0 /* from_tty */,
                     1 /* enabled */, 0 /* internal  */, 0);
+  do_cleanups (back_to);
 }