[patch]: Fix crash in objc and breakpoints

Kai Tietz Kai.Tietz@onevision.com
Thu Feb 18 10:02:00 GMT 2010


Hello,

Sorry, that I came that late to this subject, but I was pretty busy last 
weeks. As discussed in thread " [gdb-7.1] 10 days to branching..." there 
are troubles about setting breakpoints in gdb.  As I found is the issue 
related to recent use of init_sal function and missing initialization of 
pspace member.

The following patch solves this for me. I regression tested it for 
x86_64-pc-mingw32, i686-pc-linux, and i686-pc-cygwin without any 
regressions.

2010-02-18 Kai Tietz  <kai.tietz@onevision.com>

        * source.c (line_info): Initialize pspace by default
        current_program_space.
        * frame.c (find_frame_sal): Likewise.
        * linespec.c (decode_line_2): Likewise.
        (decode_objc): Likewise.

Ok for apply?

Regards,
Kai

|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

--------

Index: src/gdb/frame.c
===================================================================
--- src.orig/gdb/frame.c        2010-01-29 16:28:43.000000000 +0100
+++ src/gdb/frame.c     2010-02-18 10:49:42.745803800 +0100
@@ -1857,6 +1857,8 @@
           the call site is.  Do not pretend to.  This is jarring, but
           we can't do much better.  */
        sal->pc = get_frame_pc (frame);
+      /* Initialize pspace by default.  */
+      sal->pspace = current_program_space;
 
       return;
     }
Index: src/gdb/linespec.c
===================================================================
--- src.orig/gdb/linespec.c     2010-02-18 10:41:31.000000000 +0100
+++ src/gdb/linespec.c  2010-02-18 10:52:50.980178800 +0100
@@ -513,7 +513,9 @@
   while (i < nelts)
     {
       init_sal (&return_values.sals[i]);       /* Initialize to zeroes. 
*/
+      return_values.sals[i].pspace = current_program_space;
       init_sal (&values.sals[i]);
+      values.sals[i].pspace = current_program_space;
       if (sym_arr[i] && SYMBOL_CLASS (sym_arr[i]) == LOC_BLOCK)
        values.sals[i] = find_function_start_sal (sym_arr[i], 
funfirstline);
       i++;
@@ -1206,6 +1208,7 @@
                                                   &current_target);
 
          init_sal (&values.sals[0]);
+         values.sals[0].pspace = current_program_space;
          values.sals[0].pc = pc;
        }
       return values;
Index: src/gdb/source.c
===================================================================
--- src.orig/gdb/source.c       2010-01-12 16:54:43.000000000 +0100
+++ src/gdb/source.c    2010-02-18 10:46:36.183303800 +0100
@@ -1467,6 +1467,7 @@
   int i;
 
   init_sal (&sal);             /* initialize to zeroes */
+  sal.pspace = current_program_space; /* initialize as default.  */
 
   if (arg == 0)
     {



More information about the Gdb mailing list