From 8a4663c131e113ac85337a55ba72ce9e1688ec49 Mon Sep 17 00:00:00 2001 From: Andrew Jeffery Date: Mon, 17 Sep 2018 17:23:04 +0930 Subject: assert: Include file name in assert output Printing the line number without an associated file is almost meaningless; add the file name to improve debug ergonomics. Change-Id: I454876ccc567cb58066362caced7efbaf92cfe62 Signed-off-by: Andrew Jeffery Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66117 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Corey V. Swenson Reviewed-by: Daniel M. Crowell --- src/runtime/rt_assert.C | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/runtime/rt_assert.C') diff --git a/src/runtime/rt_assert.C b/src/runtime/rt_assert.C index a22fe461a..ea19030f1 100644 --- a/src/runtime/rt_assert.C +++ b/src/runtime/rt_assert.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2018 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -28,12 +30,13 @@ /** Hook location for trace module to set up when loaded. */ namespace TRACE { void (*traceCallback)(void*, size_t) = NULL; }; -extern "C" void __assert(AssertBehavior i_assertb, int i_line) +extern "C" void __assert(AssertBehavior i_assertb, const char* i_file, + int i_line) { if (i_assertb != ASSERT_TRACE_DONE) { - printk("Assertion failed @%p on line %d.\n", - linkRegister(), i_line); + printk("Assertion failed @%p on line %s:%d.\n", + linkRegister(), i_file, i_line); } g_hostInterfaces->assert(); -- cgit v1.2.1