This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch v4 02/13] thread, btrace: add generic branch trace support
[Sorry, I had to rush out in a hurry before, and didn't trim the previous
reply. I was just having trouble myself finding the real reply among all
the quoting, so here it is again:]
>>
>> /* The first block ends at the current pc. */
>> if (!VEC_empty (btrace_block_s, btp->btrace))
>> {
>> struct frame_info *frame = get_current_frame ();
>
> This get_current_frame call here looks fishy. This function takes a
> btrace_thread_info, and its callers work with a thread_info directly,
> which indicates that they may work with some current thread other than
> the thread passed in as argument.
>
>>
>> if (frame)
>> {
>
> What's this check supposed to mean? get_current_frame never
> returns NULL.
>
>> struct btrace_block *head =
>> VEC_index (btrace_block_s, btp->btrace, 0);
>
>>
>> if (head && !head->end)
>> head->end = get_frame_pc (frame);
I meant to suggest bypassing frames, and using regcache_read_pc instead.
--
Pedro Alves