From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113375 invoked by alias); 3 Oct 2017 11:36:23 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 113277 invoked by uid 89); 3 Oct 2017 11:36:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*r:sk:clients, H*RU:209.85.128.196, Hx-spam-relays-external:209.85.128.196, H*r:sk:static. X-HELO: mail-wr0-f196.google.com Received: from mail-wr0-f196.google.com (HELO mail-wr0-f196.google.com) (209.85.128.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Oct 2017 11:36:21 +0000 Received: by mail-wr0-f196.google.com with SMTP id v38so2703394wrc.4 for ; Tue, 03 Oct 2017 04:36:20 -0700 (PDT) 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:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=F1IfDivhdJaRa7fPB0uqHiJGW3kfYlQAeT6Wved5E68=; b=NsBj1c6qCxADc/rOlp+62K5jnJkh/4sYfdHZp/hHW5WlEuqY/op2wln7wXc+TG+ORu Tk00wlXT9RY9JNDenX4L8vwXrZBYWZwTtYr3LdDBE5JD/KIem/YdnRngiRfTe2khLHvh hm3axO5k2zowjh27MJfkjDohnX4firuuEt7zkuxS6K4OXP1m2Q+kNJduCVaZKg8HpLDX n3OGDudq3ERWcum+7N9f17U7frDNQhaZG+QAutYFOtIa8NQuxVnvgZiEX25BUrfIHCmZ PqtpgrgdNOnGEm6eolJ8AiqnttZCeaSZeZM/xQAR8RNemKcNy7cC06LGs14/XMrgJSHF 7OKA== X-Gm-Message-State: AMCzsaVGoziTIahLndqS5BQEcyEdxMnb4h0eTpk5Ni7v/1uQrXlC9Xsp QKUrhoYnWAVnIhC3NI6GpmMyQQ== X-Google-Smtp-Source: AOwi7QDDuNRFUl1iPLs0w7EC4I/G5/JSjscoKQNCbCUxbk/yLb4l33xkZsOxXQ+cx7uHh7brun4ZqQ== X-Received: by 10.223.150.161 with SMTP id u30mr2514769wrb.229.1507030579080; Tue, 03 Oct 2017 04:36:19 -0700 (PDT) Received: from E107787-LIN (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id n57sm18932258wrn.29.2017.10.03.04.36.17 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 03 Oct 2017 04:36:18 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 3/3] Fix "Remote 'g' packet reply is too long" problems with multiple inferiors References: <1506957311-30028-1-git-send-email-palves@redhat.com> <1506957311-30028-4-git-send-email-palves@redhat.com> Date: Tue, 03 Oct 2017 11:36:00 -0000 In-Reply-To: <1506957311-30028-4-git-send-email-palves@redhat.com> (Pedro Alves's message of "Mon, 2 Oct 2017 16:15:11 +0100") Message-ID: <86bmlo79an.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00035.txt.bz2 Pedro Alves writes: > @@ -7015,9 +7018,43 @@ Packet: '%s'\n"), > reason. */ > if (p_temp =3D=3D p1) > { > - struct packet_reg *reg =3D packet_reg_from_pnum (rsa, pnum); > + /* If we haven't parsed the event's thread yet, find > + it now, in order to find the architecture of the > + reported expedited registers. */ > + if (event->ptid =3D=3D null_ptid) > + { > + const char *thr =3D strstr (p1 + 1, ";thread:"); > + if (thr !=3D NULL) > + event->ptid =3D read_ptid (thr + strlen (";thread:"), > + NULL); > + else > + event->ptid =3D magic_null_ptid; > + } > + > + if (rsa =3D=3D NULL) > + { > + inferior *inf =3D (event->ptid =3D=3D null_ptid > + ? NULL > + : find_inferior_ptid (event->ptid)); > + /* If this is the first time we learn anything > + about this process, skip the registers > + included in this packet, since we don't yet > + know which architecture to use to parse > + them. */ Could you add a comment about when/how does GDB fetch the target description of the first-time-seen process? > + if (inf =3D=3D NULL) > + { > + p =3D strchrnul (p1 + 1, ';'); > + p++; > + continue; > + } Otherwise, patch is good to me. --=20 Yao (=E9=BD=90=E5=B0=A7)