From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 9AE363858D1E for ; Mon, 24 Apr 2023 16:15:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9AE363858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682352945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sgofqDJVijWcTPlBDJkiOLbxTuh4D4iPxTmKny8+BKk=; b=bsDWDORWGbE6njN+2wQKReXJvkYCGvob3Rf/w4gbX5CmbBBSuP4c8hhge6guWJ+OnRoJNK icwoPtvlJQx4tn0aWAZt43Ksusip2u6yl5O7Gk/c/bj34p8rlOgb7tK8/7o42KPDaDDp6/ oiNOmfWkHkNWtZP5p82YxZBUA2K2Two= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-408-t6bmSQu5OViC_1NlJ5H6xw-1; Mon, 24 Apr 2023 12:15:44 -0400 X-MC-Unique: t6bmSQu5OViC_1NlJ5H6xw-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-301110f1756so1631479f8f.0 for ; Mon, 24 Apr 2023 09:15:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682352942; x=1684944942; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sgofqDJVijWcTPlBDJkiOLbxTuh4D4iPxTmKny8+BKk=; b=Kt6peIsVT6wYghXcDnleqa8Fawkv+2c44DJ6S/wKlGL+K9lYpZXKpQmejxao5WK5EF uGqeyeWG6cXP59lMrLUwIsN1poKhVPbmRnOJDkDTeTDi6fmIXuJ5d9LgiUmISCZ9zJ2N A/JkGWaApkCgLNKLOUq6chXO9KHfivoTuPaeiDCdledclgGGNiKgAa1y+jiLjGefc3ca gCpqn6pKhFLTxvDoatzRe09KNQ3NhC8wL219zANg3mXHm9VzooyF+n9BvmcmdiSL3+Sw gH+eEjJD2QV5yUowMXkHyFErLRODwMhTRuF3n+Vl1dxlHDk8+Y2KIxj9zSxzGIlNhiyc IUcQ== X-Gm-Message-State: AAQBX9dbrVXYiIV+S1v5qTBxvt2ca+jNhvMYXdcfFv3FuYzZwQV+c2G2 8O03jiB9tdT6FYcYSO6WAcnrry7HqmbT/KrWjBiouDxq6XhOM0nkiG+g+obHpJH02p+l6AsRBJ/ KHS2znflFZ4gqpmIs861BnG4QGhKRGWUvXCEdzDqrl0KkvOhYfIQ58gBk0/YQQ8qb7UnWnzqnoG UWQlwNnQ== X-Received: by 2002:a5d:4fcd:0:b0:2cf:ec6c:f253 with SMTP id h13-20020a5d4fcd000000b002cfec6cf253mr10189851wrw.20.1682352942601; Mon, 24 Apr 2023 09:15:42 -0700 (PDT) X-Google-Smtp-Source: AKy350ZoakZ47OUByXbaY6N36sKkknhHjkIfyOf7UeXMy7f3oHEAOBojI9dVzOvmC+/ecm3rdKcInQ== X-Received: by 2002:a5d:4fcd:0:b0:2cf:ec6c:f253 with SMTP id h13-20020a5d4fcd000000b002cfec6cf253mr10189838wrw.20.1682352942228; Mon, 24 Apr 2023 09:15:42 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id p17-20020a056000019100b002fda1b12a0bsm11178494wrx.2.2023.04.24.09.15.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 09:15:41 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH] gdb/doc: extend the documentation of the jump command Date: Mon, 24 Apr 2023 17:15:38 +0100 Message-Id: <4da5caec8b9bba91ffc25349e86bc99797f4c9e2.1682352919.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This commit addresses PR gdb/7946. While checking for bugs relating to the jump command I noticed a long standing bug that points out a deficiency with GDB's documentation of the jump command. The bug points out that 'jump 0x...' is not always the same as 'set $pc = 0x...' and then 'continue'. Writing directly to the $pc register does not update any auxiliary state, e.g. $npc on SPARC, while using 'jump' does. It felt like this would be an easy issue to address by adding a paragraph to the docs, so I took a stab at writing something suitable. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7946 --- gdb/doc/gdb.texinfo | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 940315b2713..781eaf727be 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -20617,6 +20617,14 @@ address @code{0x485}, rather than at the address where your program stopped. @xref{Continuing and Stepping, ,Continuing and Stepping}. +However, writing directly to @code{$pc} will only change the value of +the program-counter register, while using @code{jump} will ensure that +any additional auxiliary state is also updated. For example, on +SPARC, @code{jump} will update both @code{$pc} and @code{$npc} +registers prior to resuming execution. When using the approach of +writing directly to @code{$pc} it is your job to also update the +@code{$npc} register. + The most common occasion to use the @code{jump} command is to back up---perhaps with more breakpoints set---over a portion of a program that has already executed, in order to examine its execution in more base-commit: 393946658fe67e95abe41d3de03b36d84563e873 -- 2.25.4