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

    <tr>
        <th>Summary</th>
        <td>
            Fortran language support in lldb
        </td>
    </tr>

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

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

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

<pre>
    As prompted by https://discourse.llvm.org/t/flang-fortran-plugin-for-lldb-status/81301, this is a tracking issue for Fortran support. It existing doesn't mean work is being done or not, it's just a place to find the most recent status.

Currently lldb has no specific support for Fortran. All it knows is that there is such a language. We can still display source and line step though.

```
$ cat /tmp/test.f90
program hello
  print *, 'Hello, World!'
  print *, 'Hello, World!'
  print *, 'Hello, World!'
  print *, 'Hello, World!'
  print *, 'Hello, World!'
 print *, 'Hello, World!'
  print *, 'Hello, World!'
  print *, 'Hello, World!'
  print *, 'Hello, World!'
  print *, 'Hello, World!'
 print *, 'Hello, World!'
  print *, 'Hello, World!'
end program hello
$ gfortran /tmp/test.f90 -o /tmp/test -g
```

I had to lookup what `MAIN__` is from objdump, flang uses a different symbol too. Perhaps we can grab this from some elf attribute instead.

```
$ ./bin/lldb /tmp/test -o "b MAIN__" -o "run"
(lldb) target create "/tmp/test"
Current executable set to '/tmp/test' (aarch64).
(lldb) b MAIN__
Breakpoint 1: where = test`MAIN__ + 12, address = 0x0000000000000920
(lldb) run
Process 1824608 launched: '/tmp/test' (aarch64)
Process 1824608 stopped
* thread #1, name = 'test', stop reason = breakpoint 1.1
    frame #0: 0x0000aaaaaaaaa920 test`MAIN__ at test.f90:2:26
   1    program hello
-> 2      print *, 'Hello, World!'
   3      print *, 'Hello, World!'
   4      print *, 'Hello, World!'
   5      print *, 'Hello, World!'
   6      print *, 'Hello, World!'
   7      print *, 'Hello, World!'
warning: This version of LLDB has no plugin for the language "fortran08". Inspection of frame variables will be limited.
(lldb) n
 Hello, World!
Process 1824608 stopped
* thread #1, name = 'test', stop reason = step over
    frame #0: 0x0000aaaaaaaaa96c test`MAIN__ at test.f90:3:26
   1    program hello
   2      print *, 'Hello, World!'
-> 3      print *, 'Hello, World!'
   4      print *, 'Hello, World!'
   5      print *, 'Hello, World!'
   6      print *, 'Hello, World!'
   7      print *, 'Hello, World!'
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkV1Fv2zYQ_jX0y8ECRdmy_aAHJ56xAN1QYAP6WFDiSWJNkQJ5spt_P1CyvKQJ1jTAgBUTEhkidR_vyO-7O8kQdGMRC7a-Y-vDQg7UOl8c5FmrP3pdnZBoUTr1WOwD9N51PaGC8hFaoj6wbM_EkYmj0qFygw-YGHPuEucbJo7ExLE20jbL2nny0i57MzTaxselMapcBpI0BCaO2zTjKRP3QK0OoANIIC-rk7YN6BAGhNp5OE4wEIa-d54SeCDArzpQfE05DJaJDUGH0sLF-VMEKnGatAjOg3UUV9HExCbAlyEQSOiNrBDIQa2tAmoROhcIPFZoCSYfE8YPjO-n-_3gPVoyjxCjgFYGsA5Cj5WudTW799TlBPbGgCY4WXcZA6RWUlzLY3wKQ9WChLhZg2wwgU8IVYyUtDGgdOiNfITgBl8hSKvAaIsQCHug1g1N-8w_lvPr3_QoVlBJgngkXR_vGCipd9fp3rvGyw5aNMZNQwC91zZa7ON2MbH5dZwU9_DJeaOYSJnY_KTv_gdc-LlCQ6vgFZJEWjVXZb_kFizd80FYNq-zc7w_QCtV1KBx7jT0cInyYDn_bf_w--fPLOdRJbV3Hbjyixoi6j2MyQWGgDFfKF3X6EfFPnalM0DOJfARfSv7AJdJT42X5ZRjRqzgOgQ0NUgir8uBELQNhFJ9T08JE8dSWyaOYwr4JtIYuijh6rwQ1xE_WCbEDLKNlkzsgKRvkKDyKAnje8_QbhbXrAP4FauBZGkQAlLcs3hSz002wMRWSl-1-YqJXfJizZtz48SdR3nqXSREyrI9XMa8xLIDjHDz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