GithubHelp home page GithubHelp logo

shenxiaolong-code / sourceindexlight_forgit Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 17 KB

debug tools : windbg source index solution for git projects (source faster, debug slower)

Batchfile 100.00%
git sourceindex windbg debug dumpanalysis

sourceindexlight_forgit's Introduction

SourceIndexLight_forGit

windbg source index for git repo -- it is faster than the sourceIndex_forGit.
The current windbg source index suite doesn't support git repo. here one solution is given by DOS script.

source index Usage

  • Syntax:
    gitIndex.cmd <sourceCodeDir> <pdbFilePath>
  • example gitIndex.cmd "d:\myProject\newFeature" "d:\myProject\newFeature\output\bin\myApp.pdb"
    gitIndex.cmd will make source index for this pdb file "d:\myProject\newFeature\output\bin\myApp.pdb" and update this pdb file.
    you can refer to the example in path : test/TC_gitIndex.bat

Prompt

  • for one solution with many projects/binary modules, one time is enough to call gitIndex.cmd.
    In general, you can call gitIndex.cmd for your PDB file of the .exe module.
  • you can configure the Post-Build Event in your visual studio project to simplify this procedure.
    teps in solution explorer : .exe project > right click > properties > Configuration Properties > ild Events > Post-Build Event :
    Command Line : gitIndex.cmd "$(SolutionDir)" <ProjectPdbFilePath>

you need to do:

  1. config windbg tool path
    if your windbg tool "pdbstr.exe" is added to %path%, you needn't do anything, else you need to update the file "userLocalPathConfig.bat"
    below is my windbg x86 path setting:
    where pdbstr.exe 2>nul || @set "path=C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\srcsrv;%path%"
    where windbg.exe 2>nul || @set "path=C:\Program Files (x86)\Windows Kits\10\Debuggers\x86;%path%"

  2. prepare one local git repo
    it is used to update the git repo to a specified commit id.

    example:
    assume your git repo path is "D:\sourceCode\myProjectGitRepo"
    your git url is https://..../myRepo.git
    you need to set environment varialbe :
    set "gitRepo_myRepo=D:\sourceCode\myProjectGitRepo"
    see :getRepoFromEvnVar in gitFetchRepo.cmd for detail.
    this variable is used in "gitFetchRepo.cmd" , certain you can edit "gitFetchRepo.cmd" directly without puting it into system environments.

use symbol with source index

  1. debugg application
    after you config your symbol path, the debugger will download the symbol file(.pdb) automatically.
    and source server (srcsrv) will fetch the correct version source file according to the source index information in the .pdb file.
    after the source file is downloaded , debuger will open it automaticaly and locate the current source code line.

  2. optional download source file manual
    after your debugger has downloaded the pdbfile myApp.pdb file -- assume its path is "c:\symbols\cache\myApp.pdb"

    • if you defined environment variable gitRepo_myRepo, you can run :
      gitFetchRepo.cmd "" "c:\symbols\cache\myApp.pdb"
      the gitFetchRepo.cmd will update the local repo folder indicated by environment variable gitRepo_myRepo.
    • if you doesn't define environment variable gitRepo_myRepo
      if your local git repo is "D:\sourceCode\myProjectGitRepo", you can run :
      gitFetchRepo.cmd "D:\sourceCode\myProjectGitRepo" "c:\symbols\cache\myApp.pdb"
      the gitFetchRepo.cmd will update the local repo folder "D:\sourceCode\myProjectGitRepo".

additional:

sourceindexlight_forgit's People

Contributors

shenxiaolong-code avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.