thelp for libthread_db (define ps_prochandle) - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit cdf1805191ba4ab5b8fbb1697a95fe0d32e25ee6
 (DIR) parent 39b3054a5fbec1e662ebcc6377c4e8a588b097ec
 (HTM) Author: rsc <devnull@localhost>
       Date:   Sat, 25 Dec 2004 22:01:28 +0000
       
       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:
         M include/mach.h                      |      29 ++++++++++++++++++++++++++---
       
       1 file changed, 26 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/include/mach.h b/include/mach.h
       t@@ -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 */
       t@@ -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);
       t@@ -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
       t@@ -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);
       t@@ -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);
       t@@ -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;