OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
TPEF::DebugStabElem Class Reference

#include <DebugStabElem.hh>

Inheritance diagram for TPEF::DebugStabElem:
Inheritance graph
Collaboration diagram for TPEF::DebugStabElem:
Collaboration graph

Public Member Functions

 DebugStabElem (std::vector< Byte > &data)
 
 DebugStabElem (Byte stabType, Byte other, HalfWord description, Word value)
 
virtual ~DebugStabElem ()
 
virtual ElementType type () const
 
virtual Byte byte (Word index) const
 
virtual Word length () const
 
Byte stabType () const
 
Byte other () const
 
HalfWord description () const
 
Word value () const
 
- Public Member Functions inherited from TPEF::DebugElement
 DebugElement ()
 
virtual ~DebugElement ()
 
ChunkdebugString () const
 
void setDebugString (const ReferenceManager::SafePointer *aString)
 
void setDebugString (Chunk *aString)
 
- Public Member Functions inherited from TPEF::SectionElement
virtual ~SectionElement ()
 
- Public Member Functions inherited from TPEF::SafePointable
virtual ~SafePointable ()
 

Private Attributes

Byte stabType_
 a.out stab type. More...
 
Byte other_
 a.out stab other field. More...
 
HalfWord description_
 a.out stab description field. More...
 
Word value_
 a.out stab value field. More...
 

Additional Inherited Members

- Public Types inherited from TPEF::DebugElement
enum  ElementType { DE_STAB = 0x1 }
 
- Protected Member Functions inherited from TPEF::SectionElement
 SectionElement ()
 
- Protected Member Functions inherited from TPEF::SafePointable
 SafePointable ()
 
- Protected Attributes inherited from TPEF::DebugElement
const ReferenceManager::SafePointerdebugString_
 String of debug element. More...
 

Detailed Description

Stab debug element type.

Definition at line 48 of file DebugStabElem.hh.

Constructor & Destructor Documentation

◆ DebugStabElem() [1/2]

TPEF::DebugStabElem::DebugStabElem ( std::vector< Byte > &  data)

Constructor.

Creates debug element out of data vector, where all the data is stored in big endian format.

This constructor is used when additional data part of debug element is read from data is read from TPEF file to table.

Parameters
dataData vector that is used to initialize a.out stab element.

Definition at line 49 of file DebugStabElem.cc.

50  : DebugElement() {
51 
52  // read element to object
53  stabType_ = data[0];
54  other_ = data[1];
55  description_ = data[2];
56  description_ = (description_ << BYTE_BITWIDTH) | data[3];
57  value_ = data[4];
58  value_ = (value_ << BYTE_BITWIDTH) | data[5];
59  value_ = (value_ << BYTE_BITWIDTH) | data[6];
60  value_ = (value_ << BYTE_BITWIDTH) | data[7];
61 }

References BYTE_BITWIDTH, description_, other_, stabType_, and value_.

◆ DebugStabElem() [2/2]

TPEF::DebugStabElem::DebugStabElem ( Byte  stabType,
Byte  other,
HalfWord  description,
Word  value 
)

Constructor.

Parameters
stabTypeA.out stab's type field.
otherA.out stab's other field.
desscriptionA.out stab's description field.
valueA.out stab's value field.

Definition at line 72 of file DebugStabElem.cc.

◆ ~DebugStabElem()

TPEF::DebugStabElem::~DebugStabElem ( )
virtual

Destructor.

Definition at line 82 of file DebugStabElem.cc.

82  {
83 }

Member Function Documentation

◆ byte()

Byte TPEF::DebugStabElem::byte ( Word  index) const
virtual

Returns one byte of debug element's additional data field.

Parameters
indexWhich data byte is wanted.

Implements TPEF::DebugElement.

Definition at line 92 of file DebugStabElem.cc.

92  {
93  switch (index) {
94  case 0:
95  return stabType_;
96  case 1:
97  return other_;
98  case 2:
99  return description_ >> BYTE_BITWIDTH;
100  case 3:
101  return description_;
102  case 4:
103  return value_ >> (3*BYTE_BITWIDTH);
104  case 5:
105  return value_ >> (2*BYTE_BITWIDTH);
106  case 6:
107  return value_ >> BYTE_BITWIDTH;
108  case 7:
109  return value_;
110  default:
111  throw OutOfRange(__FILE__, __LINE__, __func__,
112  "Stab element contains less data that requested.");
113  }
114 }

