<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 7/11/16 8:46 AM, 李阳 via llvm-dev
      wrote:<br>
    </div>
    <blockquote
cite="mid:CACYKtHDB=_rN2j7vJD6PVWg8=MKNP_88A4AuDZaH0xNrUFEELQ@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi all,
        <div><br>
        </div>
        <div>Since my pass doesn't work right, I follow the guide
          [Writing an LLVM Pass: Using GDB with dynamically loaded
          passes] to debug my pass.</div>
        <div><br>
        </div>
        <div>However, I succeed to meet the step: <span>the <b>opt</b></span><span> stops
            in the </span><tt class=""><span class="">PassManager::run</span></tt><span> method,
            I have no idea about setting breakpoints in my pass.These
            section is not detailed. Could anyone spare some guide?</span></div>
      </div>
    </blockquote>
    <br>
    This part of the document assumes that you are familiar with using
    gdb to set breakpoints; it's really there just to describe the
    less-obvious solution of setting breakpoints in dynamically loaded
    code.<br>
    <br>
    According to the document, once you hit a breakpoint in
    PassManager::run, you can then set a break point for a method or
    function in your pass.  For example, if your pass is named
    llvm::MyPass, then you can use:<br>
    <br>
    break llvm::MyPass::runOnModule<br>
    <br>
    ... to set up a break point in your pass's runOnModule() method.  To
    get opt running again so that it will eventually run your pass and
    hit the breakpoint, use the continue command:<br>
    <br>
    continue<br>
    <br>
    For more information on how to use gdb, see the documentation for
    gdb at <a class="moz-txt-link-freetext" href="https://www.gnu.org/software/gdb/">https://www.gnu.org/software/gdb/</a>.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <br>
    <blockquote
cite="mid:CACYKtHDB=_rN2j7vJD6PVWg8=MKNP_88A4AuDZaH0xNrUFEELQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><span><br>
          </span></div>
        <div><span>Thanks very much!</span></div>
        <div><span><br>
          </span></div>
        <div><span>Best,</span></div>
        <div><span>liyang</span></div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>