aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-06-10 10:23:54 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-06-10 10:23:54 +0000
commite1ac3328737bc34a23dbfff92b416a9d9306329a (patch)
treea6ffb502159f70dbab8c069def57709877ec7b9d /gdb/mi
parentf7f9a841a31878b377a60bfc7c793e6c8400fafe (diff)
downloadgdb-e1ac3328737bc34a23dbfff92b416a9d9306329a.zip
gdb-e1ac3328737bc34a23dbfff92b416a9d9306329a.tar.gz
gdb-e1ac3328737bc34a23dbfff92b416a9d9306329a.tar.bz2
Implement *running.
* Makefile.in: Update dependencies. * gdbthread.h (struct thread_info): New field running_. (set_running, is_running): New. * thread.c (set_running, is_running): New. * inferior.h (suppress_normal_stop_observer): Rename to... (suppress_run_stop_observers): ..this. * infcmd.c (suppress_normal_stop_observer): Rename to... (suppress_run_stop_observers): ..this. (finish_command_continuation, finish_command): Adjust. * infcall.c (call_function_by_hand): Adjust. * infrun.c (normal_stop): Call set_running. * target.c (target_resume): New. Call set_running. * target.h (target_resume): Convert from macro to a function. * mi/mi-interp.c (mi_on_resume): New. (mi_interpreter_init): Register mi_on_resume.
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-interp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 583c288..5719c56 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -69,6 +69,7 @@ static void mi_on_normal_stop (struct bpstats *bs);
static void mi_new_thread (struct thread_info *t);
static void mi_thread_exit (struct thread_info *t);
+static void mi_on_resume (ptid_t ptid);
static void *
mi_interpreter_init (int top_level)
@@ -94,6 +95,7 @@ mi_interpreter_init (int top_level)
observer_attach_new_thread (mi_new_thread);
observer_attach_thread_exit (mi_thread_exit);
observer_attach_normal_stop (mi_on_normal_stop);
+ observer_attach_target_resumed (mi_on_resume);
}
return mi;
@@ -327,6 +329,19 @@ mi_on_normal_stop (struct bpstats *bs)
gdb_flush (raw_stdout);
}
+static void
+mi_on_resume (ptid_t ptid)
+{
+ if (PIDGET (ptid) == -1)
+ fprintf_unfiltered (raw_stdout, "*running,thread-id=\"all\"\n");
+ else
+ {
+ struct thread_info *ti = find_thread_pid (ptid);
+ gdb_assert (ti);
+ fprintf_unfiltered (raw_stdout, "*running,thread-id=\"%d\"\n", ti->num);
+ }
+}
+
extern initialize_file_ftype _initialize_mi_interp; /* -Wmissing-prototypes */
void