Skip to content

Commit

Permalink
better stack traces for ELF x86_64
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Apr 24, 2017
1 parent 08a871f commit 245eed8
Show file tree
Hide file tree
Showing 10 changed files with 573 additions and 68 deletions.
1 change: 1 addition & 0 deletions src/analyze.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2894,6 +2894,7 @@ ImportTableEntry *add_source_file(CodeGen *g, PackageTableEntry *package,
ast_print(stderr, import_entry->root, 0); ast_print(stderr, import_entry->root, 0);
} }


// TODO: assert that src_basename has no '/' in it
import_entry->di_file = ZigLLVMCreateFile(g->dbuilder, buf_ptr(src_basename), buf_ptr(src_dirname)); import_entry->di_file = ZigLLVMCreateFile(g->dbuilder, buf_ptr(src_basename), buf_ptr(src_dirname));
g->import_table.put(abs_full_path, import_entry); g->import_table.put(abs_full_path, import_entry);
g->import_queue.append(import_entry); g->import_queue.append(import_entry);
Expand Down
2 changes: 1 addition & 1 deletion src/codegen.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4647,7 +4647,7 @@ static void init(CodeGen *g, Buf *source_path) {
bool is_optimized = g->is_release_build; bool is_optimized = g->is_release_build;
const char *flags = ""; const char *flags = "";
unsigned runtime_version = 0; unsigned runtime_version = 0;
ZigLLVMDIFile *compile_unit_file = ZigLLVMCreateFile(g->dbuilder, buf_ptr(source_path), ZigLLVMDIFile *compile_unit_file = ZigLLVMCreateFile(g->dbuilder, buf_ptr(g->root_out_name),
buf_ptr(&g->root_package->root_src_dir)); buf_ptr(&g->root_package->root_src_dir));
g->compile_unit = ZigLLVMCreateCompileUnit(g->dbuilder, ZigLLVMLang_DW_LANG_C99(), g->compile_unit = ZigLLVMCreateCompileUnit(g->dbuilder, ZigLLVMLang_DW_LANG_C99(),
compile_unit_file, buf_ptr(producer), is_optimized, flags, runtime_version, compile_unit_file, buf_ptr(producer), is_optimized, flags, runtime_version,
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ int main(int argc, char **argv) {
} }
} }


bool need_name = (cmd == CmdBuild || cmd == CmdAsm || cmd == CmdLink); bool need_name = (cmd == CmdBuild || cmd == CmdAsm || cmd == CmdLink || cmd == CmdParseH);


Buf in_file_buf = BUF_INIT; Buf in_file_buf = BUF_INIT;


Expand Down
Loading

0 comments on commit 245eed8

Please sign in to comment.