<div dir="ltr">Given the desire to support interoperability with binutils dwp, if it's easy enough to support multiple -e (I dunno if LLVM's command line parsing has nice support for that sort of thing?) maybe that's the best thing.<br><br>(if that's difficult, maybe we could be compatible with binutils dwp by accepting and ignoring '-e' and accepting all executables and dwo files as described - just searching any file without a debug_info.dwo section, for any CUs in the debug_info and using those for the input file list)</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Sep 1, 2017 at 12:34 PM Alexander Shaposhnikov via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">alexshap added inline comments.<br>
<br>
<br>
================<br>
Comment at: tools/llvm-dwp/llvm-dwp.cpp:725-727<br>
+  ArrayRef<std::string> DWOs = DWOFilenames.empty()<br>
+                                   ? ArrayRef<std::string>(InputFiles)<br>
+                                   : ArrayRef<std::string>(DWOFilenames);<br>
----------------<br>
dblaikie wrote:<br>
> Seems weird to ignore all the other inputs silently if -e is specified. Maybe error out if there are both?<br>
><br>
> Alternatively could support both, maybe - more like what I mentioned above, even. Could detect that something is an executable/contains skeleton units - use those to find DWOs, and treat that as another source of DWOs (so you could have arbitrarily many executables and DWOs on the command line and they'd all be read and smooshed into a DWP).<br>
><br>
> *shrug* Dunno.<br>
><br>
> What does binutils dwp do if you have both -e and .dwo files? Error?<br>
yeah,<br>
i've just looked at binutils dwp ( 2.25.1-22.base.el7).<br>
Actually binutils dwp behaves differently, it takes everything, i.e.<br>
<br>
  [alexshap@devvm32123.prn1 ~/fission/build] dwp c.dwo -e out/libFoo.so -o test.dwp<br>
  [alexshap@devvm32123.prn1 ~/fission/build] cat c.cpp<br>
  struct XXXXXX {<br>
    int YYYYYY;<br>
   };<br>
<br>
   int ZZZZZZ() {<br>
     XXXXXX x;<br>
     return x.YYYYYY;<br>
   }<br>
   [alexshap@devvm32123.prn1 ~/fission/build] strings test.dwp | grep ZZZZZZ<br>
   ZZZZZZ<br>
   _Z6ZZZZZZv<br>
<br>
additionally, binutils dwp allows to pass -e multiple times.<br>
<br>
so yes, we can try to replicate this behavior (that looks easy),<br>
alternatively, we can try to avoid introducing this new flag and try to extract the necessary information from the files themselves (i agree, this probably would be cleaner, on the down side - requires more work/a bit more complex logic + switching back and forth from bintutils version to llvm will require changing the invocation)  @dblaikie - how should we proceed ?<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D37371" rel="noreferrer" target="_blank">https://reviews.llvm.org/D37371</a><br>
<br>
<br>
<br>
</blockquote></div>