{"id":13754926,"url":"https://github.com/alschwalm/dwarfexport","last_synced_at":"2026-01-18T03:11:30.359Z","repository":{"id":56246558,"uuid":"80372503","full_name":"ALSchwalm/dwarfexport","owner":"ALSchwalm","description":"Export dwarf debug information from IDA Pro","archived":false,"fork":false,"pushed_at":"2022-08-18T17:40:26.000Z","size":32773,"stargazers_count":207,"open_issues_count":6,"forks_count":46,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-11-16T08:34:00.671Z","etag":null,"topics":["gdb","ida"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ALSchwalm.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}},"created_at":"2017-01-29T21:04:00.000Z","updated_at":"2024-11-12T19:51:13.000Z","dependencies_parsed_at":"2022-08-15T15:20:50.085Z","dependency_job_id":null,"html_url":"https://github.com/ALSchwalm/dwarfexport","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/ALSchwalm%2Fdwarfexport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALSchwalm%2Fdwarfexport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALSchwalm%2Fdwarfexport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALSchwalm%2Fdwarfexport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ALSchwalm","download_url":"https://codeload.github.com/ALSchwalm/dwarfexport/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253346404,"owners_count":21894263,"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":["gdb","ida"],"created_at":"2024-08-03T10:00:36.932Z","updated_at":"2026-01-18T03:11:30.322Z","avatar_url":"https://github.com/ALSchwalm.png","language":"C++","funding_links":[],"categories":["\u003ca id=\"6fb7e41786c49cc3811305c520dfe9a1\"\u003e\u003c/a\u003e导入导出\u0026与其他工具交互"],"sub_categories":["\u003ca id=\"8ad723b704b044e664970b11ce103c09\"\u003e\u003c/a\u003e未分类"],"readme":"\nThis Project is Unmaintained\n============================\n\nDue to a change in occupation, I no longer have access to IDA, so this project is \nunmaintained. If you are interested in becoming a maintainer, please let me know. \nOtherwise, it is unlikely I'll will merge anything but trivial merge requests.\n\ndwarfexport\n===========\n\n`dwarfexport` is an IDA Pro plugin that allows the user to export `dwarf` debug\ninformation. This can then be imported in to gdb and other tools, allowing\nyou to debug using info you have recovered in IDA even when you cannot connect\nthe IDA debugger.\n\nUsage\n-----\n\nPre-compiled copies of `dwarfexport` are available in the `bin` folder of this\nproject. Just add these files to your IDA `plugins` folder (plx and plx64 for linux,\nplw and p64 for windows) and you will have a new option\n\"Edit-\u003ePlugins-\u003eExport Dwarf Debug Info\". Click this and select a folder for the\noutput.\n\nThe plugin will generate two files in the output directory. One will be a `.c` file\nwith the decompiled functions from the Hexrays decompiler. The other is a `.dbg`\nfile that contains the debug information. *Note that because the plugin performs\ndecompilation on every function in the binary, it can take a while to run.*\n\nMove these to the device you want to debug on and load gdb (e.x, `gdb a.out`).\nYou will have full debug information, like normal gdb with source (shown below\nusing TUI mode):\n\n![debugging in gdb](/resources/screenshot.png)\n\n*Note: You may need to run `list` to get the source file loaded.*\n\nOptions\n-------\n\nThe following options are available from the plugin GUI\n\n`Use Decompiler`: On architectures where the decompiler is available, opt out of\nusing it.\n\n`Attach Debug Info`: When checked, a `.dbg` file is created with the debug information.\nHowever, this will only work if the target is an ELF file. When the target is not an ELF\nfile, uncheck this option to create a group of binary files (one for reach ELF section that\nwould have been created).\n\nBuilding On Linux\n-----------------\n\n`dwarfexport` depends on the IDA SDK as well as a `libdwarf`. Once you have these\navailable (a statically compiled copy of `libdwarf` is provided), you can set the\nenvironment variables IDASDK\\_PATH and IDA\\_PATH to the SDK path and your IDA\nfolder location respectively. Then build the plugin using `make`.\n\nBuilding On Windows\n-------------------\n\nWindows build can be performed using MSVC Compiler (cl.exe) and NMAKE\n(nmake.exe). First, download and extract [libdwarf](\nhttps://sourceforge.net/p/libdwarf/code/ci/master/tree/) source code into\n`deps/libdwarf` and [libelf](\nhttps://fossies.org/linux/misc/old/libelf-0.8.13.tar.gz/) source code into\n`deps/libelf-0.8.13`. The commands below assume WSL/MinGW/Cygwin, but you can\nuse any other method that you prefer.\n\n```\n$ git clone git://git.code.sf.net/p/libdwarf/code deps/libdwarf\n$ (cd deps/libdwarf \u0026\u0026 git checkout 988618dc8be8)\n$ curl https://fossies.org/linux/misc/old/libelf-0.8.13.tar.gz | tar -C deps -xz\n```\n\nThen, NMAKE can be invoked through x86 or x64 Native Tools Command Prompt for\nVS (depending on whether you need 32-bit or 64-bit plugin) as follows:\n\n```\ndwarfexport\u003e nmake /f Makefile.MSVC IDA_PATH=\"C:\\Program Files\\IDA 7.2\" IDASDK_PATH=\"C:\\Program Files\\IDA 7.2\\sdk\"\n```\n\n32-bit version will be placed into `bin\\dwarfexport.dll`, 64-bit version will\nbe placed into `bin\\dwarfexport64.dll`.\n\n\nBuilding on macOS\n-----------------\n\nTo build dwarfexport on macOS, you must build and install 32-bit versions of\nlibelf and libdwarf.\n\n```\n# Download, build, and install libelf (it's a libdwarf prereq)\n$ mkdir -p thirdparty\n$ pushd thirdparty\n$ wget http://www.mr511.de/software/libelf-0.8.13.tar.gz\n$ tar zxf libelf-0.8.13.tar.gz\n$ pushd libelf-0.8.13\n$ CFLAGS=-m32 CXXFLAGS=-m32 ./configure\n$ make \u0026\u0026 make install\n$ popd\n\n# Clone, build, and install libdwarf\n$ git clone git@github.com:tomhughes/libdwarf.git\n$ pushd libdwarf/\n$ CFLAGS=-m32 CXXFLAGS=-m32 ./configure\n$ make \u0026\u0026 make install\n$ popd\n$ popd\n\n# Build dwarfexport for macos\n$ IDA_PATH=\"/Applications/IDA\\ Pro\\ 6.95/idaq.app/Contents/MacOS/\" IDASDK_PATH=\"\u003cPATH TO IDASDK\u003e\" make -f Makefile.osx\n```\n\nAdding Support for Other Architectures\n--------------------------------------\n\nThere are three functions that need to be modified to add support for a new\narchitectures. They are all located in `platform.cpp`:\n\n`translate_register_num`: Translates from IDA register numbers to DWARF numbers.\nThe IDA register numbering can be found by running `idaapi.ph_get_regnames()`.\nThe index of a register in the returned list is its 'IDA register number'. A variety\nof resources exist to find the DWARF mapping for a given architecture. For example,\n[wine](https://source.winehq.org/source/dlls/dbghelp/cpu_x86_64.c) has the numbers\nfor some architectures (see `x86_64_map_dwarf_register`).\n\n`disassembler_lvar_reg_and_offset`: This function should set the `reg` and `offset`\nparameters to a dwarf register and the offset from that register that should be\nused to read from a stack variable 'member'. So `reg` will typically be a register\ncontaining a pointer to the top or bottom of the stack (so `DW_OP_breg5` is register 5\nwhich is EBP on x86), and the offset will then be the offset from the bottom or top\nof the stack.\n\n`decompiler_lvar_reg_and_offset`: On architectures supporting the decompiler, this\nfunction should be modified to perform the same work as the above function, but with\na `lvar_t` from the Hexrays decompiler. Note that it may be acceptable to reuse the\ndisassembler logic.\n\nLicense\n-------\n\n`dwarfexport` is licensed under the terms of the LGPLv2.1. See the LICENSE file for\ndetails.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falschwalm%2Fdwarfexport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falschwalm%2Fdwarfexport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falschwalm%2Fdwarfexport/lists"}