59 lines
3.7 KiB
Markdown
59 lines
3.7 KiB
Markdown
|
---
|
|||
|
title: UE符号服务器搭建笔记
|
|||
|
date: 2022-09-13 10:56:50
|
|||
|
excerpt:
|
|||
|
tags:
|
|||
|
rating: ⭐⭐
|
|||
|
---
|
|||
|
## 前言
|
|||
|
主要是为了解决在美术不用下载调试符号的情况下,引擎崩溃时可以准确定位到代码。
|
|||
|
>PDB文件主要存储了调试程序时所需要的基本信息,主要包括源文件名、变量名、函数名、FPO(帧指针)、对应的行号等等,但是我们算了一下,整个项目的pdb文件加起来有30多个G,每天编辑器要编10个版本,导致拉pdb到本地的成本也很高,会浪费很多时间。
|
|||
|
|
|||
|
思路为:
|
|||
|
>搭建一个pdb服务器(同符号服务器一个意思这里),每次做好版本的时候,将pdb都传到这台服务器上,在策划机器上发生crash的时候,ue才会用dbghelp去解析dump文件,dbghelp会拉起symsrv.dll 去pdb服务器取得需要的pdb文件拉到本地(也可以不拉),从而进一步实现对dump中的地址解析,变成文件名,函数名,行号等详细信息
|
|||
|
|
|||
|
参考文章:
|
|||
|
- ue4 符号服务器搭建:https://zhuanlan.zhihu.com/p/563637510
|
|||
|
- 微软官方文档
|
|||
|
- SymStore使用案例: https://docs.microsoft.com/en-us/windows/win32/debug/using-symstore
|
|||
|
- SymStore所有参数列表:https://docs.microsoft.com/en-us/windows/win32/debug/symstore-command-line-options
|
|||
|
- SymSrv使用案例:https://docs.microsoft.com/en-us/windows/win32/debug/using-symsrv
|
|||
|
|
|||
|
## 流程
|
|||
|
|
|||
|
1. 安装pdb相关工具。
|
|||
|
- 我们需要symstore命令,要做的是安装Debugging Tools for Windows [官方下载地址](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-download-tools)
|
|||
|
- symstore的默认安装位置为:`C:\Program Files (x86)\Windows Kits\10\Debuggers\x64`
|
|||
|
2. 搭建pdb服务器。
|
|||
|
- 支持本地路径、共享与Https方式。
|
|||
|
3. 使用symastore上传pdb。
|
|||
|
- `symstore.exe add /r /f H:\MyGame\Engine\Binaries\Win64 /s \\sanhao-NB0\pdbShare /t ACM /z pri`
|
|||
|
- [[#微软文档中的symstore案例]]
|
|||
|
4. 增加`DefaultEditorPerProjectUserSettings.ini`设置。
|
|||
|
```ini
|
|||
|
[/Script/UnrealEd.CrashReporterSettings]
|
|||
|
RemoteStorage=\\sanhao-NB0\pdbShare
|
|||
|
DownstreamStorage=D:\PDBTest //这个是本地缓存pdb文件的路径
|
|||
|
```
|
|||
|
5. 在美术的机器上的`C:\Windows\System32`目录下放置`symsrv.dll`。与symstore同路径。
|
|||
|
6. 在美术的机器上添加环境变量:`_NT_SYMBOL_PATH srv*d:\PDBTest*\\sanhao-NB0\pdbShare
|
|||
|
- [[#微软文档中的SymSrv案例]]
|
|||
|
7. 符号服务器的空间是有限的,需要定期删除过期文件,删除需要的命令是agestore。
|
|||
|
|
|||
|
### 微软文档中的SymStore案例
|
|||
|
- `symstore add /r /f \\largeapp\appserver\bins\*.* /s \\testdir\symsrv /t "Large Application" /v "Build 432" /c "Sample add"`
|
|||
|
- `symstore add /r /p /f \\BuildServer\BuildShare\3790free\symbols\*.* /s \\sampledir\symsrv /t "Windows Server 2003" /v "Build 3790 x86 free" /c "Sample add"
|
|||
|
- `symstore add /r /p /f \\BuildServer\BuildShare\3790Chk\symbols\*.* /s \\sampledir\symsrv /t "Windows Server 2003" /v "Build 3790 x86 checked" /c "Sample add"`
|
|||
|
|
|||
|
### 微软文档中的SymSrv案例
|
|||
|
o use SymSrv with a symbol store on \\mybuilds\mysymbols, set the following symbol path:
|
|||
|
`set _NT_SYMBOL_PATH= srv*\\mybuilds\mysymbols`
|
|||
|
|
|||
|
To set the symbol path so that the debugger will copy symbol files from a symbol store on \\mybuilds\mysymbols to your local directory c:\localsymbols, use:
|
|||
|
`set _NT_SYMBOL_PATH=srv*c:\localsymbols*\\mybuilds\mysymbols`
|
|||
|
|
|||
|
To set the symbol path so that the debugger will copy symbol files from a symbol store on \\mybuilds\mysymbols to the default downstream store (typically c:\debuggers\sym), use:
|
|||
|
`set _NT_SYMBOL_PATH=srv**\\mybuilds\mysymbols`
|
|||
|
|
|||
|
To use a cascading store, set the following symbol path:
|
|||
|
`set _NT_SYMBOL_PATH = srv*c:\localsymbols*\\NearbyServer\store*https://DistantServer`
|