This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: Turn check macros into functions. (issue6188088)


On 5/16/12, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Lawrence" == Lawrence Crowl <crowl@google.com> writes:
>
> Lawrence> The effect is that it now possible to get useful responses
> Lawrence> to gdb command like
> Lawrence>     (gdb) print DECL_FUNCTION_CODE (decl)
>
> Doesn't this mean that if you have checking enabled, and you use the
> wrong macro on some tree, cc1 will crash?  That seems like a distinct
> minus to me.

Yes, it does mean that, but it is a net overall improvement.

The use scenario is in copying an expression from the source to
gdb to figure out its value.  In this scenario, you typically are
not going to have the wrong tree type.

With the macro, gdb refuses to evaluate the print even when the
code is correct.  It complains about extensions or gets confused.
These extensions are not on gdb's list of things to implement.

The only way to "make it work" with the macro is to define overriding
macros in gdb.  If you do that, the patch introduces no behavioral
change.

So, the patch is a net positive.

-- 
Lawrence Crowl


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