[gvd-devel] Implementation file which does #include "somefile.cxx" is problem for GVD during expanding.browsing

eize.slange@philips.com eize.slange@philips.com
Mon, 5 May 2003 16:22:46 +0200


Hello all,

Before starting I would like to send you all a big thumb up for GVD. We're using it (on Win2k platform) to debug our embedded software running on a MIPS processor with VxWorks (using GDB as 'stupid' debugger).
Currently using version GVD 1.2.5 on Windows platform on top of GDB compiled for MIPS-target.

We've encountered a problem which I want to share it with you. We've solved the problem for us by modifying OUR code...

In our development project we're using the OpenSource PWLIB (Portable Windows Library -> www.openh323.org) as a building block. Some source-files (.CXX-files) do an include of other .CXX-files for platform depended parts (in stead of normally including
header-files). We've had a lot of trouble with GVD because it entered sometimes a infinite loop when it tries to expand-and-show the sources.

Example code (taken from PWLib-project)

   file: tlib.cxx (in UNIX-branche)
   --------------------------------

      // GVD_DEV => Cut all code almost to end from file
      // The compiler-switch VX_TASKS is active

      //////////////////////////////////////
      //
      //  Non-PTHREAD based routines
      //

      #if defined(P_MAC_MPTHREADS)
      #include "tlibmpthrd.cxx"
      #elif defined(P_PTHREADS)
      #include "tlibthrd.cxx"
      #elif defined(BE_THREADS)
      #include "tlibbe.cxx"
      #elif defined(VX_TASKS)
      // The task based thread created by julian
      #include "tlibvx.cxx"
      #else
      #include "tlibcoop.cxx"
      #endif
   <EOF>

   file: tlibvx.cxx
   ----------------
      /*
       * tlibvx.cxx
       *
       * Thread library implementation for VxWorks
      */
         class PProcess;
         class PSemaphore;

         #include <ptlib.h>

         #define VX_LOWEST_PRIORITY          250
         #define VX_LOW_PRIORITY             200
         #define VX_NORMAL_PRIORITY          150
         #define VX_DISPLAY_PRIORITY         100
         #define VX_URGENT_DISPLAY_PRIORITY  50

         /////////////////////////////////////////
         // Threads
         static int const priorities[] = {
           VX_LOWEST_PRIORITY,
           VX_LOW_PRIORITY,
           VX_NORMAL_PRIORITY,
           VX_DISPLAY_PRIORITY,
           VX_URGENT_DISPLAY_PRIORITY
         };

         int PThread::ThreadFunction(void *threadPtr)
         {
            PAssertNULL(threadPtr);

            PThread * thread = (PThread *)threadPtr;

      // GVD_DEV => Cut remaining lines from file
   <EOF>

We've solved our problem by adding replacing the #include "tlibvc.cxx" with the contents of the whole file. Not the nicest solution, but with a deadline in front...
Maybe this is a known issue. A log is included since even --log-level4 did not provide realy usable information (in my eyes as developer). If required I can create a new log for you.

With regards,

Eize