labath added a comment.

I think that having this behavior key off of a flag is really confusing. I 
think the most sensible behavior here would be to introduce a new option like 
`--compile-unit` and have that behave like the current --file+--function mode. 
This would free up the --file argument for the behavior that you want to 
implement here.

I.e.:

- --compile-unit+--function: search for the occurence of the given function in 
the given compile unit (ignoring DW_AT_decl_file)
- --file+--function: search for the given function defined in the given file 
(no matter which compile unit it comes from). This would be consistent with the 
--file+--line scenario. For maximal consistence this should also respect the 
`target.inline-breakpoint-strategy` setting and only do an exhaustive file 
search when the value of that setting is "always". If the value is "headers" 
then we should assume that the name of the .cpp file refers to a compile unit 
and only search the unit with that name.

The change in behavior is unfortunate, but I don't think this is something that 
a lot of people will depend on because the current behavior is quite confusing. 
And I think it's better to change it now instead of painting ourselves into an 
even smaller corner. To reduce surprises we can issue a warning about the 
behavior change when the user uses this flag combination. And making these 
things separate paves the way for introducing new combinations of flags 
(--compile-unit+--file+--name, or --compile-unit+--file+--line) with a 
reasonably predictable behavior...


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