# Module variables imported with 'only' get no debug symbols

**URL:** <https://community.intel.com/t/module-variables-imported-with-only-get-no-debug-symbols/144372>\
**Category:** Intel® Fortran Compiler\
**Created:** [October 26, 2026, 8:36am UTC](https://community.intel.com/t/module-variables-imported-with-only-get-no-debug-symbols/144372 "2026-10-26T08:36:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gtrafford](https://avatars.discourse-cdn.com/v4/letter/g/0627CD/32.png) [@gtrafford](https://community.intel.com/u/gtrafford)\
**Post date:** [October 26, 2026, 8:36am UTC](https://community.intel.com/t/module-variables-imported-with-only-get-no-debug-symbols/144372/1 "2026-10-26T08:36:45Z")

</div>

Hi,

In a routine that does `use some_module, only: var`, the plain name can’t be evaluated in the debugger (“Undefined variable”). The module-qualified name works: `some_module::var`. ifort resolved the plain name.

**Environment**

- ifx 2026.1.1 (Intel(R) Fortran 26.0-1156 / DPC++/C++ Compiler 2026.1.1 20260724)
- Visual Studio 2026 Professional, Windows 11 x64, Debug build, `/Od /Z7 /debug:full`, linked with `/debug`
- Intel Fortran Expression Evaluator 2.0.0 is installed.

* * *

**Reproducer: three files**

`m_vars.f90`

```fortran
module gtm
  implicit none
  integer :: ntank = 0
  real, allocatable :: tankgiip(:)
end module gtm

```

`hdf_demo.f90`

```fortran
module hdf_demo
contains
  subroutine settank(it)
    use gtm, only: tankgiip, ntank
    implicit none
    integer, intent(in) :: it
    real :: x
    x = tankgiip(it) + real(ntank) ! <- breakpoint here, then evaluate: tankgiip, ntank
    tankgiip(it) = x
  end subroutine settank
end module hdf_demo

```

`main.f90`

```fortran
program demo
  use gtm, only: tankgiip, ntank
  use hdf_demo, only: settank
  implicit none
  ntank = 7
  allocate(tankgiip(ntank)); tankgiip = 1.0
  call settank(3)
  print *, tankgiip(1)
end program demo

```

**Build**

```auto
ifx /Od /Z7 /debug:full m_vars.f90 hdf_demo.f90 main.f90 /link /debug

```

**Expected:** `tankgiip` and `ntank` can be evaluated at the breakpoint.  
**Actual:** `tankgiip` gives `Undefined variable`, while `gtm::tankgiip` works.

**What I found in the debug info.** The object file for `hdf_demo.f90` has **no** `S_LDATA32` record for `tankgiip` or `ntank` in `settank`.

The records appear if any routine in the **same file** imports the module with no `ONLY` list. Adding this to `hdf_demo.f90`, never called, is enough:

```fortran
  subroutine never_called()
    use gtm ! whole-module USE
    implicit none
  end subroutine never_called

```

Then `settank` gets `S_LDATA32 NTANK` and `S_LDATA32 TANKGIIP`.

I couldn’t find any compile options which changes this.

* * *

Thanks

---

<div class="post-metadata">

**Author:** ![andrew\_4619](https://sea3.discourse-cdn.com/intel/user_avatar/community.intel.com/andrew_4619/32/94966_2.png) [@andrew\_4619](https://community.intel.com/u/andrew_4619)\
**Post date:** [October 26, 2026, 9:27am UTC](https://community.intel.com/t/module-variables-imported-with-only-get-no-debug-symbols/144372/2 "2026-10-26T09:27:07Z")

</div>

As someone who ONLY uses use ONLY these problems hurt productivity. This problem has been around since IFX was launched and has been reported many times. It would be nice to hear from Intel to see if there is any prospect of a fix or if any work is ongoing. The other issue that causes problems is when stepping through code in debug the carrot jumps around in nonsensical ways as it seem the line numbers in the code generated often do not match up with the code. It is particularly irksome when you appear to step into code that logic dictates should not be entered (e.g. and If construct),

---

<div class="post-metadata">

**Author:** ![MarcGrodent](https://avatars.discourse-cdn.com/v4/letter/m/00C7FD/32.png) [@MarcGrodent](https://community.intel.com/u/MarcGrodent)\
**Post date:** [October 26, 2026, 10:15am UTC](https://community.intel.com/t/module-variables-imported-with-only-get-no-debug-symbols/144372/3 "2026-10-26T10:15:53Z")

</div>

I totally agree with Andrew. This debugging issue in ifx is really annoying. The debugger sometimes jumps randomly through the code and goes into branches that are not executed. I still do all my debugging with ifort, ifx is not reliable at all.

---

<div class="post-metadata">

**Author:** ![gtrafford](https://avatars.discourse-cdn.com/v4/letter/g/0627CD/32.png) [@gtrafford](https://community.intel.com/u/gtrafford)\
**Post date:** [October 27, 2026, 3:47am UTC](https://community.intel.com/t/module-variables-imported-with-only-get-no-debug-symbols/144372/4 "2026-10-27T03:47:25Z")

</div>

> The other issue that causes problems is when stepping through code in debug the carrot jumps around in nonsensical ways as it seem the line numbers in the code generated often do not match up with the code. It is particularly irksome when you appear to step into code that logic dictates should not be entered

Yes, I get this too. It’s very annoying. Sometimes it’s the inverse too where I’ll put a breakpoint inside a condition I know with 100% certainty will be entered, and it just never does.
