From patchwork Wed Dec 14 14:19:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 18453 Received: (qmail 94347 invoked by alias); 14 Dec 2016 14:19:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 94314 invoked by uid 89); 14 Dec 2016 14:19:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy=drow, genuine, xstrdup, 1797 X-HELO: mail-pg0-f65.google.com Received: from mail-pg0-f65.google.com (HELO mail-pg0-f65.google.com) (74.125.83.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 14 Dec 2016 14:19:36 +0000 Received: by mail-pg0-f65.google.com with SMTP id 3so2632094pgd.0 for ; Wed, 14 Dec 2016 06:19:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=j41TWlzjA6tGAvSSfHNQV97UtpMKK5kcdoiIETVvEMo=; b=FC7cs1VxrWQpAk75q2kywaHGZbKQDE2T5jmNKABhc38HETHqQhH2fyAaQ620aiiLPe iUIqSk6MJ/jSeLjxR/6zjH16kqjfl/rdXOylJG2UIwL9+2bLd4Q+hMA4iLwhwVv7Uq0S RsbHV1Hw1YwKRI4+ygHsa2JMDDUvN8a+h6mbDj+kif2EL51DL+8PhDIW6ddUW4vjUI/o koSgMftH1CWBqAVzckRO48MDA2pOhYwlU5tpEPD+y9P4Q7cjQY96L7Z2fRedXU3PJZV4 ttDc9YjeGOHzcQF9EOXHdvkiKvuWaTW9i+njDMUx5CMUNa4kKOFNhTxbiSUEVqAZhcs8 n09w== X-Gm-Message-State: AKaTC01jWyTmWpT+1CLc0twrAgXVIKViXwsKxW8F9hgLna5TzaXGX3blB1qHiQjsEhNzBg== X-Received: by 10.98.194.86 with SMTP id l83mr106878542pfg.64.1481725174609; Wed, 14 Dec 2016 06:19:34 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id y189sm87863260pfy.32.2016.12.14.06.19.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Dec 2016 06:19:34 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Clean up gdb.gdb/selftest.exp Date: Wed, 14 Dec 2016 14:19:17 +0000 Message-Id: <1481725157-14018-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes I recently see the test fails like this, (gdb) PASS: gdb.gdb/selftest.exp: step over argv initialization list^M 487 std::vector cmdarg_vec;^M (gdb) FAIL: gdb.gdb/selftest.exp: unknown source line (after step over argv initialization) step^M std::vector >::vector (this=0x7fffffffdc10) at ../../binutils-gdb/gdb/main.c:487^M 487 std::vector cmdarg_vec;^M (gdb) FAIL: gdb.gdb/selftest.exp: step into xmalloc call These fails are caused by using std::vector in commit f60ee22ea1d62f7004511ec65a3ad76890032d88. selttest.exp should match the source code of GDB. This patch adds some new regexp to match code using std::vector, and also removes some out of date regexp. proc "do_steps_and_nexts left us ready to execute an xmalloc call", however, there is no xmalloc called, so I also remove these bits. I am also wondering the value of do_steps_and_nexts, can we just remove it completely? It fixed fails on x86_64-linux and aarch64-linux. gdb/testsuite: 2016-12-14 Yao Qi * gdb.gdb/selftest.exp (do_steps_and_nexts): Add regexp to match new code, and remove some out of date regexp. Remove test about stepping into xmalloc. --- gdb/testsuite/gdb.gdb/selftest.exp | 93 +++++--------------------------------- 1 file changed, 11 insertions(+), 82 deletions(-) diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp index 340137a..398a071 100644 --- a/gdb/testsuite/gdb.gdb/selftest.exp +++ b/gdb/testsuite/gdb.gdb/selftest.exp @@ -83,12 +83,12 @@ proc do_steps_and_nexts {} { set description "step over ttyarg initialization" set command "step" } - -re ".*cmdarg_vec = NULL.*$gdb_prompt $" { - set description "step over cmdarg_vec initialization" - set command "step" + -re ".*std::vector cmdarg_vec.*$gdb_prompt $" { + set description "next over cmdarg_vec initialization" + set command "next" } - -re ".*pre_stat_chain = make_command_stats_cleanup.*$gdb_prompt $" { - set description "next over make_command_stats_cleanup and everything it calls" + -re ".*std::vector dirarg.*$gdb_prompt $" { + set description "next over dirarg initialization" set command "next" } -re ".*START_PROGRESS.*$gdb_prompt $" { @@ -98,10 +98,6 @@ proc do_steps_and_nexts {} { set description "next over START_PROGRESS and everything it calls" set command "next" } - -re ".*mac_init.*$gdb_prompt $" { - set description "next over mac_init and everything it calls" - set command "next" - } -re ".*init_malloc.*$gdb_prompt $" { # gdb 6.2.X is the last gdb which called init_malloc set description "next over init_malloc and everything it calls" @@ -111,6 +107,10 @@ proc do_steps_and_nexts {} { set description "next over lim_at_start initialization" set command "next" } + -re ".*scoped_command_stats stat_reporter .*$gdb_prompt $" { + set description "next over start_reporter" + set command "next" + } -re ".*TRY.*$gdb_prompt $" { set description "next over TRY" set command "next" @@ -119,23 +119,7 @@ proc do_steps_and_nexts {} { set description "step into captured_main (args)" set command "step" } - -re ".*count . 0x3.*$gdb_prompt $" { - set description "next over conditional stack alignment code 1" - set command "next" - } - -re ".*if .i != 0.*$gdb_prompt $" { - set description "next over conditional stack alignment code 2" - set command "next" - } - -re ".*alloca .i - 4.*$gdb_prompt $" { - set description "next over conditional stack alignment alloca" - set command "next" - } - -re ".*dirsize = 1.*$gdb_prompt $" { - set description "next over dirsize initialization" - set command "next" - } - -re ".*dirarg = .* xmalloc.*$gdb_prompt $" { + -re ".*saved_command_line = .* xstrdup.*$gdb_prompt $" { return } -re ".*setlocale .LC_MESSAGES,.*$gdb_prompt $" { @@ -184,10 +168,6 @@ proc do_steps_and_nexts {} { set description "step over gdb_sysroot initialization" set command "step" } - -re ".*ndir = 0.*$gdb_prompt $" { - set description "step over ndir initialization" - set command "step" - } -re ".*instream = stdin.*$gdb_prompt $" { set description "step over instream initialization" set command "step" @@ -199,11 +179,7 @@ proc do_steps_and_nexts {} { -re ".*gdb_program_name = xstrdup.*$gdb_prompt $" { set description "next over xstrdup" set command "next" - } - -re ".*quit_flag = 0.*$gdb_prompt $" { - set description "step over quit_flag initialization" - set command "step" - } + } -re ".*gdb_stdout = stdio_fileopen .stdout.;.*$gdb_prompt $" { set description "step over gdb_stdout initialization" set command "step" @@ -301,53 +277,6 @@ proc test_with_self { } { do_steps_and_nexts - gdb_test "print \"foo\"" ".\[0-9\]+ = \"foo\"" "print a string" - - # do_steps_and_nexts left us ready to execute an xmalloc call, - # so give that a try. - # If we don't actually enter the xmalloc call when we give a - # step command that seems like a genuine bug. It seems to happen - # on most RISC processors. - # NOTE drow/2003-06-22: However, if we step back to the preceding two - # lines, just keep stepping until we enter. - set stepped_back 0 - setup_xfail "alpha-*-*" "mips-*-*" - set description "step into xmalloc call" - gdb_test_multiple "step" "$description" { - -re "ncmd = 0;.*$gdb_prompt $" { - set stepped_back 1 - send_gdb "step\n" - exp_continue - } - -re ".*cmdarg = .* xmalloc.*$gdb_prompt $" { - set stepped_back 1 - send_gdb "step\n" - exp_continue - } - -re "dirsize = 1;.*$gdb_prompt $" { - set stepped_back 1 - send_gdb "step\n" - exp_continue - } - -re ".*dirarg = .* xmalloc.*$gdb_prompt $" { - if { $stepped_back == 1 } { - send_gdb "step\n" - exp_continue - } else { - fail "$description" - } - } - -re "xmalloc.*size=.*at.*utils.c.*$gdb_prompt $" { - pass "$description" - } - -re ".*No such file or directory.\r\n$gdb_prompt $" { - pass "$description (no source available)" - } - -re "A file or directory .* does not exist..\r\n$gdb_prompt $" { - pass "$description (no source available)" - } - } - # start the "xgdb" process if [target_info exists gdb,noinferiorio] { # With no way to interact with the inferior GDB, all we can do