亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? oops.c

?? ldd1的源代碼
?? C
字號:
/* * ksymoops v2.0 -- A simple filter to resolve symbols in Linux Oops-logs * * Copyright (C) 1995 Greg McGary <gkm@magilla.cichlid.com> (version 1.x) * Copyright (C) 1996 Alessandro Rubini <rubini@ipvvis.unipc.it> (upgrades) *//* * New features: *       strips syslog prefixes *       decodes registers and stack *       uses %esp to show pointers to local vars *       uses symbols in modules from /proc/ksyms */ /*  * Missing features: *       check /proc/ksyms against the map for mismatches */#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <ctype.h>#include <linux/module.h>#define MAX_NAME MOD_MAX_NAME /* quite big, indeed ... */struct ksym {  unsigned long address, extent;  struct ksym *next;  char name[MAX_NAME];  char id[MAX_NAME];};struct ksym *gsymlist; /* global symlist *//*----------------------------------------------------------------------*//* read a text line into a symbol */struct  ksym *linesym(char *line){    struct ksym *newsym=malloc(sizeof(struct ksym));    char s[MAX_NAME];    int i;        i=sscanf(line,"%lx %s %s",&newsym->address,newsym->name,s);    switch(i) {      case 2:        newsym->id[0]='\0'; /* no id available, but allright */        break;      case 3:        if (strlen(newsym->name)==1) {        /* a line in the system map */            strcpy(newsym->id,newsym->name);  /* use segment as id */            newsym->id[0]=toupper(newsym->id[0]);            strcpy(newsym->name,s);           /* this was the name */            break;        }        if (s[0]=='[') { /* a module from "ksyms" */            s[strlen(s)-1]='\0'; /* trim the bracket */            strcpy(newsym->id,s+1);            break;        }      default:         /* unknown format */        free(newsym);        return NULL;    }    newsym->extent = newsym->extent = 0;    newsym->next = NULL;    return newsym;}/*----------------------------------------------------------------------*//* * insert a symbol in the list. * "trial" is an hint used to speed things  -- it's tenfold faster  */struct ksym *insert(struct ksym *symlist, struct ksym *newsym,                   struct ksym *trial){    if (!symlist) return newsym;    if (!trial || trial->address > newsym->address) {        if (newsym->address < symlist->address) {            newsym->next = symlist;            return newsym;        }        trial = symlist;        /* disregard hint */    }    for ( ; trial->next; trial=trial->next)        if (trial->next->address > newsym->address)            break;    newsym->next = trial->next;    trial->next = newsym;    return symlist;}/*----------------------------------------------------------------------*//* read a file into a symlist */struct ksym *filesym(struct ksym *symlist, FILE *f, const char *fname){    char s[80];    int lineno = 0;    struct ksym *last = NULL, *sym;    if (!f) {        f=fopen(fname,"r");        if (!f) {            perror(fname);            return symlist;        }    }    while (fgets(s,80,f)) {        lineno++;        sym = linesym(s);        if (!sym) {            fprintf(stderr,"%s:%i: Unknown format for data line\n",                    fname,lineno);            continue;        }        symlist = insert(symlist,sym,last);        last = sym;    }    return symlist;}/*----------------------------------------------------------------------*//* write extents and remove duplicate items */struct ksym *fixlist(struct ksym *symlist){     struct ksym *ptr, *next;        for (ptr=symlist; ptr && ptr->next; ptr = ptr->next) {        while (ptr->address == ptr->next->address) { /* remove duplicates */            next=ptr->next;            if (ptr->id[0] && next->id[0]) /* both valid... hmmm */                break;            if (next->id[0])                strcpy(ptr->id,next->id);            ptr->next=next->next;            free(next);        }        if (!strcmp(ptr->id,ptr->next->id))            ptr->extent = ptr->next->address - ptr->address;        else            ptr->extent = 0;    }    ptr->extent=0;     return symlist;}/*----------------------------------------------------------------------*/#ifdef DEBUGint dumplist(struct ksym *symlist){    for (; symlist; symlist=symlist->next) {       printf("%08lx %-30s (e %08lx, id \"%s\")\n",              symlist->address,              symlist->name, symlist->extent, symlist->id);       fflush(stdout);    }    return 0;}    #endif /* DEBUG */                       /*----------------------------------------------------------------------*//* print an address in symbolic form */char *decode(unsigned int add, unsigned int esp){    static char res[64];    static struct ksym *symlist=NULL; /* used to remember last time */    if (!symlist || symlist->address > add) symlist=gsymlist;    for (;symlist && symlist->next && symlist->next->address <= add;         symlist=symlist->next)        /* nothing */;    if (add < symlist->address || !symlist->extent) { /* out of regions */        if (abs(add-esp) < 2000) {            sprintf(res,"<%%esp+%x>",add-esp);            return res;        } else            return "";    }    sprintf(res,"<%s+%lx/%lx>",symlist->name,add-symlist->address,            symlist->extent);    return res;}/*----------------------------------------------------------------------*/int disass(char *data, unsigned int eip, unsigned int esp){    /*     * This is a hack to avoid using gcc.  We create an object file by     * concatenating objfile_head, the twenty bytes of code, and     * objfile_tail.      */    static unsigned char objfile_head[] = {	0x07, 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00    };    static unsigned char objfile_tail[] = {	0x00, 0x90, 0x90, 0x90,	0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,	0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,	0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	0x25, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,	0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00,	'g',  'c',  'c',  '2',  '_',  'c',  'o',  'm',  	'p',  'i',  'l',  'e',  'd',  '.',  '\0', '_',  	'E',  'I',  'P',  '\0', '\0', '\0', '\0', '\0',	'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',	'\0', '\0', '\0', '\0', '\0', '\0'    };    char * objdump = "objdump -d /tmp/oops_decode.o";    char * objfile = "/tmp/oops_decode.o";    char buf[128], *bptr;    char *s;    FILE *f;    long l;    if (!(f=fopen(objfile,"w"))) {        perror(objfile); return -1;    }    fwrite(objfile_head, 1, sizeof(objfile_head), f);    fwrite(data, 1, 20, f);    fwrite(objfile_tail, 1, sizeof(objfile_tail), f);    fclose(f);    if (!(f=popen(objdump,"r"))) {        perror("objdump"); return -1;    }    while (fgets(buf,128,f)) {        if (strncmp(&buf[9], "<_EIP", 5))            continue;	if (strstr(buf, " is out of bounds"))	    break;        printf("Code: ");        /* try to print eip in decoded form */	l = strtol(buf, &bptr, 16);        s=decode(eip+l,esp);        if (s[0])            printf("%s",s); /* the decoded address */        else            printf("%08lx",eip+l);        while (*bptr++ != '>')            /* skip */ ;                /* print the rest of line, without newline */        bptr[strlen(bptr)-1]='\0';        printf("%s",bptr);                /* and now decode any address it embedded */        while ( (bptr=strstr(bptr, "0x")) ) {            l=strtol(bptr, &bptr, 0);            s=decode(l, esp);            if (s[0])                printf(" %s", s);        }        putchar('\n');    }    pclose(f);    unlink(objfile);               return 0;}/*----------------------------------------------------------------------*//* * All is there: now use it */int main(int argc, char **argv){    char s[512];    char *subs=NULL, *savedsubs;    int status=0, offset;    unsigned int j, k, esp, eip;    unsigned int i[16];        /* 8 suffice by now, but who knows... */    char names[16][8], c[20];  /* [8][8] suffice, but who knows */    char *ptr;    char *prgname=argv[0];    struct ksym *symlist=NULL;    char defaultmap[]="/usr/src/linux/System.map";    char *mapname=defaultmap;    if (argc>2) {        fprintf(stderr,"%s: Usage: \"%s [mapfile_name] < oops-log\"\n",                prgname, prgname);        exit(1);    }    if (argc==2)        mapname=argv[1];    fprintf(stderr,"%s: Using %s as map\n", prgname, mapname);    symlist = filesym(symlist,NULL,mapname);    symlist = filesym(symlist,NULL,"/proc/ksyms");    symlist=fixlist(symlist);    /* dumplist(symlist); */    gsymlist=symlist;    /*     * Ok, the symbol table is there, now get the message     */    if (isatty(0)) {        fprintf(stderr,"%s: please paste the oops on my stdin\n",prgname);    }    while (fgets(s,512,stdin)) {        if (!subs) { /* nothing yet */            savedsubs = subs = strstr(s,"EIP: ");        }        switch(status) {        case 0: /* not found */            if (!subs) continue;            status++;            offset=0;            esp=0;            j=sscanf(subs,"%s %x:[<%x>]",s,&i[0],&i[1]);            if (j!=3) {                fprintf(stderr,"Wrong \"EIP\" line\n");                continue;            }            printf("\n%-7s %04x:%08x %s\n",s,i[0],i[1],decode(i[1],0));            eip=i[1]; /* keep to disass */            break;                    case 1: /* before the stack */            j=sscanf(subs,"%s %x %s %x %s %x %s %x",names[0+offset],i+offset,                     names[1+offset],i+1+offset,names[2+offset],i+2+offset,                     names[3+offset],i+3+offset);            if (j==8 && strlen(names[0])==4) { /* registers */                /*                 * The problem with registers is that I need "esp"                 * first, on order to refer registers to the stack.                 * So, I save them, and decode later on                 */                if ( (ptr=strstr(subs,"esp:")) ) {                    sscanf(ptr,"%*s %x",&esp);                }                if (esp) { /* decode only when they can be ref'd to stack */                    for (j=0; j<4+offset; j++)                        printf("%s %08x %s\n",names[j],i[j],decode(i[j],esp));                    offset=0;                } else {                    offset+=4; /* next time, write after these ones */                }                continue;            }            else if (strncmp(subs,"Stack: ",7)) {                printf("%s",subs);                continue;            } else {                status++;                offset=0;                subs+=6; /* skip the string, and fall through */            }        case 2: /* stack and trace*/            if (strncmp(subs,"Call Trace",4) != 0) {                k=sscanf(subs,"%x %x %x %x %x %x %x %x",i,i+1,i+2,i+3,                         i+4,i+5,i+6,i+7);                if (k<=0) {                    fprintf(stderr,"Bad stack line (%i items)\n",j);                } else {                    for (j=0; j<k; j++)                        printf("esp+%02x: %08x %s\n",(offset+j)*4,i[j],                               decode(i[j],esp));                }                if (!offset) subs = savedsubs; /* restore */                offset+=8;                continue;            }            /* call trace */            status++;            offset=0;            subs+=12; /* skip the string, and fall through */        case 3: /* the trace */            if (strncmp(subs,"Code",4)) {                k=sscanf(subs," [<%x>] [<%x>] [<%x>] [<%x>] "                         "[<%x>] [<%x>] [<%x>] [<%x>]",i,i+1,i+2,i+3,                         i+4,i+5,i+6,i+7);                if (k==0) {                    fprintf(stderr,"Bad trace line %s(no add found)\n",subs);                } else {                    for (j=0; j<k; j++)                        printf("Trace: %08x %s\n", i[j], decode(i[j],esp));                }                subs = savedsubs; /* restore */                continue;            }            /* the code */            ptr = subs+5; /* skip "Code:" */            for (j=0; j<20; j++) {                long l=strtol(ptr,&ptr,16);                c[j]=(char)l;            }               disass(c, eip, esp);            esp=0; status=0; subs=NULL; /* ready for another oops */        }                            }    return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品日本一线二线三线不卡| 一区二区三区免费在线观看| 亚洲婷婷综合久久一本伊一区| 偷拍日韩校园综合在线| 国产精品1区二区.| 日韩视频免费观看高清完整版在线观看| 欧美激情在线一区二区三区| 全国精品久久少妇| 在线观看区一区二| 国产精品不卡视频| 极品少妇一区二区| 在线综合亚洲欧美在线视频| 亚洲免费观看高清完整版在线 | 99精品1区2区| 久久精品这里都是精品| 人人狠狠综合久久亚洲| 欧美日韩国产美| 一区二区三区在线观看网站| 成人黄色综合网站| 国产亚洲午夜高清国产拍精品| 蜜臀91精品一区二区三区 | 欧美丰满一区二区免费视频| 亚洲精品欧美激情| 99视频热这里只有精品免费| 国产三级一区二区| 国产精品1024久久| 亚洲国产高清在线| 懂色中文一区二区在线播放| 中文字幕不卡在线播放| 日本久久电影网| 成人免费在线视频观看| 成人av在线影院| 亚洲天堂免费看| 色呦呦日韩精品| 亚洲一级片在线观看| 欧美日韩久久一区| 日韩精品一级中文字幕精品视频免费观看 | 国产成人欧美日韩在线电影| 久久影视一区二区| 高清在线不卡av| 国产精品不卡一区二区三区| 一本到一区二区三区| 亚洲一区二区三区在线看| 欧美视频在线一区| 首页亚洲欧美制服丝腿| 日韩欧美激情在线| 国产精品资源在线观看| 国产欧美一二三区| 91亚洲国产成人精品一区二三| 亚洲精品乱码久久久久久久久 | 色综合久久综合中文综合网| 一区二区三区91| 日韩精品中午字幕| 成人av网站免费观看| 一区二区不卡在线播放| 91麻豆精品国产91久久久久久久久 | 精品第一国产综合精品aⅴ| 国产乱码精品1区2区3区| 亚洲视频你懂的| 欧美日韩成人高清| 国产一区二区三区四区五区美女| 一区二区三区四区不卡视频| 在线视频一区二区三区| 久久97超碰色| 亚洲视频免费观看| 日韩一区二区精品在线观看| 99视频在线精品| 日本v片在线高清不卡在线观看| 久久久99久久| 欧美日韩你懂得| 国产精品影音先锋| 亚洲尤物视频在线| 国产日韩影视精品| 在线成人午夜影院| 99精品视频在线免费观看| 蜜桃在线一区二区三区| 一区二区高清视频在线观看| 久久网站热最新地址| 欧美视频一区二区在线观看| 国产成人精品网址| 日韩福利视频导航| 亚洲综合色区另类av| 久久精品亚洲麻豆av一区二区| 在线免费观看日本欧美| 成人av动漫网站| 国产伦理精品不卡| 免费av网站大全久久| 亚洲最新视频在线观看| 国产精品嫩草影院com| 日韩欧美在线影院| 欧美日韩精品欧美日韩精品一 | 一区二区三区美女视频| 国产女人18毛片水真多成人如厕| 欧美日韩一区不卡| 99r精品视频| 国产成人在线免费| 极品少妇xxxx偷拍精品少妇| 青青草91视频| 午夜精品福利视频网站| 亚洲人成人一区二区在线观看| 国产清纯在线一区二区www| 欧美成人vps| 日韩午夜av一区| 日韩一区二区三区四区五区六区| 欧美日本韩国一区| 欧美日韩高清在线| 精品视频1区2区| 欧美日韩久久久一区| 欧美日韩精品一区二区三区四区 | 成人动漫在线一区| 国产盗摄视频一区二区三区| 在线观看视频一区二区欧美日韩 | 国产69精品久久久久毛片| 国产剧情一区在线| 粉嫩蜜臀av国产精品网站| 国产成人在线影院| 成人午夜免费电影| 91天堂素人约啪| 色婷婷av一区二区三区gif | 偷拍一区二区三区四区| 日韩成人av影视| 另类的小说在线视频另类成人小视频在线 | 日韩视频一区二区| 精品少妇一区二区三区视频免付费| 日韩一区二区三区在线| 欧美精品一区二区三| 久久精品视频网| 中文字幕亚洲不卡| 亚洲精品免费看| 午夜精品成人在线视频| 日本特黄久久久高潮| 国产一区在线观看麻豆| 国产成人精品免费| 91免费在线视频观看| 欧美性生活一区| 91精品福利在线一区二区三区| 91精品国产麻豆| 久久精品夜色噜噜亚洲a∨| 亚洲欧美日韩中文字幕一区二区三区 | 日韩国产在线观看一区| 精彩视频一区二区| 成人动漫中文字幕| 91精品国产一区二区三区蜜臀| 日韩欧美卡一卡二| 国产精品久久久久久亚洲毛片| 亚洲国产成人av| 国产成人鲁色资源国产91色综| 91丨九色丨尤物| 日韩西西人体444www| 中文字幕在线不卡一区 | 亚洲黄一区二区三区| 日韩电影在线观看网站| 欧美日韩亚洲综合在线| 精品少妇一区二区三区免费观看| 国产精品国产三级国产普通话三级| 亚洲二区在线视频| 东方aⅴ免费观看久久av| 欧美三片在线视频观看| 精品sm捆绑视频| 亚洲午夜久久久久久久久电影院| 国产一区欧美二区| 欧美日韩日日骚| 国产精品传媒入口麻豆| 韩国欧美国产一区| 欧美三级蜜桃2在线观看| 国产欧美精品区一区二区三区| 天堂精品中文字幕在线| 成人精品视频一区二区三区尤物| 欧美精品v国产精品v日韩精品| 中文在线资源观看网站视频免费不卡| 午夜视频一区二区| 91麻豆精品在线观看| 国产欧美日韩不卡免费| 免费美女久久99| 欧美在线免费视屏| 中文字幕一区二区三区不卡| 久久91精品国产91久久小草| 欧美日韩国产高清一区| 一区二区三区四区在线播放| 成人avav影音| 久久久久久久精| 紧缚捆绑精品一区二区| 6080亚洲精品一区二区| 亚洲国产精品人人做人人爽| 99综合电影在线视频| 欧美激情一区二区在线| 国产一区二区毛片| xfplay精品久久| 精品一区二区三区久久| 日韩视频国产视频| 奇米色一区二区三区四区| 欧美伦理视频网站| 偷窥少妇高潮呻吟av久久免费| 在线一区二区三区四区五区 | 久久久久久久综合| 精品一区二区三区视频在线观看| 欧美一区二区网站| 免费观看日韩电影| 精品国产乱子伦一区| 国内精品视频666|