This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/3] Fix "Remote 'g' packet reply is too long" problems with multiple inferiors
Pedro Alves <palves@redhat.com> writes:
> @@ -7015,9 +7018,43 @@ Packet: '%s'\n"),
> reason. */
> if (p_temp == p1)
> {
> - struct packet_reg *reg = 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 == null_ptid)
> + {
> + const char *thr = strstr (p1 + 1, ";thread:");
> + if (thr != NULL)
> + event->ptid = read_ptid (thr + strlen (";thread:"),
> + NULL);
> + else
> + event->ptid = magic_null_ptid;
> + }
> +
> + if (rsa == NULL)
> + {
> + inferior *inf = (event->ptid == 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 == NULL)
> + {
> + p = strchrnul (p1 + 1, ';');
> + p++;
> + continue;
> + }
Otherwise, patch is good to me.
--
Yao (齐尧)