More fixes.
This commit is contained in:
parent
8e0382d2f0
commit
13c8e7208e
|
@ -332,7 +332,7 @@ const char *elfGetAddressSymbol(u32 addr)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool elfFindLineInModule(u32 *addr, char *name, int line)
|
bool elfFindLineInModule(u32 *addr, const char *name, int line)
|
||||||
{
|
{
|
||||||
CompileUnit *unit = elfCompileUnits;
|
CompileUnit *unit = elfCompileUnits;
|
||||||
|
|
||||||
|
@ -366,7 +366,7 @@ bool elfFindLineInModule(u32 *addr, char *name, int line)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int elfFindLine(CompileUnit *unit, Function * /* func */, u32 addr, char **f)
|
int elfFindLine(CompileUnit *unit, Function * /* func */, u32 addr, const char **f)
|
||||||
{
|
{
|
||||||
int currentLine = -1;
|
int currentLine = -1;
|
||||||
if(unit->hasLineInfo) {
|
if(unit->hasLineInfo) {
|
||||||
|
@ -480,7 +480,7 @@ const char *elfGetSymbol(int i, u32 *value, u32 *size, int *type)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool elfGetSymbolAddress(char *sym, u32 *addr, u32 *size, int *type)
|
bool elfGetSymbolAddress(const char *sym, u32 *addr, u32 *size, int *type)
|
||||||
{
|
{
|
||||||
if(elfSymbolsCount) {
|
if(elfSymbolsCount) {
|
||||||
for(int i = 0; i < elfSymbolsCount; i++) {
|
for(int i = 0; i < elfSymbolsCount; i++) {
|
||||||
|
|
12
src/elf.h
12
src/elf.h
|
@ -164,7 +164,7 @@ struct Enum {
|
||||||
struct Type {
|
struct Type {
|
||||||
u32 offset;
|
u32 offset;
|
||||||
TypeEnum type;
|
TypeEnum type;
|
||||||
char *name;
|
const char *name;
|
||||||
int encoding;
|
int encoding;
|
||||||
int size;
|
int size;
|
||||||
int bitSize;
|
int bitSize;
|
||||||
|
@ -258,7 +258,7 @@ struct DebugInfo {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Symbol {
|
struct Symbol {
|
||||||
char *name;
|
const char *name;
|
||||||
int type;
|
int type;
|
||||||
int binding;
|
int binding;
|
||||||
u32 address;
|
u32 address;
|
||||||
|
@ -269,15 +269,15 @@ struct Symbol {
|
||||||
extern u32 elfReadLEB128(u8 *, int *);
|
extern u32 elfReadLEB128(u8 *, int *);
|
||||||
extern s32 elfReadSignedLEB128(u8 *, int *);
|
extern s32 elfReadSignedLEB128(u8 *, int *);
|
||||||
extern bool elfRead(const char *, int &, FILE *f);
|
extern bool elfRead(const char *, int &, FILE *f);
|
||||||
extern bool elfGetSymbolAddress(char *,u32 *, u32 *, int *);
|
extern bool elfGetSymbolAddress(const char *,u32 *, u32 *, int *);
|
||||||
extern const char *elfGetAddressSymbol(u32);
|
extern const char *elfGetAddressSymbol(u32);
|
||||||
extern const char *elfGetSymbol(int, u32 *, u32 *, int *);
|
extern const char *elfGetSymbol(int, u32 *, u32 *, int *);
|
||||||
extern void elfCleanUp();
|
extern void elfCleanUp();
|
||||||
extern bool elfGetCurrentFunction(u32, Function **, CompileUnit **c);
|
extern bool elfGetCurrentFunction(u32, Function **, CompileUnit **c);
|
||||||
extern bool elfGetObject(char *, Function *, CompileUnit *, Object **);
|
extern bool elfGetObject(const char *, Function *, CompileUnit *, Object **);
|
||||||
extern bool elfFindLineInUnit(u32 *, CompileUnit *, int);
|
extern bool elfFindLineInUnit(u32 *, CompileUnit *, int);
|
||||||
extern bool elfFindLineInModule(u32 *, char *, int);
|
extern bool elfFindLineInModule(u32 *, const char *, int);
|
||||||
u32 elfDecodeLocation(Function *, ELFBlock *, LocationType *);
|
u32 elfDecodeLocation(Function *, ELFBlock *, LocationType *);
|
||||||
u32 elfDecodeLocation(Function *, ELFBlock *, LocationType *, u32);
|
u32 elfDecodeLocation(Function *, ELFBlock *, LocationType *, u32);
|
||||||
int elfFindLine(CompileUnit *unit, Function *func, u32 addr, char **);
|
int elfFindLine(CompileUnit *unit, Function *func, u32 addr, const char **);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include "../System.h"
|
#include "../System.h"
|
||||||
#include "../NLS.h"
|
#include "../NLS.h"
|
||||||
#include "GB.h"
|
#include "gb.h"
|
||||||
#include "gbCheats.h"
|
#include "gbCheats.h"
|
||||||
#include "gbGlobals.h"
|
#include "gbGlobals.h"
|
||||||
#include "gbMemory.h"
|
#include "gbMemory.h"
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
#include "gbCheats.h"
|
#include "gbCheats.h"
|
||||||
#include "gbGlobals.h"
|
#include "gbGlobals.h"
|
||||||
#include "GB.h"
|
#include "gb.h"
|
||||||
|
|
||||||
gbCheat gbCheatList[100];
|
gbCheat gbCheatList[100];
|
||||||
int gbCheatNumber = 0;
|
int gbCheatNumber = 0;
|
||||||
|
|
|
@ -25,19 +25,19 @@
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u8 mask;
|
u8 mask;
|
||||||
u8 value;
|
u8 value;
|
||||||
char *mnen;
|
const char *mnen;
|
||||||
} GBOPCODE;
|
} GBOPCODE;
|
||||||
|
|
||||||
#define GB_READ(x) gbMemoryMap[(x)>>12][(x)&0xfff]
|
#define GB_READ(x) gbMemoryMap[(x)>>12][(x)&0xfff]
|
||||||
|
|
||||||
static char *registers[] =
|
static const char *registers[] =
|
||||||
{ "B", "C", "D", "E", "H", "L", "(HL)", "A" };
|
{ "B", "C", "D", "E", "H", "L", "(HL)", "A" };
|
||||||
|
|
||||||
static char *registers16[] =
|
static const char *registers16[] =
|
||||||
{ "BC", "DE", "HL", "SP", // for some operations
|
{ "BC", "DE", "HL", "SP", // for some operations
|
||||||
"BC", "DE", "HL", "AF" }; // for push/pop
|
"BC", "DE", "HL", "AF" }; // for push/pop
|
||||||
|
|
||||||
static char *cond[] =
|
static const char *cond[] =
|
||||||
{ "NZ", "Z", "NC", "C" };
|
{ "NZ", "Z", "NC", "C" };
|
||||||
|
|
||||||
static char hexDigits[16] = {
|
static char hexDigits[16] = {
|
||||||
|
@ -145,7 +145,7 @@ static char *addHex16(char *p, u16 value)
|
||||||
return addHex(p, value & 255);
|
return addHex(p, value & 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *addStr(char *p, char *s)
|
static char *addStr(char *p, const char *s)
|
||||||
{
|
{
|
||||||
while(*s) {
|
while(*s) {
|
||||||
*p++ = *s++;
|
*p++ = *s++;
|
||||||
|
@ -163,7 +163,7 @@ int gbDis(char *buffer, u16 address)
|
||||||
|
|
||||||
u8 opcode = GB_READ(address);
|
u8 opcode = GB_READ(address);
|
||||||
address++;
|
address++;
|
||||||
char *mnen;
|
const char *mnen;
|
||||||
GBOPCODE *op;
|
GBOPCODE *op;
|
||||||
if(opcode == 0xcb) {
|
if(opcode == 0xcb) {
|
||||||
opcode = GB_READ(address);
|
opcode = GB_READ(address);
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include "../Port.h"
|
#include "../Port.h"
|
||||||
#include "gbGlobals.h"
|
#include "gbGlobals.h"
|
||||||
#include "gbMemory.h"
|
#include "gbMemory.h"
|
||||||
#include "GB.h"
|
#include "gb.h"
|
||||||
u8 gbDaysinMonth [12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
u8 gbDaysinMonth [12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||||
const u8 gbDisabledRam [8] = {0x80, 0xff, 0xf0, 0x00, 0x30, 0xbf, 0xbf, 0xbf};
|
const u8 gbDisabledRam [8] = {0x80, 0xff, 0xf0, 0x00, 0x30, 0xbf, 0xbf, 0xbf};
|
||||||
extern int gbHardware;
|
extern int gbHardware;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "../System.h"
|
#include "../System.h"
|
||||||
#include "../Port.h"
|
#include "../Port.h"
|
||||||
#include "../Util.h"
|
#include "../Util.h"
|
||||||
#include "GB.h"
|
#include "gb.h"
|
||||||
#include "gbGlobals.h"
|
#include "gbGlobals.h"
|
||||||
|
|
||||||
extern u8 *pix;
|
extern u8 *pix;
|
||||||
|
|
|
@ -14,9 +14,28 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include "memgzio.h"
|
#include "memgzio.h"
|
||||||
|
|
||||||
|
#ifndef local
|
||||||
|
#define local static
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef DEF_MEM_LEVEL
|
||||||
|
# define DEF_MEM_LEVEL 8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef OS_CODE
|
||||||
|
#define OS_CODE 3
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef zmemcpy
|
||||||
|
#define zmemcpy memcpy
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*struct internal_state {int dummy;};*/ /* for buggy compilers */
|
/*struct internal_state {int dummy;};*/ /* for buggy compilers */
|
||||||
|
|
||||||
#ifndef Z_BUFSIZE
|
#ifndef Z_BUFSIZE
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
#if defined(HAVE_ZUTIL_H) || defined(_WIN32)
|
#if defined(HAVE_ZUTIL_H) || defined(_WIN32)
|
||||||
# include <zutil.h>
|
# include <zutil.h>
|
||||||
|
#else
|
||||||
|
#include <zlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gzFile ZEXPORT memgzopen(char *memory, int, const char *);
|
gzFile ZEXPORT memgzopen(char *memory, int, const char *);
|
||||||
|
|
Loading…
Reference in New Issue