From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18815 invoked by alias); 13 Jun 2012 12:23:52 -0000 Received: (qmail 18796 invoked by uid 22791); 13 Jun 2012 12:23:49 -0000 X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Jun 2012 12:23:36 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Sembn-0001PJ-70 from Iain_Sandoe@mentor.com for gdb-patches@sourceware.org; Wed, 13 Jun 2012 05:23:35 -0700 Received: from SVR-IES-FEM-02.mgc.mentorg.com ([137.202.0.106]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 13 Jun 2012 05:23:34 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.1.289.1; Wed, 13 Jun 2012 13:23:32 +0100 From: Iain Sandoe Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: [RFA, Patch, testsuite] gdb.base/list.exp: initial state test for stub targets. Date: Wed, 13 Jun 2012 12:23:00 -0000 Message-ID: To: MIME-Version: 1.0 (Apple Message framework v1084) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00396.txt.bz2 Hi, At present, gdb.base/list.exp behaves differently for targets that use a st= ub and those that are native, simulator or gdbserver. For the latter cases, the test does not cause an inferior to be created, an= d the default list lines around main works 'as expected'. For the stub case, an inferior is created and this will generally be stoppe= d in some start-up or exception code. At present, this is handled by runni= ng to main and then skipping the default listing, unsupport-ing the 'defaul= t list lines around main' test. I was asked to look into removing that 'unsupported'. One way to make things consistent would be to avoid creating the inferior f= or the stub case - since the listing tests only require host-side actions. = This could be achieved by replacing the gdb_load in the test with a gdb_fi= le_cmd, in the test; Patch (a) below. An alternative, is to recognise that there is an expected state from the in= ferior after run_tomain - and to check for this state; Patch (b) below. comments/OK for (a) or (b)? Iain gdb/testsuite: * gdb.base/list.exp (test_listsize): Adjust to allow testing of default lines on targets using stubs. =3D=3D=3D=3D (a) Index: gdb/testsuite/gdb.base/list.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/list.exp,v retrieving revision 1.29 diff -u -p -r1.29 list.exp --- gdb/testsuite/gdb.base/list.exp 16 Jan 2012 16:21:44 -0000 1.29 +++ gdb/testsuite/gdb.base/list.exp 13 Jun 2012 11:58:11 -0000 @@ -77,7 +77,7 @@ proc set_listsize { arg } { # =20 proc test_listsize {} { - global gdb_prompt use_gdb_stub + global gdb_prompt global hp_cc_compiler global hp_aCC_compiler =20 @@ -86,16 +86,8 @@ proc test_listsize {} { gdb_test "show listsize" "Number of source lines gdb will list by defa= ult is 10.*" "show default list size" =20=20=20=20=20 # Show the default lines - # Note that remote targets that have debugging info for _start availab= le will - # list the lines there instead of main, so we skip this test for remot= e targets. - # The second case is for optimized code, it is still correct. -=20=20=20=20 - if $use_gdb_stub { - runto_main; - unsupported "list default lines around main"; - } else { - gdb_test "list" "(1\[ \t\]+#include \"list0.h\".*7\[ \t\]+x =3D 0;\r\n.*1= 0\[ \t\]+foo .x\[+)\]+;)" "list default lines around main" - } + + gdb_test "list" "(1\[ \t\]+#include \"list0.h\".*7\[ \t\]+x =3D 0;\r\n= .*10\[ \t\]+foo .x\[+)\]+;)" "list default lines around main" =20 # Ensure we can limit printouts to one line =20 @@ -518,7 +510,7 @@ proc test_forward_search {} { gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +gdb_file_cmd ${binfile} =20 gdb_test_no_output "set width 0" =20 =3D=3D=3D=3D (b) Index: gdb/testsuite/gdb.base/list.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/list.exp,v retrieving revision 1.29 diff -u -p -r1.29 list.exp --- gdb/testsuite/gdb.base/list.exp 16 Jan 2012 16:21:44 -0000 1.29 +++ gdb/testsuite/gdb.base/list.exp 13 Jun 2012 12:22:18 -0000 @@ -86,13 +86,14 @@ proc test_listsize {} { gdb_test "show listsize" "Number of source lines gdb will list by defa= ult is 10.*" "show default list size" =20=20=20=20=20 # Show the default lines - # Note that remote targets that have debugging info for _start availab= le will - # list the lines there instead of main, so we skip this test for remot= e targets. + # Note that remote targets that have debugging info for _start availab= le + # would list the lines there instead of main, so we run to main and th= en + # look for the expected output at that stage. # The second case is for optimized code, it is still correct. =20=20=20=20=20 if $use_gdb_stub { runto_main; - unsupported "list default lines around main"; + gdb_test "list" "(2.*\[ \t\]+int x;.*7\[ \t\]+x =3D 0;\r\n.*11\[ \t\]+foo= .x\[+)\]+;)" "list default lines after running to main" } else { gdb_test "list" "(1\[ \t\]+#include \"list0.h\".*7\[ \t\]+x =3D 0;\r\n.*1= 0\[ \t\]+foo .x\[+)\]+;)" "list default lines around main" }