#include "value.h"
#include "target.h"
#include "gdbthread.h"
+#include "exceptions.h"
#include "command.h"
#include "gdbcmd.h"
#include "regcache.h"
/* Official gdblib interface function to get a list of thread ids and
the total number. */
enum gdb_rc
-gdb_list_thread_ids (struct ui_out *uiout)
+gdb_list_thread_ids (struct ui_out *uiout, char **error_message)
{
- return catch_exceptions (uiout, do_captured_list_thread_ids, NULL,
- NULL, RETURN_MASK_ALL);
+ return catch_exceptions_with_msg (uiout, do_captured_list_thread_ids, NULL,
+ error_message, RETURN_MASK_ALL);
}
/* Load infrun state for the thread PID. */
if (cur_frame == NULL)
{
/* Ooops, can't restore, tell user where we are. */
- warning ("Couldn't restore frame in current thread, at frame 0");
+ warning (_("Couldn't restore frame in current thread, at frame 0"));
print_stack_frame (get_selected_frame (NULL), 0, LOCATION);
}
else
char *saved_cmd;
if (cmd == NULL || *cmd == '\000')
- error ("Please specify a command following the thread ID list");
+ error (_("Please specify a command following the thread ID list"));
old_chain = make_cleanup_restore_current_thread (inferior_ptid);
char *saved_cmd;
if (tidlist == NULL || *tidlist == '\000')
- error ("Please specify a thread ID list");
+ error (_("Please specify a thread ID list"));
for (cmd = tidlist; *cmd != '\000' && !isalpha (*cmd); cmd++);
if (*cmd == '\000')
- error ("Please specify a command following the thread ID list");
+ error (_("Please specify a command following the thread ID list"));
old_chain = make_cleanup_restore_current_thread (inferior_ptid);
start = strtol (tidlist, &p, 10);
if (p == tidlist)
- error ("Error parsing %s", tidlist);
+ error (_("Error parsing %s"), tidlist);
tidlist = p;
while (*tidlist == ' ' || *tidlist == '\t')
tidlist++; /* Skip the - */
end = strtol (tidlist, &p, 10);
if (p == tidlist)
- error ("Error parsing %s", tidlist);
+ error (_("Error parsing %s"), tidlist);
tidlist = p;
while (*tidlist == ' ' || *tidlist == '\t')
tp = find_thread_id (start);
if (!tp)
- warning ("Unknown thread %d.", start);
+ warning (_("Unknown thread %d."), start);
else if (!thread_alive (tp))
- warning ("Thread %d has terminated.", start);
+ warning (_("Thread %d has terminated."), start);
else
{
switch_to_thread (tp->ptid);
pid_to_thread_id (inferior_ptid),
target_tid_to_str (inferior_ptid));
else
- error ("No stack.");
+ error (_("No stack."));
return;
}
- gdb_thread_select (uiout, tidstr);
+ gdb_thread_select (uiout, tidstr, NULL);
}
static int
tp = find_thread_id (num);
if (!tp)
- error ("Thread ID %d not known.", num);
+ error (_("Thread ID %d not known."), num);
if (!thread_alive (tp))
- error ("Thread ID %d has terminated.\n", num);
+ error (_("Thread ID %d has terminated."), num);
switch_to_thread (tp->ptid);
}
enum gdb_rc
-gdb_thread_select (struct ui_out *uiout, char *tidstr)
+gdb_thread_select (struct ui_out *uiout, char *tidstr, char **error_message)
{
- return catch_exceptions (uiout, do_captured_thread_select, tidstr,
- NULL, RETURN_MASK_ALL);
+ return catch_exceptions_with_msg (uiout, do_captured_thread_select, tidstr,
+ error_message, RETURN_MASK_ALL);
}
/* Commands with a prefix of `thread'. */