libmach, acid, db: 64-bit support

This commit is contained in:
Russ Cox 2012-02-19 18:11:39 -05:00
parent 60d96f2e43
commit 443d628838
36 changed files with 2311 additions and 1125 deletions

View file

@ -192,7 +192,7 @@ struct String
int len;
};
int acidregsrw(Regs*, char*, ulong*, int);
int acidregsrw(Regs*, char*, u64int*, int);
List* addlist(List*, List*);
void addvarsym(Fhdr*);
List* al(int);
@ -263,7 +263,7 @@ String* strnode(char*);
String* strnodlen(char*, int);
#define system acidsystem
char* system(void);
int trlist(Map*, Regs*, ulong, ulong, Symbol*, int);
int trlist(Map*, Regs*, u64int, u64int, Symbol*, int);
void unwind(void);
void userinit(void);
void varreg(void);

View file

@ -453,7 +453,7 @@ follow(Node *r, Node *args)
{
int n, i;
Node res;
ulong f[10];
u64int f[10];
List **tail, *l;
if(args == 0)
@ -480,7 +480,7 @@ funcbound(Node *r, Node *args)
{
int n;
Node res;
ulong bounds[2];
u64int bounds[2];
List *l;
if(args == 0)
@ -523,7 +523,7 @@ filepc(Node *r, Node *args)
int i;
Node res;
char *p, c;
ulong v;
u64int v;
if(args == 0)
error("filepc(filename:line): arg count");
@ -1035,7 +1035,7 @@ static struct
static int nsregs;
static int
straceregrw(Regs *regs, char *name, ulong *val, int isr)
straceregrw(Regs *regs, char *name, u64int *val, int isr)
{
int i;

View file

@ -354,7 +354,7 @@ indir(Map *m, ulong addr, char fmt, Node *r)
void
indirreg(Regs *regs, char *name, char fmt, Node *r)
{
ulong val;
u64int val;
if(regs == 0)
error("no register set for *%s=", name);

View file

@ -168,7 +168,7 @@ oframe(Node *n, Node *res)
{
char *p;
Node *lp;
ulong ival;
u64int ival;
Frtype *f;
p = n->sym->name;
@ -1070,12 +1070,12 @@ initexpr(void)
}
int
acidregsrw(Regs *r, char *name, ulong *u, int isr)
acidregsrw(Regs *r, char *name, u64int *u, int isr)
{
Lsym *l;
Value *v;
Node *n;
ulong addr;
u64int addr;
u32int u32;
if(!isr){

View file

@ -196,7 +196,7 @@ listregisters(Map *map, Regs *regs)
{
List **tail, *l2, *l;
Regdesc *rp;
ulong v;
u64int v;
l2 = 0;
tail = &l2;
@ -255,7 +255,7 @@ listautos(Map *map, Regs *regs, Symbol *fn)
}
int
trlist(Map *map, Regs *regs, ulong pc, ulong callerpc, Symbol *sym, int depth)
trlist(Map *map, Regs *regs, u64int pc, u64int callerpc, Symbol *sym, int depth)
{
List *q, *l;
static List **tail;

View file

@ -92,6 +92,8 @@ main(int argc, char *argv[])
default:
usage();
}ARGEND
USED(pid);
fmtinstall('Z', Zfmt);
fmtinstall('L', locfmt);
@ -195,7 +197,8 @@ attachfiles(int argc, char **argv)
pid = 0;
interactive = 0;
USED(pid);
if(setjmp(err))
return -1;

View file

@ -11,7 +11,7 @@
#include <mach.h>
typedef long WORD;
typedef ulong ADDR;
typedef u64int ADDR;
#define HUGEINT 0x7fffffff /* enormous WORD */

View file

@ -166,7 +166,7 @@ item(int a)
{ /* name [ . local ] | number | . | ^ | <register | 'x | | */
char *base;
char savc;
ulong u;
u64int u;
Symbol s;
char gsym[MAXSYM], lsym[MAXSYM];
@ -388,7 +388,7 @@ dbround(long a, long b)
ulong
dbrget(Map *map, char *name)
{
ulong u;
u64int u;
USED(map);
if(rget(correg, name, &u) < 0)

View file

@ -22,7 +22,7 @@ static void printfp(Map*, int);
* callback on stack trace
*/
static int
ptrace(Map *map, Regs *regs, ulong pc, ulong nextpc, Symbol *sym, int depth)
ptrace(Map *map, Regs *regs, u64int pc, u64int nextpc, Symbol *sym, int depth)
{
char buf[512];
@ -48,7 +48,7 @@ ptrace(Map *map, Regs *regs, ulong pc, ulong nextpc, Symbol *sym, int depth)
static ulong *adrregvals;
static int
adrrw(Regs *regs, char *name, ulong *val, int isr)
adrrw(Regs *regs, char *name, u64int *val, int isr)
{
int i;
@ -215,6 +215,7 @@ printdollar(int modif)
default:
error("bad `$' command");
}
USED(r);
}
@ -359,7 +360,7 @@ void
printpc(void)
{
char buf[512];
ulong u;
u64int u;
if(rget(correg, mach->pc, &u) < 0)
error("%r");

View file

@ -13,7 +13,7 @@ printregs(int c)
{
Regdesc *rp;
int i;
ulong u;
ADDR u;
if(correg == nil){
dprint("registers not mapped\n");

View file

@ -208,7 +208,7 @@ void
runstep(ulong loc, int keepnote)
{
int nfoll;
ulong foll[3];
ADDR foll[3];
BKPT bkpt[3];
int i;