mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 04:00:07 +08:00
* mi/mi-main.c (last_async_command): Rename to current_token.
(previous_async_command): Remove. (mi_cmd_gdb_exit): Adjust. (mi_cmd_exec_interrupt): Don't dance with previous_async_command. (mi_cmd_target_select): Adjust. (mi_cmd_execute): Don't set previous_async_command. Free token here even in async mode. (mi_execute_async_cli_command): Adjust. (mi_exec_async_cli_cmd_continuation): Adjust. Do not free the token. (mi_load_progress): Adjust.
This commit is contained in:
@ -1,3 +1,17 @@
|
|||||||
|
2008-04-24 Vladimir Prus <vladimir@codesourcery.com>
|
||||||
|
|
||||||
|
* mi/mi-main.c (last_async_command): Rename to current_token.
|
||||||
|
(previous_async_command): Remove.
|
||||||
|
(mi_cmd_gdb_exit): Adjust.
|
||||||
|
(mi_cmd_exec_interrupt): Don't dance with previous_async_command.
|
||||||
|
(mi_cmd_target_select): Adjust.
|
||||||
|
(mi_cmd_execute): Don't set previous_async_command. Free token
|
||||||
|
here even in async mode.
|
||||||
|
(mi_execute_async_cli_command): Adjust.
|
||||||
|
(mi_exec_async_cli_cmd_continuation): Adjust. Do not free the
|
||||||
|
token.
|
||||||
|
(mi_load_progress): Adjust.
|
||||||
|
|
||||||
2008-04-24 Vladimir Prus <vladimir@codesourcery.com>
|
2008-04-24 Vladimir Prus <vladimir@codesourcery.com>
|
||||||
|
|
||||||
* infcmd.c (step_1_continuation): Always disable longjmp
|
* infcmd.c (step_1_continuation): Always disable longjmp
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2008-04-24 Vladimir Prus <vladimir@codesourcery.com>
|
||||||
|
|
||||||
|
* doc/gdb.texinfo (GDB/MI Output Syntax): Clarify that async
|
||||||
|
output does not necessary include any tokens.
|
||||||
|
|
||||||
2008-04-22 Corinna Vinschen <vinschen@redhat.com>
|
2008-04-22 Corinna Vinschen <vinschen@redhat.com>
|
||||||
|
|
||||||
* gdb.texinfo (Set SH Calling convention): New @item.
|
* gdb.texinfo (Set SH Calling convention): New @item.
|
||||||
|
@ -17914,10 +17914,13 @@ Notes:
|
|||||||
All output sequences end in a single line containing a period.
|
All output sequences end in a single line containing a period.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
The @code{@var{token}} is from the corresponding request. If an execution
|
The @code{@var{token}} is from the corresponding request. Note that
|
||||||
command is interrupted by the @samp{-exec-interrupt} command, the
|
for all async output, while the token is allowed by the grammar and
|
||||||
@var{token} associated with the @samp{*stopped} message is the one of the
|
may be output by future versions of @value{GDBN} for select async
|
||||||
original execution command, not the one of the interrupt command.
|
output messages, it is generally omitted. Frontends should treat
|
||||||
|
all async output as reporting general changes in the state of the
|
||||||
|
target and there should be no need to associate async output to any
|
||||||
|
prior command.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
@cindex status output in @sc{gdb/mi}
|
@cindex status output in @sc{gdb/mi}
|
||||||
|
@ -93,9 +93,7 @@ static struct mi_timestamp *current_command_ts;
|
|||||||
|
|
||||||
static int do_timings = 0;
|
static int do_timings = 0;
|
||||||
|
|
||||||
/* The token of the last asynchronous command. */
|
static char *current_token;
|
||||||
static char *last_async_command;
|
|
||||||
static char *previous_async_command;
|
|
||||||
|
|
||||||
extern void _initialize_mi_main (void);
|
extern void _initialize_mi_main (void);
|
||||||
static enum mi_cmd_result mi_cmd_execute (struct mi_parse *parse);
|
static enum mi_cmd_result mi_cmd_execute (struct mi_parse *parse);
|
||||||
@ -124,8 +122,8 @@ enum mi_cmd_result
|
|||||||
mi_cmd_gdb_exit (char *command, char **argv, int argc)
|
mi_cmd_gdb_exit (char *command, char **argv, int argc)
|
||||||
{
|
{
|
||||||
/* We have to print everything right here because we never return. */
|
/* We have to print everything right here because we never return. */
|
||||||
if (last_async_command)
|
if (current_token)
|
||||||
fputs_unfiltered (last_async_command, raw_stdout);
|
fputs_unfiltered (current_token, raw_stdout);
|
||||||
fputs_unfiltered ("^exit\n", raw_stdout);
|
fputs_unfiltered ("^exit\n", raw_stdout);
|
||||||
mi_out_put (uiout, raw_stdout);
|
mi_out_put (uiout, raw_stdout);
|
||||||
/* FIXME: The function called is not yet a formal libgdb function. */
|
/* FIXME: The function called is not yet a formal libgdb function. */
|
||||||
@ -222,14 +220,9 @@ mi_cmd_exec_interrupt (char *args, int from_tty)
|
|||||||
error ("mi_cmd_exec_interrupt: Inferior not executing.");
|
error ("mi_cmd_exec_interrupt: Inferior not executing.");
|
||||||
|
|
||||||
interrupt_target_command (args, from_tty);
|
interrupt_target_command (args, from_tty);
|
||||||
if (last_async_command)
|
if (current_token)
|
||||||
fputs_unfiltered (last_async_command, raw_stdout);
|
fputs_unfiltered (current_token, raw_stdout);
|
||||||
fputs_unfiltered ("^done", raw_stdout);
|
fputs_unfiltered ("^done", raw_stdout);
|
||||||
xfree (last_async_command);
|
|
||||||
if (previous_async_command)
|
|
||||||
last_async_command = xstrdup (previous_async_command);
|
|
||||||
xfree (previous_async_command);
|
|
||||||
previous_async_command = NULL;
|
|
||||||
mi_out_put (uiout, raw_stdout);
|
mi_out_put (uiout, raw_stdout);
|
||||||
mi_out_rewind (uiout);
|
mi_out_rewind (uiout);
|
||||||
fputs_unfiltered ("\n", raw_stdout);
|
fputs_unfiltered ("\n", raw_stdout);
|
||||||
@ -679,8 +672,8 @@ mi_cmd_target_select (char *args, int from_tty)
|
|||||||
do_cleanups (old_cleanups);
|
do_cleanups (old_cleanups);
|
||||||
|
|
||||||
/* Issue the completion message here. */
|
/* Issue the completion message here. */
|
||||||
if (last_async_command)
|
if (current_token)
|
||||||
fputs_unfiltered (last_async_command, raw_stdout);
|
fputs_unfiltered (current_token, raw_stdout);
|
||||||
fputs_unfiltered ("^connected", raw_stdout);
|
fputs_unfiltered ("^connected", raw_stdout);
|
||||||
mi_out_put (uiout, raw_stdout);
|
mi_out_put (uiout, raw_stdout);
|
||||||
mi_out_rewind (uiout);
|
mi_out_rewind (uiout);
|
||||||
@ -1191,25 +1184,8 @@ mi_cmd_execute (struct mi_parse *parse)
|
|||||||
if (parse->cmd->argv_func != NULL
|
if (parse->cmd->argv_func != NULL
|
||||||
|| parse->cmd->args_func != NULL)
|
|| parse->cmd->args_func != NULL)
|
||||||
{
|
{
|
||||||
/* FIXME: We need to save the token because the command executed
|
|
||||||
may be asynchronous and need to print the token again.
|
|
||||||
In the future we can pass the token down to the func
|
|
||||||
and get rid of the last_async_command. */
|
|
||||||
/* The problem here is to keep the token around when we launch
|
|
||||||
the target, and we want to interrupt it later on. The
|
|
||||||
interrupt command will have its own token, but when the
|
|
||||||
target stops, we must display the token corresponding to the
|
|
||||||
last execution command given. So we have another string where
|
|
||||||
we copy the token (previous_async_command), if this was
|
|
||||||
indeed the token of an execution command, and when we stop we
|
|
||||||
print that one. This is possible because the interrupt
|
|
||||||
command, when over, will copy that token back into the
|
|
||||||
default token string (last_async_command). */
|
|
||||||
|
|
||||||
if (target_executing)
|
if (target_executing)
|
||||||
{
|
{
|
||||||
if (!previous_async_command)
|
|
||||||
previous_async_command = xstrdup (last_async_command);
|
|
||||||
if (strcmp (parse->command, "exec-interrupt"))
|
if (strcmp (parse->command, "exec-interrupt"))
|
||||||
{
|
{
|
||||||
struct ui_file *stb;
|
struct ui_file *stb;
|
||||||
@ -1223,18 +1199,13 @@ mi_cmd_execute (struct mi_parse *parse)
|
|||||||
error_stream (stb);
|
error_stream (stb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
last_async_command = xstrdup (parse->token);
|
current_token = xstrdup (parse->token);
|
||||||
cleanup = make_cleanup (free_current_contents, &last_async_command);
|
cleanup = make_cleanup (free_current_contents, ¤t_token);
|
||||||
/* FIXME: DELETE THIS! */
|
/* FIXME: DELETE THIS! */
|
||||||
if (parse->cmd->args_func != NULL)
|
if (parse->cmd->args_func != NULL)
|
||||||
r = parse->cmd->args_func (parse->args, 0 /*from_tty */ );
|
r = parse->cmd->args_func (parse->args, 0 /*from_tty */ );
|
||||||
else
|
else
|
||||||
r = parse->cmd->argv_func (parse->command, parse->argv, parse->argc);
|
r = parse->cmd->argv_func (parse->command, parse->argv, parse->argc);
|
||||||
if (target_can_async_p () && target_executing)
|
|
||||||
/* last_async_command will be freed by continuation that
|
|
||||||
all execution command set. */
|
|
||||||
discard_cleanups (cleanup);
|
|
||||||
else
|
|
||||||
do_cleanups (cleanup);
|
do_cleanups (cleanup);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@ -1309,8 +1280,8 @@ mi_execute_async_cli_command (char *mi, char *args, int from_tty)
|
|||||||
/* NOTE: For synchronous targets asynchronous behavour is faked by
|
/* NOTE: For synchronous targets asynchronous behavour is faked by
|
||||||
printing out the GDB prompt before we even try to execute the
|
printing out the GDB prompt before we even try to execute the
|
||||||
command. */
|
command. */
|
||||||
if (last_async_command)
|
if (current_token)
|
||||||
fputs_unfiltered (last_async_command, raw_stdout);
|
fputs_unfiltered (current_token, raw_stdout);
|
||||||
fputs_unfiltered ("^running\n", raw_stdout);
|
fputs_unfiltered ("^running\n", raw_stdout);
|
||||||
fputs_unfiltered ("(gdb) \n", raw_stdout);
|
fputs_unfiltered ("(gdb) \n", raw_stdout);
|
||||||
gdb_flush (raw_stdout);
|
gdb_flush (raw_stdout);
|
||||||
@ -1321,8 +1292,8 @@ mi_execute_async_cli_command (char *mi, char *args, int from_tty)
|
|||||||
calling execute_command is wrong. It should only be printed
|
calling execute_command is wrong. It should only be printed
|
||||||
once gdb has confirmed that it really has managed to send a
|
once gdb has confirmed that it really has managed to send a
|
||||||
run command to the target. */
|
run command to the target. */
|
||||||
if (last_async_command)
|
if (current_token)
|
||||||
fputs_unfiltered (last_async_command, raw_stdout);
|
fputs_unfiltered (current_token, raw_stdout);
|
||||||
fputs_unfiltered ("^running\n", raw_stdout);
|
fputs_unfiltered ("^running\n", raw_stdout);
|
||||||
|
|
||||||
/* Ideally, we should be intalling continuation only when
|
/* Ideally, we should be intalling continuation only when
|
||||||
@ -1348,8 +1319,6 @@ mi_execute_async_cli_command (char *mi, char *args, int from_tty)
|
|||||||
do_cleanups (old_cleanups);
|
do_cleanups (old_cleanups);
|
||||||
/* If the target was doing the operation synchronously we fake
|
/* If the target was doing the operation synchronously we fake
|
||||||
the stopped message. */
|
the stopped message. */
|
||||||
if (last_async_command)
|
|
||||||
fputs_unfiltered (last_async_command, raw_stdout);
|
|
||||||
fputs_unfiltered ("*stopped", raw_stdout);
|
fputs_unfiltered ("*stopped", raw_stdout);
|
||||||
mi_out_put (uiout, raw_stdout);
|
mi_out_put (uiout, raw_stdout);
|
||||||
mi_out_rewind (uiout);
|
mi_out_rewind (uiout);
|
||||||
@ -1365,18 +1334,11 @@ void
|
|||||||
mi_exec_async_cli_cmd_continuation (struct continuation_arg *arg, int error_p)
|
mi_exec_async_cli_cmd_continuation (struct continuation_arg *arg, int error_p)
|
||||||
{
|
{
|
||||||
/* Assume 'error' means that target is stopped, too. */
|
/* Assume 'error' means that target is stopped, too. */
|
||||||
if (last_async_command)
|
|
||||||
fputs_unfiltered (last_async_command, raw_stdout);
|
|
||||||
fputs_unfiltered ("*stopped", raw_stdout);
|
fputs_unfiltered ("*stopped", raw_stdout);
|
||||||
mi_out_put (uiout, raw_stdout);
|
mi_out_put (uiout, raw_stdout);
|
||||||
fputs_unfiltered ("\n", raw_stdout);
|
fputs_unfiltered ("\n", raw_stdout);
|
||||||
fputs_unfiltered ("(gdb) \n", raw_stdout);
|
fputs_unfiltered ("(gdb) \n", raw_stdout);
|
||||||
gdb_flush (raw_stdout);
|
gdb_flush (raw_stdout);
|
||||||
if (last_async_command)
|
|
||||||
{
|
|
||||||
free (last_async_command);
|
|
||||||
last_async_command = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1428,8 +1390,8 @@ mi_load_progress (const char *section_name,
|
|||||||
xfree (previous_sect_name);
|
xfree (previous_sect_name);
|
||||||
previous_sect_name = xstrdup (section_name);
|
previous_sect_name = xstrdup (section_name);
|
||||||
|
|
||||||
if (last_async_command)
|
if (current_token)
|
||||||
fputs_unfiltered (last_async_command, raw_stdout);
|
fputs_unfiltered (current_token, raw_stdout);
|
||||||
fputs_unfiltered ("+download", raw_stdout);
|
fputs_unfiltered ("+download", raw_stdout);
|
||||||
cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
|
cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
|
||||||
ui_out_field_string (uiout, "section", section_name);
|
ui_out_field_string (uiout, "section", section_name);
|
||||||
@ -1447,8 +1409,8 @@ mi_load_progress (const char *section_name,
|
|||||||
struct cleanup *cleanup_tuple;
|
struct cleanup *cleanup_tuple;
|
||||||
last_update.tv_sec = time_now.tv_sec;
|
last_update.tv_sec = time_now.tv_sec;
|
||||||
last_update.tv_usec = time_now.tv_usec;
|
last_update.tv_usec = time_now.tv_usec;
|
||||||
if (last_async_command)
|
if (current_token)
|
||||||
fputs_unfiltered (last_async_command, raw_stdout);
|
fputs_unfiltered (current_token, raw_stdout);
|
||||||
fputs_unfiltered ("+download", raw_stdout);
|
fputs_unfiltered ("+download", raw_stdout);
|
||||||
cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
|
cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
|
||||||
ui_out_field_string (uiout, "section", section_name);
|
ui_out_field_string (uiout, "section", section_name);
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2008-04-24 Vladimir Prus <vladimir@codesourcery.com>
|
||||||
|
|
||||||
|
* gdb.mi/mi-syn-frame.exp: Adjust for token disappearance.
|
||||||
|
* gdb.mi/mi2-syn-frame.exp: Likewise.
|
||||||
|
* lib/mi-support.exp: Likewise.
|
||||||
|
|
||||||
2008-04-24 Vladimir Prus <vladimir@codesourcery.com>
|
2008-04-24 Vladimir Prus <vladimir@codesourcery.com>
|
||||||
|
|
||||||
* lib/gdb.exp (gdb_continue_to_breakpoint): Allow the caller
|
* lib/gdb.exp (gdb_continue_to_breakpoint): Allow the caller
|
||||||
|
@ -60,7 +60,7 @@ mi_gdb_test "403-exec-continue" \
|
|||||||
|
|
||||||
# Presently, the *stopped notification for this case does not include
|
# Presently, the *stopped notification for this case does not include
|
||||||
# any information. This can be considered a bug.
|
# any information. This can be considered a bug.
|
||||||
mi_gdb_test "" "403\\*stopped" "finished exec continue"
|
mi_gdb_test "" "\\*stopped" "finished exec continue"
|
||||||
|
|
||||||
mi_gdb_test "404-stack-list-frames 0 0" \
|
mi_gdb_test "404-stack-list-frames 0 0" \
|
||||||
"404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]" \
|
"404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]" \
|
||||||
@ -88,7 +88,7 @@ mi_gdb_test "407-stack-list-frames" \
|
|||||||
|
|
||||||
mi_gdb_test "408-exec-continue" "408\\^running"
|
mi_gdb_test "408-exec-continue" "408\\^running"
|
||||||
|
|
||||||
mi_gdb_test "" "408\\*stopped.*" "finished exec continue"
|
mi_gdb_test "" ".*\\*stopped.*" "finished exec continue"
|
||||||
|
|
||||||
mi_gdb_test "409-stack-list-frames 0 0" \
|
mi_gdb_test "409-stack-list-frames 0 0" \
|
||||||
"409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]" \
|
"409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]" \
|
||||||
|
@ -58,7 +58,7 @@ mi_gdb_test "402-stack-list-frames" "402\\^done,stack=\\\[frame=\{level=\"0\",ad
|
|||||||
|
|
||||||
send_gdb "403-exec-continue\n"
|
send_gdb "403-exec-continue\n"
|
||||||
gdb_expect {
|
gdb_expect {
|
||||||
-re "403\\^running\[\r\n\]+${my_mi_gdb_prompt}403\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" {
|
-re "403\\^running\[\r\n\]+${my_mi_gdb_prompt}.*\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" {
|
||||||
pass "403-exec-continue"
|
pass "403-exec-continue"
|
||||||
}
|
}
|
||||||
timeout {
|
timeout {
|
||||||
@ -92,7 +92,7 @@ mi_gdb_test "407-stack-list-frames" \
|
|||||||
|
|
||||||
send_gdb "408-exec-continue\n"
|
send_gdb "408-exec-continue\n"
|
||||||
gdb_expect {
|
gdb_expect {
|
||||||
-re "408\\^running\[\r\n\]+${my_mi_gdb_prompt}408\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" {
|
-re "408\\^running\[\r\n\]+${my_mi_gdb_prompt}.*\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" {
|
||||||
pass "408-exec-continue"
|
pass "408-exec-continue"
|
||||||
}
|
}
|
||||||
timeout {
|
timeout {
|
||||||
|
@ -947,7 +947,7 @@ proc mi_expect_stop { reason func args file line extra test } {
|
|||||||
if { $reason == "exited-normally" } {
|
if { $reason == "exited-normally" } {
|
||||||
|
|
||||||
gdb_expect {
|
gdb_expect {
|
||||||
-re "220\\*stopped,reason=\"exited-normally\"\r\n$mi_gdb_prompt$" {
|
-re "\\*stopped,reason=\"exited-normally\"\r\n$mi_gdb_prompt$" {
|
||||||
pass "$test"
|
pass "$test"
|
||||||
}
|
}
|
||||||
-re ".*$mi_gdb_prompt$" {fail "continue to end (2)"}
|
-re ".*$mi_gdb_prompt$" {fail "continue to end (2)"}
|
||||||
@ -973,13 +973,13 @@ proc mi_expect_stop { reason func args file line extra test } {
|
|||||||
|
|
||||||
set a $after_reason
|
set a $after_reason
|
||||||
|
|
||||||
verbose -log "mi_expect_stop: expecting: .*220\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$file\",line=\"$line\"\}$after_stopped\r\n$mi_gdb_prompt$"
|
verbose -log "mi_expect_stop: expecting: .*\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$file\",line=\"$line\"\}$after_stopped\r\n$mi_gdb_prompt$"
|
||||||
gdb_expect {
|
gdb_expect {
|
||||||
-re ".*220\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$file\",line=\"($line)\"\}$after_stopped\r\n$mi_gdb_prompt$" {
|
-re ".*\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$file\",line=\"($line)\"\}$after_stopped\r\n$mi_gdb_prompt$" {
|
||||||
pass "$test"
|
pass "$test"
|
||||||
return $expect_out(2,string)
|
return $expect_out(2,string)
|
||||||
}
|
}
|
||||||
-re ".*220\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
|
-re ".*\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
|
||||||
fail "$test (stopped at wrong place)"
|
fail "$test (stopped at wrong place)"
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user