[llvm-dev] [cfe-dev] RFC: Remove uninteresting debug locations at -O0
Robinson, Paul via llvm-dev
llvm-dev at lists.llvm.org
Wed Apr 29 05:48:39 PDT 2020
> -----Original Message-----
> From: cfe-dev <cfe-dev-bounces at lists.llvm.org> On Behalf Of Pavel Labath
> via cfe-dev
> Sent: Wednesday, April 29, 2020 7:27 AM
> To: Adrian Prantl <aprantl at apple.com>
> Cc: Davidino Italiano <ditaliano at apple.com>; Clang Dev <cfe-
> dev at lists.llvm.org>
> Subject: Re: [cfe-dev] RFC: Remove uninteresting debug locations at -O0
> On Tue, 28 Apr 2020 at 22:58, Adrian Prantl via cfe-dev
> <cfe-dev at lists.llvm.org> wrote:
> > or will inherit whatever debug location the instruction before it has
> This part looks worrying to me. Would that mean, that if in your
> example, I set a breakpoint on line 7, the program would stop directly
> at the callq instruction? That seems like it would break the following
> b 7
> # program stops at line 7
> p foo
> # hmm... that value isn't right, lemme see what happens if I change it
> p foo = other_foo
> In non-optimized builds I would expect to be able to make these kinds
> of modifications to the program and things should generally "work". In
> that sense, maybe these loads are not "uninteresting" as they are what
> makes these modifications take effect.
There are a couple of things going on here, which are about perceptions
and the user experience.
First is the source-syntactic difference between method and function calls:
These turn into the same instruction sequence (load foo and call getFoo).
In the second case, I think it's pretty clear we'd want to stop before
we start loading the arguments. In the first case the syntax tricks us
into thinking the load isn't part of the calling sequence; but it still is.
Second is the broader and more hand-wavy aspect of "what is a statement"
and "how many points within a subexpression are we going to distinguish"
which DWARF itself is not particularly helpful about, and does its own
hand-wavy thing with the poorly named "quality of implementation" rubric.
I don't think arbitrarily deciding "loads are not interesting" is a good
heuristic. Personally I think the user needs better training. 😊
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
More information about the llvm-dev