src/share/vm/adlc/filebuff.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hs-6771309 Sdiff src/share/vm/adlc

src/share/vm/adlc/filebuff.hpp

Print this page
rev 461 : Fixed 6771309: debugging AD files is difficult without #line directives in generated code
Summary: more and better #line and #define directives in the generated code; ADLC itself accepts #line directives
Reviewed-by: never, kvn


  51 
  52   int   _err;                   // Error flag for file seek/read operations
  53   long  _filepos;               // Current offset from start of file
  54   int   _linenum;
  55 
  56   ArchDesc& _AD;                // Reference to Architecture Description
  57 
  58   // Error reporting function
  59   void file_error(int flag, int linenum, const char *fmt, ...);
  60 
  61  public:
  62   const BufferedFile *_fp;           // File to be buffered
  63 
  64   FileBuff(BufferedFile *fp, ArchDesc& archDesc); // Constructor
  65   ~FileBuff();                  // Destructor
  66 
  67   // This returns a pointer to the start of the current line in the buffer,
  68   // and increments bufeol and filepos to point at the end of that line.
  69   char *get_line(void);
  70   int linenum() const { return _linenum; }

  71 
  72   // This converts a pointer into the buffer to a file offset.  It only works
  73   // when the pointer is valid (i.e. just obtained from getline()).
  74   int getoff(const char *s) { return _bufoff+(int)(s-_buf); }
  75 };
  76 
  77 //------------------------------FileBuffRegion---------------------------------
  78 // A buffer region is really a region of some file, specified as a linked list
  79 // of offsets and lengths.  These regions can be merged; overlapping regions
  80 // will coalesce.
  81 class FileBuffRegion {
  82  public:                        // Workaround dev-studio friend/private bug
  83   FileBuffRegion *_next;        // Linked list of regions sorted by offset.
  84  private:
  85   FileBuff       *_bfr;         // The Buffer of the file
  86   int _offset, _length;         // The file area
  87   int             _sol;         // Start of line where the file area starts
  88   int             _line;        // First line of region
  89 
  90  public:


  51 
  52   int   _err;                   // Error flag for file seek/read operations
  53   long  _filepos;               // Current offset from start of file
  54   int   _linenum;
  55 
  56   ArchDesc& _AD;                // Reference to Architecture Description
  57 
  58   // Error reporting function
  59   void file_error(int flag, int linenum, const char *fmt, ...);
  60 
  61  public:
  62   const BufferedFile *_fp;           // File to be buffered
  63 
  64   FileBuff(BufferedFile *fp, ArchDesc& archDesc); // Constructor
  65   ~FileBuff();                  // Destructor
  66 
  67   // This returns a pointer to the start of the current line in the buffer,
  68   // and increments bufeol and filepos to point at the end of that line.
  69   char *get_line(void);
  70   int linenum() const { return _linenum; }
  71   void set_linenum(int line) { _linenum = line; }
  72 
  73   // This converts a pointer into the buffer to a file offset.  It only works
  74   // when the pointer is valid (i.e. just obtained from getline()).
  75   int getoff(const char *s) { return _bufoff+(int)(s-_buf); }
  76 };
  77 
  78 //------------------------------FileBuffRegion---------------------------------
  79 // A buffer region is really a region of some file, specified as a linked list
  80 // of offsets and lengths.  These regions can be merged; overlapping regions
  81 // will coalesce.
  82 class FileBuffRegion {
  83  public:                        // Workaround dev-studio friend/private bug
  84   FileBuffRegion *_next;        // Linked list of regions sorted by offset.
  85  private:
  86   FileBuff       *_bfr;         // The Buffer of the file
  87   int _offset, _length;         // The file area
  88   int             _sol;         // Start of line where the file area starts
  89   int             _line;        // First line of region
  90 
  91  public:
src/share/vm/adlc/filebuff.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File