This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Alternate output modes for GNAT.Memory_Dump


Output lines from GNAT.Memory_Dump.Dump can now be prefixed with an offset
relative to the start of the dump, or have no prefix at all, instead of
showing an absolute address.

Test:
$ gnatmake -q dump_test
$ ./dump_test
00: 4C 6F 72 65 6D 20 69 70 73 75 6D 20 64 6F 6C 6F "Lorem ipsum dolo"
10: 72 20 73 69 74 20 61 6D 65 74 2C 20 63 6F 6E 73 "r sit amet, cons"
20: 65 63 74 65 74 75 65 72 20 61 64 69 70 69 73 63 "ectetuer adipisc"
30: 69 6E 67 20 73 65 64 20 64 69 61 6D 20 6E 6F 6E "ing sed diam non"
40: 75 6D                                           "um"

with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Memory_Dump; use GNAT.Memory_Dump;
procedure Dump_Test is
   S : constant String := "Lorem ipsum dolor sit amet, consectetuer adipiscing"
                          & " sed diam nonum";
begin
   Dump (S'Address, S'Length, Offset);
end;

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-07-18  Thomas Quinot  <quinot@adacore.com>

	* g-memdum.adb, g-memdum.ads (Dump): New parameter Prefix, defaulted
	to Absolute_Address.

Attachment: difs
Description: Text document


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