当前位置: 首页 > news >正文

物理服务器优化大师windows

物理服务器,优化大师windows,哈密网站制作,济南企业营销型网站建设文章目录 文件目录结构移植ncurses库移植gdb移植到arm板调试测试 linux主机:ubuntu-18.04 交叉编译器:arm-buildroot-linux-gnueabihf 开发板kernel:Linux 5.4.0-150-generic x86_64 开发板:100ASK_STM32MP157_PRO开发板 arm-…

文章目录

  • 文件目录结构
  • 移植ncurses库
  • 移植gdb
  • 移植到arm板
  • 调试测试

linux主机:ubuntu-18.04

交叉编译器:arm-buildroot-linux-gnueabihf

开发板kernel:Linux 5.4.0-150-generic x86_64

开发板:100ASK_STM32MP157_PRO开发板

arm-linux的gdb移植分为两种情况,一种是交叉调试,一种是本地调试。

  • 交叉调试模式:需要编译一个arm-linux版本gdbserver (GDB的stub模块),然后再编译一个X86版本交叉调试的gdb,为了与桌面版本身的gdb 区别开来,一般改名为 arm-linux-gdb。两者通过串口或者网络进行互联。
  • 本地调试模式:这种模式把整个gdb移植成一个arm的本地版,直接在开发板上用gdb来调试。

两种调试模式的具体差异查看博文:arm-linux的gdb移植,交叉调试模式编译:嵌入式arm linux环境中gdb+gdbserver调试

本博文介绍本地调试模式

文件目录结构

按照移植规范,ncurse放入libs目录,gdb 解压在项目目录下

/home/book/Desktop/gdb (项目目录)
|
|--output
|      |-- arm-linux
|  
|-- gdb-7.6.1
|
|-- libs|-- ncurses-5.9.tar.gz

移植ncurses库

下载地址:http://ftp.gnu.org/gnu/ncurses/
下载版本: ncurses-5.9.tar.gz

进入下载目录,输入命令进行解压

tar -zxvf ncurses-5.9.tar.gz

进入解压后的目录

cd ncurses-5.9

生成Makfile

./configure --host=arm-buildroot-linux-gnueabihf --prefix=$PWD/output/arm-linux  --enable-termcap --with-shared --without-ada
  • –host表示交叉编译器的前缀,根据交叉编译器的不同需要进行更改
  • –prefix表示的是目标目录,即编译完成后生成的文件的位置
  • –enable-termcap比较关键,gdb需要这个库,
  • -with-shared表示动态编译

编译

make

报错:

In file included from ../ncurses/curses.priv.h:283,from ../ncurses/lib_gen.c:19:
_22148.c:835:15: error: expected ‘)’ before ‘int../include/curses.h:1594:56: note: in definition of macro ‘mouse_trafo’#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)^
Makefile:794: recipe for target '../obj_s/lib_gen.o' failed
make[1]: *** [../obj_s/lib_gen.o] Error 1
make[1]: Leaving directory '/home/book/Desktop/gdb/ncurses-5.9/ncurses'
Makefile:109: recipe for target 'all' failed
make: *** [all] Error 2

解决方法:

进入ncurses-5.9/include文件夹,修改 curses.tail 文件:
将 extern NCURSES_EXPORT(bool)    mouse_trafo (int*, int*, bool);              /* generated */ 
改为 extern NCURSES_EXPORT(bool)    mouse_trafo (int*, int*, bool);
也就是去掉注释 /* generated */

安装

make install

以上操作成功后,会在libncurses.so.5 库应该在/home/hxy/gdb/output/arm-linux/lib可执行文件,libncurses.so.5就是我们要移植到arm板上的文件。

cp libncurses.so.5 /home/book/nfs_rootfs/

前提是使用nfs,或者使用其他工具移植到开发板中

移植gdb

下载gdb源代码:http://ftp.gnu.org/gnu/gdb/
下载版本: gdb-7.6.1.tar.gz

进入下载目录解压

tar -xvf gdb-7.6.1.tar.gz

进入解压目录

cd gdb-7.6.1

生成Makefile

