jankratochvil added a comment.

The filename should not be checked from `SymbolContext::function` but rather 
from `SymbolContext::line_entry`.  As that is cheaper.  And when one asks for 
breakpoint at `1a.h:1` then it is enough to check `.debug_line` (which needs to 
be checked anyway) and why to look into `.debug_info` for the function name 
etc. at all?
I think there is even a bug due to the Function being involved and not just 
line_entry:

  tail -n99 1b.c 1b.h;clang -o 1b 1b.c -Wall 
-g;~/redhat/llvm-monorepo2-clangassert/bin/lldb -batch ./1a -o 'breakpoint set 
-f 1b.h -l 1' 
  ==> 1b.c <==
  static void func(void) {}
  int main(void) {
  #include "1b.h"
    return 0;
  }
  ==> 1b.h <==
    func();
  (lldb) target create "./1a"
  Current executable set to '/home/jkratoch/t/1a' (x86_64).
  (lldb) breakpoint set -f 1b.h -l 1
  Breakpoint 1: no locations (pending).
  WARNING:  Unable to resolve breakpoint to any actual locations.

For a practical use case the `1b.h` should be rather called `1b.def`, there are 
such files found in many GNU projects - although usually the `*.def` files are 
included into data `struct`s and not into function code. But still. This 
reproducer should be even a part of the testcase for your patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74136/new/

https://reviews.llvm.org/D74136



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to