BlueRoseNote/03-UnrealEngine/流程管理与部署/UE符号服务器搭建笔记.md
2023-06-29 11:55:02 +08:00

59 lines
3.7 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
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`