[PATCH] No resuming while tfinding

Pedro Alves pedro@codesourcery.com
Wed Mar 17 15:22:00 GMT 2010


On Wednesday 17 March 2010 01:59:24, Stan Shebs wrote:
> So I propose that we make an executive decision to disable all the 
> resumption commands while in tfind mode.  Does this make sense to everyone?

I object to not making this change.  :-)  

We should look at tfind mode as sort of a different
target.  It's is kind of similar to debugging a core dump
while still connecting to a live target.  (yay, GDB has
gone multi-target already :-D)  Execution commands aren't allowed
when debugging a core dump either.  At most, some could map some
of those commands to browsing through the traceframes, like
"stepi" (heuristically) following while-stepping traceframes,
but, never to running the live target.  Execution commands
are prohibited when debugging core dumps by having the
core_ops target return false to target_has_execution,
instead of having checks in every command though.  We could
try just installing a remote.c:remote_has_execution callback
that returns false when in tfind mode, but, it would
automatically prohibit e.g., "kill", "attach", "detach", "run",
etc. as well, which is not clear we do want to prohibit those
in tfind mode, and the resulting "The program is not being run."
error looks confusing in that case.  We could always tweak
ERROR_NO_INFERIOR though.

> 2010-03-16 Stan Shebs  <stan@codesourcery.com>
> 
>     * infcall.c: Include tracepoint.h.
>     (call_function_by_hand): Disallow calls in tfind mode.
>     * infcmd.c (ensure_not_tfind_mode): New function.
>     (continue_1): Call it.
>     (step_1) Ditto.
>     (jump_command): Ditto.
>     (signal_command): Ditto.
>     (until_command): Ditto.
>     (finish_command): Ditto.

This misses the "until" command, in breakpoint.c.

> *** infcmd.c    16 Feb 2010 21:18:46 -0000      1.259
> --- infcmd.c    17 Mar 2010 01:34:00 -0000
> ***************
> *** 56,61 ****
> --- 56,62 ----
>   #include "inline-frame.h"
>   
>   extern void disconnect_or_stop_tracing (int from_tty);
> + extern int get_traceframe_number (void);

This is unnecessary, get_traceframe_number is declared in
tracepoint.h.  The disconnect_or_stop_tracing declaration
shown above could use moving there as well...

-- 
Pedro Alves



More information about the Gdb-patches mailing list