[lldb-dev] getting filename/line #

Randy Heiland via lldb-dev lldb-dev at lists.llvm.org
Thu Jun 21 08:18:45 PDT 2018


I cannot figure how to get a backtrace with filenames/line #s. Suggestions?
(And if this list is not the proper one to ask such questions, please
redirect me)

On OSX with:
$ lldb --version
lldb-900.0.64
  Swift-4.0

For example:
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001001e7d42 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fffc4d91457 libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x00007fffc4c09420 libsystem_c.dylib`abort + 129
    frame #3: 0x00007fffc4cf8fe7 libsystem_malloc.dylib`free + 530
    frame #4: 0x0000000100017138
pc-nb`BioFVM::Microenvironment::compute_gradient_vector(int) + 472
    frame #5: 0x00000001000174ca
pc-nb`BioFVM::Microenvironment::gradient_vector(int) + 42
    frame #6: 0x0000000100021bc1
pc-nb`BioFVM::Basic_Agent::nearest_gradient(int) + 17
    frame #7: 0x0000000100069ccc
pc-nb`chemotaxis_function(PhysiCell::Cell*, PhysiCell::Phenotype&, double)
+ 364
    frame #8: 0x0000000100054ecc
pc-nb`PhysiCell::Cell::update_motility_vector(double) + 284
    frame #9: 0x0000000100053262
pc-nb`PhysiCell::standard_update_cell_velocity(PhysiCell::Cell*,
PhysiCell::Phenotype&, double) + 818
    frame #10: 0x0000000100051053 pc-nb`.omp_outlined..7 + 211
    frame #11: 0x0000000100186043 libomp.dylib`__kmp_invoke_microtask + 147
    frame #12: 0x000000010015bfff libomp.dylib`__kmp_invoke_task_func + 156
    frame #13: 0x000000010015943c libomp.dylib`__kmp_fork_call + 5961
    frame #14: 0x000000010015075e libomp.dylib`__kmpc_fork_call + 192
  * frame #15: 0x0000000100050b0c
pc-nb`PhysiCell::Cell_Container::update_all_cells(double, double, double,
double) + 780
    frame #16: 0x0000000100071a54 pc-nb`main + 2516
    frame #17: 0x00000001001c5235 libdyld.dylib`start + 1
    frame #18: 0x00000001001c5235 libdyld.dylib`start + 1

It would seem that my default formatting would have this:
(lldb) settings show frame-format
frame-format (format-string) = "frame #${frame.index}: ${frame.pc}{
${module.file.basename}{`${function.name-with-args}{${frame.no-debug}${function.pc-offset}}}}{
at ${line.file.basename}:${line.number}}{${function.is-optimized} [opt]}\n"

Thanks!
-Randy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20180621/348e0a5b/attachment-0001.html>


More information about the lldb-dev mailing list