RFC: DW_TAG_try_block

H. J. Lu hjl@lucon.org
Tue May 27 15:19:00 GMT 2003


On Tue, May 27, 2003 at 11:12:12AM -0400, Elena Zannoni wrote:
>  > > How about adding a little test case to the gdb.c++ directory?
>  > > 
>  > 
>  > I can provide a simple C++ code. But you will need Intel C++ compiler to
>  > see the problem. Also the current Intel compiler doesn't support RedHat
>  > 9.
>  > 
> 
> Hmm, maybe just post the example code then.
> 
> elena
> 

When it is compiled by ecc 7.1,

# ecc -g main.cc -o main

The current gdb won't see ni nor n when break points are set in try
and catch blocks.


H.J.
-----
#include <iostream>
#include <stdexcept>

using namespace std;

int main(int argc, char* argv[])
{
    try {

        int ni = 2;
        if (ni)
            cout << "scatt: " << ni << endl;

        throw "Good: ";

        exit(EXIT_SUCCESS);
    } catch(runtime_error& e) {
        cerr << "scatt: runtime error occured.\n";
        exit(EXIT_FAILURE);
    }
    catch (const char *p)
    {
        int n;
        n = 3;
        cerr << p << n << endl;
        exit(EXIT_FAILURE);
    }
}



More information about the Gdb mailing list