This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [patch] new command: 'dump' a region of memory in ascii and hex


> Date: Tue, 21 Nov 2000 18:33:41 -0800
> From: David Whedon <dwhedon@gordian.com>
> 
> Here is a new function that I have found useful, maybe you will too.  The only
> thing I don't completely like about it is that I have to make my xterm wider
> than 80 chars for most of the output to look good.  This means it won't look
> very good at all at console.

I think this is not a good idea, at least not as the default.  Note
that the symbol names can be much longer than in your example
(especially with C++ programs), which might make the display awkward
to read at best, and utterly unreadable at worst.  The symbol names
seem a bit redundant, anyway, for many uses of such a memory dump.

How about the following format:

    (top-gdb) dump 0x683d3
    Dumping from 0x683d3 <internal_error+3> to 0x68463 <safe_strsignal+35>
    <safe_strsignal>:
    0x683d3:      8d450c50 ff7508e8 05ffffff 9028756e    .E.P.u.......(un
    0x683e3:      646f6375 6d656e74 65642065 72726e6f    documented.errno
    <safe_strerror>:
    0x68403:      0c0083c4 0485c075 155368e0 83060068    .......u.Sh....h
    0x68413:      bc151400 e8f87c0c 00b8bc15 14008b5d    ......|........]
    0x68423:      fcc9c328 756e646f 63756d65 6e746564    ...(undocumented
    0x68433:      20736967 6e616c20 25642900 005589e5    .signal.%d)..U..
    0x68443:      538b5d08 53e83355 0a0083c4 0485c075    S.].S.3U.......u
    0x68453:      15536826 84060068 dc151400 e8b07c0c    .Sh&...h......|.
    0x68463:      00b8dc15 14008b5d fcc9c33a 20002573    .......]...:..%s
    End of dump from 0x683d3 <internal_error+3> to 0x68463 <safe_strsignal+35>
    (top-gdb)

We could then have an option that modifies this display to put the
symbol names on each line, like your original suggestion, for those
who want that.

> 2000-11-21  David Whedon <dwhedon@gordian.com>
> 	* printcmd.c (dump_command) : new command that dumps a region 
> 	of memory in hex and ascii
> 	(_initialize_printcmd) : add 'dump' to command list.

Please accompany the changes with a suitable additions to
gdb.texinfo.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]