# How to get xrefs to field in IDApython

**URL:** <https://community.hex-rays.com/t/how-to-get-xrefs-to-field-in-idapython/427>\
**Category:** IDA General\
**Tags:** idapython\
**Created:** [August 4, 2025, 9:39am UTC](https://community.hex-rays.com/t/how-to-get-xrefs-to-field-in-idapython/427 "2025-08-04T09:39:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoavst](https://sea2.discourse-cdn.com/flex002/user_avatar/community.hex-rays.com/yoavst/32/124_2.png) [@yoavst](https://community.hex-rays.com/u/yoavst)\
**Post date:** [August 4, 2025, 9:39am UTC](https://community.hex-rays.com/t/how-to-get-xrefs-to-field-in-idapython/427/1 "2025-08-04T09:39:18Z")

</div>

I’m trying to fetch the results of “jump to xref globally” for a combination of a tinfo\_t and an offset. (I know they depend on caching, it is part of an advance xref plugin).

I tried to find xrefs using the following code but no results returned (tid was successfully returned):

```auto
def get_udm_index(tif: tinfo_t, udm: udm_t) -> int | None:
    """Get the index of a `udm` in a `tif`"""
    index = tif.find_udm(udm, ida_typeinf.STRMEM_OFFSET)
    if index == -1:
        return None
    return index

def tid_from_udm(tif: tinfo_t, udm: udm_t) -> int | None:
    """Get the type ID of a `udm` in a `tif`"""
    index = get_udm_index(tif, udm)
    if index is None:
        return None
    return tif.get_udm_tid(index)

def member_xrefs_to(typ: tinfo_t, member: udm_t) -> list[int]:
    """Get all xrefs to the given member of a type"""
    tid = tid_from_udm(typ, member)
    if tid is None:
        return []

    return [xref.frm for xref in idautils.XrefsTo(tid, 0)]

```

---

<div class="post-metadata">

**Author:** ![teresa\_hexrays](https://sea2.discourse-cdn.com/flex002/user_avatar/community.hex-rays.com/teresa_hexrays/32/11_2.png) [@teresa\_hexrays](https://community.hex-rays.com/u/teresa_hexrays)\
**Post date:** [August 7, 2025, 9:17am UTC](https://community.hex-rays.com/t/how-to-get-xrefs-to-field-in-idapython/427/2 "2025-08-07T09:17:35Z")

</div>

Hello @yoavst,  
I’ve asked around if this is possible, but unfortunately, it doesn’t look like it.  
Here’s the answer I received:

> Global xrefs are a feature of the decompiler, so using the IDA level API (`XrefsTo`) will not return them. Currently, global xrefs are **not** exposed in the decompiler API.

Hope this clears things up a bit.

---

<div class="post-metadata">

**Author:** ![igor](https://sea2.discourse-cdn.com/flex002/user_avatar/community.hex-rays.com/igor/32/35_2.png) [@igor](https://community.hex-rays.com/u/igor)\
**Post date:** [September 17, 2025, 1:53pm UTC](https://community.hex-rays.com/t/how-to-get-xrefs-to-field-in-idapython/427/3 "2025-09-17T13:53:29Z")

</div>

hey, can you try the new option added in 9.2?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/rays_hex/original/1X/6625c8f2fb10808250d09630eedc6df52b1cb807.png)
