VELT-0.1.5开发: gdb串口调试内核时信息丢失的问题
来源:互联网 发布:java 对象流 编辑:程序博客网 时间:2024/05/16 19:25
快乐虾
http://blog.csdn.net/lights_joy/(QQ群:Visual EmbedLinux Tools 375515651)
欢迎转载,但请保留作者信息
本文仅适用于vs2013 + velt-0.1.5
VELT的全称是Visual EmbedLinuxTools,它是一个与visual gdb类似的visual studio插件,用以辅助完成Linux开发。利用这个插件,将可以在visual studio的IDE中进行Linux应用程序的开发(包括编译和调试),也可以进行uboot和linux内核的编译,并根据编译时的错误信息正确定位到源码。目前的版本是0.1.4,仅支持vs2013。此插件可以在CSDN下载频道下载(http://download.csdn.net/detail/lights_joy/8429771)。下面是它的基本功能:
支持x86 Linux,海思hi3516/hi3520,MinGW这几个平台,提供这几个平台的项目模板。
完成UBOOT的编译,并根据编译的错误信息自动定位到相应的文件位置。
完成LINUX内核的编译,并根据编译的错误信息自动定位到相应的文件位置。
在VS下完成Linux内核的配置。
不使用Makefile进行Linux应用程序的编译。
使用Makefile进行Linux应用程序的开发。
使用SSH连接目标机器并用gdb进行应用程序的调试。
使用Telnet连接目标机器并用gdb进行应用程序的调试。
在VS中集成Linux终端(Poderosa),支持SSH/Telnet/Com,在打开终端时自动将VS的变量导出为bash里的变量,如ProjectDir等。
当用gdb-7.8.2通过串口调试内核时,gdb并不显示内核的输出信息,或者仅能显示部分的输出信息,这对于内核调试而言很不方便。查了下gdb的代码,当gdb从串口上读取字符时是这样的:
static intgetpkt_or_notif_sane_1(char **buf, long *sizeof_buf, int forever,int expecting_notif, int *is_notif){....../* Process any number of notifications, and then return when we get a packet. */for (;;){/* If we get a timeout or bad checksum, retry up to MAX_TRIES times. */for (tries = 1; tries <= MAX_TRIES; tries++){/* This can loop forever if the remote side sends us characters continuously, but if it pauses, we'll get SERIAL_TIMEOUT from readchar because of timeout. Then we'll count that as a retry. Note that even when forever is set, we will only wait forever prior to the start of a packet. After that, we expect characters to arrive at a brisk pace. They should show up within remote_timeout intervals. */doc = readchar(timeout);} while (c != SERIAL_TIMEOUT && c != '$' && c != '%');if (c == SERIAL_TIMEOUT){......}else{/* We've found the start of a packet or notification. Now collect the data. */val = read_frame(buf, sizeof_buf);if (val >= 0)break;}remote_serial_write("-", 1);}......}}
当接收到的数据不是$或者%时,gdb直接丢弃,内核的输出信息就此惨遭毒手!
输出这些信息:
/* This can loop forever if the remote side sends us characters continuously, but if it pauses, we'll get SERIAL_TIMEOUT from readchar because of timeout. Then we'll count that as a retry. Note that even when forever is set, we will only wait forever prior to the start of a packet. After that, we expect characters to arrive at a brisk pace. They should show up within remote_timeout intervals. */do{c = readchar(timeout);if (c != SERIAL_TIMEOUT && c != '$' && c != '%')putchar(c);} while (c != SERIAL_TIMEOUT && c != '$' && c != '%');
这样就没问题了!
- VELT-0.1.5开发: gdb串口调试内核时信息丢失的问题
- VELT-0.1.3开发: MinGW gdb的一个奇怪问题
- VELT-0.1.5开发:使用kgdb调试Linux内核
- VELT-0.1.5开发:在vs2013下调试Linux内核
- VELT-0.1.5开发:中断MinGW gdb的执行
- VELT-0.1.5开发:调试方案更改
- velt-0.1.7开发: KernelConfig的问题
- VELT-0.1.5开发:在vs2013下编译gdb
- VELT-0.1.3开发: 调试参数
- VELT-0.1.6开发:在VS2013下用QEMU调试x86 Linux内核
- velt-0.2.7对qemu内核调试的支持
- 串口打印调试信息的延时问题
- 【ARM-Linux开发】用VS2013+VELT-0.1.4进行海思平台 Linux内核 的开发
- 用VS2013+VELT-0.1.4进行海思平台 Linux内核 的开发
- VELT-0.1.5开发:在vs2013下调试Linux GUI程序
- 关于单片机调试时电脑串口驱动丢失的解决办法
- 配置信息丢失问题调试及解决方法
- Linux内核开发二:GDB调试
- Divein_day02_shell总结
- java 求标准差代码实现
- 程序员面试 基本知识
- AsyncTask和Handler的优缺点比较
- leetcode: Sum Root to Leaf Numbers 菜鸟解法
- VELT-0.1.5开发: gdb串口调试内核时信息丢失的问题
- 数据结构--尾递归
- 决策树模型
- 12种常见的并发网络服务程序设计方案
- 一个常见的js邮箱正则表达式
- UNIX环境高级编程中的11章程序11-2编译问题---undefined reference to `pthread_create'
- syswrite 函数
- 图像放缩中最近邻插值和双线性插值的基本原理
- 给定一个乱序数组,找到其中第K大的值,要求时间复杂度最低