util-linux调试

Debian下调试util-linux

通过dpkg-buildpackage覆盖编译选项,按照-g -O0编译

cat /etc/dpkg/buildflags.conf 
SET CFLAGS -g -O0 -fdebug-prefix-map=/home/uos/work/util-linux/gerrit/util-linux=. -fstack-protector-strong -Wformat -Werror=format-security
SET CXXFLAGS -g -O0 -fdebug-prefix-map=/home/uos/work/util-linux/gerrit/util-linux=. -fstack-protector-strong -Wformat -Werror=format-security
SET FCFLAGS -g -O0 -fdebug-prefix-map=/home/uos/work/util-linux/gerrit/util-linux=. -fstack-protector-strong
SET FFLAGS -g -O0 -fdebug-prefix-map=/home/uos/work/util-linux/gerrit/util-linux=. -fstack-protector-strong
SET GCJFLAGS -g -O0 -fdebug-prefix-map=/home/uos/work/util-linux/gerrit/util-linux=. -fstack-protector-strong
SET OBJCFLAGS -g -O0 -fdebug-prefix-map=/home/uos/work/util-linux/gerrit/util-linux=. -fstack-protector-strong -Wformat -Werror=format-security
SET OBJCXXFLAGS -g -O0 -fdebug-prefix-map=/home/uos/work/util-linux/gerrit/util-linux=. -fstack-protector-strong -Wformat -Werror=format-security

配置环境变量nostrip

export DEB_BUILD_OPTIONS=nostrip

配置日志等级

export LIBBLKID_DEBUG=all
   all      [0xffff] : info about all subsystems
   cache    [0x0004] : blkid tags cache
   config   [0x0008] : config file utils
   dev      [0x0010] : device utils
   devname  [0x0020] : /proc/partitions evaluation
   devno    [0x0040] : conversions to device name
   evaluate [0x0080] : tags resolving
   help     [0x0001] : this help
   lowprobe [0x0100] : superblock/raids/partitions probing
   buffer   [0x2000] : low-probing buffers
   probe    [0x0200] : devices verification
   read     [0x0400] : cache parsing
   save     [0x0800] : cache writing
   tag      [0x1000] : tags utils
参考源码中Documentation/howto-debug.txt
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在Linux上安装ESP-IDF,您可以按照以下步骤进行操作: 1. 首先,确保您的系统已联网。如果未联网,您可以按照以下步骤设置网络连接: - 编辑->虚拟网络编辑器->更改设置->桥接模式(桥接至电脑IP描述)->应用->确定。 2. 下载Python软件包。您可以使用以下命令安装所需的软件包: ``` sudo apt-get install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 ``` 3. 安装git工具: ``` sudo apt install git ``` 4. 获取ESP-IDF。您可以使用终端命令创建一个新的工程文件夹,然后克隆ESP-IDF仓库: ``` mkdir esp_4.1 cd esp_4.1 git clone -b v4.1 --recursive https://github.com.cnpmjs.org/espressif/esp-idf.git ``` 如果在下载过程中遇到错误,您可以在esp-idf目录下执行以下命令来完成初始化: ``` git submodule update --init --recursive ``` 5. 安装其他所需工具。除了ESP-IDF本身,您还需要安装其他工具,如编译器、调试器、Python包等。 6. 将hello_world示例拷贝到esp_4.1文件夹下: ``` cp esp-idf/examples/get-started/hello_world/ ./ -r ``` 7. 进入hello_world示例并编译代码: ``` cd hello_world idf.py build ``` 8. 使用USB线将ESP32模组连接到电脑。您可以使用以下命令查看下载端口: ``` ls /dev/tty* ``` 您可以找到一个类似于`/dev/ttyUSB0`的端口,这就是下载端口号。 9. 最后,将esp-idf环境加入环境变量。您可以将以下命令复制并粘贴到shell配置文件中(如.profile、.bashrc、.zprofile等): ``` alias get_idf='. $HOME/esp_4.1/esp-idf/export.sh' ``` 确保文件路径正确。保存并关闭文件后,重启虚拟机或使用以下命令刷新配置文件: ``` source .profile ``` 现在,您已经成功安装并配置了ESP-IDF环境。您可以运行示例代码并开始开发ESP32应用程序了。<span class="em">1</span><span class="em">2</span><span class="em">3</span><span class="em">4</span>

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值