# Copyright (C) 2011-2019 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Configure GDB using the ELinOS environment."""
import os
import glob
import gdb
def warn(msg):
print "warning: %s" % msg
def get_elinos_environment():
"""Return the ELinOS environment.
If the ELinOS environment is properly set up, return a dictionary
which contains:
* The path to the ELinOS project at key 'project';
* The path to the ELinOS CDK at key 'cdk';
* The ELinOS target name at key 'target' (Eg. 'i486-linux');
* A list of Xenomai install prefixes (which could be empty, if
the ELinOS project does not include Xenomai) at key 'xenomai'.
If one of these cannot be found, print a warning; the corresponding
value in the returned dictionary will be None.
"""
result = {}
for key in ("project", "cdk", "target"):
var = "ELINOS_" + key.upper()
if var in os.environ:
result[key] = os.environ[var]
else:
warn("%s not set" % var)
result[key] = None
if result["project"] is not None:
result["xenomai"] = glob.glob(result["project"] + "/xenomai-[0-9.]*")
else:
result["xenomai"] = []
return result
def elinos_init():
"""Initialize debugger environment for ELinOS.
Let the debugger know where to find the ELinOS libraries on host. This
assumes that an ELinOS environment is properly set up. If some environment
variables are missing, warn about which library may be missing.
"""
elinos_env = get_elinos_environment()
solib_dirs = []
# System libraries
if None in (elinos_env[key] for key in ("cdk", "target")):
warn("ELinOS system libraries will not be loaded")
else:
solib_prefix = "%s/%s" % (elinos_env["cdk"], elinos_env["target"])
solib_dirs += ["%s/%s" % (solib_prefix, "lib")]
gdb.execute("set solib-absolute-prefix %s" % solib_prefix)
# Xenomai libraries. Those are optional, so have a lighter warning
# if they cannot be located.
if elinos_env["project"] is None:
warn("Xenomai libraries may not be loaded")
else:
for dir in elinos_env['xenomai']:
solib_dirs += ["%s/%s"
% (dir, "xenomai-build/usr/realtime/lib")]
if len(solib_dirs) != 0:
gdb.execute("set solib-search-path %s" % ":".join(solib_dirs))
if __name__ == "__main__":
elinos_init()
没有合适的资源?快使用搜索试试~ 我知道了~
win10下编译的gdb 8.3.1,适用于windows上gdb + gdbserver调试
共63个文件
mo:34个
xml:14个
info:4个
需积分: 0 19 下载量 144 浏览量
2023-05-17
16:22:04
上传
评论
收藏 7.17MB ZIP 举报
温馨提示
适用于 使用gdbserver + adb转发 + gdb在windows中调试 文
资源推荐
资源详情
资源评论
收起资源包目录
gdb-8.3.1.zip (63个子文件)
gdb-8.3.1
bin
gdbserver.exe 373KB
gdb.exe 20.05MB
gdb-add-index 3KB
share
gdb
syscalls
mips-n32-linux.xml 17KB
mips-n64-linux.xml 16KB
freebsd.xml 21KB
ppc64-linux.xml 14KB
amd64-linux.xml 16KB
s390-linux.xml 19KB
arm-linux.xml 21KB
aarch64-linux.xml 14KB
i386-linux.xml 17KB
s390x-linux.xml 17KB
ppc-linux.xml 15KB
sparc64-linux.xml 17KB
mips-o32-linux.xml 18KB
gdb-syscalls.dtd 504B
sparc-linux.xml 18KB
system-gdbinit
elinos.py 3KB
wrs-linux.py 1005B
man
man1
gdb-add-index.1 6KB
gdb.1 13KB
gdbserver.1 13KB
man5
gdbinit.5 7KB
info
annotate.info 48KB
dir 541B
stabs.info 179KB
gdb.info 2.25MB
bfd.info 651KB
locale
rw
LC_MESSAGES
bfd.mo 388B
ga
LC_MESSAGES
opcodes.mo 30KB
da
LC_MESSAGES
bfd.mo 150KB
opcodes.mo 17KB
vi
LC_MESSAGES
bfd.mo 157KB
opcodes.mo 33KB
fi
LC_MESSAGES
bfd.mo 159KB
opcodes.mo 30KB
nl
LC_MESSAGES
opcodes.mo 25KB
sv
LC_MESSAGES
bfd.mo 152KB
opcodes.mo 49KB
tr
LC_MESSAGES
bfd.mo 68KB
opcodes.mo 16KB
it
LC_MESSAGES
opcodes.mo 26KB
fr
LC_MESSAGES
bfd.mo 206KB
opcodes.mo 39KB
ru
LC_MESSAGES
bfd.mo 252KB
ja
LC_MESSAGES
bfd.mo 131KB
ro
LC_MESSAGES
bfd.mo 67KB
opcodes.mo 16KB
zh_CN
LC_MESSAGES
bfd.mo 17KB
opcodes.mo 20KB
pt_BR
LC_MESSAGES
opcodes.mo 50KB
hr
LC_MESSAGES
bfd.mo 5KB
id
LC_MESSAGES
bfd.mo 141KB
opcodes.mo 30KB
de
LC_MESSAGES
opcodes.mo 51KB
pt
LC_MESSAGES
bfd.mo 196KB
es
LC_MESSAGES
bfd.mo 204KB
opcodes.mo 39KB
sr
LC_MESSAGES
bfd.mo 198KB
opcodes.mo 37KB
uk
LC_MESSAGES
bfd.mo 258KB
opcodes.mo 66KB
共 63 条
- 1
资源评论
在-
- 粉丝: 18
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功