cjia4 / gdb-msvc

GDB with patches for debugging MSVC binaries

Home Page:https://github.com/lesderid/gdb-msvc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gdb-msvc

This is a fork of https://github.com/lesderid/gdb-msvc. Basically it hosts patches for GDB that consumes PDB debug symbols. The purpose is to enable GDB supporting source level debugging for executables that compiled by MSVC and LLVM compilers on Windows.

NOTES

It introduce dependencies on

  1. Radare2
  2. llvm

Building

  • mkdir build && cd build
  • ../configure --target=i686-w64-mingw32 --host=i686-w64-mingw32 <other configure flags>
  • make (and make install)

Tips

  1. mingw cross compile it could utilize mingw on Linux that generate executable for windows
  2. some LLVM CXXflags will have '-fno-exceptions' which conflict with gdb/ada-lang.c compilation (it requires exception support) workaround to change it to '-fexceptions'

llvm-config --cxxflags
-I/usr/lib/llvm-14/include -std=c++14 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS

  1. It does not work for "sudo apt install libradare2-dev" for Ubuntu22.04. You can do it for Ubuntu20.04. it requires libr/p_pdb.h. After installation, it could be found in /usr/include. Manual installation is required:

    http://archive.ubuntu.com/ubuntu/pool/universe/r/radare2/libradare2-dev_4.2.1+dfsg-2_amd64.deb http://archive.ubuntu.com/ubuntu/pool/universe/r/radare2/libradare2-4.2.1_4.2.1+dfsg-2_amd64.deb http://archive.ubuntu.com/ubuntu/pool/universe/r/radare2/libradare2-common_4.2.1+dfsg-2_all.deb http://archive.ubuntu.com/ubuntu/pool/universe/c/capstone/libcapstone3_4.0.1+really+3.0.5-1build1_amd64.deb http://archive.ubuntu.com/ubuntu/pool/universe/libz/libzip/libzip5_1.5.1-0ubuntu1_amd64.deb http://archive.ubuntu.com/ubuntu/pool/universe/r/radare2/libradare2-common_4.2.1+dfsg-2_all.deb

download and install them manually

wget xxxx.deb  
sudo apt install ./xxx.deb

License

Most of the code is available under the terms of the GNU GPLv3 license. See the original README and license notices in source files for details.

By contributing you agree to make your code available under the same license.

About

GDB with patches for debugging MSVC binaries

https://github.com/lesderid/gdb-msvc/

License:GNU General Public License v2.0


Languages

Language:C 80.1%Language:Assembly 9.7%Language:Makefile 2.4%Language:C++ 2.3%Language:Scheme 1.9%Language:M4 1.1%Language:Shell 0.7%Language:Ada 0.4%Language:Yacc 0.4%Language:Python 0.3%Language:TeX 0.3%Language:Perl 0.2%Language:Roff 0.1%Language:Pascal 0.1%Language:Fortran 0.1%Language:GDB 0.1%Language:C# 0.0%Language:DIGITAL Command Language 0.0%Language:HTML 0.0%Language:Lex 0.0%Language:Rust 0.0%Language:PHP 0.0%Language:NASL 0.0%Language:CMake 0.0%Language:sed 0.0%Language:Awk 0.0%Language:XSLT 0.0%Language:Emacs Lisp 0.0%Language:Go 0.0%Language:Objective-C 0.0%Language:Batchfile 0.0%Language:SAS 0.0%Language:Module Management System 0.0%Language:DTrace 0.0%Language:R 0.0%Language:Mathematica 0.0%