[PATCH 14/16] remote, btrace: add branch trace remote ops
Metzger, Markus T
markus.t.metzger@intel.com
Fri Jun 1 08:49:00 GMT 2012
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Jan Kratochvil
> Sent: Wednesday, May 30, 2012 10:44 PM
Thanks for your review!
[...]
> > + if (packet->support != PACKET_ENABLE)
> > + {
> > + errno = ENOSYS;
>
> errno is not used for intra-GDB/gdbserver communication. Everywhere.
I'll look into error handling.
> > + return NULL;
> > + }
> > +
> > + buf += xsnprintf (buf, endbuf - buf, "%s", packet->name); buf +=
> > + xsnprintf (buf, endbuf - buf, ":on:"); buf = write_ptid (buf,
> > + endbuf, ptid); putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size,
> > + 0);
> > +
> > + switch (packet_ok (rs->buf, packet))
> > + {
> > + case PACKET_OK:
> > + tinfo = xzalloc (sizeof (*tinfo));
> > + if (tinfo)
>
> Remove, xzalloc can never fail.
Fixed.
> > + tinfo->ptid = ptid;
> > + else
> > + errno = ENOMEM;
> > + break;
> > + case PACKET_ERROR:
> > + {
> > + int pid = ptid_get_lwp (ptid);
> > + if (!pid)
> > + pid = ptid_get_pid (ptid);
> > +
> > + error (_("Couldn't enable btrace for %d: %s"),
> > + pid, rs->buf);
>
> Use target_pid_to_str. Everywhere.
Fixed.
[...]
> > + struct cleanup *cleanup = make_cleanup (xfree, xml);
>
> Empty line after declarations.
Fixed.
[...]
Regards,
Markus.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 7228 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20120601/0de8fde8/attachment.p7s>
-------------- next part --------------
--------------------------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
More information about the Gdb-patches
mailing list