References __func__, BYTE_BITWIDTH, description_, other_, stabType_, and value_.

◆ description()

HalfWord TPEF::DebugStabElem::description ( ) const

Returns description field of stored a.out stab symbol.

Returns
Description field of stored a.out stab symbol.

Definition at line 170 of file DebugStabElem.cc.

170  {
171  return description_;
172 }

References description_.

◆ length()

Word TPEF::DebugStabElem::length ( ) const
virtual

Returns additional data length of TPEF debug element.

TPEF debug element for sotring a.out stab symbols contains always 8 bytes of additional data. This element is described in TPEF specification.

Returns
Number of additional data bytes that are stored.

Implements TPEF::DebugElement.

Definition at line 126 of file DebugStabElem.cc.

126  {
127  return 8;
128 }

◆ other()

Byte TPEF::DebugStabElem::other ( ) const

Returns other field of stored a.out stab symbol.

Returns
Other field of stored a.out stab symbol.

Definition at line 159 of file DebugStabElem.cc.

159  {
160  return other_;
161 }

References other_.

◆ stabType()

Byte TPEF::DebugStabElem::stabType ( ) const

Returns type of stored a.out stab symbol.

Returns
Type of stored a.out stab symbol.

Definition at line 148 of file DebugStabElem.cc.

148  {
149  return stabType_;
150 }

References stabType_.

◆ type()

DebugStabElem::ElementType TPEF::DebugStabElem::type ( ) const
virtual

Returns type of TPEF debug element.

Returns
Type of TPEF debug element.

Implements TPEF::DebugElement.

Definition at line 137 of file DebugStabElem.cc.

137  {
138  return DE_STAB;
139 }

References TPEF::DebugElement::DE_STAB.

◆ value()

Word TPEF::DebugStabElem::value ( ) const

Returns value field of stored a.out stab symbol.

Returns
Value field of stored a.out stab symbol.

Definition at line 181 of file DebugStabElem.cc.

181  {
182  return value_;
183 }

References value_.

Member Data Documentation

◆ description_

HalfWord TPEF::DebugStabElem::description_
private

a.out stab description field.

Definition at line 76 of file DebugStabElem.hh.

Referenced by byte(), DebugStabElem(), and description().

◆ other_

Byte TPEF::DebugStabElem::other_
private

a.out stab other field.

Definition at line 74 of file DebugStabElem.hh.

Referenced by byte(), DebugStabElem(), and other().

◆ stabType_

Byte TPEF::DebugStabElem::stabType_
private

a.out stab type.

Definition at line 72 of file DebugStabElem.hh.

Referenced by byte(), DebugStabElem(), and stabType().

◆ value_

Word TPEF::DebugStabElem::value_
private

a.out stab value field.

Definition at line 78 of file DebugStabElem.hh.

Referenced by byte(), DebugStabElem(), and value().


The documentation for this class was generated from the following files:
TPEF::DebugStabElem::other
Byte other() const
Definition: DebugStabElem.cc:159
TPEF::DebugElement::DebugElement
DebugElement()
Definition: DebugElement.cc:43
OutOfRange
Definition: Exception.hh:320
TPEF::DebugElement::DE_STAB
@ DE_STAB
Definition: DebugElement.hh:59
TPEF::DebugStabElem::description
HalfWord description() const
Definition: DebugStabElem.cc:170
TPEF::DebugStabElem::description_
HalfWord description_
a.out stab description field.
Definition: DebugStabElem.hh:76
TPEF::DebugStabElem::stabType_
Byte stabType_
a.out stab type.
Definition: DebugStabElem.hh:72
TPEF::DebugStabElem::stabType
Byte stabType() const
Definition: DebugStabElem.cc:148
__func__
#define __func__
Definition: Application.hh:67
TPEF::DebugStabElem::value_
Word value_
a.out stab value field.
Definition: DebugStabElem.hh:78
TPEF::DebugStabElem::other_
Byte other_
a.out stab other field.
Definition: DebugStabElem.hh:74
BYTE_BITWIDTH
const Byte BYTE_BITWIDTH
Definition: BaseType.hh:136
TPEF::DebugStabElem::value
Word value() const
Definition: DebugStabElem.cc:181