From 06a698058e448775721d40deb4694d7fc4e972fd Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 3 Nov 2020 06:44:36 +0000 Subject: [PATCH] changed hawk to print xma information when -D and -m are specifed --- hawk/bin/main.c | 17 +++++++++++++++-- hawk/lib/hawk-xma.h | 2 +- hawk/lib/xma.c | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/hawk/bin/main.c b/hawk/bin/main.c index 7235f4fb..01963551 100644 --- a/hawk/bin/main.c +++ b/hawk/bin/main.c @@ -1050,6 +1050,15 @@ static hawk_mmgr_t xma_mmgr = HAWK_NULL }; +static int xma_dumper_without_hawk (void* ctx, const hawk_bch_t* fmt, ...) +{ + va_list ap; + va_start (ap, fmt); + vfprintf (stderr, fmt, ap); + va_end (ap); + return 0; +} + #if defined(HAWK_BUILD_DEBUG) static hawk_uintptr_t debug_mmgr_count = 0; static hawk_uintptr_t debug_mmgr_alloc_count = 0; @@ -1245,7 +1254,7 @@ static HAWK_INLINE int execute_hawk (int argc, hawk_bch_t* argv[]) if (apply_fs_and_gvs_to_rtx(rtx, &arg) <= -1) { - print_hawk_rtx_error (hawk); + print_hawk_rtx_error (rtx); goto oops; } @@ -1293,7 +1302,11 @@ oops: if (rtx) hawk_rtx_close (rtx); if (hawk) hawk_close (hawk); - if (xma_mmgr.ctx) hawk_xma_close (xma_mmgr.ctx); + if (xma_mmgr.ctx) + { + if (app_debug) hawk_xma_dump (xma_mmgr.ctx, xma_dumper_without_hawk, HAWK_NULL); + hawk_xma_close (xma_mmgr.ctx); + } freearg (&arg); #if defined(HAWK_BUILD_DEBUG) diff --git a/hawk/lib/hawk-xma.h b/hawk/lib/hawk-xma.h index 46f0a7e8..c2e50388 100644 --- a/hawk/lib/hawk-xma.h +++ b/hawk/lib/hawk-xma.h @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2006-20202 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2006-2020 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/hawk/lib/xma.c b/hawk/lib/xma.c index 5bd8279e..bb643851 100644 --- a/hawk/lib/xma.c +++ b/hawk/lib/xma.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2019 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2006-2020 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions