GDB从一行的8个字节到4个字节检查数据显示格式 [英] GDB examine data display format from 8 bytes in a row to 4 bytes

查看:677
本文介绍了GDB从一行的8个字节到4个字节检查数据显示格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的 gdb

 (gdb) x / 20bx 0xbffff2c0 
0xbffff2c0:0xd4 0xf2 0xff 0xbf 0x16 0x8f 0x04 0x08
0xbffff2c8:0x05 0x00 0x00 0x00 0x00 0x00 0x0c 0x42
0xbffff2d0:0x6b 0x00 0x00 0x00

可以将它更改为连续4个字节吗?

解决方案

gdb (至少在我看到的7.1和7.6源代码中)hard-wires每行元素的最大数量,<$ c
$ b

  maxelts = 8; $ c> x 将根据格式打印。


if(size =='w')
maxelts = 4;
if(size =='g')
maxelts = 2;
if(format =='s'|| format =='i')
maxelts = 1;

解决方法是获得您想要的内容,然后键入 x / 4bx 0xbffff2c0 打印4个元素,然后键入输入打印每个连续的4个元素集。


This is the display of my gdb

(gdb) x/20bx 0xbffff2c0
0xbffff2c0: 0xd4    0xf2    0xff    0xbf    0x16    0x8f    0x04    0x08
0xbffff2c8: 0x05    0x00    0x00    0x00    0x00    0x00    0x0c    0x42
0xbffff2d0: 0x6b    0x00    0x00    0x00

Is is possible to change it to 4 bytes in a row?

解决方案

gdb (at least in the 7.1 and 7.6 source I looked at) hard-wires the maximum number of elements per line that x will print, based on the format.

maxelts = 8;
if (size == 'w')
  maxelts = 4;
if (size == 'g')
  maxelts = 2;
if (format == 's' || format == 'i')
  maxelts = 1;

A workaround to get what you want is to type x/4bx 0xbffff2c0 to print 4 elements and then type just enter to print each successive set of 4 elements.

这篇关于GDB从一行的8个字节到4个字节检查数据显示格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