From patchwork Fri Jun 9 16:46:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 70836 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9BA6D3858C41 for ; Fri, 9 Jun 2023 16:46:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9BA6D3858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1686329215; bh=VMIWTNm4xoLo0TphYURQhVXRpP8m1v8j6vzgLowHvtQ=; h=Date:Subject:References:In-Reply-To:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=xyyCMFPVA6c4SaVrN2A8YgoFbZHT6FHjSV797A64lt77iLOuarO5yN2zUR80TSWdK Yg5W7V2q11DZxWQ02nk+UGQmbuYVC1ZV2Eofzd0gjRvojrk9Cw6uvJ2MgDAzhAals0 Ym6FoY3BePgq6Ku0RmNpHZPBAxETF5qZlL0Cx5Kk= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by sourceware.org (Postfix) with ESMTPS id 412493858C41 for ; Fri, 9 Jun 2023 16:46:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 412493858C41 Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-33e75ca0a8bso8398975ab.0 for ; Fri, 09 Jun 2023 09:46:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686329189; x=1688921189; h=to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VMIWTNm4xoLo0TphYURQhVXRpP8m1v8j6vzgLowHvtQ=; b=azG5jHOvUHM3201dmCYeq0afD6zNqbmIGeJ1PhoBGAFn7RtJJwiJhEgqPcrmJJRcXL U4oKK6Aooe9P0cG0AjH3+U6SSFLSvdsc4OUvqWqnGKvnh7zTdWqURW4uqZjrQpb19kMH ZVy76H0Sd72Dd+nHlbmMYgZGLi2GEUVHzgeQ96v3oph5VrU9cQbCm2ZgJPV3ALXItShf 7Ma4BRa3Kx5+QE4ha+fvw95gUxrsVPyNQ+wgSxlppB6O0UQ20jQFchz4C7cnqM3afHEl XFxNbVi+4YZZa1O2dB4HgDd+Spb9uvDVaAN8jjr0xjNG0cJuW8T4hDoeucg52xmLkjZy x+uA== X-Gm-Message-State: AC+VfDzOC21xmQg43/9z5sLnXA1KLAZEoHJ0fUnBIgv5Z/PjFYUNCT0o 2KHAN/eyao4ReOOQUEY3ROcn9gAnBKjzmvKp4TnFIw== X-Google-Smtp-Source: ACHHUZ4pxDmzlrJfynntY8ZcgUcUa/YcIpUDZD3Gww+Op8gWn+tXlORc18K1gYu3JTM/xkyhwPr8zA== X-Received: by 2002:a92:cc0f:0:b0:33e:614a:7115 with SMTP id s15-20020a92cc0f000000b0033e614a7115mr1883433ilp.31.1686329189378; Fri, 09 Jun 2023 09:46:29 -0700 (PDT) Received: from localhost.localdomain (75-166-136-83.hlrn.qwest.net. [75.166.136.83]) by smtp.gmail.com with ESMTPSA id n18-20020a92dd12000000b00325df6679a7sm1195610ilm.26.2023.06.09.09.46.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 09:46:29 -0700 (PDT) Date: Fri, 09 Jun 2023 10:46:25 -0600 Subject: [PATCH 1/2] Use std::string for MI token MIME-Version: 1.0 Message-Id: <20230609-mi-xfree-v1-1-04e9c8d9a679@adacore.com> References: <20230609-mi-xfree-v1-0-04e9c8d9a679@adacore.com> In-Reply-To: <20230609-mi-xfree-v1-0-04e9c8d9a679@adacore.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" This changes the MI "token" to be a std::string, removing some manual memory management. It also makes current_token 'const' in order to support this change. --- gdb/mi/mi-main.c | 21 ++++++++++----------- gdb/mi/mi-main.h | 2 +- gdb/mi/mi-parse.c | 9 +++------ gdb/mi/mi-parse.h | 11 +++++------ 4 files changed, 19 insertions(+), 24 deletions(-) diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 7503ffd2f18..7d671657a44 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -78,7 +78,7 @@ static struct mi_timestamp *current_command_ts; static int do_timings = 0; -char *current_token; +const char *current_token; /* Few commands would like to know if options like --thread-group were explicitly specified. This variable keeps the current parsed command including all option, and make it possible. */ @@ -1810,7 +1810,7 @@ captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context) current_command_ts = context->cmd_start; scoped_restore save_token = make_scoped_restore (¤t_token, - context->token); + context->token.c_str ()); mi->running_result_record_printed = 0; mi->mi_proceeded = 0; @@ -1821,7 +1821,7 @@ captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context) if (mi_debug_p) gdb_printf (gdb_stdlog, " token=`%s' command=`%s' args=`%s'\n", - context->token, context->command, context->args ()); + context->token.c_str (), context->command, context->args ()); mi_cmd_execute (context); @@ -1833,7 +1833,7 @@ captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context) uiout will most likely crash in the mi_out_* routines. */ if (!mi->running_result_record_printed) { - gdb_puts (context->token, mi->raw_stdout); + gdb_puts (context->token.c_str (), mi->raw_stdout); /* There's no particularly good reason why target-connect results in not ^done. Should kill ^connected for MI3. */ gdb_puts (strcmp (context->command, "target-select") == 0 @@ -1872,7 +1872,7 @@ captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context) { if (!mi->running_result_record_printed) { - gdb_puts (context->token, mi->raw_stdout); + gdb_puts (context->token.c_str (), mi->raw_stdout); gdb_puts ("^done", mi->raw_stdout); mi_out_put (uiout, mi->raw_stdout); mi_out_rewind (uiout); @@ -1915,7 +1915,7 @@ mi_print_exception (const char *token, const struct gdb_exception &exception) void mi_execute_command (const char *cmd, int from_tty) { - char *token; + std::string token; std::unique_ptr command; /* This is to handle EOF (^D). We just quit gdb. */ @@ -1931,13 +1931,12 @@ mi_execute_command (const char *cmd, int from_tty) } catch (const gdb_exception &exception) { - mi_print_exception (token, exception); - xfree (token); + mi_print_exception (token.c_str (), exception); } if (command != NULL) { - command->token = token; + command->token = std::move (token); if (do_timings) { @@ -1960,7 +1959,7 @@ mi_execute_command (const char *cmd, int from_tty) /* The command execution failed and error() was called somewhere. */ - mi_print_exception (command->token, result); + mi_print_exception (command->token.c_str (), result); mi_out_rewind (current_uiout); /* Throw to a higher level catch for SIGTERM sent to GDB. */ @@ -1982,7 +1981,7 @@ mi_execute_command (mi_parse *context) error (_("Command is not an MI command")); scoped_restore save_token = make_scoped_restore (¤t_token, - context->token); + context->token.c_str ()); scoped_restore save_debug = make_scoped_restore (&mi_debug_p, 0); mi_cmd_execute (context); diff --git a/gdb/mi/mi-main.h b/gdb/mi/mi-main.h index 1741f48b3ee..cb17921c150 100644 --- a/gdb/mi/mi-main.h +++ b/gdb/mi/mi-main.h @@ -34,7 +34,7 @@ extern void mi_print_timing_maybe (struct ui_file *file); extern int mi_async_p (void); -extern char *current_token; +extern const char *current_token; struct mi_suppress_notification { diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c index a113d4d48da..aceecad6db6 100644 --- a/gdb/mi/mi-parse.c +++ b/gdb/mi/mi-parse.c @@ -216,7 +216,6 @@ mi_parse::parse_argv () mi_parse::~mi_parse () { xfree (command); - xfree (token); freeargv (argv); } @@ -290,7 +289,7 @@ mi_parse::set_language (const char *arg, const char **endp) } std::unique_ptr -mi_parse::make (const char *cmd, char **token) +mi_parse::make (const char *cmd, std::string *token) { const char *chp; @@ -302,9 +301,7 @@ mi_parse::make (const char *cmd, char **token) /* Find/skip any token and then extract it. */ for (chp = cmd; *chp >= '0' && *chp <= '9'; chp++) ; - *token = (char *) xmalloc (chp - cmd + 1); - memcpy (*token, cmd, (chp - cmd)); - (*token)[chp - cmd] = '\0'; + *token = std::string (cmd, chp - cmd); /* This wasn't a real MI command. Return it as a CLI_COMMAND. */ if (*chp != '-') @@ -422,7 +419,7 @@ mi_parse::make (gdb::unique_xmalloc_ptr command, std::unique_ptr parse (new struct mi_parse); parse->command = command.release (); - parse->token = xstrdup (""); + parse->token = ""; if (parse->command[0] != '-') throw_error (UNDEFINED_COMMAND_ERROR, diff --git a/gdb/mi/mi-parse.h b/gdb/mi/mi-parse.h index 6373543529b..78fb414b4f0 100644 --- a/gdb/mi/mi-parse.h +++ b/gdb/mi/mi-parse.h @@ -44,13 +44,12 @@ struct mi_parse /* Attempts to parse CMD returning a ``struct mi_parse''. If CMD is invalid, an exception is thrown. For an MI_COMMAND COMMAND, ARGS and OP are initialized. Un-initialized fields are zero. *TOKEN is - set to the token, even if an exception is thrown. It is allocated - with xmalloc; it must either be freed with xfree, or assigned to - the TOKEN field of the resultant mi_parse object, to be freed by - mi_parse_free. */ + set to the token, even if an exception is thrown. It can be + assigned to the TOKEN field of the resultant mi_parse object, + to be freed by mi_parse_free. */ static std::unique_ptr make (const char *cmd, - char **token); + std::string *token); /* Create an mi_parse object given the command name and a vector of arguments. Unlike with the other constructor, here the @@ -74,7 +73,7 @@ struct mi_parse enum mi_command_type op = MI_COMMAND; char *command = nullptr; - char *token = nullptr; + std::string token; const struct mi_command *cmd = nullptr; struct mi_timestamp *cmd_start = nullptr; char **argv = nullptr; From patchwork Fri Jun 9 16:46:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 70837 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 752323855592 for ; Fri, 9 Jun 2023 16:46:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 752323855592 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1686329216; bh=eeAcacXBjyn0Afu7ipI9ro6nQiJVhZy/ifMNRNv1CQE=; h=Date:Subject:References:In-Reply-To:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=a9/ogV8AJ4fb/4WxdtCIMpHFxJ1X0zWOUNrEqzmS8tyewhxVGdVYnYXopxH4+dsXy NhicefQGFY6CIHrC0SuRkmasLsql8fMyF9WjQTgvrXytp1HeKfGreS59p/CJ012OGI wf/EYiM3laWzc8mcIiNl8aZOXycjkGO7JqT1oBX4= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by sourceware.org (Postfix) with ESMTPS id C7BA93858C52 for ; Fri, 9 Jun 2023 16:46:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C7BA93858C52 Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-77493b3d18cso92285639f.0 for ; Fri, 09 Jun 2023 09:46:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686329190; x=1688921190; h=to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eeAcacXBjyn0Afu7ipI9ro6nQiJVhZy/ifMNRNv1CQE=; b=DaqZn6hTlTKUOGBxZ8O/wrkE4fm/y2bnn5USSOM3mWlhB/URNM9e3ikqdSCv8uDf9F CsnvWP+3tGwpr81mgWVZIIxMkMLNmcUAXyucNiXvrmWoLKAd+wKdYNbe/F2FzDISwchA BqX9m4FAP7GWML7fqJ7dXkya23c23p/fCVw9BeC+sBmcIfYNKg829DMFuacnJFdImPva Q9moGAIqFbFI9YlN7iCaUlq8yD/y8o2Q8P6ofuZspzanHLXa2cEsRnkNneQFE+OYudjd +XWVCS/HFc5nh6sv4rurJq3kS5IpTxK3vLXe8EWOtnLv+gUNSr+6n0EZGzTRBNauurwc lUCw== X-Gm-Message-State: AC+VfDwbpTLVK5DJvokBAhLl6NeNhgnruftfPy/2icq/sQ+M5NL3kLJG 3tW551xXYVCYy0WTN4dtM/88StgZ0k557ShbKak92A== X-Google-Smtp-Source: ACHHUZ7TGrrTV/Sp0c4B4dAICgi21omCU3JEY3hhlkDS/ZGyCNUPne3sO87okERV/jZcxGiV2GmBDg== X-Received: by 2002:a92:c743:0:b0:331:a2f5:b50d with SMTP id y3-20020a92c743000000b00331a2f5b50dmr1864047ilp.30.1686329189956; Fri, 09 Jun 2023 09:46:29 -0700 (PDT) Received: from localhost.localdomain (75-166-136-83.hlrn.qwest.net. [75.166.136.83]) by smtp.gmail.com with ESMTPSA id n18-20020a92dd12000000b00325df6679a7sm1195610ilm.26.2023.06.09.09.46.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 09:46:29 -0700 (PDT) Date: Fri, 09 Jun 2023 10:46:26 -0600 Subject: [PATCH 2/2] Use unique_xmalloc_ptr for mi_parse::command MIME-Version: 1.0 Message-Id: <20230609-mi-xfree-v1-2-04e9c8d9a679@adacore.com> References: <20230609-mi-xfree-v1-0-04e9c8d9a679@adacore.com> In-Reply-To: <20230609-mi-xfree-v1-0-04e9c8d9a679@adacore.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" This changes mi_parse::command to be a unique_xmalloc_ptr and fixes up all the uses. This avoids some manual memory management. std::string is not used here due to how the Python API works -- this approach avoids an extra copy there. --- gdb/mi/mi-cmds.c | 4 ++-- gdb/mi/mi-main.c | 9 +++++---- gdb/mi/mi-parse.c | 21 +++++++++------------ gdb/mi/mi-parse.h | 4 +++- gdb/python/py-micmd.c | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c index f8cae4131d8..5ea31fc98d1 100644 --- a/gdb/mi/mi-cmds.c +++ b/gdb/mi/mi-cmds.c @@ -52,10 +52,10 @@ struct mi_command_mi : public mi_command parse->parse_argv (); if (parse->argv == nullptr) - error (_("Problem parsing arguments: %s %s"), parse->command, + error (_("Problem parsing arguments: %s %s"), parse->command.get (), parse->args ()); - this->m_argv_function (parse->command, parse->argv, parse->argc); + this->m_argv_function (parse->command.get (), parse->argv, parse->argc); } private: diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 7d671657a44..9108cf505c7 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -1821,7 +1821,8 @@ captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context) if (mi_debug_p) gdb_printf (gdb_stdlog, " token=`%s' command=`%s' args=`%s'\n", - context->token.c_str (), context->command, context->args ()); + context->token.c_str (), context->command.get (), + context->args ()); mi_cmd_execute (context); @@ -1836,7 +1837,7 @@ captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context) gdb_puts (context->token.c_str (), mi->raw_stdout); /* There's no particularly good reason why target-connect results in not ^done. Should kill ^connected for MI3. */ - gdb_puts (strcmp (context->command, "target-select") == 0 + gdb_puts (strcmp (context->command.get (), "target-select") == 0 ? "^connected" : "^done", mi->raw_stdout); mi_out_put (uiout, mi->raw_stdout); mi_out_rewind (uiout); @@ -1858,10 +1859,10 @@ captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context) /* This "feature" will be removed as soon as we have a complete set of mi commands. */ /* Echo the command on the console. */ - gdb_printf (gdb_stdlog, "%s\n", context->command); + gdb_printf (gdb_stdlog, "%s\n", context->command.get ()); /* Call the "console" interpreter. */ argv[0] = INTERP_CONSOLE; - argv[1] = context->command; + argv[1] = context->command.get (); mi_cmd_interpreter_exec ("-interpreter-exec", argv, 2); /* If we changed interpreters, DON'T print out anything. */ diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c index aceecad6db6..a9b9cdaf88f 100644 --- a/gdb/mi/mi-parse.c +++ b/gdb/mi/mi-parse.c @@ -215,7 +215,6 @@ mi_parse::parse_argv () mi_parse::~mi_parse () { - xfree (command); freeargv (argv); } @@ -307,7 +306,7 @@ mi_parse::make (const char *cmd, std::string *token) if (*chp != '-') { chp = skip_spaces (chp); - parse->command = xstrdup (chp); + parse->command = make_unique_xstrdup (chp); parse->op = CLI_COMMAND; return parse; @@ -319,16 +318,14 @@ mi_parse::make (const char *cmd, std::string *token) for (; *chp && !isspace (*chp); chp++) ; - parse->command = (char *) xmalloc (chp - tmp + 1); - memcpy (parse->command, tmp, chp - tmp); - parse->command[chp - tmp] = '\0'; + parse->command = make_unique_xstrndup (tmp, chp - tmp); } /* Find the command in the MI table. */ - parse->cmd = mi_cmd_lookup (parse->command); + parse->cmd = mi_cmd_lookup (parse->command.get ()); if (parse->cmd == NULL) throw_error (UNDEFINED_COMMAND_ERROR, - _("Undefined MI command: %s"), parse->command); + _("Undefined MI command: %s"), parse->command.get ()); /* Skip white space following the command. */ chp = skip_spaces (chp); @@ -418,19 +415,19 @@ mi_parse::make (gdb::unique_xmalloc_ptr command, { std::unique_ptr parse (new struct mi_parse); - parse->command = command.release (); + parse->command = std::move (command); parse->token = ""; - if (parse->command[0] != '-') + if (parse->command.get ()[0] != '-') throw_error (UNDEFINED_COMMAND_ERROR, _("MI command '%s' does not start with '-'"), - parse->command); + parse->command.get ()); /* Find the command in the MI table. */ - parse->cmd = mi_cmd_lookup (parse->command + 1); + parse->cmd = mi_cmd_lookup (parse->command.get () + 1); if (parse->cmd == NULL) throw_error (UNDEFINED_COMMAND_ERROR, - _("Undefined MI command: %s"), parse->command); + _("Undefined MI command: %s"), parse->command.get ()); /* This over-allocates slightly, but it seems unimportant. */ parse->argv = XCNEWVEC (char *, args.size () + 1); diff --git a/gdb/mi/mi-parse.h b/gdb/mi/mi-parse.h index 78fb414b4f0..c729e94c1f0 100644 --- a/gdb/mi/mi-parse.h +++ b/gdb/mi/mi-parse.h @@ -72,7 +72,9 @@ struct mi_parse const char *args (); enum mi_command_type op = MI_COMMAND; - char *command = nullptr; + /* This is not std::string because it avoids a copy in the Python + API case. */ + gdb::unique_xmalloc_ptr command; std::string token; const struct mi_command *cmd = nullptr; struct mi_timestamp *cmd_start = nullptr; diff --git a/gdb/python/py-micmd.c b/gdb/python/py-micmd.c index 7027210d0d8..01fc6060ece 100644 --- a/gdb/python/py-micmd.c +++ b/gdb/python/py-micmd.c @@ -358,7 +358,7 @@ mi_command_py::invoke (struct mi_parse *parse) const parse->parse_argv (); if (parse->argv == nullptr) - error (_("Problem parsing arguments: %s %s"), parse->command, + error (_("Problem parsing arguments: %s %s"), parse->command.get (), parse->args ());