Fix obvious gotcha in string comparison
[deliverable/binutils-gdb.git] / gdb / exec.c
index b18ca8b662e4eb43ec67ca7efacfe1f009da351b..67ecc6363072cdd7b8b00aaa36085b7c2ccf032f 100644 (file)
@@ -152,13 +152,13 @@ exception_print_same (struct gdb_exception e1, struct gdb_exception e2)
 
   return (e1.reason == e2.reason
          && e1.error == e2.error
-         && strcmp (e1.message, e2.message) == 0);
+         && strcmp (msg1, msg2) == 0);
 }
 
 /* See gdbcore.h.  */
 
 void
-exec_file_locate_attach (int pid, int from_tty)
+exec_file_locate_attach (int pid, int defer_bp_reset, int from_tty)
 {
   char *exec_file, *full_exec_path = NULL;
   struct cleanup *old_chain;
@@ -233,6 +233,8 @@ exec_file_locate_attach (int pid, int from_tty)
 
   TRY
     {
+      if (defer_bp_reset)
+       current_inferior ()->symfile_flags |= SYMFILE_DEFER_BP_RESET;
       symbol_file_add_main (full_exec_path, from_tty);
     }
   CATCH (err, RETURN_MASK_ERROR)
@@ -241,6 +243,7 @@ exec_file_locate_attach (int pid, int from_tty)
        warning ("%s", err.message);
     }
   END_CATCH
+  current_inferior ()->symfile_flags &= ~SYMFILE_DEFER_BP_RESET;
 
   do_cleanups (old_chain);
 }
@@ -798,7 +801,7 @@ section_table_read_available_memory (gdb_byte *readbuf, ULONGEST offset,
          enum target_xfer_status status;
 
          /* Get the intersection window.  */
-         end = std::min (offset + len, r->start + r->length);
+         end = std::min<CORE_ADDR> (offset + len, r->start + r->length);
 
          gdb_assert (end - offset <= len);
 
This page took 0.027867 seconds and 4 git commands to generate.