#1328 closed defect (fixed)

mdump (& probably wdump) in shell have problems

Reported by: Gene Smith Owned by: Joel Sherrill
Priority: normal Milestone: 4.10
Component: score Version: 4.9
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

Trying mdump command in shell, I noticed that when you ask for 256 or more bytes it goes back to showing 16 bytes (1 line) of data. Only if you leave off the length can you see the full 320 bytes (20 lines) of data which is the maximum. Also, if you ask for 17-31 bytes, you only get 1 line of data (16 byte). Only when you ask for 32 to 47 bytes do you see the 2nd line of data but not the 3rd, etc.

Looking at the code it is mainly because the number of lines is stored in an unsigned byte which loses information when > 255.

I modified the mdump code so that the number of bytes is stored in an int instead of a char. Also, fixed so that the if 320 or less bytes are requested, the exact number of locations are accessed and printed instead of a multiple of 16.

I will attach a patch for this shortly, after a bit more testing. Probably wdump (word dump) has the same problem but have not yet tried it.

Attachments (2)

main_mdump.c.diff (1.3 KB) - added by Gene Smith on Sep 30, 2008 at 10:10:16 PM.
Patch to main_mdump.c relative to 4.9.0 version
main_mwdump.c.diff (1.6 KB) - added by Gene Smith on Sep 30, 2008 at 10:11:28 PM.
Patch to main_mwdump.c relative to 4.9.0 version

Download all attachments as: .zip

Change History (3)

Changed on Sep 30, 2008 at 10:10:16 PM by Gene Smith

Attachment: main_mdump.c.diff added

Patch to main_mdump.c relative to 4.9.0 version

Changed on Sep 30, 2008 at 10:11:28 PM by Gene Smith

Attachment: main_mwdump.c.diff added

Patch to main_mwdump.c relative to 4.9.0 version

comment:1 Changed on Oct 1, 2008 at 7:06:46 PM by Joel Sherrill

Resolution: fixed
Status: newclosed

Patch committed to 4.9 branch and CVS head. Also updated 4.9.1 entry on Wiki to include this PR as addressed in 4.9.1.

Note: See TracTickets for help on using tickets.