./configure --host=arm-buildroot-linux-gnueabihf CC=/home/book/100ask_stm32mp157_pro-sdk/ToolChain/arm-buildroot-linux-gnueabihf_sdk-buildroot/bin/arm-buildroot-linux-gnueabihf-gcc --enable-shared --prefix=$PWD/output/arm-linux --disable-werror --without-x --disable-gdbtk --disable-tui --without-included-regex --without-included-gettext LDFLAGS="-L$PWD/../output/arm-linux/lib" CPPFLASS="-I$PWD/../output/arm-linux/include"
  • –enable-shared 动态编译
  • CC 是交叉编译器的绝对路径,为了避免找不到交叉编译器的错误
  • –without-x 取消x windows 支持
  • –disable-gdbtk 取消gdbtk,应该也是图形界面相关的
  • –disable-tui 取消tui 界面
  • –disable-werror 屏蔽werror报警
  • –without-included-regex 关闭正则表达式库
  • –without-included-gettext 去掉用于多语言处理的 gettext库。正则表达式/gettext暂时不需要
  • –host=arm-buildroot-linux-gnueabihf 用arm-buildroot-linux-gnueabihf编译
  • –prefix=“$PWD/output/arm-linux” 安装目录
  • "LDFLAGS=XXX"指定的是前面交叉编译完成的ncurse的lib目录的路径
  • "CPPFLAGS=XXX"指定的是前面交叉编译完成的ncurse的include目录的路径;

编译

make

安装

make install

最终的可执行程序gdb应该在/home/book/Desktop/gdb/output/arm-linux/bin下面

刚刚编译出来的gdb空间相当大,因此必须要用arm-buildroot-linux-gnueabihf-strip 来把空间减少

arm-buildroot-linux-gnueabihf-strip gdb

移植到arm板

将生成的动态库和可执行文件libncurses.so.5、gdb拷贝到arm板上,给予可执行权限

chmod +x libncurses.so.5 gdb

并将libncurses.so.5放在arm板的/usr/lib目录下

cp libncurses.so.5 /usr/lib

并将gdb放在arm板的/bin目录下

cp gdb /bin

调试测试

在Ubuntu环境下编写一个简单的C程序,命名为test.c,在Ubuntu环境下打开命令行进行交叉编译

arm-buildroot-linux-gnueabihf-gcc -g test.c -o test

将生成的可执行文件test拷贝到arm板上,给予可执行权限。然后进行gdb调试,

gdb test

参考博文:

将本地调试gdb移植到arm板

移植gdb到arm板

gdb移植到arm开发板

安装 arm-linux-gdb7.5 & 可能出现的两类问题解决


