Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdb shadow support in coredump mode #13

Open
fpmystar opened this issue Jul 4, 2018 · 3 comments
Open

gdb shadow support in coredump mode #13

fpmystar opened this issue Jul 4, 2018 · 3 comments

Comments

@fpmystar
Copy link

fpmystar commented Jul 4, 2018

Hi Argp:

I want to use your wonderful tool - CENSUS/shadow to analysis coredump jemalloc layout. But when install all the tool include the pyrsistence, gdb for android and shadow. then load the coredump file with gdb. and parse the jemalloc with jeparse,but it always failed. can you kindly tell me why? does the shadow support the coredump local gdb mode? Thanks very much.

(gdb) source shadow-master/gdb_driver.py
[shadow]init
(gdb) jeparse -c shadow-master/cfg/android8_32.cfg
[shadow] configuration file found
[shadow] parsing configuration...
[shadow] parsing structures from memory...
[shadow] 2018-07-03 13:13:29
Python Exception <class 'gdb.error'> unable to handle request:
Error occurred in Python command: unable to handle request

@fpmystar
Copy link
Author

fpmystar commented Jul 4, 2018

when use the jeparse -v, I can't find the debug.log in current directory.
(gdb) source ../shadow-master/gdb_driver.py
(gdb) jeparse -c ../shadow-master/cfg/android8_32.cfg
[shadow] parsing configuration...
[shadow] parsing structures from memory...
[shadow] 2018-07-04 08:14:00
Python Exception <class 'gdb.error'> unable to handle request:
Error occurred in Python command: unable to handle request
(gdb) jeparse -v
[shadow] parsing structures from memory...
[shadow] 2018-07-04 08:14:27
Python Exception <class 'gdb.error'> unable to handle request:
Error occurred in Python command: unable to handle request
(gdb) pw

@hanli-lee
Copy link

resolution: catch the exception,and then return an specific arch,for example: "Aarch64"
diff --git a/gdb_engine.py b/gdb_engine.py
index 66fc50d..2c2ede6 100644
--- a/gdb_engine.py
+++ b/gdb_engine.py
@@ -75,10 +75,13 @@ def get_xul_version():
def get_arch():
# get the start of text
text_addr = None
try:
for l in execute("info proc stat").split("\n"):
if l.startswith("Start of text:"):
text_addr = int(l.split(":")[1], 16)
break
except gdb.error:
return "Aarch64"

@argp
Copy link
Member

argp commented Aug 7, 2019

Great, thanks! Can you submit it as a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants