add signal handler w/ debug info

This commit is contained in:
2021-05-08 16:23:24 -04:00
parent 523c123e2e
commit 22dd58e140
7 changed files with 105 additions and 4 deletions

View File

@@ -41,11 +41,18 @@ void fs_reset(struct vfile *f) {
#define IS_GIT_OBJ (strlen(doc.filepath + doc.base) == 38 && (strstr(doc.filepath, "objects") != NULL))
void set_dbg_current_file(parse_job_t *job) {
unsigned long long pid = (unsigned long long) pthread_self();
g_hash_table_replace(ScanCtx.dbg_current_files, GINT_TO_POINTER(pid), job);
}
void parse(void *arg) {
parse_job_t *job = arg;
document_t doc;
set_dbg_current_file(job);
doc.filepath = job->filepath;
doc.ext = (short) job->ext;
doc.base = (short) job->base;