aboutcode-org / aboutcode-org/elf-inspector

Ignore "fake" symbols

Ouverte
#7 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
1
Forks
0
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

These are builtin and related:
This is a small function worked out in go-inspector:
```Python
def is_fake_path(path):
"""
Return True if a ``path`` string is for a fake path injected by the linker or compiler in the binary.
See:
https://github.com/smoofra/elfutils/blob/53b6f190892c738f28840e7481a09c7ee19b6720/src/srcfiles.cxx#L160

For example:
>>> is_fake_symbol("")
True
>>> is_fake_symbol("foo/bar/")
True
>>> is_fake_symbol("")
True
>>> is_fake_symbol("/artificial/asdasdas/adsd")
False
>>> is_fake_symbol("")
False
>>> is_fake_symbol("/sdfsdfsdf/zffd")
Trye

"""
fake_paths = (
#gcc intrinsics
"", "",
# seen in Go and C++
"",
"",
)
return isinstance(path, str) and any(fs in path for fs in fake_paths)
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.