From patchwork Fri Oct 11 23:24:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 98769 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 5C0AD3857835 for ; Fri, 11 Oct 2024 23:25:38 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id E34BF3858D26 for ; Fri, 11 Oct 2024 23:24:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E34BF3858D26 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E34BF3858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728689079; cv=none; b=YzTbHvWF3kOvYagfQCaaBwMp9EC9mkqIBJrwRnZXdh8nRPN1V1iKuUUCm8SgNAq2j9feCEwCUhIg9c2gtPN8ZcMxfnoY2/2lijY1790J9QwSuoqpkLu8h4g1MYPq8vt7vN81otgNkVibiNx6+1Zh1eSXFw2HUVuz39ZrnX5FCyg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728689079; c=relaxed/simple; bh=Wa5ehOVCr9bYaMNiFxRg3zLPLqSpj0FN2/hQVoFfw/0=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=EOQSnZj2bOFJAVcp1tFDnC0xR4m6WsIBCmP6cOF63Qk0hSYA6ZAgc6p+UbT17Rt1ZiieWRa9tzK4wsIR5aWzrS99elXtCcnsMLrDi/N+FCmjKjwzmZZawCfDhdpvZvuDH3WIeIztzw6KfQdPIi3DG4eeGM7ry7dV63yTZQ2bjuM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5006a.ext.cloudfilter.net ([10.0.29.179]) by cmsmtp with ESMTPS id zIYTsPTfzg2lzzOzrsLyjE; Fri, 11 Oct 2024 23:24:35 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id zOzqsME8p3nDKzOzrshQb7; Fri, 11 Oct 2024 23:24:35 +0000 X-Authority-Analysis: v=2.4 cv=T6iKTeKQ c=1 sm=1 tr=0 ts=6709b3b3 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=DAUX931o1VcA:10 a=ItBw4LHWJt0A:10 a=CrcZfdKhomYTbV2mLZcA:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=MAYD0AlLAIeSlPjdOwM2ZAfnQcRtHwzyfCk2U6xS7P4=; b=Ro5OLbXaTZhit0v4Y2kf5n8VtO 1wtdvCJcXNNnqYPc1WSGiwI+MzeLwRGzlpyJAeOP/4RWEoFBQZMS+jXx2M7G3vsagRxS50TP4wZ5p jX20Z7X6UTfV92zbc2Gm82p3q; Received: from 97-118-40-216.hlrn.qwest.net ([97.118.40.216]:39238 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1szOzq-001F4p-0Q for gdb-patches@sourceware.org; Fri, 11 Oct 2024 17:24:34 -0600 From: Tom Tromey Date: Fri, 11 Oct 2024 17:24:30 -0600 Subject: [PATCH 1/3] Use ui-out tables in some "maint print" commands MIME-Version: 1.0 Message-Id: <20241011-even-more-ui-out-v1-1-e1f92f01bacb@tromey.com> References: <20241011-even-more-ui-out-v1-0-e1f92f01bacb@tromey.com> In-Reply-To: <20241011-even-more-ui-out-v1-0-e1f92f01bacb@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.14.2 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.118.40.216 X-Source-L: No X-Exim-ID: 1szOzq-001F4p-0Q X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-40-216.hlrn.qwest.net (prentzel.local) [97.118.40.216]:39238 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfAk5eqKaxY7AP0jI2OcTLtUPE7JlR246pb8xheCaQwiffBvQ0/dKIL0NiEwfdft7dn0opwkpk2E1LIUXYnMr1sT2eUdWdgzqIavcOR0IDwgHdfyCnMEV F7CDVJht3s/l6gcKlIS7FABPKNDfKheQYkzXuu/KzDGf4O9hMhJjDI5iqxVsOS29mY3Nc/IxSok6NIlWL4qmovwJ85xbnuRKxQU= X-Spam-Status: No, score=-3020.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP 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.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org This changes various "maint print" register commands to use ui-out tables rather than the current printf approach. --- gdb/regcache-dump.c | 210 ++++++++++++++++++-------------- gdb/regcache.c | 132 +++++++++----------- gdb/regcache.h | 11 +- gdb/testsuite/gdb.base/maint.exp | 4 +- gdb/testsuite/gdb.server/server-run.exp | 2 +- 5 files changed, 191 insertions(+), 168 deletions(-) diff --git a/gdb/regcache-dump.c b/gdb/regcache-dump.c index 6b711bf6c2a01e21b89b952e9926a7acfb27540b..f71f05bbdc77c6956bfb09f1cc62b57245ee59f0 100644 --- a/gdb/regcache-dump.c +++ b/gdb/regcache-dump.c @@ -38,43 +38,45 @@ class register_dump_regcache : public register_dump } protected: - void dump_reg (ui_file *file, int regnum) override + + int num_additional_headers () override + { return 1; } + + void additional_headers (ui_out *out) override { - if (regnum < 0) + out->table_header (0, ui_left, "value", + m_dump_pseudo ? "Cooked value" : "Raw value"); + } + + void dump_reg (ui_out *out, int regnum) override + { + if (regnum < gdbarch_num_regs (m_gdbarch) || m_dump_pseudo) { - if (m_dump_pseudo) - gdb_printf (file, "Cooked value"); + auto size = register_size (m_gdbarch, regnum); + + if (size == 0) + return; + + gdb::byte_vector buf (size); + auto status = m_regcache->cooked_read (regnum, buf.data ()); + + if (status == REG_UNKNOWN) + out->field_string ("value", ""); + else if (status == REG_UNAVAILABLE) + out->field_string ("value", ""); else - gdb_printf (file, "Raw value"); + { + string_file str; + print_hex_chars (&str, buf.data (), size, + gdbarch_byte_order (m_gdbarch), true); + out->field_stream ("value", str); + } } else { - if (regnum < gdbarch_num_regs (m_gdbarch) || m_dump_pseudo) - { - auto size = register_size (m_gdbarch, regnum); - - if (size == 0) - return; - - gdb::byte_vector buf (size); - auto status = m_regcache->cooked_read (regnum, buf.data ()); - - if (status == REG_UNKNOWN) - gdb_printf (file, ""); - else if (status == REG_UNAVAILABLE) - gdb_printf (file, ""); - else - { - print_hex_chars (file, buf.data (), size, - gdbarch_byte_order (m_gdbarch), true); - } - } - else - { - /* Just print "" for pseudo register when - regcache_dump_raw. */ - gdb_printf (file, ""); - } + /* Just print "" for pseudo register when + regcache_dump_raw. */ + out->field_string ("value", ""); } } @@ -97,39 +99,39 @@ class register_dump_reg_buffer : public register_dump, reg_buffer } protected: - void dump_reg (ui_file *file, int regnum) override + + int num_additional_headers () override + { return 1; } + + void additional_headers (ui_out *out) override { - if (regnum < 0) - { - if (m_has_pseudo) - gdb_printf (file, "Cooked value"); - else - gdb_printf (file, "Raw value"); - } - else + out->table_header (0, ui_left, "value", + m_has_pseudo ? "Cooked value" : "Raw value"); + } + + void dump_reg (ui_out *out, int regnum) override + { + if (regnum < gdbarch_num_regs (m_gdbarch) || m_has_pseudo) { - if (regnum < gdbarch_num_regs (m_gdbarch) || m_has_pseudo) - { - auto size = register_size (m_gdbarch, regnum); + auto size = register_size (m_gdbarch, regnum); - if (size == 0) - return; + if (size == 0) + return; - auto status = get_register_status (regnum); + auto status = get_register_status (regnum); - gdb_assert (status != REG_VALID); + gdb_assert (status != REG_VALID); - if (status == REG_UNKNOWN) - gdb_printf (file, ""); - else - gdb_printf (file, ""); - } + if (status == REG_UNKNOWN) + out->field_string ("value", ""); else - { - /* Just print "" for pseudo register when - regcache_dump_raw. */ - gdb_printf (file, ""); - } + out->field_string ("value", ""); + } + else + { + /* Just print "" for pseudo register when + regcache_dump_raw. */ + out->field_string ("value", ""); } } }; @@ -144,7 +146,14 @@ class register_dump_none : public register_dump {} protected: - void dump_reg (ui_file *file, int regnum) override + + int num_additional_headers () override + { return 0; } + + void additional_headers (ui_out *out) override + { } + + void dump_reg (ui_out *out, int regnum) override {} }; @@ -158,24 +167,38 @@ class register_dump_remote : public register_dump {} protected: - void dump_reg (ui_file *file, int regnum) override + + int num_additional_headers () override + { return 3; } + + void additional_headers (ui_out *out) override + { + out->table_header (7, ui_left, "remnum", "Rmt Nr"); + out->table_header (11, ui_left, "goffset", "g/G Offset"); + out->table_header (3, ui_left, "expedited", "Expedited"); + } + + void dump_reg (ui_out *out, int regnum) override { - if (regnum < 0) + int pnum, poffset; + + if (regnum < gdbarch_num_regs (m_gdbarch) + && remote_register_number_and_offset (m_gdbarch, regnum, + &pnum, &poffset)) { - gdb_printf (file, "Rmt Nr g/G Offset Expedited"); + out->field_signed ("remnum", pnum); + out->field_signed ("goffset", poffset); + + if (remote_register_is_expedited (regnum)) + out->field_string ("expedited", "yes"); + else + out->field_skip ("expedited"); } - else if (regnum < gdbarch_num_regs (m_gdbarch)) + else { - int pnum, poffset; - - if (remote_register_number_and_offset (m_gdbarch, regnum, - &pnum, &poffset)) - { - if (remote_register_is_expedited (regnum)) - gdb_printf (file, "%7d %11d yes", pnum, poffset); - else - gdb_printf (file, "%7d %11d", pnum, poffset); - } + out->field_skip ("remnum"); + out->field_skip ("goffset"); + out->field_skip ("expedited"); } } }; @@ -190,22 +213,28 @@ class register_dump_groups : public register_dump {} protected: - void dump_reg (ui_file *file, int regnum) override + + int num_additional_headers () override + { return 1; } + + void additional_headers (ui_out *out) override { - if (regnum < 0) - gdb_printf (file, "Groups"); - else + out->table_header (0, ui_left, "groups", "Groups"); + } + + void dump_reg (ui_out *out, int regnum) override + { + string_file file; + const char *sep = ""; + for (const struct reggroup *group : gdbarch_reggroups (m_gdbarch)) { - const char *sep = ""; - for (const struct reggroup *group : gdbarch_reggroups (m_gdbarch)) + if (gdbarch_register_reggroup_p (m_gdbarch, regnum, group)) { - if (gdbarch_register_reggroup_p (m_gdbarch, regnum, group)) - { - gdb_printf (file, "%s%s", sep, group->name ()); - sep = ","; - } + gdb_printf (&file, "%s%s", sep, group->name ()); + sep = ","; } } + out->field_stream ("groups", file); } }; @@ -221,15 +250,13 @@ regcache_print (const char *args, enum regcache_dump_what what_to_dump) { /* Where to send output. */ stdio_file file; - ui_file *out; + std::optional redirect; - if (args == NULL) - out = gdb_stdout; - else + if (args != nullptr) { if (!file.open (args, "w")) perror_with_name (_("maintenance print architecture")); - out = &file; + redirect.emplace (current_uiout, &file); } std::unique_ptr dump; @@ -241,20 +268,25 @@ regcache_print (const char *args, enum regcache_dump_what what_to_dump) else gdbarch = current_inferior ()->arch (); + const char *name; switch (what_to_dump) { case regcache_dump_none: dump.reset (new register_dump_none (gdbarch)); + name = "Registers"; break; case regcache_dump_remote: dump.reset (new register_dump_remote (gdbarch)); + name = "RegisterRemote"; break; case regcache_dump_groups: dump.reset (new register_dump_groups (gdbarch)); + name = "RegisterGroups"; break; case regcache_dump_raw: case regcache_dump_cooked: { + name = "RegisterDump"; auto dump_pseudo = (what_to_dump == regcache_dump_cooked); if (target_has_registers ()) @@ -272,7 +304,7 @@ regcache_print (const char *args, enum regcache_dump_what what_to_dump) break; } - dump->dump (out); + dump->dump (current_uiout, name); } static void diff --git a/gdb/regcache.c b/gdb/regcache.c index f04354d822f9c78db671e9cd41f15811b0770bd8..c0433121d2fd6312bbafaca91fe8c3a536ffe7ec 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -1509,7 +1509,7 @@ reg_flush_command (const char *command, int from_tty) } void -register_dump::dump (ui_file *file) +register_dump::dump (ui_out *out, const char *name) { auto descr = regcache_descr (m_gdbarch); int regnum; @@ -1521,107 +1521,91 @@ register_dump::dump (ui_file *file) gdb_assert (descr->nr_cooked_registers == gdbarch_num_cooked_regs (m_gdbarch)); - for (regnum = -1; regnum < descr->nr_cooked_registers; regnum++) + ui_out_emit_table table (out, 6 + num_additional_headers (), -1, name); + out->table_header (10, ui_left, "name", "Name"); + out->table_header (4, ui_left, "num", "Nr"); + out->table_header (4, ui_left, "relnum", "Rel"); + out->table_header (8, ui_left, "offset", "Offset"); + out->table_header (5, ui_left, "size", "Size"); + out->table_header (15, ui_left, "type", "Type"); + additional_headers (out); + out->table_body (); + + for (regnum = 0; regnum < descr->nr_cooked_registers; regnum++) { - /* Name. */ - if (regnum < 0) - gdb_printf (file, " %-10s", "Name"); - else - { - const char *p = gdbarch_register_name (m_gdbarch, regnum); + ui_out_emit_tuple tuple_emitter (out, nullptr); - if (p[0] == '\0') - p = "''"; - gdb_printf (file, " %-10s", p); - } + /* Name. */ + const char *p = gdbarch_register_name (m_gdbarch, regnum); + if (p[0] == '\0') + p = "''"; + out->field_string ("name", p); /* Number. */ - if (regnum < 0) - gdb_printf (file, " %4s", "Nr"); - else - gdb_printf (file, " %4d", regnum); + out->field_signed ("num", regnum); /* Relative number. */ - if (regnum < 0) - gdb_printf (file, " %4s", "Rel"); - else if (regnum < gdbarch_num_regs (m_gdbarch)) - gdb_printf (file, " %4d", regnum); + if (regnum < gdbarch_num_regs (m_gdbarch)) + out->field_signed ("relnum", regnum); else - gdb_printf (file, " %4d", - (regnum - gdbarch_num_regs (m_gdbarch))); + out->field_signed ("relnum", (regnum - gdbarch_num_regs (m_gdbarch))); /* Offset. */ - if (regnum < 0) - gdb_printf (file, " %6s ", "Offset"); - else + if (register_offset != descr->register_offset[regnum] + || (regnum > 0 + && (descr->register_offset[regnum] + != (descr->register_offset[regnum - 1] + + descr->sizeof_register[regnum - 1])))) { - gdb_printf (file, " %6ld", - descr->register_offset[regnum]); - if (register_offset != descr->register_offset[regnum] - || (regnum > 0 - && (descr->register_offset[regnum] - != (descr->register_offset[regnum - 1] - + descr->sizeof_register[regnum - 1]))) - ) - { - if (!footnote_register_offset) - footnote_register_offset = ++footnote_nr; - gdb_printf (file, "*%d", footnote_register_offset); - } - else - gdb_printf (file, " "); - register_offset = (descr->register_offset[regnum] - + descr->sizeof_register[regnum]); + if (!footnote_register_offset) + footnote_register_offset = ++footnote_nr; + std::string val = string_printf ("%ld*%d", + descr->register_offset[regnum], + footnote_register_offset); + out->field_string ("offset", val); } + else + out->field_signed ("offset", descr->register_offset[regnum]); + register_offset = (descr->register_offset[regnum] + + descr->sizeof_register[regnum]); /* Size. */ - if (regnum < 0) - gdb_printf (file, " %5s ", "Size"); - else - gdb_printf (file, " %5ld", descr->sizeof_register[regnum]); + out->field_signed ("size", descr->sizeof_register[regnum]); /* Type. */ { const char *t; std::string name_holder; - if (regnum < 0) - t = "Type"; - else + static const char blt[] = "builtin_type"; + + t = register_type (m_gdbarch, regnum)->name (); + if (t == NULL) { - static const char blt[] = "builtin_type"; - - t = register_type (m_gdbarch, regnum)->name (); - if (t == NULL) - { - if (!footnote_register_type_name_null) - footnote_register_type_name_null = ++footnote_nr; - name_holder = string_printf ("*%d", - footnote_register_type_name_null); - t = name_holder.c_str (); - } - /* Chop a leading builtin_type. */ - if (startswith (t, blt)) - t += strlen (blt); + if (!footnote_register_type_name_null) + footnote_register_type_name_null = ++footnote_nr; + name_holder = string_printf ("*%d", + footnote_register_type_name_null); + t = name_holder.c_str (); } - gdb_printf (file, " %-15s", t); - } + /* Chop a leading builtin_type. */ + if (startswith (t, blt)) + t += strlen (blt); - /* Leading space always present. */ - gdb_printf (file, " "); + out->field_string ("type", t); + } - dump_reg (file, regnum); + dump_reg (out, regnum); - gdb_printf (file, "\n"); + out->text ("\n"); } if (footnote_register_offset) - gdb_printf (file, "*%d: Inconsistent register offsets.\n", - footnote_register_offset); + out->message ("*%d: Inconsistent register offsets.\n", + footnote_register_offset); if (footnote_register_type_name_null) - gdb_printf (file, - "*%d: Register type's name NULL.\n", - footnote_register_type_name_null); + out->message ("*%d: Register type's name NULL.\n", + footnote_register_type_name_null); } #if GDB_SELF_TEST diff --git a/gdb/regcache.h b/gdb/regcache.h index 2f4b7d94c69344bbe9d2f5b716874fc47c6720c4..916044e3a793b20886b74602c3aefcd89742e487 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -31,6 +31,7 @@ struct gdbarch; class thread_info; struct process_stratum_target; struct inferior; +class ui_out; extern struct regcache *get_thread_regcache (process_stratum_target *target, ptid_t ptid); @@ -533,7 +534,7 @@ extern void registers_changed_thread (thread_info *thread); class register_dump { public: - void dump (ui_file *file); + void dump (ui_out *out, const char *name); virtual ~register_dump () = default; protected: @@ -541,9 +542,15 @@ class register_dump : m_gdbarch (arch) {} + /* Number of additional table headers. */ + virtual int num_additional_headers () = 0; + + /* Add the additional headers to OUT. */ + virtual void additional_headers (ui_out *out) = 0; + /* Dump the register REGNUM contents. If REGNUM is -1, print the header. */ - virtual void dump_reg (ui_file *file, int regnum) = 0; + virtual void dump_reg (ui_out *out, int regnum) = 0; gdbarch *m_gdbarch; }; diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index d6aa22321f1c0e364a03212619722a5863229ee7..970cec1d89161b940af3e61033f63d2293893b17 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -70,11 +70,11 @@ set saw_registers 0 set saw_headers 0 set test "maint print registers" gdb_test_multiple $test $test { - -re "\[^\r\n\]+Name\[^\r\n\]+Nr\[^\r\n\]+Rel\[^\r\n\]+Offset\[^\r\n\]+Size\[^\r\n\]+Type\[^\r\n\]+\r\n" { + -re "Name\[^\r\n\]+Nr\[^\r\n\]+Rel\[^\r\n\]+Offset\[^\r\n\]+Size\[^\r\n\]+Type\[^\r\n\]+\r\n" { set saw_headers 1 exp_continue } - -re "^\[^\r\n\]+\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\r\n" { + -re "\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\r\n" { set saw_registers 1 exp_continue } diff --git a/gdb/testsuite/gdb.server/server-run.exp b/gdb/testsuite/gdb.server/server-run.exp index af5a5f53ca03f1bd9507f8b7284d70ddb7f12915..e81384f0dfb4fb5b187631ce131eb5e801c758a4 100644 --- a/gdb/testsuite/gdb.server/server-run.exp +++ b/gdb/testsuite/gdb.server/server-run.exp @@ -74,7 +74,7 @@ if { [info exists pc_regname] } { set seen_line false gdb_test_multiple "maintenance print remote-registers" \ $expedited_pc_test_name -lbl { - -re " ${pc_regname}\[\[:space:\]\]+${decimal}.*${decimal} yes" { + -re "${pc_regname}\[\[:space:\]\]+${decimal}.*${decimal}\[\[:space:\]\]+yes" { set seen_line true exp_continue }