This is the mail archive of the gdb-patches@sourceware.org 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: [RFC] Fix build failure in stap-probe.c.


On Wed, May 2, 2012 at 11:56 AM, Sergio Durigan Junior
<sergiodj@redhat.com> wrote:
> On Wednesday, May 02 2012, Doug Evans wrote:
>
>> Hi.
>>
>> I'm getting build failures, gcc is complaining that "opcode" and
>> "lookahead_opcode" "may be used uninitialized".
>
> Hi Doug,
>
> I'm not seeing this error when I compile (even with -O2), but I believe
> you :-).
>
>> cc1: warnings being treated as errors
>> ../../src/gdb/stap-probe.c: In function 'stap_parse_argument_1':
>> ../../src/gdb/stap-probe.c:1558: error: 'lookahead_opcode' may be used uninitialized in this function
>> ../../src/gdb/stap-probe.c:813: note: 'lookahead_opcode' was declared here
>> ../../src/gdb/stap-probe.c:1558: error: 'opcode' may be used uninitialized in this function
>> ../../src/gdb/stap-probe.c:778: note: 'opcode' was declared here
>> make: *** [stap-probe.o] Error 1
>>
>> This patch is just RFC.
>> IIUC the code already watches for valid operators before
>> calling stap_get_opcode, so stap_get_opcode should "never" return zero.
>> So I'm wondering if maybe step_get_opcode should be changed
>> to always succeed and always set the opcode.
>
> You're right. ?Does this patch work for you?
>
> 2012-05-02 ?Sergio Durigan Junior ?<sergiodj@redhat.com>
>
> ? ? ? ?* stap-probe.c (stap_is_operator): Change declaration.
> ? ? ? ?(stap_get_opcode): Change return value.
> ? ? ? ?(stap_parse_argument_1): Update calls to `stap_get_opcode' and
> ? ? ? ?`stap_parse_argument_1'.

Works great, thanks!


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