This is the mail archive of the gdb@sources.redhat.com 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: RFC: DW_TAG_try_block


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);
    }
}


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