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: New warning in GDB 7.5


> These come from the following 2 lines in src/.gdbinit:
> 
>   # Force loading of symbols, enough to give us VALBITS etc.
>   set main
>   # With some compilers, we need this to give us struct Lisp_Symbol etc.:
>   set Fmake_symbol
> The comments explain why they are needed.

Are these really doing anything? Unless "main" and "Fmake_symbol" were
settings, I think the warning is actually correct: these commands
have no effect.

> Why was the new warning added? what problem(s) does it solve?

The warning was added to catch the situation where the wrong assignment
operator was used. This is very common when you debug a multi-language
application. For instance, when debugging Ada, one might write the
following:

        (gdb) set blabla = 10

But, in Ada mode, the correct assignment operator is ":=", while "="
is the comparison operator. When you keep switching back and forth
between Ada and C code, it's very easy to make that mistake.

-- 
Joel


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