apps/elftosb/common/SRecordSourceFile.h
/*
* File: SRecordSourceFile.h
*
* Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
* See included license file for license details.
*/
#if !defined(_SRecordSourceFile_h_)
#define _SRecordSourceFile_h_
#include "SourceFile.h"
#include "StSRecordFile.h"
#include "StExecutableImage.h"
namespace elftosb
{
class SRecordSourceFile : public SourceFile
{
public:
SRecordSourceFile(const std::string &path);
virtual ~SRecordSourceFile() {}
static bool isSRecordFile(std::istream &stream);
virtual void open();
virtual void close();
virtual bool supportsNamedSections() const { return false; }
virtual bool supportsNamedSymbols() const { return false; }
virtual DataSource *createDataSource();
virtual bool hasEntryPoint();
virtual uint32_t getEntryPointAddress();
protected:
StSRecordFile *m_file;
StExecutableImage *m_image;
bool m_hasEntryRecord;
StSRecordFile::SRecord m_entryRecord;
protected:
void buildMemoryImage();
};
}; // namespace elftosb
#endif // _SRecordSourceFile_h_
elftosb::SRecordSourceFile::close
virtual void close()
Closes the file.
Definition: apps/elftosb/common/SRecordSourceFile.cpp:52
elftosb::DataSource
Abstract base class for data sources.
Definition: apps/elftosb/common/DataSource.h:33
StSRecordFile::SRecord
Definition: apps/elftosb/common/StSRecordFile.h:44
elftosb::SRecordSourceFile::hasEntryPoint
virtual bool hasEntryPoint()
Returns true if an entry point was set in the file.
Definition: apps/elftosb/common/SRecordSourceFile.cpp:73
elftosb::SRecordSourceFile::m_hasEntryRecord
bool m_hasEntryRecord
Whether an S7,8,9 record was found.
Definition: apps/elftosb/common/SRecordSourceFile.h:71
StSRecordFile
S-record parser.
Definition: apps/elftosb/common/StSRecordFile.h:38
StExecutableImage
Used to build a representation of memory regions.
Definition: apps/elftosb/common/StExecutableImage.h:27
elftosb::SRecordSourceFile::open
virtual void open()
Opens the file.
Definition: apps/elftosb/common/SRecordSourceFile.cpp:35
elftosb::SRecordSourceFile::isSRecordFile
static bool isSRecordFile(std::istream &stream)
Test whether the stream contains a valid S-record file.
Definition: apps/elftosb/common/SRecordSourceFile.cpp:29
elftosb
Definition: BootImage.h:13
elftosb::SRecordSourceFile::getEntryPointAddress
virtual uint32_t getEntryPointAddress()
Returns the entry point address.
Definition: apps/elftosb/common/SRecordSourceFile.cpp:84
elftosb::SourceFile
Abstract base class for a source file containing executable code.
Definition: apps/elftosb/common/SourceFile.h:33
elftosb::SRecordSourceFile::createDataSource
virtual DataSource * createDataSource()
Returns data source for the entire file.
Definition: apps/elftosb/common/SRecordSourceFile.cpp:65
elftosb::SRecordSourceFile
Executable file in the Motorola S-record format.
Definition: apps/elftosb/common/SRecordSourceFile.h:27
elftosb::SRecordSourceFile::m_file
StSRecordFile * m_file
S-record parser instance.
Definition: apps/elftosb/common/SRecordSourceFile.h:69
elftosb::SRecordSourceFile::m_image
StExecutableImage * m_image
Memory image of the S-record file.
Definition: apps/elftosb/common/SRecordSourceFile.h:70
elftosb::SRecordSourceFile::SRecordSourceFile
SRecordSourceFile(const std::string &path)
Default constructor.
Definition: apps/elftosb/common/SRecordSourceFile.cpp:22
elftosb::SRecordSourceFile::buildMemoryImage
void buildMemoryImage()
Build memory image of the S-record file.
Definition: apps/elftosb/common/SRecordSourceFile.cpp:106
elftosb::SRecordSourceFile::~SRecordSourceFile
virtual ~SRecordSourceFile()
Destructor.
Definition: apps/elftosb/common/SRecordSourceFile.h:34
elftosb::SRecordSourceFile::m_entryRecord
StSRecordFile::SRecord m_entryRecord
Record for the entry point.
Definition: apps/elftosb/common/SRecordSourceFile.h:72