Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading Specific Symbols from a Symbol Server in Visual Studio that match a regex

We have a symbol server that hosts our PDBs for our internal libraries. All DLLs that are published begin with prefix "ABC"

I would like to configure Visual Studio to Load only specified modules that match ABC.*

In Tools -> Options -> Debugging -> Symbols, when I check "Only specified modules" and add "ABC.*.dll" or "ABC.*", no symbols are loaded; However when I list DLLs manually they work. Is there any way to set this up?

Also, when I check "All modules, unless excluded" my symbols are loaded, but Visual Studio also wastes time requesting symbols for other DLLs we do not host.

Other Information:

Using Visual Studio 2012 SP2 NuPeek is our NuGet / Symbol Server

like image 532
badazzhindu Avatar asked Apr 30 '13 12:04

badazzhindu


1 Answers

You could redirect your symbol server to a python (or language of your choice) script running locally. I have done this to re-write requests internally so I can serve files in network scenarios not supported by Microsoft.

If you look at the http request you can hook into the URL to run your regex. At some point the symbol server will make a request that looks like this:

http://server.name/serverpath/my.pdb/CHECKSUMOFPDB0123456/my.pdb 

With bottle.py you could write a server like this.

@route('/<pdbname>/<pdbchecksum>/<pdbname2>') 
def http_handler(pdbname, pdbchecksum, pdbname2):
    # check its directly requesting a pdb, rather than redirects or similar
    if pdbname == pdbname2:
       if matchesMyRegex(pdbname):
           return redirect("http://myserver/%s/%s/%s" %(pdbname, pdbchecksum, pdbname2))
    return abort(404, "Not found")

I used SimpleHTTPServer, but pseudo bottle.py code is more concise.

like image 105
carpenterjc Avatar answered Oct 24 '22 14:10

carpenterjc