diff options
| author | jvoisin | 2021-01-01 17:20:59 +0100 |
|---|---|---|
| committer | jvoisin | 2021-01-02 17:02:11 +0100 |
| commit | 0245273cb946b341fc0d62cd27817e72d654a6bc (patch) | |
| tree | bc4732ba89cd8f7d8f9ff6b2999558442470bf73 /src/sp_utils.c | |
| parent | c4dac996dea5c3cb80247d3119903d6a6491fcc1 (diff) | |
Add stacktraces to dumps
Diffstat (limited to 'src/sp_utils.c')
| -rw-r--r-- | src/sp_utils.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sp_utils.c b/src/sp_utils.c index 1253eff..8550168 100644 --- a/src/sp_utils.c +++ b/src/sp_utils.c | |||
| @@ -165,6 +165,22 @@ int sp_log_request(const zend_string* restrict folder, | |||
| 165 | fprintf(file, "RULE: sp%s%s\n", from, ZSTR_VAL(text_repr)); | 165 | fprintf(file, "RULE: sp%s%s\n", from, ZSTR_VAL(text_repr)); |
| 166 | 166 | ||
| 167 | fprintf(file, "FILE: %s:%d\n", current_filename, current_line); | 167 | fprintf(file, "FILE: %s:%d\n", current_filename, current_line); |
| 168 | |||
| 169 | |||
| 170 | zend_execute_data *orig_execute_data = EG(current_execute_data); | ||
| 171 | zend_execute_data *current = EG(current_execute_data); | ||
| 172 | while (current) { | ||
| 173 | EG(current_execute_data) = current; | ||
| 174 | char* const complete_path_function = get_complete_function_path(current); | ||
| 175 | if (complete_path_function) { | ||
| 176 | const int current_line = zend_get_executed_lineno(TSRMLS_C); | ||
| 177 | fprintf(file, "STACKTRACE: %s:%d\n", complete_path_function, current_line); | ||
| 178 | } | ||
| 179 | current = current->prev_execute_data; | ||
| 180 | } | ||
| 181 | EG(current_execute_data) = orig_execute_data; | ||
| 182 | |||
| 183 | |||
| 168 | for (size_t i = 0; zones[i].str; i++) { | 184 | for (size_t i = 0; zones[i].str; i++) { |
| 169 | zval* variable_value; | 185 | zval* variable_value; |
| 170 | zend_string* variable_key; | 186 | zend_string* variable_key; |
