{"id":13739773,"url":"https://github.com/kubkon/zig-dwarfdump","last_synced_at":"2025-03-22T15:30:48.115Z","repository":{"id":60488034,"uuid":"543490253","full_name":"kubkon/zig-dwarfdump","owner":"kubkon","description":"dwarfdump utility but in Zig","archived":false,"fork":false,"pushed_at":"2024-03-08T22:07:04.000Z","size":116,"stargazers_count":28,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-18T13:15:16.497Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kubkon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-09-30T07:55:49.000Z","updated_at":"2025-02-17T15:27:33.000Z","dependencies_parsed_at":"2023-11-24T09:29:53.037Z","dependency_job_id":"84acaf24-8f55-4e1c-b33b-9b3d0f03d886","html_url":"https://github.com/kubkon/zig-dwarfdump","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubkon%2Fzig-dwarfdump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubkon%2Fzig-dwarfdump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubkon%2Fzig-dwarfdump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubkon%2Fzig-dwarfdump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kubkon","download_url":"https://codeload.github.com/kubkon/zig-dwarfdump/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244978421,"owners_count":20541854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T04:00:37.456Z","updated_at":"2025-03-22T15:30:47.657Z","avatar_url":"https://github.com/kubkon.png","language":"Zig","funding_links":[],"categories":["Applications"],"sub_categories":[],"readme":"# zig-dwarfdump\n\n`dwarfdump` utility but in Zig.\n\n### Why?\n\nTurns out the best way of learning a new file/data format is to write a parser yourself, and so here we are.\nPerhaps in the future we will be able to use this project as a full substitute for `llvm-dwarfdump`, but time\nwill tell.\n\n### Usage\n\n```\n$ zig-dwarfdump --help\nUsage: zig-dwarfdump [options] file\n\nGeneral options:\n--debug-info          Display .debug_info section contents (default)\n--eh-frame            Display .eh_frame section contents\n--llvm-compatibility  Output is formatted exactly like llvm-dwarfdump, with no extra information\n--all, -a             Display all debug info sections\n--help                Display this help and exit\n\n```\n\n### Example usage (MachO)\n\n```\n$ zig-dwarfdump main.o\n\n__debug_info contents:\n0x0000000000000000: Compile Unit: length = 0x00000000000000a1, format = DWARF32, version = 0x0004, abbr_offset = 0x0000000000000000, addr_size = 0x08 (next unit at 0x00000000000000a5)\n\n0x000000000000000b: DW_TAG_compile_unit\n                      DW_AT_producer                          (clang version 15.0.0 (git@github.com:ziglang/zig-bootstrap ae458b715c229ee49397c2c156461ababc7ed98c))\n                      DW_AT_language                          (c)\n                      DW_AT_name                              (main.c)\n                      DW_AT_LLVM_sysroot                      (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk)\n                      DW_AT_APPLE_sdk                         (MacOSX12.3.sdk)\n                      DW_AT_stmt_list                         (0000000000000000)\n                      DW_AT_comp_dir                          (/Users/kubkon/dev/zld/examples/hello_c)\n                      DW_AT_low_pc                            (0000000000000000)\n                      DW_AT_high_pc                           (0000000000000+48)\n\n0x0000000000000032:   DW_TAG_variable\n                        DW_AT_type                            (43)\n                        DW_AT_decl_file                       (1)\n                        DW_AT_decl_line                       (4)\n                        DW_AT_location                        ( 3 48 0 0 0 0 0 0 0 )\n\n0x0000000000000043:   DW_TAG_array_type\n                        DW_AT_type                            (4f)\n\n0x0000000000000048:     DW_TAG_subrange_type\n                          DW_AT_type                          (56)\n                          DW_AT_count                         (8)\n\n0x000000000000004e:     NULL\n\n0x000000000000004f:   DW_TAG_base_type\n                        DW_AT_name                            (char)\n                        DW_AT_encoding                        (6)\n                        DW_AT_byte_size                       (1)\n\n0x0000000000000056:   DW_TAG_base_type\n                        DW_AT_name                            (__ARRAY_SIZE_TYPE__)\n                        DW_AT_byte_size                       (8)\n                        DW_AT_encoding                        (7)\n\n0x000000000000005d:   DW_TAG_subprogram\n                        DW_AT_low_pc                          (0000000000000000)\n                        DW_AT_high_pc                         (0000000000000+48)\n                        DW_AT_framebase                       ( 6d )\n                        DW_AT_name                            (main)\n                        DW_AT_decl_file                       (1)\n                        DW_AT_decl_line                       (3)\n                        DW_AT_prototyped                      (true)\n                        DW_AT_type                            (93)\n                        DW_AT_external                        (true)\n\n0x0000000000000076:     DW_TAG_formal_parameter\n                          DW_AT_location                      ( 91 78 )\n                          DW_AT_name                          (argc)\n                          DW_AT_decl_file                     (1)\n                          DW_AT_decl_line                     (3)\n                          DW_AT_type                          (93)\n\n0x0000000000000084:     DW_TAG_formal_parameter\n                          DW_AT_location                      ( 8f 10 )\n                          DW_AT_name                          (argv)\n                          DW_AT_decl_file                     (1)\n                          DW_AT_decl_line                     (3)\n                          DW_AT_type                          (9a)\n\n0x0000000000000092:     NULL\n\n0x0000000000000093:   DW_TAG_base_type\n                        DW_AT_name                            (int)\n                        DW_AT_encoding                        (5)\n                        DW_AT_byte_size                       (4)\n\n0x000000000000009a:   DW_TAG_pointer_type\n                        DW_AT_type                            (9f)\n\n0x000000000000009f:   DW_TAG_pointer_type\n                        DW_AT_type                            (4f)\n\n0x00000000000000a4:   NULL\n```\n\n```\n$ zig-dwarfdump --eh-frame main.o\n__TEXT,__eh_frame contents:\n\nCIE:\n  Length                        : 16\n  Id                            : 0\n  Version                       : 1\n  Augmentation                  : zR\n  Code Alignment Factor         : 1\n  Data Alignment Factor         : -8\n  Return Address Register       : 30\n  Augmentation Length           : 1\n  FDE Pointer Encoding          : 16\n  LSDA Pointer Encoding         : 0\n  Augmentation Data             : 0x10\n  Initial Instructions          : 0x0c1f00\n\nFDE:\n  Length                        : 32\n  CIE Pointer                   : 0x18\n  PC Begin                      : 0xffffffffffffffe4\n  PC Range                      : 64\n  Augmentation Length           : 0\n  Instructions                  : 0x440e10780e000000000000\n\nFDE:\n  Length                        : 44\n  CIE Pointer                   : 0x3c\n  PC Begin                      : 0xffffffffffffffc0\n  PC Range                      : 56\n  Augmentation Length           : 0\n  Instructions                  : 0x440e30480c1d109e019d02600c1f30480e00dedd000000\n```\n\n### Building\n\nUse latest `zig` master:\n\n```\n$ git clone https://github.com/kubkon/zig-dwarfdump.git\n$ zig build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubkon%2Fzig-dwarfdump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkubkon%2Fzig-dwarfdump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubkon%2Fzig-dwarfdump/lists"}