From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42248 invoked by alias); 28 Feb 2018 05:46:16 -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 42120 invoked by uid 89); 28 Feb 2018 05:46:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: sessmg22.ericsson.net Received: from sessmg22.ericsson.net (HELO sessmg22.ericsson.net) (193.180.251.58) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Feb 2018 05:46:03 +0000 Received: from ESESSHC015.ericsson.se (Unknown_Domain [153.88.183.63]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id 6C.F7.26548.812469A5; Wed, 28 Feb 2018 06:46:01 +0100 (CET) Received: from ESESBMR505.ericsson.se (153.88.183.201) by ESESSHC015.ericsson.se (153.88.183.63) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 28 Feb 2018 06:46:00 +0100 Received: from ESESBMB503.ericsson.se (153.88.183.170) by ESESBMR505.ericsson.se (153.88.183.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Wed, 28 Feb 2018 06:46:00 +0100 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (153.88.183.157) by ESESBMB503.ericsson.se (153.88.183.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26 via Frontend Transport; Wed, 28 Feb 2018 06:46:00 +0100 Received: from [10.0.0.110] (192.222.251.162) by MW2PR1501MB2012.namprd15.prod.outlook.com (2603:10b6:302:c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.11; Wed, 28 Feb 2018 05:45:57 +0000 Subject: Re: [PATCH v3 2/2] Make gdbserver work with filename-only binaries To: Sergio Durigan Junior , GDB Patches CC: Pedro Alves , Joel Brobecker References: <20180210014241.19278-3-sergiodj@redhat.com> <20180228032708.19670-1-sergiodj@redhat.com> <20180228032708.19670-3-sergiodj@redhat.com> From: Simon Marchi Message-ID: <8f56c11a-09ba-dd9e-7c89-56dfcb25c1cf@ericsson.com> Date: Wed, 28 Feb 2018 05:46:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180228032708.19670-3-sergiodj@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: YQBPR0101CA0022.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00::35) To MW2PR1501MB2012.namprd15.prod.outlook.com (2603:10b6:302:c::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9b628670-31a2-4b83-d429-08d57e6e8a68 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:MW2PR1501MB2012; X-Microsoft-Exchange-Diagnostics: 1;MW2PR1501MB2012;3:Jhu6AIKNmr2MyVnVnnmXzSlSqVy2iDqcEhIGF+Vm5KFmVAZpEHPF0yzdyoy25Y9U6HitjjgmZfVFxuGiqQOOInw+9uQeKEGfABizSTb3DKCsE0ARcJptGL0XbcyPl+IsLc9xDxMy9jizvzdFMP7DejIZFrJx048p8zBa02yHFowUBX/ouplgH8i5Hh3fSyXJpoz2qK9HpbYTZw0m1xv0n3xWhMdLyh0e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nAZ1IfMiLJ//pHQ0g5FyC1/14kk0xbTuAoxiuEbzmYV/YHny0hI1Z4HqL86MYZBIy1bGqH0OykP3l8eBEJF+qiN//1vkG8FaW/ukC4Y4EEzqyAy1NMj9na/F;4:pY6ani7+s5qwsv0IlmdlOgMvUBU8Z2yl/7mj9hl9wt2TZIptLyVPVGjl6xL4ji4HeuUHsR7PBZZ1pNrWChhNS3RtmwsiPLCAfF1Fn7/9T6sUGcChC1ohhjFoxaZEvb8S6EUd29aEwLvrS1+pD9ONz/tmOQbLnPOTfUmIIkZ9WvZfmNm+l/psu1Ov2UNwICl+GnPh1SqgwCkMCtmbCxU5slxSLyjuxlutxi9+fbJleayTYT3Y5nRxeeOOmbjmLHhK5zZ8SnJQVRxxi0Hov+TxVDA9sW3pAITH0B6wcWCET45sziZz5BpUi4oCfWPR5XnnMhUvpeEZ7hjouxKwJ/3Xx37Ask9gO813WMANvg3+6KlMsJSzj6qij7VJVowCVvJP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(158342451672863)(22074186197030); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040501)(2401047)(8121501046)(5005006)(3231220)(944501215)(52105095)(3002001)(93006095)(93001095)(10201501046)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:MW2PR1501MB2012;BCL:0;PCL:0;RULEID:;SRVR:MW2PR1501MB2012; X-Forefront-PRVS: 0597911EE1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(346002)(396003)(39860400002)(366004)(376002)(39380400002)(377424004)(199004)(189003)(65956001)(50466002)(86362001)(6486002)(6666003)(31696002)(2906002)(2950100002)(6116002)(54906003)(230700001)(4326008)(97736004)(106356001)(26005)(65806001)(386003)(52146003)(305945005)(105586002)(16526019)(68736007)(64126003)(36756003)(8676002)(47776003)(25786009)(66066001)(6346003)(81156014)(8936002)(478600001)(3846002)(229853002)(53936002)(23676004)(6306002)(65826007)(316002)(77096007)(6246003)(81166006)(7736002)(5660300001)(76176011)(110136005)(16576012)(2486003)(58126008)(53546011)(186003)(31686004)(52116002)(2004002);DIR:OUT;SFP:1101;SCL:1;SRVR:MW2PR1501MB2012;H:[10.0.0.110];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNVzJQUjE1MDFNQjIwMTI7MjM6VDFzVnMrQ0trZHFFQ000MlFlSytpNm5W?= =?utf-8?B?T2JPeWkrWFFtdEt2UlJMTlozUURiWVZiejZLMkJyRkQ0ZVdFRHk2V0R2YmR1?= =?utf-8?B?Wk5QR2NVSWNUempHemp4REYwaEFLN1FiUy91Y2VlRFRJZ0Q0RU5NTk5BOXFX?= =?utf-8?B?K3g3TGxOQnoyVU1McnhRQTlDYU83Y29pVjZwWHNwZ1NCZ25SNnJ3bFZCZnky?= =?utf-8?B?dDNqclQ2am01VFFWM0RUK0puaXlCRzRoRGZyRTZNZ0NvOTlKRmErSzRzQmR5?= =?utf-8?B?WS9qMExicU5nOGpGSzFmcTZYK2E2dHhnRE1sNmtYYkVmMGpDRmlocFlaTUt4?= =?utf-8?B?T09iODd5cnVUUE1BYjZ1aEVYNTVtRUNrQUlydERmNDFzcHQ4K0l0anByV1Vo?= =?utf-8?B?Vnd5V2FyZFVlckc1WDNyZ2lualZWalcvU3EydFF4UDNjT0dvQk5PN2U2RHZL?= =?utf-8?B?OW5zYjlmZjQwbUo0Qi94Rm82cjExQTRFOElhQXNGM0JaOTVETVowVEhjb3hV?= =?utf-8?B?RnlJM2xyQjduWUZUejEwRVNURHoybEt2ajF2MmJqOCtBNGxtRktrM3FDZ0xj?= =?utf-8?B?ZmljcE5nO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+kKSqwbxKjtO3LNh850V+dlklpe80Hyhg5WTkynYAkhRiRtD1oEcpxVppMXtB1eI3neR1vU=;24:5VlQ+jGckjmaC4v+5eVB9ntfeaRDweCiDq6r+YR6tRiUpE8VIwJwkjyggAj5tJBRfBL4FcCEYTTbuR9/BHGa5T8ZabR9bDxLNLWqERyL75I=;7:PIKrAF0kuk4EPrS37t0ZVsoC1yOJsXKuzOxo16mQmLd2HNbNz6riN2/nv8/9ElyC9wkfVQW0P4Qy1TUq1Xuk2PEnwr2AcHOyvea3zHgk6TYd/Ls5egpv1IpFs2kBCaBbBHlC3C6xQFd3dd0vJeNeuUtxKjCoMQBP2en7VrSTU5BTH9d/9XKlXQXRT9tWsi5Xr+2XyKncEtGRh3Pzp6E3sBZ67BydlPqRpCmTXTvPfEM3T/6k9KRQXO1yGFLsLqSs SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2018 05:45:57.0952 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9b628670-31a2-4b83-d429-08d57e6e8a68 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR1501MB2012 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00447.txt.bz2 On 2018-02-27 10:27 PM, Sergio Durigan Junior wrote: > diff --git a/gdb/testsuite/gdb.server/abspath.exp b/gdb/testsuite/gdb.server/abspath.exp > new file mode 100644 > index 0000000000..beb1d96209 > --- /dev/null > +++ b/gdb/testsuite/gdb.server/abspath.exp > @@ -0,0 +1,51 @@ > +# This testcase is part of GDB, the GNU debugger. > + > +# Copyright 2018 Free Software Foundation, Inc. > + > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see . > + > +# Test that gdbserver performs path expansion/adjustment when we > +# provide just a filename (without any path specifications) to it. > + > +load_lib gdbserver-support.exp > + > +standard_testfile normal.c > + > +if { [skip_gdbserver_tests] } { > + return 0 > +} > + > +if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } { > + return -1 > +} > + > +# Make sure we're disconnected, in case we're testing with an > +# extended-remote board, therefore already connected. > +gdb_test "disconnect" ".*" > + > +set target_exec [gdbserver_download_current_prog] > + > +# Switch to where $target_exec lives, and execute gdbserver from > +# there. > +with_cwd "[file dirname $target_exec]" { > + set target_execname [file tail $target_exec] > + set res [gdbserver_start "" $target_execname] > + > + set gdbserver_protocol [lindex $res 0] > + set gdbserver_gdbport [lindex $res 1] > + gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport > + > + gdb_breakpoint main > + gdb_test "continue" "Breakpoint $decimal.* main.*" "continue to main" > +} The patch LGTM, just a note about the test. I think this won't work when testing with a remote target (wher gdbserver is started on another machine. with_cwd will try to cd into an directory that exists on the other machine, or an "empty string" directory (I am not sure what gdbserver_download_current_prog returns), so it will probably crash. It would complicate the test quite a bit to make it work with a remote target, and wouldn't add much value: when testing with a remote target, gdbserver is started with a filename-only argument (that's how I stumbled on the issue). So if that breaks, all the other tests will fail. A counter argument for that would be that the remote board file is subject to change. if we change it so that it invokes gdbserver by passing non-filename-only paths, the feature would not be tested anymore... At the minimum, I think we need to skip this test is target is a remote one ([is_remote target]). If you want to go further and make the test work with a remote target, then go ahead, but I would be fine with just skipping it. Simon