From 46cd7e5d070cfa8d0f0bd2874df8886618f8ee19 Mon Sep 17 00:00:00 2001 From: "Yichun Zhang (agentzh)" Date: Mon, 28 Sep 2020 14:08:46 -0700 Subject: [PATCH] Doc: documented the @var(NAME, EXE) notation in the beginners guide and langref docs --- doc/SystemTap_Beginners_Guide/en-US/ScriptConstructs.xml | 6 ++++++ doc/langref.tex | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/doc/SystemTap_Beginners_Guide/en-US/ScriptConstructs.xml b/doc/SystemTap_Beginners_Guide/en-US/ScriptConstructs.xml index 218fd9ebc..20e61de57 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/ScriptConstructs.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/ScriptConstructs.xml @@ -170,6 +170,12 @@ then it can be referenced through @var("varname@src/file.c"). + +It is also supported to specify an executable or library file path as the +second argument, as in +@var("varname", "/path/to/exe/or/lib") + + SystemTap tracks the typing information of the target variable and can examine the fields of a structure with the -> operator. diff --git a/doc/langref.tex b/doc/langref.tex index f7167734c..bba017ce3 100644 --- a/doc/langref.tex +++ b/doc/langref.tex @@ -1094,6 +1094,10 @@ file name at the end and has the shortest file name path (e.g. given \texttt{src/sub/module/bar/baz.c} and \texttt{src/bar/baz.c} the second CU will be chosen to resolve \texttt{foo}). +The notation \texttt{@var("varname", "/path/to/exe-or-so)} is also supported +to explicitly specify an executable or library file path in which the global or +top-level static variable resides. + \texttt{\$var->field} or \texttt{@var("var@file.c")->field} traverses a structure's field. The indirection operator may be repeated to follow additional levels of pointers. -- 2.43.5