CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
62 lines
2.3 KiB
TeX
62 lines
2.3 KiB
TeX
\subsection{Class CodeSource}
|
|
\label{sec:codesource}
|
|
|
|
\definedin{CodeSource.h}
|
|
|
|
The CodeSource interface is used by the ParseAPI to retrieve binary code from
|
|
an executable, library, or other binary code object; it also can provide hints
|
|
of function entry points (such as those derived from debugging symbols) to seed
|
|
the parser. The ParseAPI provides a default implementation based on the
|
|
SymtabAPI that supports many common binary formats. For details on implementing
|
|
a custom CodeSource, see Appendix \ref{sec:extend}.
|
|
|
|
\begin{apient}
|
|
virtual bool nonReturning(Address func_entry)
|
|
virtual bool nonReturning(std::string func_name)
|
|
\end{apient}
|
|
\apidesc{Looks up whether a function returns (by name or location). This information may be statically known for some code sources, and can lead to better parsing accuracy.}
|
|
|
|
\begin{apient}
|
|
virtual bool nonReturningSyscall(int /*number*/)
|
|
\end{apient}
|
|
\apidesc{Looks up whether a system call returns (by system call number). This information may be statically known for some code sources, and can lead to better parsing accuracy.}
|
|
|
|
|
|
\begin{apient}
|
|
virtual Address baseAddress()
|
|
virtual Address loadAddress()
|
|
\end{apient}
|
|
\apidesc{If the binary file type supplies non-zero base or load addresses (e.g. Windows PE), implementations should override these functions.}
|
|
|
|
\begin{apient}
|
|
std::map< Address, std::string > & linkage()
|
|
\end{apient}
|
|
\apidesc{Returns a reference to the external linkage map, which may or may not be filled in for a particular CodeSource implementation.}
|
|
|
|
\begin{apient}
|
|
struct Hint {
|
|
Address _addr;
|
|
CodeRegion *_region;
|
|
std::string _name;
|
|
Hint(Addr, CodeRegion *, std::string);
|
|
}
|
|
std::vector< Hint > const& hints()
|
|
\end{apient}
|
|
\apidesc{Returns a vector of the currently defined function entry hints.}
|
|
|
|
\begin{apient}
|
|
std::vector<CodeRegion *> const& regions()
|
|
\end{apient}
|
|
\apidesc{Returns a read-only vector of code regions within the binary represented by this code source.}
|
|
|
|
\begin{apient}
|
|
int findRegions(Address addr,
|
|
set<CodeRegion *> & ret)
|
|
\end{apient}
|
|
\apidesc{Finds all CodeRegion objects that overlap the provided address. Some code sources (e.g. archive files) may have several regions with overlapping address ranges; others (e.g. ELF binaries) do not.}
|
|
|
|
\begin{apient}
|
|
bool regionsOverlap()
|
|
\end{apient}
|
|
\apidesc{Indicates whether the CodeSource contains overlapping regions.}
|