tools/gdb: fix older version gdb compatibility issue
Prebuilt arm-none-eabi-gdb may have not socket module available. Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
parent
58cd81ea46
commit
1a934a4da0
1 changed files with 7 additions and 6 deletions
|
@ -18,18 +18,19 @@
|
|||
#
|
||||
############################################################################
|
||||
|
||||
import socket
|
||||
|
||||
import gdb
|
||||
import utils
|
||||
from lists import dq_for_every, sq_for_every
|
||||
|
||||
socket = utils.import_check(
|
||||
"socket", errmsg="No socket module found, please try gdb-multiarch instead."
|
||||
)
|
||||
|
||||
NET_IPv4 = utils.get_symbol_value("CONFIG_NET_IPv4")
|
||||
NET_IPv6 = utils.get_symbol_value("CONFIG_NET_IPv6")
|
||||
|
||||
# NuttX's AF_INET and AF_INET6 have same value as Linux's
|
||||
AF_INET = socket.AF_INET
|
||||
AF_INET6 = socket.AF_INET6
|
||||
AF_INET = utils.get_symbol_value("AF_INET")
|
||||
AF_INET6 = utils.get_symbol_value("AF_INET6")
|
||||
|
||||
|
||||
def ntohs(val):
|
||||
|
@ -247,5 +248,5 @@ class NetStats(gdb.Command):
|
|||
gdb.write("\n")
|
||||
|
||||
|
||||
if utils.get_symbol_value("CONFIG_NET"):
|
||||
if utils.get_symbol_value("CONFIG_NET") and socket:
|
||||
NetStats()
|
||||
|
|
Loading…
Reference in a new issue