<div dir="ltr">Sounds like a good idea to me.<div><br></div><div>(For testing I'd recommend a .ll file with the paths you need hard coded and lldb-test breakpoint.)</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, 14 Mar 2018 at 05:16, Greg Clayton via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255)"><span style="font-size:11px;color:rgb(79,129,135)">When using "</span><font color="#4f8187"><span style="font-size:11px">settings set target.source-map", when we try to set breakpoints by file and line, we try to undo any source remapping we did so we can set the breakpoint correctly:</span></font></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;background-color:rgb(255,255,255)"><span style="color:#4f8187"><br></span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;background-color:rgb(255,255,255)"><span style="color:#4f8187">BreakpointSP</span> <span style="color:#4f8187">Target</span>::CreateBreakpoint(<span style="color:#ba2da2">const</span> <span style="color:#4f8187">FileSpecList</span> *containingModules,</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;background-color:rgb(255,255,255)">                                      <span style="color:#ba2da2">const</span> <span style="color:#4f8187">FileSpec</span> &file, <span style="color:#703daa">uint32_t</span> line_no,</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;background-color:rgb(255,255,255)">                                      <span style="color:#4f8187">lldb</span>::<span style="color:#4f8187">addr_t</span> offset,</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;background-color:rgb(255,255,255)">                                      <span style="color:#4f8187">LazyBool</span> check_inlines,</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;background-color:rgb(255,255,255)">                                      <span style="color:#4f8187">LazyBool</span> skip_prologue, <span style="color:#ba2da2">bool</span> internal,</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;background-color:rgb(255,255,255)">                                      <span style="color:#ba2da2">bool</span> hardware,</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;background-color:rgb(255,255,255)">                                      <span style="color:#4f8187">LazyBool</span> move_to_nearest_code) {</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;background-color:rgb(255,255,255)">  <span style="color:#4f8187">FileSpec</span> remapped_file;</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;background-color:rgb(255,255,255)">  <span style="color:#4f8187">ConstString</span> remapped_path;</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;color:rgb(49,89,93);background-color:rgb(255,255,255)"><span style="color:#000000">  </span><span style="color:#ba2da2">if</span><span style="color:#000000"> (</span>GetSourcePathMap<span style="color:#000000">().</span>ReverseRemapPath<span style="color:#000000">(</span><span style="color:#4f8187">ConstString</span><span style="color:#000000">(file.</span>GetPath<span style="color:#000000">().</span><span style="color:#3e1e81">c_str</span><span style="color:#000000">()),</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;background-color:rgb(255,255,255)">                                          remapped_path))</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;background-color:rgb(255,255,255)">    remapped_file.<span style="color:#31595d">SetFile</span>(remapped_path.<span style="color:#31595d">AsCString</span>(), <span style="color:#ba2da2">true</span>);</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;color:rgb(186,45,162);background-color:rgb(255,255,255)"><span style="color:#000000">  </span>else</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;background-color:rgb(255,255,255)">    remapped_file = file;</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;background-color:rgb(255,255,255);min-height:14px"><br></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;background-color:rgb(255,255,255);min-height:14px"><br></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;background-color:rgb(255,255,255);min-height:14px">Note that the "<span style="font-size:11px">remapped_file.</span><span style="font-size:11px;color:rgb(49,89,93)">SetFile</span><span style="font-size:11px">(remapped_path.</span><span style="font-size:11px;color:rgb(49,89,93)">AsCString</span><span style="font-size:11px">(), </span><span style="font-size:11px;color:rgb(186,45,162)">true</span><span style="font-size:11px">);" is saying to resolve the path. I don't believe we want this path to resolve itself right?</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;background-color:rgb(255,255,255);min-height:14px"><span style="font-size:11px"><br></span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;background-color:rgb(255,255,255);min-height:14px"><span style="font-size:11px">I am currently running issues when using this with:</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;background-color:rgb(255,255,255);min-height:14px"><span style="font-size:11px"><br></span></div><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255);min-height:14px"><span style="font-family:Helvetica;font-size:11px">(lldb) </span><font face="Helvetica"><span style="font-size:11px">settings set target.source-map ./ /Users/me/source</span></font></div><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255);min-height:14px"><font face="Helvetica"><span style="font-size:11px"><br></span></font></div><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255);min-height:14px"><font face="Helvetica"><span style="font-size:11px">The debug info has all of the compilation directories set to "." and the resolving the path will cause the current working directory to be used when resolving the path and then we can't set breakpoints because the resolved path doesn't match. Any objections if I change the second argument to false so it doesn't resolve? I can't imagine we would want this reverse mapping to resolve??</span></font></div><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255);min-height:14px"><br></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;background-color:rgb(255,255,255);min-height:14px"><br></div></div>_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
</blockquote></div>