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 A94BF3858020 for ; Wed, 22 Mar 2023 21:17:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A94BF3858020 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=1679519866; 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: in-reply-to:in-reply-to:references:references; bh=wBB4beLz5Tn4eaAZ6RZ3Htb3B0WYkCN9sSudbm5PA5c=; b=GFaQPLkTqMlidPqXMnIvHJrNPNEKBYkPOTU+dPKa7n/MZAAqFSTQJAqnB1ynQ5egLKxXKq RYC3D7Sl/WJPF4v1fMnSNTtvCqwQD44zqfDG8X2hnQaEFJ04q0SsJUOD1FDEISbCjb6mtd 9QIElaPzKru80hXbrbiNhV7kdtfT2+g= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-518-vG-lljTXNQiK9ekseE7xaw-1; Wed, 22 Mar 2023 17:17:42 -0400 X-MC-Unique: vG-lljTXNQiK9ekseE7xaw-1 Received: by mail-wm1-f70.google.com with SMTP id r35-20020a05600c322300b003edce6ff3b4so5053469wmp.4 for ; Wed, 22 Mar 2023 14:17:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679519861; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wBB4beLz5Tn4eaAZ6RZ3Htb3B0WYkCN9sSudbm5PA5c=; b=VPIt8Bbp3GYG0/qxnS496+fv7g4w1+R6SxtKNztuavWkqFQS8bAvNuwxE1AGsJI3Aw UY1/tmO5IPrXkT90SPVX9/PEeYHXhF9lM2AIk2vADcKOChzbfXLkulOdi6CcQ0xuUboe e4BpaHZ6vYXs2xoy2XEs+/XizrZFtS4xw5OYYcVVRXUgDmMPe2aPl1P0bfoyuQdv16HL 70xt/jOfm+hdeuez71R3tZFCbAWo7UvkOSFZyjaex8yiPojgdn3nha4FYTUXRU2QAZ9u g8/aU/4iyyCNAF+H2ZVX8nGMxVWCWzSmRspomp936OI+JiZLYyvmOpnGWp/MXYiP3GDq yozA== X-Gm-Message-State: AO0yUKULHaU/PlX/iky/fhXmX1b+ZtnfXAEHQ3JVp0JvYjwbHP3pKruG B3eE2GzBLeQEON0Ih/4DtIE9KNuEBz321sHJCh8uhtiXe8vmypn/L0pDgJ+QL/SU/VYeoew/9NL YkeZQJX3h3/8SD8bLb5nfOruJc2/mPr3eCbw648n7kle3D/DwOFZNDnr/3JeViR6Qo5bVyX0BUr 7l/I0c/g== X-Received: by 2002:a1c:f418:0:b0:3eb:38e6:f650 with SMTP id z24-20020a1cf418000000b003eb38e6f650mr571035wma.41.1679519861450; Wed, 22 Mar 2023 14:17:41 -0700 (PDT) X-Google-Smtp-Source: AK7set+xuclNmFdMvgWjQBFDUc9tBI3FiEgqhg4jknxt6ODTyaw5uHe61zX55XdtUdH0h/09hLmXjw== X-Received: by 2002:a1c:f418:0:b0:3eb:38e6:f650 with SMTP id z24-20020a1cf418000000b003eb38e6f650mr571022wma.41.1679519861051; Wed, 22 Mar 2023 14:17:41 -0700 (PDT) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id v10-20020a05600c470a00b003ee11ac2288sm8922466wmo.21.2023.03.22.14.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 14:17:40 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Pedro Alves , Simon Marchi , Andrew Burgess Subject: [PATCHv2 0/2] displaced stepping debug improvements Date: Wed, 22 Mar 2023 21:17:36 +0000 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: <8473de37-fa6b-f7ec-e4b6-78b971324804@simark.ca> References: <8473de37-fa6b-f7ec-e4b6-78b971324804@simark.ca> 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=-5.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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 mini series is just an expansion of the first patch from the parent series: improvements to the displaced stepping debug output. In V2: - As Simon suggested, the debug has now moved to displaced_step_prepare_throw, so the (not yet upstreamed) displaced stepping for the AMD GPU target should still see the debug output, - The debug code now handles a failure to disassemble better: there's nothing worse than enabling debug to try and solve a problem, and having GDB crash in a different way. If an instruction fails to disassemble GDB will now print a basic debug message and skip the rest of the debug output, - As suggested, I've moved the displaced_step_dump_bytes helper function into gdbsupport/ and given it a better name, - I have NOT tried to implement the improvement Simon suggested where the architecture backend tells GDB core how many bytes the replacement instruction(s) occupied. This still means that in some cases we will disassemble the entire displaced step buffer unnecessarily, but I don't see that as a huge problem. Fixing this just to reduce some debug output a little seems excessive. Let me know if you feel this is a blocker for this work being merged and I can take another look at it. Thanks, Andrew --- Andrew Burgess (2): gdb: more debug output for displaced stepping gdb: move displaced_step_dump_bytes into gdbsupport (and rename) gdb/amd64-tdep.c | 2 +- gdb/displaced-stepping.c | 3 +- gdb/i386-tdep.c | 2 +- gdb/infrun.c | 101 ++++++++++++++++++++++++------------- gdb/infrun.h | 3 -- gdb/rs6000-tdep.c | 2 +- gdb/s390-tdep.c | 2 +- gdbsupport/array-view.h | 1 + gdbsupport/common-utils.cc | 18 +++++++ gdbsupport/common-utils.h | 15 ++++++ 10 files changed, 105 insertions(+), 44 deletions(-) base-commit: bf3f6c02d73f9823b8cb4f59524f29fbbfb6126d -- 2.25.4