From patchwork Tue Mar 29 15:49:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1610694 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=YgHK2X21; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KSYtC4RvJz9sFk for ; Wed, 30 Mar 2022 02:50:11 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4KSYtC3M26z2yHt for ; Wed, 30 Mar 2022 02:50:11 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=YgHK2X21; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::52a; helo=mail-pg1-x52a.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=YgHK2X21; dkim-atps=neutral Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4KSYt84GrRz2xvW for ; Wed, 30 Mar 2022 02:50:08 +1100 (AEDT) Received: by mail-pg1-x52a.google.com with SMTP id t4so12112266pgc.1 for ; Tue, 29 Mar 2022 08:50:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mxOPp0hWtq3q4pMh7FIDwn9oHGtXHbmu896O/A8YW+k=; b=YgHK2X21co+95n0eeIiK8Y09CO62r5Zls/JVC5a1J353/LBizhcoe5zrqC6FVTqPyo bDPfrn8pwpGU9ReGXPO0Afwhhkp3MYnF1O6cBHvNUxiqbrZhxVhUBR8waEPoeqGP0xwD IOYS0gryQ27lA5LlBaaDS81p5n44V4V2ioI5Q/hfqQCYdIpga0kv+r6uohNTC49ctM1c P6kPXZAeGOxrNJtfQlSUSYI+fhiHJ8Rx+r14JjuFub4HPGcXe+QmxcoL2tVIx3Aw8xEg P4SEpUj2SGEaj7/g6I3Rcu/3W5Fw+dJFBGGmFFlgYWpVmVHfrfK9u8nfBZCFA0nJHY1l Bqaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mxOPp0hWtq3q4pMh7FIDwn9oHGtXHbmu896O/A8YW+k=; b=VrGxLLMEHWOOx4JkcDjkrbZub8M9qTlkcBA+sSMog3o69m9lEAaaa4N4t4tB8s/DDf +3MiCFV1jSLUUTTESkWxZchjxCFb/rdTNbJQSA6+k7rHXOdRTeJhvq/ciOG3NMNRFxaw xNI29GvoIEXt0ElpiIGNrLJXz0cr7GnyHKAVidOE8N5s7LGEjbgTxOHHUSxh0PnljajR 84VJSWovR8rmFvEhFrf1F3G/74yh7twNDL/NuQdaHJbD8Ywd/feEL3z0uX88L/m8l33c RepSKKDp8GZB71wQmMrdoyTdbB4DbGoiy3Z7XRn0xVx0LyLXTsBExfa+6WvOw1IhxL+i Q2Mw== X-Gm-Message-State: AOAM530mMnw/vQzUillFs/x3s2vS2xCrzSLlkyIuUGRxHqo7OfDp89mq FpFdism9BE0mkocXTxy0YELNGPHoyTk= X-Google-Smtp-Source: ABdhPJw8ALLif/nYqy5hPcwJSerFqoE1ESOrRC91N1PwzE2NumVbUta599gjoszrZ2OGcGJaNgey2w== X-Received: by 2002:a63:9502:0:b0:386:3916:ca8e with SMTP id p2-20020a639502000000b003863916ca8emr2413295pgd.357.1648569006519; Tue, 29 Mar 2022 08:50:06 -0700 (PDT) Received: from bobo.ibm.com (58-6-255-110.tpgi.com.au. [58.6.255.110]) by smtp.gmail.com with ESMTPSA id s35-20020a056a001c6300b004fb20b5d6c1sm14163564pfw.40.2022.03.29.08.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Mar 2022 08:50:06 -0700 (PDT) From: Nicholas Piggin To: pdbg@lists.ozlabs.org Date: Wed, 30 Mar 2022 01:49:05 +1000 Message-Id: <20220329154931.493851-13-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220329154931.493851-1-npiggin@gmail.com> References: <20220329154931.493851-1-npiggin@gmail.com> MIME-Version: 1.0 Subject: [Pdbg] [PATCH v2 12/38] libpdbg: thread_regs don't print regs X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" The gdbserver uses thread_getregs to send data to the client, printing to console is noisy. Push the printing into callers that want it. Reviewed-by: Joel Stanley Signed-off-by: Nicholas Piggin --- libpdbg/chip.c | 2 -- libpdbg/thread.c | 7 +------ src/thread.c | 2 ++ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/libpdbg/chip.c b/libpdbg/chip.c index 79aeb35..6cbf48b 100644 --- a/libpdbg/chip.c +++ b/libpdbg/chip.c @@ -380,8 +380,6 @@ int ram_getregs(struct thread *thread, struct thread_regs *regs) CHECK_ERR(thread->ram_destroy(thread)); - thread_print_regs(regs); - return 0; } diff --git a/libpdbg/thread.c b/libpdbg/thread.c index 4a7523c..78a59b8 100644 --- a/libpdbg/thread.c +++ b/libpdbg/thread.c @@ -371,7 +371,6 @@ void thread_print_regs(struct thread_regs *regs) int thread_getregs(struct pdbg_target *target, struct thread_regs *regs) { struct thread *thread; - int err; assert(pdbg_target_is_class(target, "thread")); @@ -385,11 +384,7 @@ int thread_getregs(struct pdbg_target *target, struct thread_regs *regs) return -1; } - err = thread->getregs(thread, regs); - if (!err) - thread_print_regs(regs); - - return err; + return thread->getregs(thread, regs); } int thread_getgpr(struct pdbg_target *target, int gpr, uint64_t *value) diff --git a/src/thread.c b/src/thread.c index 8ddf4ae..76909d6 100644 --- a/src/thread.c +++ b/src/thread.c @@ -362,6 +362,8 @@ static int thread_regs_print(struct reg_flags flags) if (thread_getregs(thread, ®s)) continue; + thread_print_regs(®s); + if (flags.do_backtrace) { struct pdbg_target *adu;