[RFA] Fix c++/16597 (crash when inspecting lambda expression variables)

Tom Tromey tromey@redhat.com
Thu Apr 10 16:58:00 GMT 2014


>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:

Keith> That was the easy part. The not-so-easy/questionable part is the test
Keith> case, which uses the (assembler) output of the compiler to run
Keith> against. Writing by hand is very time-consuming and tricky, because we
Keith> must be stopped inside the lambda function in order to trigger the
Keith> bug.

Keith> In any case, I thought I would submit this and see if anyone had any
Keith> better ideas.

I think it's fine to do this.

In the past we've done two additional things that make it slightly nicer.

First, we've checked in the original source file as a separate file, I
think along with a note in the .exp about it.  This approach lets you
avoid this:

Keith> +# WARNING: This is hard-coded from the original source file! This
Keith> +# breakpoint should be set inside the lambda in A::doit().

... since you can refer to comments in the original source file IIRC.


Second, I think we've edited the compilation directory in the .S file,
and maybe other little details as well (I had to edit the files to avoid
'main' for some reason I cannot remember):

Keith> +.Linfo_string2:
Keith> +	.asciz	 "/home/keiths/tmp/16597"

You can easily find some examples in gdb.dwarf2, just follow one of
those.

Tom



More information about the Gdb-patches mailing list