LineInformation.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #if ! defined( LINE_INFORMATION_H )
00032 #define LINE_INFORMATION_H
00033
00034 #include "symutil.h"
00035 #include "RangeLookup.h"
00036 #include "Serialization.h"
00037 #include "Annotatable.h"
00038 #include "Module.h"
00039
00040 #define NEW_GETSOURCELINES_INTERFACE
00041
00042 namespace Dyninst{
00043 namespace SymtabAPI{
00044
00045 class LineInformation : public AnnotationContainer<Statement>,
00046 private RangeLookup< Statement, Statement::StatementLess >
00047 {
00048 SYMTAB_EXPORT bool addItem_impl(Statement);
00049 SYMTAB_EXPORT Serializable *ac_serialize_impl(SerializerBase *, const char * = "lineInformation") THROW_SPEC (SerializerError);
00050 public:
00051 typedef RangeLookup< Statement, Statement::StatementLess >::const_iterator const_iterator;
00052 typedef RangeLookup< Statement, Statement::StatementLess >::AddressRange AddressRange;
00053
00054 SYMTAB_EXPORT LineInformation();
00055
00056
00057 SYMTAB_EXPORT bool addLine( const char * lineSource,
00058 unsigned int lineNo,
00059 unsigned int lineOffset,
00060 Offset lowInclusiveAddr,
00061 Offset highExclusiveAddr );
00062
00063 SYMTAB_EXPORT void addLineInfo(LineInformation *lineInfo);
00064
00065 SYMTAB_EXPORT bool addAddressRange( Offset lowInclusiveAddr,
00066 Offset highExclusiveAddr,
00067 const char * lineSource,
00068 unsigned int lineNo,
00069 unsigned int lineOffset = 0 );
00070
00071
00072 SYMTAB_EXPORT bool getSourceLines( Offset addressInRange, std::vector< Statement *> & lines );
00073 SYMTAB_EXPORT bool getSourceLines( Offset addressInRange, std::vector< LineNoTuple > & lines);
00074
00075 SYMTAB_EXPORT bool getAddressRanges( const char * lineSource, unsigned int LineNo, std::vector< AddressRange > & ranges );
00076
00077 SYMTAB_EXPORT const_iterator begin() const;
00078 SYMTAB_EXPORT const_iterator end() const;
00079 SYMTAB_EXPORT unsigned getSize() const;
00080
00081 SYMTAB_EXPORT ~LineInformation();
00082
00083 protected:
00084
00085
00086
00087
00088
00089
00090 unsigned size_;
00091 };
00092
00093 }
00094 }
00095
00096 #endif