aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-08-11 11:18:10 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-08-11 11:18:10 -0300
commite2c07dcbf7492e79e5825a6ca66d28e2e372f71e (patch)
tree0bc3eb66a5710dd58f65d2747850e87f01dfba7a
parent439e45a2f69549b674d6a6e2023e8debfa00a2b8 (diff)
downloadlua-e2c07dcbf7492e79e5825a6ca66d28e2e372f71e.tar.gz
lua-e2c07dcbf7492e79e5825a6ca66d28e2e372f71e.tar.bz2
lua-e2c07dcbf7492e79e5825a6ca66d28e2e372f71e.zip
Improved documentation for 'lua_getinfo'
-rw-r--r--manual/manual.of42
1 files changed, 24 insertions, 18 deletions
diff --git a/manual/manual.of b/manual/manual.of
index 67d3b7e1..664b5c1e 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -4685,7 +4685,10 @@ information about a function or an activation record.
4685@Lid{lua_getstack} fills only the private part 4685@Lid{lua_getstack} fills only the private part
4686of this structure, for later use. 4686of this structure, for later use.
4687To fill the other fields of @Lid{lua_Debug} with useful information, 4687To fill the other fields of @Lid{lua_Debug} with useful information,
4688you must call @Lid{lua_getinfo}. 4688you must call @Lid{lua_getinfo} with an appropriate parameter.
4689(Specifically, to get a field,
4690you must add the letter between parentheses in the field's comment
4691to the parameter @id{what} of @Lid{lua_getinfo}.)
4689 4692
4690The fields of @Lid{lua_Debug} have the following meaning: 4693The fields of @Lid{lua_Debug} have the following meaning:
4691@description{ 4694@description{
@@ -4838,10 +4841,24 @@ printf("%d\n", ar.linedefined);
4838 4841
4839Each character in the string @id{what} 4842Each character in the string @id{what}
4840selects some fields of the structure @id{ar} to be filled or 4843selects some fields of the structure @id{ar} to be filled or
4841a value to be pushed on the stack: 4844a value to be pushed on the stack.
4845(These characters are also documented in the declaration of
4846the structure @Lid{lua_Debug},
4847between parentheses in the comments following each field.)
4842@description{ 4848@description{
4843 4849
4844@item{@Char{n}| fills in the field @id{name} and @id{namewhat}; 4850@item{@Char{f}|
4851pushes onto the stack the function that is
4852running at the given level;
4853}
4854
4855@item{@Char{l}| fills in the field @id{currentline};
4856}
4857
4858@item{@Char{n}| fills in the fields @id{name} and @id{namewhat};
4859}
4860
4861@item{@Char{r}| fills in the fields @id{ftransfer} and @id{ntransfer};
4845} 4862}
4846 4863
4847@item{@Char{S}| 4864@item{@Char{S}|
@@ -4849,9 +4866,6 @@ fills in the fields @id{source}, @id{short_src},
4849@id{linedefined}, @id{lastlinedefined}, and @id{what}; 4866@id{linedefined}, @id{lastlinedefined}, and @id{what};
4850} 4867}
4851 4868
4852@item{@Char{l}| fills in the field @id{currentline};
4853}
4854
4855@item{@Char{t}| fills in the field @id{istailcall}; 4869@item{@Char{t}| fills in the field @id{istailcall};
4856} 4870}
4857 4871
@@ -4859,21 +4873,13 @@ fills in the fields @id{source}, @id{short_src},
4859@id{nups}, @id{nparams}, and @id{isvararg}; 4873@id{nups}, @id{nparams}, and @id{isvararg};
4860} 4874}
4861 4875
4862@item{@Char{f}|
4863pushes onto the stack the function that is
4864running at the given level;
4865}
4866
4867@item{@Char{L}| 4876@item{@Char{L}|
4868pushes onto the stack a table whose indices are the 4877pushes onto the stack a table whose indices are
4869numbers of the lines that are valid on the function. 4878the lines on the function with some associated code,
4870(A @emph{valid line} is a line with some associated code, 4879that is, the lines where you can put a break point.
4871that is, a line where you can put a break point. 4880(Lines with no code include empty lines and comments.)
4872Non-valid lines include empty lines and comments.)
4873
4874If this option is given together with option @Char{f}, 4881If this option is given together with option @Char{f},
4875its table is pushed after the function. 4882its table is pushed after the function.
4876
4877This is the only option that can raise a memory error. 4883This is the only option that can raise a memory error.
4878} 4884}
4879 4885