Software /
code /
prosody
Comparison
util/debug.lua @ 5776:bd0ff8ae98a8
Remove all trailing whitespace
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Fri, 09 Aug 2013 17:48:21 +0200 |
parent | 4778:127de6eec433 |
child | 5785:b2d6c5f94aa5 |
comparison
equal
deleted
inserted
replaced
5775:a6c2b8933507 | 5776:bd0ff8ae98a8 |
---|---|
91 info = debug.getinfo(thread, level+1); | 91 info = debug.getinfo(thread, level+1); |
92 else | 92 else |
93 info = debug.getinfo(level+1); | 93 info = debug.getinfo(level+1); |
94 end | 94 end |
95 if not info then break; end | 95 if not info then break; end |
96 | 96 |
97 levels[(level-start_level)+1] = { | 97 levels[(level-start_level)+1] = { |
98 level = level; | 98 level = level; |
99 info = info; | 99 info = info; |
100 locals = get_locals_table(level+1); | 100 locals = get_locals_table(level+1); |
101 upvalues = get_upvalues_table(info.func); | 101 upvalues = get_upvalues_table(info.func); |
102 }; | 102 }; |
103 end | 103 end |
104 return levels; | 104 return levels; |
105 end | 105 end |
106 | 106 |
107 function traceback(...) | 107 function traceback(...) |
108 local ok, ret = pcall(_traceback, ...); | 108 local ok, ret = pcall(_traceback, ...); |
135 end | 135 end |
136 | 136 |
137 level = level or 1; | 137 level = level or 1; |
138 | 138 |
139 message = message and (message.."\n") or ""; | 139 message = message and (message.."\n") or ""; |
140 | 140 |
141 -- +3 counts for this function, and the pcall() and wrapper above us | 141 -- +3 counts for this function, and the pcall() and wrapper above us |
142 local levels = get_traceback_table(thread, level+3); | 142 local levels = get_traceback_table(thread, level+3); |
143 | 143 |
144 local last_source_desc; | 144 local last_source_desc; |
145 | 145 |
146 local lines = {}; | 146 local lines = {}; |
147 for nlevel, level in ipairs(levels) do | 147 for nlevel, level in ipairs(levels) do |
148 local info = level.info; | 148 local info = level.info; |
149 local line = "..."; | 149 local line = "..."; |
150 local func_type = info.namewhat.." "; | 150 local func_type = info.namewhat.." "; |