From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16793 invoked by alias); 2 Aug 2017 18:00:38 -0000 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 Received: (qmail 16547 invoked by uid 89); 2 Aug 2017 18:00:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: aserp1040.oracle.com Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 Aug 2017 18:00:21 +0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v72I0IeV000410 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Aug 2017 18:00:19 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v72I0IIM009560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Aug 2017 18:00:18 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v72I0HR1004375; Wed, 2 Aug 2017 18:00:18 GMT Received: from [10.154.163.153] (/10.154.163.153) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 02 Aug 2017 11:00:17 -0700 Subject: Re: [PATCH v4] gdb: ADI support To: Yao Qi Cc: gdb-patches@sourceware.org References: <86379a4d55.fsf@gmail.com> From: Wei-min Pan Message-ID: <96ca9d77-8f57-59d2-ded2-afee72abc467@oracle.com> Date: Wed, 02 Aug 2017 18:00:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <86379a4d55.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-08/txt/msg00052.txt.bz2 On 8/2/2017 12:55 AM, Yao Qi wrote: > Weimin Pan writes: > >>> gdb_test "adi x shmaddr" "${hex}00:.*\t0.*" "examine ADI" >> Or change it to: >> >> gdb_test "adi x shmaddr" "${hex}00:\t0 " "examine ADI" >> > Why does it print a trailing space? Can we remove it? It is from the > for loop in adi_print_versions, A trailing space is needed to separate tag values. I can change the code so that no space is added for the last tag value: if (tags[v_idx] == 0xff) /* no version tag */ printf_filtered ("-"); else printf_filtered ("%1X", tags[v_idx]); if (cnt > 1) printf_filtered (" "); and use your suggested "adi x" commands in the script. > + for (int i = maxelts; i > 0 && cnt > 0; i--, cnt--) > + { > + if (tags[v_idx] == 0xff) /* no version tag */ > + printf_filtered ("- "); > + else > + printf_filtered ("%1X ", tags[v_idx]); > + ++v_idx; > + } > >>> >>>> gdb_test "adi x/100 shmaddr" "${hex}00:\t${newadi} ${newadi}" \ >>>> "examine new ADI" >>> It will pass if changed to: >>> >>> gdb_test "adi x/100 shmaddr" "${hex}00:.*\t${newadi} ${newadi}.*" \ >>> "examine new ADI" >> Or change it to: >> >> gdb_test "adi x/100 shmaddr" "${hex}00:\t${newadi} ${newadi} " \ >> "examine new ADI" >> > Likewise. > >>>>> (gdb) PASS: gdb.arch/sparc64-adi.exp: reset ADI >>>>> continue^M >>>>> Continuing.^M >>>>> ^M >>>>> Program received signal SIGSEGV, Segmentation fault^M >>>>> ADI precise mismatch while accessing address 0xfff8000100048000.^M >>>>> 0xfff8000100129f38 in adi_set_version () from /usr/lib64/libadi.so^M >>>> gdb_test "continue" \ >>>> [multi_line "Program received signal SIGSEGV, Segmentation fault" \ >>>> "ADI precise mismatch while accessing address $hex" ] \ >>>> "continue to sigsegv" >>> And it will pass if changed to >>> >>> gdb_test "continue" \ >>> [multi_line ".*Program received signal SIGSEGV, Segmentation fault.*" \ >>> ".*ADI precise mismatch while accessing address $hex.*" ] \ >>> "continue to sigsegv" >> Or change it to: >> >> gdb_test "continue" \ >> [multi_line "Program received signal SIGSEGV, Segmentation fault.*" \ >> "ADI precise mismatch while accessing address $hex.*" ] \ >> "continue to sigsegv" > That is OK. >