Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
e5e822e0
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e5e822e0
编写于
3月 20, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Debug: Provide information for debugging with QEMU
上级
dcebc822
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
59 addition
and
7 deletion
+59
-7
Debug/README.md
Debug/README.md
+48
-2
Debug/macgdb.tool
Debug/macgdb.tool
+5
-1
Docs/Configuration.pdf
Docs/Configuration.pdf
+0
-0
Docs/Configuration.tex
Docs/Configuration.tex
+1
-1
Docs/Differences/Differences.pdf
Docs/Differences/Differences.pdf
+0
-0
Docs/Differences/Differences.tex
Docs/Differences/Differences.tex
+5
-3
未找到文件。
Debug/README.md
浏览文件 @
e5e822e0
...
...
@@ -17,11 +17,16 @@ The general approach is as follows:
#### Preparing Source Code
By default EDK II optimises produced binaries, so to build a "real" debug binary one should target
`NOOPT`
. Do be aware that it strongly affects resulting binary size.
`NOOPT`
. Do be aware that it strongly affects resulting binary size:
```
build -a X64 -t XCODE5 -b NOOPT -p OpenCorePkg/OpenCorePkg.dsc # for macOS
build -a X64 -t CLANGPDB -b NOOPT -p OpenCorePkg/OpenCorePkg.dsc # for other systems
```
`GdbSyms.dll`
is built as a part of OpenCorePkg, yet prebuilt binaries are also available:
-
`GdbSyms/Bin/X64_XCODE5/GdbSyms.dll`
is built with
UDK2018 and
XCODE5
-
`GdbSyms/Bin/X64_XCODE5/GdbSyms.dll`
is built with XCODE5
To wait for debugger connection on startup
`WaitForKeyPress`
functions from
`OcMiscLib.h`
can be
utilised. Do be aware that this function additionally calls
`DebugBreak`
function, which may
...
...
@@ -60,6 +65,44 @@ settings:
bios.bootDelay = "3000"
```
#### QEMU configuration
In addition to VMware it is also possible to use
[
QEMU
](
https://www.qemu.org
)
. QEMU debugging
on macOS host is generally rather limited and slow, but it is enough for generic troubleshooting
when no macOS guest booting is required.
1.
Build OVMF firmware in NOOPT mode to be able to debug it:
```
build -a X64 -t XCODE5 -b NOOPT -p OvmfPkg/OvmfPkgX64.dsc # for macOS
build -a X64 -t CLANGPDB -b NOOPT -p OvmfPkg/OvmfPkgX64.dsc # for other systems
```
2.
Prepare launch directory with OpenCore as usual. For example, make a directory named
`QemuRun`
and
`cd`
to it. You should have a similar directory structure:
```
.
└── ESP
└── EFI
├── BOOT
│ └── BOOTx64.efi
└── OC
├── OpenCore.efi
└── config.plist
```
3.
Run QEMU (
`OVMF_BUILD`
should point to OVMF build directory, e.g.
`$HOME/UefiWorkspace/Build/OvmfX64/NOOPT_XCODE5/FV`
):
```
qemu-system-x86_64 -L . -bios "$OVMF_BUILD/OVMF.fd" -hda fat:rw:ESP \
-machine q35 -m 2048 -cpu Penryn -smp 4,cores=2 -gdb tcp::8864
```
You may additionally pass
`-S`
flag to QEMU to stop at first instruction
and wait for GDB connection.
#### GDB Configuration
It is a good idea to use GDB Multiarch in case different debugging architectures are planned to be
...
...
@@ -81,6 +124,9 @@ reload-uefi
b DebugBreak
```
For simplicitly
`macgdb.tool`
performs them all. Note, that you need to run
`reload-uefi`
after any new binary loads.
#### References
1.
https://communities.vmware.com/thread/390128
...
...
Debug/macgdb.tool
浏览文件 @
e5e822e0
...
...
@@ -24,7 +24,11 @@ if [ "$GDB" = "" ]; then
exit
1
fi
"
$GDB
"
-ex
"target remote localhost:8864"
\
if
[
"
$GDB_PORT
"
=
""
]
;
then
GDB_PORT
=
8864
fi
"
$GDB
"
-ex
"target remote localhost:
$GDB_PORT
"
\
-ex
"source Scripts/gdb_uefi.py"
\
-ex
"set pagination off"
\
-ex
"reload-uefi"
\
...
...
Docs/Configuration.pdf
浏览文件 @
e5e822e0
无法预览此类型文件
Docs/Configuration.tex
浏览文件 @
e5e822e0
...
...
@@ -4872,7 +4872,7 @@ Similar to other projects working with hardware OpenCore supports auditing and d
The use of
\texttt
{
NOOPT
}
or
\texttt
{
DEBUG
}
build modes instead of
\texttt
{
RELEASE
}
can produce a lot more debug output. With
\texttt
{
NOOPT
}
source level debugging with
GDB or IDA Pro is also available. For GDB check
\href
{
https:
//
github.com
/
acidanthera
/
OpenCorePkg
/
tree
/
master
/
Debug
}{
O
cSupport
Debug
}
\href
{
https:
//
github.com
/
acidanthera
/
OpenCorePkg
/
tree
/
master
/
Debug
}{
O
penCore
Debug
}
page. For IDA Pro you will need IDA Pro
7
.
3
or newer, refer to
\href
{
https:
//
www.hex
-
rays.com
/
products
/
ida
/
support
/
tutorials
/
index.shtml
}{
Debugging the XNU Kernel with IDA Pro
}
for more details.
...
...
Docs/Differences/Differences.pdf
浏览文件 @
e5e822e0
无法预览此类型文件
Docs/Differences/Differences.tex
浏览文件 @
e5e822e0
\documentclass
[]
{
article
}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Fri Mar 6 09:43:05 2020
%DIF ADD ../Configuration.tex
Sun Mar 15 17:26:3
7 2020
%DIF ADD ../Configuration.tex
Fri Mar 20 05:08:2
7 2020
\usepackage
{
lmodern
}
\usepackage
{
amssymb,amsmath
}
...
...
@@ -5180,8 +5180,10 @@ Similar to other projects working with hardware OpenCore supports auditing and d
The use of
\texttt
{
NOOPT
}
or
\texttt
{
DEBUG
}
build modes instead of
\texttt
{
RELEASE
}
can produce a lot more debug output. With
\texttt
{
NOOPT
}
source level debugging with
GDB or IDA Pro is also available. For GDB check
\href
{
https:
//
github.com
/
acidanthera
/
OpenCorePkg
/
tree
/
master
/
Debug
}{
OcSupport Debug
}
page. For IDA Pro you will need IDA Pro
7
.
3
or newer, refer to
\DIFdelbegin
%DIFDELCMD < \href{https://github.com/acidanthera/OpenCorePkg/tree/master/Debug}{OcSupport Debug}
%DIFDELCMD < %%%
\DIFdelend
\DIFaddbegin
\href
{
https:
//
github.com
/
acidanthera
/
OpenCorePkg
/
tree
/
master
/
Debug
}{
OpenCore Debug
}
\DIFaddend
page. For IDA Pro you will need IDA Pro
7
.
3
or newer, refer to
\href
{
https:
//
www.hex
-
rays.com
/
products
/
ida
/
support
/
tutorials
/
index.shtml
}{
Debugging the XNU Kernel with IDA Pro
}
for more details.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录