*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / tracepoint.c
index b9b9f5ee8c6ba2dbc46c9127d434aaee21407e95..e9568e50a57e9db7a1fb8897c8e374fb19ad4f15 100644 (file)
@@ -7,7 +7,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -16,9 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -585,11 +583,12 @@ tracepoint_operation (struct tracepoint *t, int from_tty,
       ALL_TRACEPOINTS (t2)
        if (t2->next == t)
        {
-         tracepoint_delete_event (t2->number);
          t2->next = t->next;
          break;
        }
 
+      tracepoint_delete_event (t->number);
+
       if (t->addr_string)
        xfree (t->addr_string);
       if (t->source_file)
@@ -1162,7 +1161,7 @@ add_register (struct collection_list *collection, unsigned int regno)
 {
   if (info_verbose)
     printf_filtered ("collect register %d\n", regno);
-  if (regno > (8 * sizeof (collection->regs_mask)))
+  if (regno >= (8 * sizeof (collection->regs_mask)))
     error (_("Internal: register number %d too large for tracepoint"),
           regno);
   collection->regs_mask[regno / 8] |= 1 << (regno % 8);
@@ -1489,7 +1488,10 @@ stringify_collection_list (struct collection_list *list, char *string)
   (*str_list)[ndx] = NULL;
 
   if (ndx == 0)
-    return NULL;
+    {
+      free (str_list);
+      return NULL;
+    }
   else
     return *str_list;
 }
This page took 0.025114 seconds and 4 git commands to generate.