This is the mail archive of the gcc-help@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]

Declaring a function from gcc internals


Hi,

We are always working on implementing SEH exceptions on a arm
cross-compiler so we have started to add parser recognition for __try
,__except __finally keyword (resp. RID_SEH_TRY, RID_SEH_EXCEPT,
RID_SEH_FINALLY)

We have also declared the following new functions :
extern void c_begin_seh_try_stmt (location_t, tree);
extern tree c_finish_seh_try_stmt (void);
extern void c_begin_except_clause (tree);
extern void c_finish_except_clause (void);

Now let's consider the following sample code :

int _tmain(int argc, _TCHAR* argv[])
{
  DWORD* ptr = NULL;   // NULL pointer

      __try
      {
            puts("in try");
            *ptr = 0x4242;    // causes an access violation exception;
      }
      __except(puts("in filter"), EXCEPTION_EXECUTE_HANDLER)
      {
            puts("in except");
      }
      return 0;
}

What we need now is to parse the __except (easy) 






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