{
ptid_t ptid = inferior_ptid;
- TRY
+ try
{
CORE_ADDR lm_addr;
}
/* If an error occurred, print TLS related messages here. Otherwise,
throw the error to some higher catcher. */
- CATCH (ex, RETURN_MASK_ALL)
+ catch (const gdb_exception &ex)
{
int objfile_is_library = (objfile->flags & OBJF_SHARED);
error (_("Cannot find thread-local storage for %s, "
"shared library %s:\n%s"),
target_pid_to_str (ptid).c_str (),
- objfile_name (objfile), ex.message);
+ objfile_name (objfile), ex.what ());
else
error (_("Cannot find thread-local storage for %s, "
"executable file %s:\n%s"),
target_pid_to_str (ptid).c_str (),
- objfile_name (objfile), ex.message);
+ objfile_name (objfile), ex.what ());
break;
default:
- throw_exception (ex);
+ throw;
break;
}
}
- END_CATCH
}
else
error (_("Cannot find thread-local variables on this target"));
void
target_detach (inferior *inf, int from_tty)
{
+ /* After we have detached, we will clear the register cache for this inferior
+ by calling registers_changed_ptid. We must save the pid_ptid before
+ detaching, as the target detach method will clear inf->pid. */
+ ptid_t save_pid_ptid = ptid_t (inf->pid);
+
/* As long as some to_detach implementations rely on the current_inferior
(either directly, or indirectly, like through target_gdbarch or by
reading memory), INF needs to be the current inferior. When that
current_top_target ()->detach (inf, from_tty);
- /* After we have detached, clear the register cache for this inferior. */
- ptid_t pid_ptid = ptid_t (inf->pid);
-
- registers_changed_ptid (pid_ptid);
+ registers_changed_ptid (save_pid_ptid);
/* We have to ensure we have no frame cache left. Normally,
- registers_changed_ptid (pid_ptid) calls reinit_frame_cache when
- inferior_ptid matches pid_ptid, but in our case, it does not
+ registers_changed_ptid (save_pid_ptid) calls reinit_frame_cache when
+ inferior_ptid matches save_pid_ptid, but in our case, it does not
call it, as inferior_ptid has been reset. */
reinit_frame_cache ();
}
handle_len, inf);
}
+/* See target.h. */
+
+gdb::byte_vector
+target_thread_info_to_thread_handle (struct thread_info *tip)
+{
+ return current_top_target ()->thread_info_to_thread_handle (tip);
+}
+
void
target_resume (ptid_t ptid, int step, enum gdb_signal signal)
{
/* Target wrapper for follow exec hook. */
void
-target_follow_exec (struct inferior *inf, char *execd_pathname)
+target_follow_exec (struct inferior *inf, const char *execd_pathname)
{
current_top_target ()->follow_exec (inf, execd_pathname);
}
return gdb::unique_xmalloc_ptr<char> (nullptr);
if (transferred == 0)
- return gdb::unique_xmalloc_ptr<char> (xstrdup (""));
+ return make_unique_xstrdup ("");
bufstr[transferred] = 0;