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

查看:32
本文介绍了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 个字节?

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

推荐答案

gdb(至少在我查看的 7.1 和 7.6 源代码中)硬连接每行的最大元素数 x 将根据格式打印.

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;

获得所需内容的解决方法是键入 x/4bx 0xbffff2c0 以打印 4 个元素,然后仅键入 enter 以打印每个连续的 4 个元素集.

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天全站免登陆