-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debugger: Change DWARF symbol table name
Signed-off-by: iipeace <[email protected]>
- Loading branch information
Showing
1 changed file
with
29 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
__credits__ = "Peace Lee" | ||
__license__ = "GPLv2" | ||
__version__ = "3.9.8" | ||
__revision__ = "240525" | ||
__revision__ = "240526" | ||
__maintainer__ = "Peace Lee" | ||
__email__ = "[email protected]" | ||
__repository__ = "https://github.com/iipeace/guider" | ||
|
@@ -8549,7 +8549,7 @@ def convUnit2Size(value, verb=True): | |
# sizeZB = 1180591620717411303424 | ||
# sizeYB = 120892581961462917470617 | ||
|
||
if isinstance(value, (long, float)): | ||
if isinstance(value, (int, long, float)): | ||
return value | ||
|
||
value = str(value) | ||
|
@@ -34706,6 +34706,21 @@ def convMemStat(mlist): | |
"rss": long(mlist[rssIdx]) << 12, | ||
} | ||
|
||
@staticmethod | ||
def getMemStatList(pid): | ||
try: | ||
mlist = SysMgr.getMemStat(SysMgr.pid) | ||
return SysMgr.convMemStat(mlist) | ||
except SystemExit: | ||
sys.exit(0) | ||
except: | ||
SysMgr.printWarn( | ||
"failed to memory stats for %s(%s)" | ||
% (SysMgr.getComm(pid), pid), | ||
reason=True, | ||
) | ||
return {} | ||
|
||
@staticmethod | ||
def getMemStat(pid): | ||
try: | ||
|
@@ -87592,7 +87607,7 @@ def loadAndroidJITSymbols(self): | |
continue | ||
symInfo.update(v) | ||
origElfObj.attr[n] = symInfo | ||
elif n in ("dwarf", "dwarfTable"): | ||
elif n in ("dwarf", "dwarfsymTable"): | ||
dwarfInfo = origElfObj.attr.get(n, {}) | ||
if not dwarfInfo: | ||
origElfObj.attr[n] = {} | ||
|
@@ -87775,7 +87790,7 @@ def loadAndroidJITSymbols(self): | |
jmapTable.append( | ||
[attrs["value"], sym, attrs["size"], fname] | ||
) | ||
elif n in ("dwarf", "dwarfTable"): | ||
elif n in ("dwarf", "dwarfsymTable"): | ||
if not fname in ElfAnalyzer.cachedFiles: | ||
ElfAnalyzer.cachedFiles[fname] = elfObj | ||
dwarfInfo = ElfAnalyzer.cachedFiles[fname].attr.get(n, {}) | ||
|
@@ -103418,7 +103433,7 @@ def mergeSymTable(self, force=False, onlyFunc=True, removeOrig=False): | |
|
||
# merge sym tables # | ||
tempSymTable = {} | ||
for secName in ("symTable", "dynsymTable", "dwarfTable"): | ||
for secName in ("symTable", "dynsymTable", "dwarfsymTable"): | ||
if not secName in self.attr: | ||
continue | ||
tempSymTable.update(self.attr[secName]) | ||
|
@@ -106385,7 +106400,7 @@ def _printStrSect(sh_name, strtab): | |
frameSectName = "" | ||
|
||
# check frame section # | ||
self.attr["dwarfTable"] = {} | ||
self.attr["dwarfsymTable"] = {} | ||
if SysMgr.dwarfEnable and e_shframe >= 0 and frameSectName: | ||
|
||
def _getEncType(encoding): | ||
|
@@ -106762,10 +106777,7 @@ def _getRegRule(reg): | |
table = myObj["table"] | ||
regOrder = myObj["regOrder"] | ||
|
||
if "initLoc" in myObj: | ||
initLoc = myObj["initLoc"] | ||
else: | ||
initLoc = 0 | ||
initLoc = myObj.get("initLoc", 0) | ||
|
||
# get return address register # | ||
if "rar" in myObj: | ||
|
@@ -107308,7 +107320,7 @@ def _decodeData2(table, pos): | |
continue | ||
|
||
# register stripped function info # | ||
self.attr["dwarfTable"][hex(initLoc)] = { | ||
self.attr["dwarfsymTable"][hex(initLoc)] = { | ||
"value": initLoc, | ||
"size": lenSize, | ||
"type": "FUNC", | ||
|
@@ -107570,7 +107582,7 @@ def _decodeEntry( | |
not foffset in self.addrTable | ||
or not self.addrTable[foffset] | ||
): | ||
self.attr["dwarfTable"][hex(foffset)] = { | ||
self.attr["dwarfsymTable"][hex(foffset)] = { | ||
"value": foffset, | ||
"size": 1, | ||
"type": "FUNC", | ||
|
@@ -109380,12 +109392,14 @@ def _addEntryOldState(cmd, args, isExtended=False): | |
path=newpath, debug=debug, fd=dfd, size=len(mdata) | ||
) | ||
|
||
for dt in ("symTable", "dynsymTable", "dwarfTable"): | ||
# merge tables # | ||
for dt in ("symTable", "dynsymTable", "dwarfsymTable"): | ||
if not dt in dobj.attr: | ||
continue | ||
self.attr.setdefault(dt, {}) | ||
self.attr[dt].update(dobj.attr[dt]) | ||
|
||
# merge dwarf data # | ||
for dt in dobj.attr.get("dwarf", []): | ||
self.attr.setdefault("dwarf", {}) | ||
if type(dobj.attr["dwarf"][dt]) is list: | ||
|
@@ -109397,6 +109411,8 @@ def _addEntryOldState(cmd, args, isExtended=False): | |
else: | ||
self.attr["dwarf"].setdefault(dt, {}) | ||
self.attr["dwarf"][dt].update(dobj.attr["dwarf"][dt]) | ||
|
||
del dobj | ||
except ValueError: | ||
pass | ||
except SystemExit: | ||
|