mirror of
https://github.com/apache/nuttx.git
synced 2026-10-04 12:48:09 +00:00
utils.py:support import check and requirements.txt
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
parent
bf2d6a3554
commit
e71d45ce86
2 changed files with 10 additions and 0 deletions
0
tools/gdb/requirements.txt
Normal file
0
tools/gdb/requirements.txt
Normal file
|
|
@ -145,6 +145,16 @@ def get_symbol_value(name, locspec="nx_start", cacheable=True):
|
|||
return value
|
||||
|
||||
|
||||
def import_check(module, name="", errmsg=""):
|
||||
try:
|
||||
module = __import__(module, fromlist=[name])
|
||||
except ImportError:
|
||||
gdb.write(errmsg if errmsg else f"Error to import {module}\n")
|
||||
return None
|
||||
|
||||
return getattr(module, name) if name else module
|
||||
|
||||
|
||||
def hexdump(address, size):
|
||||
inf = gdb.inferiors()[0]
|
||||
mem = inf.read_memory(address, size)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue