<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<blockquote
cite="mid:CAENS6EtFhJBcoNizfyD-41-hXL_A-OyYQssSvQOp-xwtj+ywmw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Wed, Jun 24, 2015 at 2:28 PM, Oleg
Ranevskyy <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:llvm.mail.list@gmail.com" target="_blank">llvm.mail.list@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> Hi David,<br>
<br>
I got a problem related to the change made in r188651 -
not including file/line info for artificial arguments
like "this" and "self".<br>
Would you be able to take a look at it, please?<br>
</div>
</blockquote>
<div><br>
</div>
<div>Could you provide a simple test case? (& ideally:
does this reproduce on X86, a platform I've easy access to
(& if it doesn't, I'd be curious to understand why
not...))</div>
</div>
</div>
</div>
</blockquote>
Sure. It's enough to have a simple class with a constructor and
create its instance. <br>
Compile it w/o fast ISel, e.g.: clang -g -O0 main.cpp
--target=armv7l-unknown-linux-gnueabihf -mllvm -fast-isel=0<br>
<br>
class MyClass<br>
{<br>
public:<br>
MyClass()<br>
{<br>
}<br>
};<br>
int main()<br>
{<br>
MyClass obj; // <-- can't step into MyClass::MyClass() here<br>
return 0;<br>
}<br>
<br>
It didn't reproduce on X86_64 though. I will try to find out why.<br>
<blockquote
cite="mid:CAENS6EtFhJBcoNizfyD-41-hXL_A-OyYQssSvQOp-xwtj+ywmw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">I am compiling the
code for ARM linux with fast ISel disabled: -mllvm
-fast-isel=0. The problem is that it's not possible to
step into<span></span> the constructor, destructor or a
method of a class while debugging. Clang generates
correct .loc in function prologues, but then, due to
r188651, inserts a debug info location with zeroed line
number (.loc 1 0 0) for "this", which misleads the
debugger. <br>
<br>
Could you explain the reasoning behind this change,
please?<br>
</div>
</blockquote>
<div><br>
The reason for the change, if I recall correctly (perhaps
I mentioned in the commit message, I'm not sure) was to
reduce debug info size for the debug_info section - I
don't believe the intent was to have any impact on the
line table.<br>
<br>
(artificial variables, like "this" don't have a location
they are declared on, so there was/is no need to have a
DW_AT_decl_file/line in the debug_info describing their
declaration location)<br>
</div>
</div>
</div>
</div>
</blockquote>
I see, thanks.<br>
The r188651 patch leads to inserting ".loc 1 0 0" into the
constructor's code. Here is a part of the assembly I get for the
MyClass constructor:<br>
<br>
_ZN7MyClassC2Ev: @ @_ZN7MyClassC2Ev<br>
.Lfunc_begin1:<br>
.loc 1 7 0 @ main.cpp:7:0<br>
.fnstart<br>
.cfi_startproc<br>
@ BB#0: @ %entry<br>
.loc 1 0 0 @ main.cpp:0:0
<-------------- loc with line == 0 confuses the debugger<br>
.pad #4<br>
sub sp, sp, #4<br>
....<br>
<br>
Fast ISel removes this ".loc 1 0 0", so the debugger successfully
steps into the constructor due to the previous ".loc 1 7 0".<br>
<blockquote
cite="mid:CAENS6EtFhJBcoNizfyD-41-hXL_A-OyYQssSvQOp-xwtj+ywmw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> <br>
This hasn't been noticed before due to the fast ISel
omitting location info for arguments, so the correct
location from the prologue is used. It is probably yet
another problem to handle.<br>
<br>
Thanks in advance for any help.<br>
Kind regards,<br>
Oleg<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<br>
</body>
</html>