This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] PR varobj/18564 regression in showing __thread so extern variable
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Thu, 03 Sep 2015 10:37:33 +0100
- Subject: Re: [PATCH] PR varobj/18564 regression in showing __thread so extern variable
- Authentication-results: sourceware.org; auth=none
- References: <1440934487 dot 22248 dot 9 dot camel at skynet dot be> <86wpw9x9au dot fsf at gmail dot com> <1441229015 dot 13071 dot 23 dot camel at skynet dot be>
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 (éå)