Skip to content
  • Maarten Lankhorst's avatar
    lib/core: Use libdw to decode stack trace with debugging symbols, v2. · e39e0991
    Maarten Lankhorst authored
    libdw is a new dependency built from the elfutils package. It provides
    us a way to generate line numbers and file names from the instruction
    pointer.
    
    elfutils is LGPLv3 or GPLv2, so it's ok to link against it.
    
    Before:
    IGT-Version: 1.23-g8ae86abd419d (x86_64) (Linux: 4.16.0-1-amd64 x86_64)
    Starting subtest: fail-result
    (meta_test:29661) CRITICAL: Test assertion failure function test_result, file ../tests/meta_test.c:94:
    (meta_test:29661) CRITICAL: Failed assertion: result == 1
    (meta_test:29661) CRITICAL: error: 0 != 1
    Stack trace:
      #0 [__igt_fail_assert+0x20a]
      #1 [test_result+0x7a]
      #2 [__real_main120+0x240]
      #3 [main+0x4a]
      #4 (../csu/libc-start.c) __libc_start_main:344
      #5 [_start+0x2a]
    
    After:
    IGT-Version: 1.23-g8ae86abd419d (x86_64) (Linux: 4.16.0-1-amd64 x86_64)
    Starting subtest: fail-result
    (meta_test:1357) CRITICAL: Test assertion failure function test_result, file ../tests/meta_test.c:94:
    (meta_test:1357) CRITICAL: Failed assertion: result == 1
    (meta_test:1357) CRITICAL: error: 0 != 1
    Stack trace:
      #0 ../lib/igt_core.c:1467 __igt_fail_assert()
      #1 ../tests/meta_test.c:95 test_result()
      #2 ../tests/meta_test.c:137 __real_main120()
      #3 ../tests/meta_test.c:120 main()
      #4 ../csu/libc-start.c:344 __libc_start_main()
      #5
    
     [_start+0x2a]
    
    Changes since v1:
    - Add libdw dependency to readme.
    - Change backtrace format slightly.
    
    Cc: Petri Latvala <petri.latvala@intel.com>
    Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
    [mlankhorst: Add description about libdw in commit msg, name -> dwfl_name]
    Reviewed-by: default avatarPetri Latvala <petri.latvala@intel.com>
    e39e0991