diff options
author | Andrew Jeffery <andrewrj@au1.ibm.com> | 2018-09-17 17:23:04 +0930 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-10-02 14:36:19 -0500 |
commit | 8a4663c131e113ac85337a55ba72ce9e1688ec49 (patch) | |
tree | 6f8862c726a1cb4f6c0ceb46f395ac4cefb43309 /src/lib | |
parent | 506a20f3bb46ce2033719354fdf7d8c3f146985e (diff) | |
download | talos-hostboot-8a4663c131e113ac85337a55ba72ce9e1688ec49.tar.gz talos-hostboot-8a4663c131e113ac85337a55ba72ce9e1688ec49.zip |
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 <andrewrj@au1.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66117
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/assert.C | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/lib/assert.C b/src/lib/assert.C index 953393c31..bd55ae546 100644 --- a/src/lib/assert.C +++ b/src/lib/assert.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2017 */ +/* Contributors Listed Below - COPYRIGHT 2011,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -41,7 +41,8 @@ /** 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_CRITICAL) && (KernelMisc::in_kernel_mode())) { @@ -61,23 +62,23 @@ extern "C" void __assert(AssertBehavior i_assertb, int i_line) } else { - printk("Assertion failed @%p on line %d.\n", - linkRegister(), i_line); + printk("Assertion failed @%p at %s:%d.\n", + linkRegister(), i_file, i_line); } task_crash(); break; case ASSERT_CRITICAL: // Critical task, trace not available. - printk("Assertion failed @%p on line %d.(Crit_Assert)\n", - linkRegister(), i_line); + printk("Assertion failed @%p on line %s:%d. (Crit_Assert)\n", + linkRegister(), i_file, i_line); // Need to call the external CritAssert system call cpu_crit_assert(reinterpret_cast<uint64_t>(linkRegister())); break; case ASSERT_KERNEL: // Kernel assert called. - printk("Assertion failed @%p on line %d. (kassert)\n", - linkRegister(), i_line); + printk("Assertion failed @%p on line %s:%d. (kassert)\n", + linkRegister(), i_file, i_line); /*@ * @errortype |