this is a more "clean" conversion to 64 bit than the type-fixups branch, which does borrow some elements from it but has far less find and replace...it is about 98-99% done, notes to follow later

This commit is contained in:
DarthArgus
2017-01-24 03:35:59 +00:00
parent 42b949c3dc
commit 36686348e9
458 changed files with 2282 additions and 2367 deletions
@@ -379,8 +379,8 @@ static bool dwarfSearch(char const *dwarfLines, unsigned int linesLength, void c
if (valid)
{
unsigned int addrOffset = 0;
if (progAddr < reinterpret_cast<unsigned int>(info.dli_fbase))
addrOffset = reinterpret_cast<unsigned int>(info.dli_fbase);
if (progAddr < reinterpret_cast<uintptr_t>(info.dli_fbase))
addrOffset = reinterpret_cast<uintptr_t>(info.dli_fbase);
const void *testAddr = reinterpret_cast<const void *>(progAddr+addrOffset);
if (testAddr >= addr)
{
@@ -461,7 +461,7 @@ struct Stab
unsigned int n_strx; // index into string table
unsigned char n_type; // type of stab entry
char n_other;
unsigned short n_desc; // for N_SLINE entries, line number
uint16_t n_desc; // for N_SLINE entries, line number
unsigned int n_value; // value of symbol
};
@@ -503,12 +503,12 @@ static bool stabSearch(Stab const *stab, unsigned int stabSize, char const *stab
if (reinterpret_cast<void const *>(stab->n_value) > info.dli_fbase)
funcBase = reinterpret_cast<void const *>(stab->n_value);
else
funcBase = reinterpret_cast<void const *>(reinterpret_cast<unsigned int>(info.dli_fbase)+stab->n_value);
funcBase = reinterpret_cast<void const *>(reinterpret_cast<uintptr_t>(info.dli_fbase)+stab->n_value);
foundSrcLine = -1;
}
else if (stab->n_type == N_SLINE && addr >= funcBase) // source line
{
if (stab->n_value < reinterpret_cast<unsigned int>(addr)-reinterpret_cast<unsigned int>(funcBase))
if (stab->n_value < reinterpret_cast<uintptr_t>(addr)-reinterpret_cast<uintptr_t>(funcBase))
foundSrcLine = stab->n_desc;
else
{
@@ -582,10 +582,10 @@ void DataLint::addFilePath(char const *filePath)
++longPath;
++longPath;
++longPath;
char *shortPath = &text[0];
char *int16_tPath = &text[0];
*seperator = '\0';
m_assetList->push_back(std::make_pair(shortPath, longPath));
m_assetList->push_back(std::make_pair(int16_tPath, longPath));
}
}
@@ -8,6 +8,8 @@
#ifndef REMOTE_DEBUG_H
#define REMOTE_DEBUG_H
#include <stdint.h>
// ======================================================================
/** This class is both a platform and network-protocol independent way of
@@ -69,9 +71,9 @@ public:
protected:
//define typdefs of function types
typedef void (*RemoveFunction)();
typedef void (*OpenFunction)(const char *server, uint16 port);
typedef void (*OpenFunction)(const char *server, uint16_t port);
typedef void (*CloseFunction)();
typedef void (*SendFunction)(void *buffer, uint32 bufferLen);
typedef void (*SendFunction)(void *buffer, uint32_t bufferLen);
typedef void (*IsReadyFunction)();
typedef void (*UpFunction)();
@@ -92,7 +94,7 @@ public:
static void install(RemoveFunction, OpenFunction, CloseFunction, SendFunction, IsReadyFunction);
///open a session
static void open(const char *server = nullptr, uint16 port = 0);
static void open(const char *server = nullptr, uint16_t port = 0);
///packs the data into a packet, and sends it using the client-defined SendFunction
static void send(MESSAGE_TYPE type, const char* name = "");
@@ -101,7 +103,7 @@ public:
static void translateVarArgs(const char *format, ...);
///register a variable with the system
static uint32 registerVariable(const char* variableName, void *memLoc, VARIABLE_TYPES type, bool sendToClients);
static uint32_t registerVariable(const char* variableName, void *memLoc, VARIABLE_TYPES type, bool sendToClients);
///send the variable value to the clients
static void updateVariable(const char* variableName);
@@ -135,10 +137,10 @@ protected:
static void remove();
///store the stream in a map, use an int for network communication
static uint32 registerStream(const std::string& streamName);
static uint32_t registerStream(const std::string& streamName);
///store the static view in a map, use an int for network communication
static uint32 registerStaticView(const std::string& staticViewName);
static uint32_t registerStaticView(const std::string& staticViewName);
///find and return the stream number for a given stream name, -1 if not found
static int32 findStream(const std::string& name);
@@ -159,15 +161,15 @@ protected:
static SendFunction ms_sendFunction;
static IsReadyFunction ms_isReadyFunction;
typedef std::map<uint32, Channel *> StreamMap;
typedef std::map<uint32_t , Channel *> StreamMap;
///stream names
static StreamMap *ms_streams;
typedef std::map<uint32, Channel *> VariableMap;
typedef std::map<uint32_t , Channel *> VariableMap;
///What variables are registered
static VariableMap *ms_variables;
typedef std::map<uint32, Channel *> StaticViewMap;
typedef std::map<uint32_t , Channel *> StaticViewMap;
///StaticView names
static StaticViewMap *ms_staticViews;
@@ -184,24 +186,24 @@ protected:
static bool ms_opened;
///What streaming channels are squelched (i.e. don't send to client at all)
static std::map<uint32, bool> *ms_squelchedStream;
static std::map<uint32_t , bool> *ms_squelchedStream;
///What static channels are squelched (i.e. don't send to client at all)
static std::map<uint32, bool> *ms_squelchedStatic;
static std::map<uint32_t , bool> *ms_squelchedStatic;
///the next stream number
static uint32 ms_nextStream;
static uint32_t ms_nextStream;
///the next variable number
static uint32 ms_nextVariable;
static uint32_t ms_nextVariable;
///the next staticView number
static uint32 ms_nextStaticView;
static uint32_t ms_nextStaticView;
typedef std::map<uint32, Variable *> VariableValueMap;
typedef std::map<uint32_t , Variable *> VariableValueMap;
static VariableValueMap *ms_variableValues;
typedef std::map<uint32, UpFunction> MovementFunctionMap;
typedef std::map<uint32_t , UpFunction> MovementFunctionMap;
static MovementFunctionMap *ms_upFunctionMap;
static MovementFunctionMap *ms_downFunctionMap;
static MovementFunctionMap *ms_leftFunctionMap;
@@ -626,19 +626,19 @@ bool DebugHelp::writeMiniDump(char const *miniDumpFileName, PEXCEPTION_POINTERS
return false;
// get the file name without the path
const char *shortProgramName = strrchr(programName, '\\');
if (shortProgramName)
++shortProgramName;
const char *int16_tProgramName = strrchr(programName, '\\');
if (int16_tProgramName)
++int16_tProgramName;
else
shortProgramName = programName;
int16_tProgramName = programName;
// lop off the extension
char *dot = const_cast<char *>(strchr(shortProgramName, '.'));
char *dot = const_cast<char *>(strchr(int16_tProgramName, '.'));
if (dot)
*dot = '\0';
// create a reasonable minidump filename
snprintf(buffer, sizeof(buffer), "%s_%d.mdmp", shortProgramName, static_cast<int>(GetCurrentProcessId()));
snprintf(buffer, sizeof(buffer), "%s_%d.mdmp", int16_tProgramName, static_cast<int>(GetCurrentProcessId()));
miniDumpFileName = buffer;
}