+2010-04-16 Mike Frysinger <vapier@gentoo.org>
+
+ * solib-frv.c (enable_break1_done): Delete.
+ (enable_break2): Do not check enable_break1_done. Move the
+ enable_break2_done setting and call to
+ remove_solib_event_breakpoints() to the end. Return without
+ warning when the contents of _dl_debug_addr are 0.
+ (enable_break): Do not set enable_break1_done.
+ (frv_clear_solib): Likewise.
+
2010-04-16 Kevin Buettner <kevinb@redhat.com>
* m32c-tdep.c (m32c_m16c_address_to_pointer): Print warning
*/
-static int enable_break1_done = 0;
static int enable_break2_done = 0;
static int
char **bkpt_namep;
asection *interp_sect;
- if (!enable_break1_done || enable_break2_done)
+ if (enable_break2_done)
return 1;
- enable_break2_done = 1;
-
- /* First, remove all the solib event breakpoints. Their addresses
- may have changed since the last time we ran the program. */
- remove_solib_event_breakpoints ();
-
interp_text_sect_low = interp_text_sect_high = 0;
interp_plt_sect_low = interp_plt_sect_high = 0;
}
addr = extract_unsigned_integer (addr_buf, sizeof addr_buf, byte_order);
+ if (solib_frv_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "enable_break: _dl_debug_addr[0..3] = %s\n",
+ hex_string_custom (addr, 8));
+
+ /* If it's zero, then the ldso hasn't initialized yet, and so
+ there are no shared libs yet loaded. */
+ if (addr == 0)
+ {
+ if (solib_frv_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "enable_break: ldso not yet initialized\n");
+ /* Do not warn, but mark to run again. */
+ return 0;
+ }
+
/* Fetch the r_brk field. It's 8 bytes from the start of
_dl_debug_addr. */
if (target_read_memory (addr + 8, addr_buf, sizeof addr_buf) != 0)
/* We're also done with the loadmap. */
xfree (ldm);
+ /* Remove all the solib event breakpoints. Their addresses
+ may have changed since the last time we ran the program. */
+ remove_solib_event_breakpoints ();
+
/* Now (finally!) create the solib breakpoint. */
create_solib_event_breakpoint (target_gdbarch, addr);
+ enable_break2_done = 1;
+
return 1;
}
return 0;
}
- enable_break1_done = 1;
create_solib_event_breakpoint (target_gdbarch,
symfile_objfile->ei.entry_point);
frv_clear_solib (void)
{
lm_base_cache = 0;
- enable_break1_done = 0;
enable_break2_done = 0;
main_lm_addr = 0;
if (main_executable_lm_info != 0)