diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2022-01-17 11:27:35 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2022-03-31 11:32:33 -0400 |
commit | 4f5539f026fafe2a3bf190dd86e95f87d75a00e7 (patch) | |
tree | 024e004b82ad1876ab1e240014e90a07481de2a9 /gdb/infrun.c | |
parent | 6e6e87de92b1c3ba95bf5f1932c59efea71ec4f6 (diff) | |
download | gdb-4f5539f026fafe2a3bf190dd86e95f87d75a00e7.zip gdb-4f5539f026fafe2a3bf190dd86e95f87d75a00e7.tar.gz gdb-4f5539f026fafe2a3bf190dd86e95f87d75a00e7.tar.bz2 |
gdb/infrun: add reason parameter to stop_all_threads
Add a "reason" parameter, only used to show in debug messages what is
the reason for stopping all threads. This helped me understand the
debug logs while adding some new uses of stop_all_threads, so I am
proposing to merge it.
Change-Id: I66c8c335ebf41836a7bc3d5fe1db92c195f65e55
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r-- | gdb/infrun.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index dbd8277..12661b5 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2388,7 +2388,7 @@ resume_1 (enum gdb_signal sig) /* Fallback to stepping over the breakpoint in-line. */ if (target_is_non_stop_p ()) - stop_all_threads (); + stop_all_threads ("displaced stepping falling back on inline stepping"); set_step_over_info (regcache->aspace (), regcache_read_pc (regcache), 0, tp->global_num); @@ -4904,7 +4904,7 @@ handle_one (const wait_one_event &event) /* See infrun.h. */ void -stop_all_threads (void) +stop_all_threads (const char *reason) { /* We may need multiple passes to discover all threads. */ int pass; @@ -4912,7 +4912,7 @@ stop_all_threads (void) gdb_assert (exists_non_stop_target ()); - infrun_debug_printf ("starting"); + INFRUN_SCOPED_DEBUG_START_END ("reason=%s", reason); scoped_restore_current_thread restore_thread; @@ -7957,7 +7957,7 @@ stop_waiting (struct execution_control_state *ecs) /* If all-stop, but there exists a non-stop target, stop all threads now that we're presenting the stop to the user. */ if (!non_stop && exists_non_stop_target ()) - stop_all_threads (); + stop_all_threads ("presenting stop to user in all-stop"); } /* Like keep_going, but passes the signal to the inferior, even if the @@ -8057,7 +8057,7 @@ keep_going_pass_signal (struct execution_control_state *ecs) we're about to step over, otherwise other threads could miss it. */ if (step_over_info_valid_p () && target_is_non_stop_p ()) - stop_all_threads (); + stop_all_threads ("starting in-line step-over"); /* Stop stepping if inserting breakpoints fails. */ try |