Kinetis Bootloader Host  2.0.0
Host Tools for Kinetis devices
elftosb::MemoryImageDataSource::TextSegment Class Reference

Segment corresponding to a text region of the executable image. More...

#include <DataSource.h>

+ Inheritance diagram for elftosb::MemoryImageDataSource::TextSegment:
+ Collaboration diagram for elftosb::MemoryImageDataSource::TextSegment:

Public Member Functions

 TextSegment (MemoryImageDataSource &source, StExecutableImage *image, unsigned index)
 Default constructor.
 
virtual unsigned getData (unsigned offset, unsigned maxBytes, uint8_t *buffer)
 Gets all or a portion of the segment's data. More...
 
virtual unsigned getLength ()
 Gets the length of the segment's data.
 
virtual bool hasNaturalLocation ()
 Returns whether the segment has an associated address.
 
virtual uint32_t getBaseAddress ()
 Returns the address associated with the segment.
 
- Public Member Functions inherited from elftosb::DataSource::Segment
 Segment (DataSource &source)
 Default constructor.
 
virtual ~Segment ()
 Destructor.
 

Protected Attributes

StExecutableImagem_image
 Coalesced image of the file.
 
unsigned m_index
 Record index.
 
- Protected Attributes inherited from elftosb::DataSource::Segment
DataSourcem_source
 The data source to which this segment belongs.
 

Detailed Description

Segment corresponding to a text region of the executable image.

Member Function Documentation

unsigned MemoryImageDataSource::TextSegment::getData ( unsigned  offset,
unsigned  maxBytes,
uint8_t *  buffer 
)
virtual

Gets all or a portion of the segment's data.

The data is copied into buffer. Up to maxBytes bytes may be copied, so buffer must be at least that large.

Parameters
offsetIndex of the first byte to start copying from.
maxBytesThe maximum number of bytes that can be returned. buffer must be at least this large.
bufferPointer to buffer where the data is copied.
Returns
The number of bytes copied into buffer.

Implements elftosb::DataSource::Segment.


The documentation for this class was generated from the following files: