调试代码 显示rawbin
来源:互联网 发布:免费域名申请tk 编辑:程序博客网 时间:2024/05/17 01:43
#define Ser_Printf printf
#define macdbg_prser printf
int macdbg_dmphex(const char* buff, int len)
{
int retval = 0;
int x, y, tot, lineoff;
const char* curr;
//Ser_Printf("buff %x.\r\n", buff );
Ser_Printf("\r\n" );
lineoff = 0;
curr = buff;
tot = 0;
for( x = 0; x+16 < len; ){
Ser_Printf("%x\t", lineoff);
for( y = 0; y < 16; y++ ){
macdbg_prser("%02x ", (unsigned char)*(curr + y));
}
macdbg_prser(" ");
for( y = 0; y < 16; y++ ){
char c;
c = *(curr + y);
if( c > 31 && c < 127 ){
macdbg_prser("%c", c);
}else{
macdbg_prser("%c", '.');
}
tot++;
}
curr += 16;
x += 16;
lineoff+=16;
macdbg_prser("\r\n");
}
//do last line
//Ser_Printf("tot %d.\r\n", tot );
//Ser_Printf("len %d.\r\n", len );
if( tot < len ){
curr = (buff + tot);
macdbg_prser("%x\t", lineoff);
for( y = 0; y < (len - tot); y++ ){
macdbg_prser("%02x ", (unsigned char)*(curr + y));
}
//padding with spaces
//Ser_Printf("(len - tot) %d.\r\n", (len - tot) );
if( (len - tot) < 16 ){
for( y = 0; y < (32 - ((len - tot)*2)); y++ ){
macdbg_prser(" ");
}
}
for( y = 0; y < 16-(len - tot); y++ ){
macdbg_prser(" ");
}
macdbg_prser(" ");
//Ser_Printf("(len - tot) %d.\r\n", (len - tot) );
for( y = 0; y < (len - tot); y++ ){
char c;
c = *(curr + y);
if( c >31 && c < 127 ){
macdbg_prser("%c", c);
}else{
macdbg_prser("%c", '.');
//macdbg_prser("%c", c);
}
}
}
macdbg_prser("\r\n");
return retval;
}
0 0
- 调试代码 显示rawbin
- gdb调试不显示代码的原因
- Qt Quick调试之显示代码行号
- VC6调试 ATL 显示内存泄漏代码文件行号
- GDB调试中动态显示执行的代码
- opencv视频获取显示代码问题和调试
- java调试过程 jdk部分代码无法显示变量值
- vs2010调试qt代码 qsting变量值不显示
- 字符串显示问题(方便初学者串口调试代码)
- 调试代码
- 代码调试
- 调试代码
- 调试代码
- 代码调试
- 代码调试
- 代码调试
- 代码调试
- 代码调试
- myeclipse安装SVN插件
- Maximum Product of Word Lengths
- <c:forEach>
- 差分约束系统入门
- 中兴笔试
- 调试代码 显示rawbin
- 华为2017年大牛机试题—10进制转换位12进制
- struts基础
- 第2周项目3-体验复杂度(1)
- 51nod1002 数塔取数问题
- Android Glide简单用法
- 一名猎头想对候选人说的心里话
- Android中ClassLoader和java中有什么关系和区别
- centos 6.5 部署tomcat 实现自动化部署