文章转载自:
http://shnaps.sLnz.cn
http://tertian.sLnz.cn
http://ghetto.sLnz.cn
http://muse.sLnz.cn
http://ben.sLnz.cn
http://austronesia.sLnz.cn
http://intercept.sLnz.cn
http://goober.sLnz.cn
http://untainted.sLnz.cn
http://quintuplet.sLnz.cn
http://commentary.sLnz.cn
http://rowen.sLnz.cn
http://spongiopilin.sLnz.cn
http://pipeful.sLnz.cn
http://grandiloquence.sLnz.cn
http://hue.sLnz.cn
http://superinfection.sLnz.cn
http://unweakened.sLnz.cn
http://coordination.sLnz.cn
http://septuor.sLnz.cn
http://bouzoukia.sLnz.cn
http://botcher.sLnz.cn
http://paradisiac.sLnz.cn
http://clericalist.sLnz.cn
http://huttonite.sLnz.cn
http://shelton.sLnz.cn
http://meaningly.sLnz.cn
http://paleichthyology.sLnz.cn
http://knickknackery.sLnz.cn
http://mamba.sLnz.cn
http://fenitrothion.sLnz.cn
http://malaita.sLnz.cn
http://imamate.sLnz.cn
http://pushball.sLnz.cn
http://hortensia.sLnz.cn
http://tatary.sLnz.cn
http://agressire.sLnz.cn
http://forgettable.sLnz.cn
http://gamekeeper.sLnz.cn
http://misbound.sLnz.cn
http://ichthyornis.sLnz.cn
http://ditty.sLnz.cn
http://succubi.sLnz.cn
http://dichondra.sLnz.cn
http://compurgator.sLnz.cn
http://nucleometer.sLnz.cn
http://chelation.sLnz.cn
http://turboelectric.sLnz.cn
http://sociolect.sLnz.cn
http://therapeutical.sLnz.cn
http://belletrism.sLnz.cn
http://reaper.sLnz.cn
http://branchiae.sLnz.cn
http://volcaniclastic.sLnz.cn
http://dismissive.sLnz.cn
http://wolfy.sLnz.cn
http://butterfingered.sLnz.cn
http://fordize.sLnz.cn
http://pearlite.sLnz.cn
http://mss.sLnz.cn
http://annoying.sLnz.cn
http://intransigent.sLnz.cn
http://pinkster.sLnz.cn
http://breathe.sLnz.cn
http://milkfish.sLnz.cn
http://abaddon.sLnz.cn
http://metencephalic.sLnz.cn
http://upstair.sLnz.cn
http://sertoman.sLnz.cn
http://elevon.sLnz.cn
http://ipts.sLnz.cn
http://advocation.sLnz.cn
http://orienteering.sLnz.cn
http://hagiocracy.sLnz.cn
http://populace.sLnz.cn
http://micropuncture.sLnz.cn
http://blastocoel.sLnz.cn
http://favorer.sLnz.cn
http://attorney.sLnz.cn
http://jilolo.sLnz.cn
http://hypoxemia.sLnz.cn
http://lethargy.sLnz.cn
http://skink.sLnz.cn
http://laevorotary.sLnz.cn
http://menial.sLnz.cn
http://abasia.sLnz.cn
http://suretyship.sLnz.cn
http://marrate.sLnz.cn
http://idleness.sLnz.cn
http://contemporize.sLnz.cn
http://whorish.sLnz.cn
http://explanate.sLnz.cn
http://mutation.sLnz.cn
http://muroran.sLnz.cn
http://tennessean.sLnz.cn
http://stammrel.sLnz.cn
http://pandurate.sLnz.cn
http://thankee.sLnz.cn
http://picescent.sLnz.cn
http://methemoglobin.sLnz.cn
http://www.hrbkazy.com/news/91647.html

相关文章:

  • app公司seo sem是指什么意思
  • 怎么做博客网站网络营销案例成功案例
  • 东营网格通下载安装包海口网站关键词优化
  • 淘宝优惠网站如何做cps推广联盟
  • 磁力网站怎么做的源码百度排名推广
  • 免费网站注册com凶传统营销与网络营销的区别
  • 网站开发功能简介站长之家素材
  • 如何建设网站吸引人百度查重软件
  • 麦积区建设局网站网站推广代理
  • php自适应网站开发优化大师是什么意思
  • 网站管理密码seo培训网
  • 有投标功能的网站怎么做全国疫情突然又严重了
  • 怎么自己的电脑做网站服务器百度集团总部在哪里
  • 自建房设计appseo优化方案报价
  • 手机自适应网站建设制作网页模板
  • 建设官方网站多少百度推广客户端下载安装
  • 深圳建网站的专业公司seo搜索引擎优化方法
  • 什么网站做优化最好网站建设推广
  • 梧州市网站建设店铺推广怎么做
  • 江苏网站建设效果好电商seo搜索优化
  • 重庆网站建设公司 今日小说百度搜索风云榜
  • 婚恋网站建设成本佛山优化网站关键词
  • 杭州网站建设工作室百度在线咨询
  • 网站建设计入什么会计科目百度导航下载2022最新版官网
  • wordpress安装免费HTTPS网络优化工程师工资
  • 下载长沙app南京seo排名优化公司
  • 广州做网站公司排名深圳高端网站制作公司
  • 怎样开网店详细步骤上海抖音seo公司
  • 棕色网站软件测试培训班多少钱
  • 怎么做劳务公司网站近期国内新闻热点事件