diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2022-07-31 14:32:57 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2022-07-31 14:32:57 -0400 |
| commit | 522d8eb648bcf0f58d17d421e4f5967b251b0b70 (patch) | |
| tree | 693660545bb00b5c4528efd4ca0c9a6febfe02bb | |
| parent | 9b835833024a5742741c06225c008bac847f2e74 (diff) | |
fix parse type documentation
| -rw-r--r-- | python/binaryview.py | 4 | ||||
| -rw-r--r-- | python/platform.py | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/python/binaryview.py b/python/binaryview.py index 4cee0ab8..c527b09f 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -6265,7 +6265,9 @@ class BinaryView: def parse_type_string(self, text: str) -> Tuple['_types.Type', '_types.QualifiedName']: """ ``parse_type_string`` parses string containing C into a single type :py:Class:`Type`. - In contrast to the :py:'platform + In contrast to the :py:class:`Platform.parse_types_from_source` or :py:class:`Platform.parse_types_from_source_file`, ``parse_type_string`` + can only load a single type, though it can take advantage of existing type information in the binary + view, while those two APIs do not. :param str text: C source code string of type to create :return: A tuple of a :py:Class:`Type` and type name diff --git a/python/platform.py b/python/platform.py index 05cbaabf..71410d84 100644 --- a/python/platform.py +++ b/python/platform.py @@ -405,7 +405,8 @@ class Platform(metaclass=_PlatformMetaClass): ): """ ``parse_types_from_source`` parses the source string and any needed headers searching for them in - the optional list of directories provided in ``include_dirs``. + the optional list of directories provided in ``include_dirs``. Note that this API does not allow + the source to rely on existing types that only exist in a specific view. Use :py:class:`BinaryView.parse_type_string` instead. :param str source: source string to be parsed :param str filename: optional source filename @@ -459,7 +460,8 @@ class Platform(metaclass=_PlatformMetaClass): def parse_types_from_source_file(self, filename, include_dirs: Optional[List[str]] = None, auto_type_source=None): """ ``parse_types_from_source_file`` parses the source file ``filename`` and any needed headers searching for them in - the optional list of directories provided in ``include_dirs``. + the optional list of directories provided in ``include_dirs``. Note that this API does not allow + the source to rely on existing types that only exist in a specific view. Use :py:class:`BinaryView.parse_type_string` instead. :param str filename: filename of file to be parsed :param include_dirs: optional list of string filename include directories @@ -511,4 +513,4 @@ class Platform(metaclass=_PlatformMetaClass): @property def arch(self): - return self._arch
\ No newline at end of file + return self._arch |
