diff options
author | neal <neal> | 2008-07-01 15:44:58 +0000 |
---|---|---|
committer | neal <neal> | 2008-07-01 15:44:58 +0000 |
commit | 1a25f9748426519fb3033f199a911c90b181a1d3 (patch) | |
tree | dc66177f83df085fd42e19cdc3aff367fe8709b1 /libhurd-mm | |
parent | 014d6a7d2c52b28b6bbd51f6687bacbfa97e29ea (diff) |
2008-07-01 Neal H. Walfield <neal@gnu.org>
* as-dump.c [RM_INTERN]: Include <md5.h>, "../viengoos/cap.h" and
"../viengoos/activity.h".
(do_walk) [RM_INTERN]: Print data pages' md5 sums as well.
Diffstat (limited to 'libhurd-mm')
-rw-r--r-- | libhurd-mm/ChangeLog | 6 | ||||
-rw-r--r-- | libhurd-mm/as-dump.c | 36 |
2 files changed, 41 insertions, 1 deletions
diff --git a/libhurd-mm/ChangeLog b/libhurd-mm/ChangeLog index 4b79c47..2af49e9 100644 --- a/libhurd-mm/ChangeLog +++ b/libhurd-mm/ChangeLog @@ -1,3 +1,9 @@ +2008-07-01 Neal H. Walfield <neal@gnu.org> + + * as-dump.c [RM_INTERN]: Include <md5.h>, "../viengoos/cap.h" and + "../viengoos/activity.h". + (do_walk) [RM_INTERN]: Print data pages' md5 sums as well. + 2008-06-24 Neal H. Walfield <neal@gnu.org> * madvise.c: New file. diff --git a/libhurd-mm/as-dump.c b/libhurd-mm/as-dump.c index cfda2b4..bdedbc4 100644 --- a/libhurd-mm/as-dump.c +++ b/libhurd-mm/as-dump.c @@ -24,6 +24,13 @@ #include <hurd/stddef.h> #include <assert.h> +#ifdef RM_INTERN +#include <md5.h> + +#include "../viengoos/cap.h" +#include "../viengoos/activity.h" +#endif + static void print_nr (int width, l4_int64_t nr, bool hex) { @@ -102,6 +109,33 @@ do_walk (activity_t activity, int index, #endif S_PRINTF ("%s", cap_type_string (cap.type)); +#ifdef RM_INTERN + if (cap.type == cap_page || cap.type == cap_rpage) + { + struct object *object = cap_to_object_soft (root_activity, &cap); + if (object) + { + struct md5_ctx ctx; + unsigned char result[16]; + + md5_init_ctx (&ctx); + md5_process_bytes (object, PAGESIZE, &ctx); + md5_finish_ctx (&ctx, result); + + S_PRINTF (" "); + int i; + for (i = 0; i < 16; i ++) + printf ("%x%x", result[i] & 0xf, result[i] >> 4); + + for (i = 0; i < PAGESIZE / sizeof (int); i ++) + if (((int *) (object))[i] != 0) + break; + if (i == PAGESIZE / sizeof (int)) + S_PRINTF (" zero page"); + } + } +#endif + if (! descend) S_PRINTF ("..."); @@ -149,5 +183,5 @@ do_walk (activity_t activity, int index, void as_dump_from (activity_t activity, struct cap *root, const char *prefix) { - // do_walk (activity, -1, root, ADDR (0, 0), 0, true, prefix); + do_walk (activity, -1, root, ADDR (0, 0), 0, true, prefix); } |