* solib-svr4.c (enable_break): Don't attempt to place breakpoints,
authorKevin Buettner <kevinb@redhat.com>
Mon, 13 Dec 2010 15:45:55 +0000 (15:45 +0000)
committerKevin Buettner <kevinb@redhat.com>
Mon, 13 Dec 2010 15:45:55 +0000 (15:45 +0000)
when attaching, on the names in bkpt_names: _start, __start, and
main.

gdb/ChangeLog
gdb/solib-svr4.c

index e75187ab5947fff7e8563972c63f30365f535949..620cccce6d80ef14427f299a4789ed41d440a0a8 100644 (file)
@@ -1,3 +1,9 @@
+2010-12-13  Kevin Buettner  <kevinb@redhat.com>
+
+       * solib-svr4.c (enable_break): Don't attempt to place breakpoints,
+       when attaching, on the names in bkpt_names: _start, __start, and
+       main.
+
 2010-12-12  Stan Shebs  <stan@codesourcery.com>
 
        * value.c (value_of_internalvar): Add case for trace state
index 51065522ab5c9bb1dabf544a02937f83a5fbc98b..60efc4a7b1f1af4370a000f299fb7d6b7e73db66 100644 (file)
@@ -1607,17 +1607,20 @@ enable_break (struct svr4_info *info, int from_tty)
        }
     }
 
-  for (bkpt_namep = bkpt_names; *bkpt_namep != NULL; bkpt_namep++)
+  if (!current_inferior ()->attach_flag)
     {
-      msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, symfile_objfile);
-      if ((msymbol != NULL) && (SYMBOL_VALUE_ADDRESS (msymbol) != 0))
+      for (bkpt_namep = bkpt_names; *bkpt_namep != NULL; bkpt_namep++)
        {
-         sym_addr = SYMBOL_VALUE_ADDRESS (msymbol);
-         sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch,
-                                                        sym_addr,
-                                                        &current_target);
-         create_solib_event_breakpoint (target_gdbarch, sym_addr);
-         return 1;
+         msymbol = lookup_minimal_symbol (*bkpt_namep, NULL, symfile_objfile);
+         if ((msymbol != NULL) && (SYMBOL_VALUE_ADDRESS (msymbol) != 0))
+           {
+             sym_addr = SYMBOL_VALUE_ADDRESS (msymbol);
+             sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch,
+                                                            sym_addr,
+                                                            &current_target);
+             create_solib_event_breakpoint (target_gdbarch, sym_addr);
+             return 1;
+           }
        }
     }
   return 0;