Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure source links work #156

Open
aeulitz opened this issue Dec 14, 2022 · 1 comment
Open

Ensure source links work #156

aeulitz opened this issue Dec 14, 2022 · 1 comment

Comments

@aeulitz
Copy link
Contributor

aeulitz commented Dec 14, 2022

Replacing VSO:5259293 in an effort to create bugs that are more specific and further upstream.

Among the things that VSO:5259293 asked for was for V8 source code to resolve in the debugger. As I understand it, we attempted to address this by the addition of source links (scripts\fetch_code.ps1). However, as per a quick check with a devinstalled Office (
lkg/main/dev 16.0.16012.15010 (b7ab2e58b0)), symbols get loaded ...

0:106> lmDvmv8jsi
Browse full module list
start end module name
00007ffad7f30000 00007ffada104000 v8jsi (private pdb symbols) c:\symbols\v8jsi.dll.pdb\130A78201C1243A0B45DA03F4F31012D1\v8jsi.dll.pdb
Loaded symbol image file: C:\Program Files\Microsoft Office\root\Office16\v8jsi.dll

However, sources do not appear to get resolved (using v8runtime::V8Runtime::ExecuteString as an example, WinDbg does not open any source file):

0:093> bl
0 e Disable Clear 00007ffad7f82a10 [D:\a\_work\1\s\build\v8build\v8\jsi\V8JsiRuntime.cpp @ 710] 0001 (0001) 0:**** v8jsi!v8runtime::V8Runtime::ExecuteString 0:093> g ... Breakpoint 0 hit v8jsi!v8runtime::V8Runtime::ExecuteString: 00007ffad7f82a10 4c894c2420 mov qword ptr [rsp+20h],r9 ss:000000f0`c6dc

@ghost ghost added the Needs: triage 🔍 label Dec 14, 2022
@aeulitz
Copy link
Contributor Author

aeulitz commented Dec 15, 2022

I found that the following sequence of commands can be used to show the source links embedded in the PDB.

  1. Display sourcelink string names in the PDB via
pdbdump v8jsi.dll.pdb strnames | findstr "sourcelink

This outputs something like

892:     297  sourcelink$1
894:       0  sourcelink$2

I found pdbdump.exe on the \vcfs\builds\msvc\main\20221214.01\binaries.amd64ret\bin\amd64 release share (path probably needs to be adjusted for current releases).

  1. Pass the string names displayed by the above command into pdbstr
pdbstr -p:v8jsi.dll.pdb -r -i:d:\temp\out.txt -s:'sourcelink$1

I found pdbstr.exe in d:\nugetcache\microsoft.windows.dbg.srcsrv.10.0.17074.10021\lib\amd64

The output file generated by the above command (d:\temp\out.txt) shows the JSON sourcelink map:

{
    "documents": {
        "D:\a\_work\1\s\\build\\v8build\\v8\\*" : "https://raw.githubusercontent.com/v8/v8/10.6.194.10/*",
        "D:\a\_work\1\s\\build\\v8build\\v8\\jsi\\*" : "https://raw.githubusercontent.com/microsoft/v8-jsi/0492cb64ee645a2796ff0f1eb768a46611f2bc2c/src/*"
    }
}

It seems that the local paths in the above map contain a mix of '\' and '\\' path separators. I'm guessing that in order to be valid JSON, all local path separators should be '\\'.

tudorms pushed a commit to tudorms/v8-jsi that referenced this issue Dec 16, 2022
ghost pushed a commit that referenced this issue Dec 19, 2022
@ghost ghost added the Status: Fixed label Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant