Re: [PATCH 00/11] C++/MinGW patches

Pedro Alves
2015-11-03T11:20:48Z

On 11/03/2015 10:46 AM, Qian Hong wrote:
> Hi Pedro,
>
> On Tue, Nov 3, 2015 at 4:46 AM, Pedro Alves <palves@redhat.com> wrote:
>> Thanks! Note you'll need to configure gdb with --enable-build-with-cxx
>> in order to make it build with a C++ compiler.
>
> I think I have some interesting testing result for you ;-)
>
> I compiled latest gdb in your branch on MSYS2 on Windows [1], with my
> additional modification to enable build-with-cxx.
>
> It compiles fine. However, when debugging a simple hello world
> program, I got error below:
> "This application has requested the Runtime to terminate it in an
> unusual way. Please contact the application's support team for more
> information." when debugging a simple hello world program. "
>
> Steps to reproduce:
> 1. $ cat hello.c
> # include <stdio.h>
> int main(void)
> {
> int a = 10;
> printf("haha a is %d\n", 10);
> return 0;
> }
>
> 2. compile with MSYS2 mingw gcc
> $ gcc hello.c -g -O0 -o hello.exe
>
> 3. debugging hello.exe with gdb (build with cxx)
> $ gdb hello.exe
>
> 3.1. set a breakpoint on main()
> 3.2. type `c`
>
> expect result:
> gdb should report that the program is not start yet.
>
> actual result:
> gdb exit with error message: "This application has requested the
> Runtime to terminate it in an unusual way. Please contact the
> application's support team for more information." when debugging a
> simple hello world program. "

Hmm. Sounds like an uncaught C++ exception. I guess we could try
making C++ mode use setjmp/longjmp exceptions like C mode, for confirmation.

>
> Then I tried build gdb again without build-with-cxx, and this error
> disappear, gdb works as expect, at least for simple hello world.
>
> Cross-reference: feature request for gdb-git package in MSYS2 [2]
>
> [1] https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-gdb-git
> [2] https://github.com/Alexpux/MINGW-packages/issues/862
>
>
>

Thanks,
Pedro Alves