RE: [patch v4 09/13] gdbserver, btrace: add generic btrace support

Metzger, Markus T
2012-12-04T14:50:47Z

> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Wednesday, November 28, 2012 9:32 PM

Thanks for your review.

[...]

> > + if (!thread->btrace)
> > + fprintf (stderr, "Could not enable btrace for %s.\n", ptid_str);
> > + else
> > + err = 0;
> > + }
> > +
> > + return err;
>
> Instead of printing those errors to stderr, you can pass them
> down to GDB, by sending "E.ERRTXT" instead of E01. (See
> packet_check_result in remote.c).

Thanks. This is much better in terms of error reporting.

[...]

> > + else if (offset >= cache.used_size)
> > + {
> > + buffer_free (&cache);
> > + return 0;
>
> I think this should be -1.

Yes. I removed the == case. When offset equals the cache size, we return 0.

[...]

Thanks,
Markus.
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052