Skip to content

Commit

Permalink
addresses represented with 64 bits
Browse files Browse the repository at this point in the history
  • Loading branch information
pruzko committed Apr 20, 2019
1 parent a7a104c commit 135a99c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
30 changes: 15 additions & 15 deletions include/retdec/fileformat/types/tls_info/tls_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ namespace fileformat {
class TlsInfo
{
private:
std::vector<std::uint32_t> callBacks; ///< addresses of callback functions
std::uint32_t rawDataStartAddr; ///< start address of raw data
std::uint32_t rawDataEndAddr; ///< end address of raw data
std::uint32_t indexAddr; ///< address of index
std::uint32_t callBacksAddr; ///< address of array of callbacks
std::vector<std::uint64_t> callBacks; ///< addresses of callback functions
std::uint64_t rawDataStartAddr; ///< start address of raw data
std::uint64_t rawDataEndAddr; ///< end address of raw data
std::uint64_t indexAddr; ///< address of index
std::uint64_t callBacksAddr; ///< address of array of callbacks
std::uint32_t zeroFillSize; ///< size of zero fill
std::uint32_t characteristics; ///< characteristics
bool rawDataStartAddrValid; ///< member validity flag
Expand All @@ -38,28 +38,28 @@ class TlsInfo

/// @name Getters
/// @{
bool getRawDataStartAddr(std::uint32_t &res) const;
bool getRawDataEndAddr(std::uint32_t &res) const;
bool getIndexAddr(std::uint32_t &res) const;
bool getCallBacksAddr(std::uint32_t &res) const;
bool getRawDataStartAddr(std::uint64_t &res) const;
bool getRawDataEndAddr(std::uint64_t &res) const;
bool getIndexAddr(std::uint64_t &res) const;
bool getCallBacksAddr(std::uint64_t &res) const;
bool getZeroFillSize(std::uint32_t &res) const;
bool getCharacteristics(std::uint32_t &res) const;
const std::vector<std::uint32_t> &getCallBacks() const;
const std::vector<std::uint64_t> &getCallBacks() const;
/// @}

/// @name Setters
/// @{
void setRawDataStartAddr(std::uint32_t sAddr);
void setRawDataEndAddr(std::uint32_t eAddr);
void setIndexAddr(std::uint32_t iAddr);
void setCallBacksAddr(std::uint32_t cbAddr);
void setRawDataStartAddr(std::uint64_t sAddr);
void setRawDataEndAddr(std::uint64_t eAddr);
void setIndexAddr(std::uint64_t iAddr);
void setCallBacksAddr(std::uint64_t cbAddr);
void setZeroFillSize(std::uint32_t zFill);
void setCharacteristics(std::uint32_t chars);
/// @}

/// @name Other methods
/// @{
void addCallBack(std::uint32_t cb);
void addCallBack(std::uint64_t cb);
/// @}
};

Expand Down
20 changes: 10 additions & 10 deletions src/fileformat/types/tls_info/tls_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TlsInfo::~TlsInfo()
* @param res Variable to store the result to
* @return @c true on success, @c false otherwise
*/
bool TlsInfo::getRawDataStartAddr(std::uint32_t &res) const
bool TlsInfo::getRawDataStartAddr(std::uint64_t &res) const
{
if (!rawDataStartAddrValid)
{
Expand All @@ -50,7 +50,7 @@ bool TlsInfo::getRawDataStartAddr(std::uint32_t &res) const
* @param res Variable to store the result to
* @return @c true on success, @c false otherwise
*/
bool TlsInfo::getRawDataEndAddr(std::uint32_t &res) const
bool TlsInfo::getRawDataEndAddr(std::uint64_t &res) const
{
if (!rawDataEndAddrValid)
{
Expand All @@ -65,7 +65,7 @@ bool TlsInfo::getRawDataEndAddr(std::uint32_t &res) const
* @param res Variable to store the result to
* @return @c true on success, @c false otherwise
*/
bool TlsInfo::getIndexAddr(std::uint32_t &res) const
bool TlsInfo::getIndexAddr(std::uint64_t &res) const
{
if (!indexAddrValid)
{
Expand All @@ -80,7 +80,7 @@ bool TlsInfo::getIndexAddr(std::uint32_t &res) const
* @param res Variable to store the result to
* @return @c true on success, @c false otherwise
*/
bool TlsInfo::getCallBacksAddr(std::uint32_t &res) const
bool TlsInfo::getCallBacksAddr(std::uint64_t &res) const
{
if (!callBacksAddrValid)
{
Expand Down Expand Up @@ -124,7 +124,7 @@ bool TlsInfo::getCharacteristics(std::uint32_t &res) const
* Get addresses of callbacks
* @return Addresses of callbacks
*/
const std::vector<std::uint32_t> &TlsInfo::getCallBacks() const
const std::vector<std::uint64_t> &TlsInfo::getCallBacks() const
{
return callBacks;
}
Expand All @@ -133,7 +133,7 @@ const std::vector<std::uint32_t> &TlsInfo::getCallBacks() const
* Set start of raw data address
* @param sAddr start of raw data address to set
*/
void TlsInfo::setRawDataStartAddr(std::uint32_t sAddr)
void TlsInfo::setRawDataStartAddr(std::uint64_t sAddr)
{
rawDataStartAddr = sAddr;
rawDataStartAddrValid = true;
Expand All @@ -143,7 +143,7 @@ void TlsInfo::setRawDataStartAddr(std::uint32_t sAddr)
* Set end of raw data address
* @param eAddr end of raw data address to set
*/
void TlsInfo::setRawDataEndAddr(std::uint32_t eAddr)
void TlsInfo::setRawDataEndAddr(std::uint64_t eAddr)
{
rawDataEndAddr = eAddr;
rawDataEndAddrValid = true;
Expand All @@ -153,7 +153,7 @@ void TlsInfo::setRawDataEndAddr(std::uint32_t eAddr)
* Set address of index
* @param iAddr address of index to set
*/
void TlsInfo::setIndexAddr(std::uint32_t iAddr)
void TlsInfo::setIndexAddr(std::uint64_t iAddr)
{
indexAddr = iAddr;
indexAddrValid = true;
Expand All @@ -163,7 +163,7 @@ void TlsInfo::setIndexAddr(std::uint32_t iAddr)
* Set address of callbacks
* @param cbAddr address of callbacks to set
*/
void TlsInfo::setCallBacksAddr(std::uint32_t cbAddr)
void TlsInfo::setCallBacksAddr(std::uint64_t cbAddr)
{
callBacksAddr = cbAddr;
callBacksAddrValid = true;
Expand Down Expand Up @@ -193,7 +193,7 @@ void TlsInfo::setCharacteristics(std::uint32_t chars)
* Add callback
* @param cb Callback to add
*/
void TlsInfo::addCallBack(std::uint32_t cb)
void TlsInfo::addCallBack(std::uint64_t cb)
{
callBacks.push_back(cb);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ TlsInfo::~TlsInfo()
*/
std::string TlsInfo::getRawDataStartAddrStr(std::ios_base &(* format)(std::ios_base &)) const
{
std::uint32_t val;
std::uint64_t val;
return (tlsInfo && tlsInfo->getRawDataStartAddr(val)) ? getNumberAsString(val, format) : "";
}

Expand All @@ -43,7 +43,7 @@ std::string TlsInfo::getRawDataStartAddrStr(std::ios_base &(* format)(std::ios_b
*/
std::string TlsInfo::getRawDataEndAddrStr(std::ios_base &(* format)(std::ios_base &)) const
{
std::uint32_t val;
std::uint64_t val;
return (tlsInfo && tlsInfo->getRawDataEndAddr(val)) ? getNumberAsString(val, format) : "";
}

Expand All @@ -54,7 +54,7 @@ std::string TlsInfo::getRawDataEndAddrStr(std::ios_base &(* format)(std::ios_bas
*/
std::string TlsInfo::getIndexAddrStr(std::ios_base &(* format)(std::ios_base &)) const
{
std::uint32_t val;
std::uint64_t val;
return (tlsInfo && tlsInfo->getIndexAddr(val)) ? getNumberAsString(val, format) : "";
}

Expand All @@ -65,7 +65,7 @@ std::string TlsInfo::getIndexAddrStr(std::ios_base &(* format)(std::ios_base &))
*/
std::string TlsInfo::getCallBacksAddrStr(std::ios_base &(* format)(std::ios_base &)) const
{
std::uint32_t val;
std::uint64_t val;
return (tlsInfo && tlsInfo->getCallBacksAddr(val)) ? getNumberAsString(val, format) : "";
}

Expand Down

0 comments on commit 135a99c

Please sign in to comment.