From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 0C2993858D33 for ; Mon, 27 Apr 2020 22:04:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0C2993858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wm1-x32f.google.com with SMTP id y24so642666wma.4 for ; Mon, 27 Apr 2020 15:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=acFlD4YTDDk/S4rhaYcGrmZHIxpJCXBjs8yINtu+JEc=; b=gTqlsyl5sj4nJ48tOxYThlCYdlXf/WWnL/PcstgDfeq2einnzxo/yYRNYx1sOH90bd LsXjdMP2ZwQ03Y3+Bdyg6pdPI7v9cgE8O27Dy13LtHktnUdcz+fTz5y21SYhl3N4YAMG eiSXyTS/EuSMJwXAxh9IbK4nUax0bxTV1R8U/+vPtJZdI6p/er/ci6m246v46+9csUjY YIirw1DkTcd/xPLwNQfWQZs8G1AW4JsmIjLFK+SScOW/SAnMHc4wrC6SVfuylv2Bw6gA wlUEDsHEkpjZYFb/Ki7mgnM1YW4FJDcj9Em1yyMjWHOolx4llgbmY69XQosUgzDwr9zJ i12g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=acFlD4YTDDk/S4rhaYcGrmZHIxpJCXBjs8yINtu+JEc=; b=W5mPgVDyBI/2jNo231MSIdsZN8nuL15PE8EK7FHUZljLaPzGfRheDXP8442eSToEll PZTNdAKniT5+vyZfRfswTxQaodbc7MKwHf8MVXyUFS+kqk5YlfbYPRNIMDWNkr8tYaIQ YvGjWkruK35gNhGOytCZwymTiZQPVTU+4QzsXmRNF5O9MTUiU/lj+ql9v/viyT+AyIAY 5GYbwbWQHHWmFA2y4ccoLOtGHfLzOILjOc92/2EVDAUPJLeLHomk1m4hM8Fj+XQOG9fZ FneljuxihaaptFT70HyLv0Nb//rTQPw4bX+0zGOj8+JAGmcn8WnYgBYzc7aK4Ijvb3Gh jp+g== X-Gm-Message-State: AGi0PuZSTFz8+D07bRD8COiSERsxKHe7u3s5ovfRxQ1jDyE1e20A1TO0 m0QGcSO+hpLzICiGJvsS5TBsRmCTfdM= X-Google-Smtp-Source: APiQypJyrlyOftpuvVTFMl+W0tIcVrYgsKrFq6PXmV2M5cgtBt3lq+QE3qCMQjYlSdVa8UdvhUUToQ== X-Received: by 2002:a1c:59c3:: with SMTP id n186mr894114wmb.24.1588025069031; Mon, 27 Apr 2020 15:04:29 -0700 (PDT) Received: from localhost (host81-151-181-184.range81-151.btcentralplus.com. [81.151.181.184]) by smtp.gmail.com with ESMTPSA id z1sm702731wmf.15.2020.04.27.15.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 15:04:28 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: palves@redhat.com, Andrew Burgess Subject: [PATCHv2 0/3] Restore thread and frame patches Date: Mon, 27 Apr 2020 23:04:22 +0100 Message-Id: X-Mailer: git-send-email 2.25.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-16.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2020 22:04:41 -0000 This series merges together and replaces two previously separate patches: https://sourceware.org/pipermail/gdb-patches/2020-February/166202.html https://sourceware.org/pipermail/gdb-patches/2020-April/167215.html The first had no feedback, while the second had some positive feedback, but also some negative feedback. The concerns raised were that making this change broke the existing GDB debug model, and added unneeded complexity. I'm not sure what I can do about the complexity, but to address the first point I've made all of these changes optional in both the first and third patches of this new series, and the default for both the new options is off. In the first patch of this new series I updated the technique I use for preserving the thread, previously I was storing inferior_ptid, however, after seeing Pedro's recent series[1], I switched to storing the thread_info pointer. I tested this series on top of current master, and also on top of Pedro's recent series[1]. All feedback welcome. Thanks, Andrew [1] https://sourceware.org/pipermail/gdb-patches/2020-April/167578.html --- Andrew Burgess (3): gdb: Restore previously selected thread when switching inferior gdb: Unify two copies of restore_selected_frame gdb: Track the current frame for each thread gdb/ChangeLog | 52 +++ gdb/NEWS | 19 + gdb/doc/ChangeLog | 14 + gdb/doc/gdb.texinfo | 42 ++- gdb/frame.c | 87 +++++ gdb/frame.h | 68 ++++ gdb/gdbthread.h | 15 +- gdb/inferior.c | 58 ++- gdb/inferior.h | 10 + gdb/infrun.c | 26 +- gdb/testsuite/ChangeLog | 10 + .../gdb.threads/restore-selected-frame.c | 85 +++++ .../gdb.threads/restore-selected-frame.exp | 336 ++++++++++++++++++ gdb/testsuite/gdb.threads/restore-thread.c | 246 +++++++++++++ gdb/testsuite/gdb.threads/restore-thread.exp | 220 ++++++++++++ gdb/thread.c | 135 +++---- 16 files changed, 1315 insertions(+), 108 deletions(-) create mode 100644 gdb/testsuite/gdb.threads/restore-selected-frame.c create mode 100644 gdb/testsuite/gdb.threads/restore-selected-frame.exp create mode 100644 gdb/testsuite/gdb.threads/restore-thread.c create mode 100644 gdb/testsuite/gdb.threads/restore-thread.exp -- 2.25.3