TempleOSCD_150720.ISO
This commit is contained in:
1 parent
401601816c
commit
f8c05f98f4
554 files changed
+26046
-24853
No files matched your search
+61
-5
@@ -11,7 +11,8 @@ I64 HashEntrySize(CHashSrcSym *temph)
|
||||
return temph(CHashClass *)->size;
|
||||
case HTt_FUN:
|
||||
if (dbg_info=temph->dbg_info)
|
||||
return dbg_info->body[dbg_info->max_line+1-dbg_info->min_line]-dbg_info->body[0];
|
||||
return dbg_info->body[dbg_info->max_line+1-dbg_info->min_line]
|
||||
-dbg_info->body[0];
|
||||
else
|
||||
return -1;
|
||||
case HTt_FILE:
|
||||
@@ -47,8 +48,9 @@ I64 HashEntrySize2(CHashSrcSym *temph)
|
||||
else if (temph->type & HTT_FUN) {
|
||||
result+=MemberLstSize(temph);
|
||||
if (dbg_info=temph->dbg_info)
|
||||
//This should be $LK,"MSize",A="MN:MSize"$() but it would crash on AOT .BIN.Z file funs.
|
||||
result+=dbg_info->body[dbg_info->max_line+1-dbg_info->min_line]-dbg_info->body[0];
|
||||
//This should be $LK,"MSize",A="MN:MSize"$() but it would crash on AOT .BIN.Z file funs.
|
||||
result+=dbg_info->body[dbg_info->max_line+1-dbg_info->min_line]
|
||||
-dbg_info->body[0];
|
||||
} else if (temph->type&HTT_DEFINE_STR)
|
||||
result+=MSize2(temph(CHashDefineStr *)->data);
|
||||
else if (temph->type & HTT_GLBL_VAR) {
|
||||
@@ -56,12 +58,13 @@ I64 HashEntrySize2(CHashSrcSym *temph)
|
||||
if (!(temph(CHashGlblVar *)->flags&GVF_ALIAS))
|
||||
result+=MSize2(temph(CHashGlblVar *)->data_addr);
|
||||
if (temph(CHashGlblVar *)->fun_ptr)
|
||||
result+=HashEntrySize2(temph(CHashGlblVar *)->fun_ptr-temph(CHashGlblVar *)->fun_ptr->ptr_stars_cnt);
|
||||
result+=HashEntrySize2(temph(CHashGlblVar *)->fun_ptr
|
||||
-temph(CHashGlblVar *)->fun_ptr->ptr_stars_cnt);
|
||||
}
|
||||
} else if (temph->type & HTT_FILE)
|
||||
result+=MSize2(temph(CHashGeneric *)->user_data0);
|
||||
else if (temph->type & HTT_MODULE &&
|
||||
StrCmp(temph->str,KERNEL_MODULE_NAME))
|
||||
StrCmp(temph->str,KERNEL_MODULE_NAME))
|
||||
result+=MSize2(temph(CHashGeneric *)->user_data0);
|
||||
return result;
|
||||
}
|
||||
@@ -83,3 +86,56 @@ I64 HashTableSize2(CHashTable *table)
|
||||
result+=MSize2(table);
|
||||
return result;
|
||||
}
|
||||
|
||||
U0 MapFileWrite(CHashTable *h,U8 *map_name,U8 drv_let)
|
||||
{
|
||||
CHashSrcSym *temph;
|
||||
I64 i,size;
|
||||
U8 *src_link;
|
||||
CDoc *doc;
|
||||
CDocBin *tempb;
|
||||
CDbgInfo *dbg_info;
|
||||
|
||||
doc=DocNew(map_name);
|
||||
doc->flags|=DOCF_NO_CURSOR;
|
||||
for (i=0;i<=h->mask;i++) {
|
||||
temph=h->body[i];
|
||||
while (temph) {
|
||||
if (temph->src_link && !(temph->type & (HTF_IMPORT | HTF_PRIVATE))) {
|
||||
src_link=StrNew(temph->src_link);
|
||||
if (drv_let && StrLen(src_link)>=4)
|
||||
src_link[3]=drv_let;
|
||||
if (dbg_info=temph->dbg_info) {
|
||||
size=offset(CDbgInfo.body)+
|
||||
sizeof(U32)*(dbg_info->max_line+2-dbg_info->min_line);
|
||||
if (size>MSize(dbg_info)) {
|
||||
"Corrupt Map Entry\n";
|
||||
dbg_info=NULL;
|
||||
} else {
|
||||
if (dbg_info->min_line<=dbg_info->max_line) {
|
||||
tempb=CAlloc(sizeof(CDocBin));
|
||||
tempb->size=size;
|
||||
tempb->data=MAlloc(size);
|
||||
MemCpy(tempb->data,dbg_info,size);
|
||||
tempb->num=doc->cur_bin_num++;
|
||||
tempb->use_cnt=1;
|
||||
QueIns(tempb,doc->bin_root.last);
|
||||
} else
|
||||
dbg_info=NULL;
|
||||
}
|
||||
}
|
||||
if (dbg_info)
|
||||
DocPrint(doc,"$$LK,\"%s\",A=\"%s\",BI=%d$$\n",
|
||||
temph->str,src_link,tempb->num);
|
||||
else
|
||||
DocPrint(doc,"$$LK,\"%s\",A=\"%s\"$$\n",temph->str,src_link);
|
||||
|
||||
Free(src_link);
|
||||
}
|
||||
temph=temph->next;
|
||||
}
|
||||
}
|
||||
DocBinsValidate(doc);
|
||||
DocWrite(doc);
|
||||
DocDel(doc);
|
||||
}
|
||||
Reference in new issue
Block a user