Re: [PATCH v10 25/28] btrace, gdbserver: read branch trace incrementally

Tom Tromey
2014-01-16T17:57:28Z

>>>>> "Markus" == Markus Metzger <markus.t.metzger@intel.com> writes:

Hi Markus.

Markus> -VEC (btrace_block_s) *
Markus> -target_read_btrace (struct btrace_target_info *btinfo,
Markus> +enum btrace_error
Markus> +target_read_btrace (VEC (btrace_block_s) **btrace,
Markus> + struct btrace_target_info *btinfo,
Markus> enum btrace_read_type type)
Markus> {
Markus> struct target_ops *t;

Markus> for (t = current_target.beneath; t != NULL; t = t->beneath)
Markus> if (t->to_read_btrace != NULL)
Markus> - return t->to_read_btrace (btinfo, type);
Markus> + return t->to_read_btrace (btrace, btinfo, type);

Markus> tcomplain ();
Markus> - return NULL;
Markus> + return BTRACE_ERR_NOT_SUPPORTED;
Markus> }

While rebasing my branch I noticed this code.

tcomplain doesn't return, so the final "return" here will never be
executed.

Given the function's history I assume this is no big deal -- just a
small oversight, compounded by the compiler not bothering to tell us
that it knows about this :)

However I wanted to point it out in case you were expecting an error
return here.

If it is not important, then please just ignore it. I have fixed it on
my branch already.

Tom