<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/69594>69594</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Help on How to debug LLVM JIT
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Thrrreeee
      </td>
    </tr>
</table>

<pre>
     I attempted to debug the examples in the LLVM JIT project using the LLDB debugging tool, specifically LLJITDumpObjects.cpp. However, I encountered an issue when I reached the statement 'int Result = Add1(42);.' At this point, it automatically jumps to the assembly code of the Add1 function, making it challenging for me to comprehend the step-by-step process of how JIT compiles the Add1 module in real-time. 
Here are my steps:
[https://github.com/llvm/llvm-project/blob/main/llvm/examples/OrcV2Examples/LLJITDumpObjects/LLJITDumpObjects.cpp](url)
I compile the file using the following command:
```shell
clang++ -g LLJITDumpObjects.cpp `llvm-config --cxxflags --ldflags --system-libs --libs core orcjit native`  -O3 -o LLJITDumpObjects
``` 

Then I set a breakpoint at 'int Result = Add1(42)' , I use LLDB for debugging.
```c++
// Look up the JIT'd function, cast it to a function pointer, then call it.
  auto Add1Addr = ExitOnErr(J->lookup("add1"));
  int (*Add1)(int) = Add1Addr.toPtr<int(int)>();
  int Result = Add1(42);
  outs() << "add1(42) = " << Result << "\n";
``` 
When I choose to step into this statement,then assembly code for the 'Add1' function appears:
![image](https://github.com/llvm/llvm-project/assets/72311224/aacb2a8f-010e-4f07-ab82-c83405ec7343)
So during my debugging process, I have no way of knowing how JIT operates.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVd1uqzgQfhrnZkQEJiRwwUV-dVJ11dVudfbamAHcGhvZpmnefmUTkj3ds1odqarDeDx_33wzzFrRKsSSZDuSHRZsdJ025WtnjEFEXFS6vpZwBuYc9oPDGpyGGquxBdch4CfrB4kWhArfz8_ff4On8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