aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-12-25 22:01:28 +0000
committerrsc <devnull@localhost>2004-12-25 22:01:28 +0000
commitcdf1805191ba4ab5b8fbb1697a95fe0d32e25ee6 (patch)
treecf679c7e705f8de4a1053e030a60093e24b6e700 /include
parent39b3054a5fbec1e662ebcc6377c4e8a588b097ec (diff)
downloadplan9port-cdf1805191ba4ab5b8fbb1697a95fe0d32e25ee6.tar.gz
plan9port-cdf1805191ba4ab5b8fbb1697a95fe0d32e25ee6.tar.bz2
plan9port-cdf1805191ba4ab5b8fbb1697a95fe0d32e25ee6.zip
help for libthread_db (define ps_prochandle)
add symbols to unwind for disasesmbly-based stack unwinding add global state for library to help debugger programs (symhdr etc., attachproc, attachcore, attachargs).
Diffstat (limited to 'include')
-rw-r--r--include/mach.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/include/mach.h b/include/mach.h
index 89c3f850..23089e44 100644
--- a/include/mach.h
+++ b/include/mach.h
@@ -246,6 +246,7 @@ struct Fhdr
ulong sppcoff; /* offset of sp-pc table in file */
ulong lnpcsz; /* size of line number-pc table */
ulong lnpcoff; /* size of line number-pc table */
+ char *txtfil; /* text name, for core files */
void *elf; /* handle to elf image */
void *dwarf; /* handle to dwarf image */
void *macho; /* handle to mach-o image */
@@ -276,7 +277,7 @@ struct Fhdr
int (*indexlsym)(Fhdr*, Symbol*, uint, Symbol*);
int (*findlsym)(Fhdr*, Symbol*, Loc, Symbol*);
- int (*unwind)(Fhdr*, Map*, Regs*, ulong*);
+ int (*unwind)(Fhdr*, Map*, Regs*, ulong*, Symbol*);
};
Fhdr* crackhdr(char *file, int mode);
@@ -304,6 +305,22 @@ int procnotes(int pid, char ***notes);
char* proctextfile(int pid);
/*
+ * Command-line debugger help
+ */
+extern Fhdr *symhdr;
+extern Fhdr *corhdr;
+extern char *symfil;
+extern char *corfil;
+extern int corpid;
+extern Regs *correg;
+extern Map *symmap;
+extern Map *cormap;
+
+int attachproc(int pid);
+int attachcore(Fhdr *hdr);
+int attachargs(int argc, char **argv, int omode);
+
+/*
* Machine descriptions.
*
* mach.c
@@ -383,7 +400,7 @@ struct Mach
int (*foll)(Map*, Regs*, ulong, ulong*); /* follow set */
char* (*exc)(Map*, Regs*); /* last exception */
- int (*unwind)(Map*, Regs*, ulong*);
+ int (*unwind)(Map*, Regs*, ulong*, Symbol*);
/* cvt to local byte order */
u16int (*swap2)(u16int);
@@ -472,11 +489,12 @@ int lookuplsym(Symbol *s1, char *name, Symbol *s2);
int indexlsym(Symbol *s1, uint ndx, Symbol *s2);
int findlsym(Symbol *s1, Loc loc, Symbol *s);
int symoff(char *a, uint n, ulong addr, uint class);
-int unwindframe(Map *map, Regs *regs, ulong *next);
+int unwindframe(Map *map, Regs *regs, ulong *next, Symbol*);
void _addhdr(Fhdr*);
void _delhdr(Fhdr*);
extern Fhdr* fhdrlist;
+Fhdr* findhdr(char*);
Symbol* flookupsym(Fhdr*, char*);
Symbol* ffindsym(Fhdr*, Loc, uint);
@@ -501,4 +519,9 @@ int locfmt(Fmt*);
int loccmp(Loc*, Loc*);
int locsimplify(Map *map, Regs *regs, Loc loc, Loc *newloc);
+struct ps_prochandle
+{
+ int pid;
+};
+
extern int machdebug;