From patchwork Fri Feb 7 15:00:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shahab Vahedi X-Patchwork-Id: 37741 Received: (qmail 82077 invoked by alias); 7 Feb 2020 15:01:16 -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 81523 invoked by uid 89); 7 Feb 2020 15:01:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: mail-lj1-f193.google.com Received: from mail-lj1-f193.google.com (HELO mail-lj1-f193.google.com) (209.85.208.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Feb 2020 15:00:59 +0000 Received: by mail-lj1-f193.google.com with SMTP id x7so2490276ljc.1 for ; Fri, 07 Feb 2020 07:00:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YitNeZOdunlKFW6gHEqJ/DEGqLNJJPRUezeeCFG1wRA=; b=fXVBaiz2NlDBJDLHpJTXZlRIxOinCvi+OGqS1SBpPmEhPENqgbV4iC0pM009YN2XgJ Je4ACJhNpfmYMbGEeB2zI5uxcsD5fxkh2zTS0WaJ23tDnlTreZzSjsSz9ZOxZ2EVKmGk hOXUPpZ1xF1y7ClcW3Fsi0OYxNhTiWxZr37kyvcdYILTBMG4bbDdlmhIfGY4jTjHsG3m JySYCJmfC6CCrVVNsKcNfrUfJMCRLI1I+lth5mLAHcVrk9vTgPBwcUyVDtIoNc/sqywA ywXjaQX6n7lhiKJPyr/okfRqEjCIHmR5tfF6fxykgvbhtnwwbZvtYsF0BPcrjQvjoiTd jspA== Return-Path: Received: from archie.internal.synopsys.com ([2a03:1b20:6:f011::2d]) by smtp.gmail.com with ESMTPSA id p136sm1184412lfa.8.2020.02.07.07.00.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 07:00:56 -0800 (PST) From: Shahab Vahedi To: gdb-patches@sourceware.org Cc: Shahab Vahedi , Shahab Vahedi , Francois Bedard , Anton Kolesov Subject: [PATCH 11/14] gdb/testsuite: Fix dbx.exp for remote targets Date: Fri, 7 Feb 2020 16:00:00 +0100 Message-Id: <20200207150003.8383-12-shahab.vahedi@gmail.com> In-Reply-To: <20200207150003.8383-1-shahab.vahedi@gmail.com> References: <20200207150003.8383-1-shahab.vahedi@gmail.com> MIME-Version: 1.0 From: Anton Kolesov Testcase dbx.exp uses command "exec-file" but doesn't properly handle the case of replacing one executable with another - it was handling the case of local debugging, when inferior process is started by GDB, but not the case of remote gdbserver, where message is different. Example output, which is now handled is: (gdb) file .../gdb.base/dbx/dbx A program is being debugged already. Are you sure you want to change the file? (y or n) y Load new symbol table from .../gdb.base/dbx/dbx"? (y or n) y gdb/testsuite/ChangeLog: 2016-08-19 Anton Kolesov * gdb.base/dbx.exp (gdb_file_cmd): Add a case for changing the file. Signed-off-by: Anton Kolesov --- gdb/testsuite/gdb.base/dbx.exp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gdb/testsuite/gdb.base/dbx.exp b/gdb/testsuite/gdb.base/dbx.exp index d911fedf92cd..7993a658a314 100644 --- a/gdb/testsuite/gdb.base/dbx.exp +++ b/gdb/testsuite/gdb.base/dbx.exp @@ -183,6 +183,12 @@ proc gdb_file_cmd {arg} { verbose "\t\tKilling previous program being debugged" exp_continue } + -re "A program is being debugged already.*change the file.*y or n. $" { + # Handle the case of remote targets. + send_gdb "y\n" + verbose "\t\tChanging the file from previous program being debugged" + exp_continue + } -re ".*$gdb_prompt $" { verbose "\t\tLoaded $arg with new symbol table into $GDB" return 0