This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Philippe Waroquiers <> 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 (éå)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]