[PATCH] PR varobj/18564 regression in showing __thread so extern variable

Yao Qi qiyaoltc@gmail.com
Thu Sep 3 09:37:00 GMT 2015


Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:

>> > +{
>> > +   so_extern = &so_extern;
>> > +   printf("address is %p\n", &so_extern); /* break here to check result */
>> 
>> Don't have to call printf and include stdio.h.
> Not clear by what to replace this printf (or why it harms).
>

We don't have to get printf involved in the test, because some targets
may don't have printf at all.

> I need to put a break after the assignment, as the .exp 
> will compare so_extern value with address of so_extern.
> (note: I changed the .exp, so as to also check so_extern value
> in main thread).
> The printf line allows to put a break after the assignment.
> If it is really better to remove the printf/stdio.h, any suggestion
> about what to replace it with ? (we need to avoid the compiler to
> optimise away this code to be sure we can put a break).

We can replace it with "i++;" (i is a local variable, or a volatile
global variable).

-- 
Yao (齐尧)



More information about the Gdb-patches mailing list