From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by sourceware.org (Postfix) with ESMTPS id B61D83858D32 for ; Mon, 23 Jan 2023 17:43:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B61D83858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f66.google.com with SMTP id y1so7073970wru.2 for ; Mon, 23 Jan 2023 09:43:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CXzjiper6ExsSrGHqMzDbDVYCJ1NX/xh1gGfP/fduf4=; b=nyeElL1oTXUUqAApGcsD5km0i822PMqxvHydNjw8JcIuGZS6F485i7thsnUYoKBxtO PWdlwwRSJJniJPFk4k2kYt4yTN5hckMQhgE7yPLFdHDiP2/8g9OI5UuNEPqpj8Us+9fZ ZxUbWGJWiYFKYOeSKF7h7ybU+WKNDIuWBLKaV6wFZ4o1HV9Vq6u5/7Fs9tdTqH/PEFOM DcDjuOkNXqnvIc6GuOa7crHCflvfcZwfsBI192+cag2DpiiGRN+SdpORgNJJ3lBhid5V SgfRORyxDGIUiG9OVAmzzthgXJJyGkbLMphRMuiRSLJMzgRH5M3UJZdVOUpabvdExGcr 8uYw== X-Gm-Message-State: AFqh2kraf0L+Bg+dfA+7w6vDjQ5K1ZPztTlwtVpc7EAzCRJgIYOigU+Q AXRE228+31Htn62AiPhJQ4uRLyNTBI8/iQ== X-Google-Smtp-Source: AMrXdXus79JjJK6ET8hnSUCSedJf8Pv6Uqaixlg/JwcgLR4Fokhz5rS/KRXqZ1HHIEUqQho4o6fL0w== X-Received: by 2002:a05:6000:3c9:b0:2bc:7f32:e6ae with SMTP id b9-20020a05600003c900b002bc7f32e6aemr20010967wrg.64.1674495815741; Mon, 23 Jan 2023 09:43:35 -0800 (PST) Received: from ?IPv6:2001:8a0:f92b:9e00::1fe? ([2001:8a0:f92b:9e00::1fe]) by smtp.gmail.com with ESMTPSA id h3-20020adfe983000000b002bdf5832843sm21948959wrm.66.2023.01.23.09.43.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Jan 2023 09:43:35 -0800 (PST) Subject: Re: [PATCH v4 2/3] gdb: Add per-remote target variables for memory read and write config To: Christina Schimpe , gdb-patches@sourceware.org Cc: tom@tromey.com, aburgess@redhat.com, eliz@gnu.org References: <20221221133958.2111768-1-christina.schimpe@intel.com> <20221221133958.2111768-3-christina.schimpe@intel.com> From: Pedro Alves Message-ID: <3f2945d9-bcdf-0f32-d2ce-84c2be9361a6@palves.net> Date: Mon, 23 Jan 2023 17:43:34 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20221221133958.2111768-3-christina.schimpe@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,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: On 2022-12-21 1:39 p.m., Christina Schimpe wrote: > +/* User configurable variables for the number of characters in a > + memory read/write packet. MIN (rsa->remote_packet_size, > + rsa->sizeof_g_packet) is the default. Some targets need smaller > + values (fifo overruns, et.al.) and some users need larger values > + (speed up transfers). The variables ``preferred_*'' (the user > + request), ``current_*'' (what was actually set) and ``forced_*'' > + (Positive - a soft limit, negative - a hard limit). */ > + > +struct memory_packet_config > +{ > + const char *name; > + long size; > + int fixed_p; > +}; It seems like this struct would better be split in two like in patch #1, as we don't really need to store a name per remote connection, as it'll always be the same for all connections. However, I don't want to block your patch further, so I'm OK with merging as is. > @@ -2037,31 +2057,49 @@ set_memory_packet_size (const char *args, struct memory_packet_config *config) ... > /* Update the config. */ > config->fixed_p = fixed_p; > config->size = size; > + > + const char* target_type = get_target_type_name (target_connected); Formatting: "const char *target_type" > + gdb_printf (_("The %s %s is set to \"%s\".\n"), config->name, target_type, > + args); > + > } > > +/* Show the memory-read or write-packet size configuration CONFIG of the > + target REMOTE. If REMOTE is nullptr, the default configuration for future > + remote targets should be passed in CONFIG. */ > + > static void > -show_memory_packet_size (struct memory_packet_config *config) > +show_memory_packet_size (memory_packet_config *config, remote_target *remote) > { > + const char* target_type = get_target_type_name (remote != nullptr); Ditto. OK with the formatting nits fixed. Pedro Alves