...
 
Commits (4)
    https://gitcode.net/btwise/opencorepkg_mod/-/commit/4d2fed90adc308d6e9f24eab6ceb3d265d10ff1e Debug: Add support for 32-bit on 32-bit under GDB (#493) 2023-10-27T00:44:19+03:00 Mike Beaton mjsbeaton@gmail.com In addition to existing support for 32-bit on 64-bit https://gitcode.net/btwise/opencorepkg_mod/-/commit/763b0ea7ef23861f6e230d7b28fd4a5560a012d0 Debug: Add working 32 on 32 GDB VS Code config 2023-10-26T23:58:13+01:00 Mike Beton mjsbeaton@gmail.com https://gitcode.net/btwise/opencorepkg_mod/-/commit/f42f0385107a07f5db2acbfb3b6859d642ca22c1 Merge branch 'master' of https://github.com/acidanthera/OpenCorePkg 2023-10-27T10:51:13+08:00 btwise tyq@qq.com https://gitcode.net/btwise/opencorepkg_mod/-/commit/ccc663424f478c7b60592b9362ba4a75776bbaa5 Merge branch 'master' of https://gitee.com/btwise/OpenCorePkg 2023-10-27T10:51:58+08:00 btwise tyq@qq.com
......@@ -3,6 +3,7 @@ OpenCore Changelog
#### v0.9.6
- Updated builtin firmware versions for SMBIOS and the rest
- Fixed hang while generating boot entries on some systems
- Add `efidebug.tool` support for 32-bit on 32-bit using GDB (in addition to existing 32-bit on 64-bit support)
#### v0.9.5
- Fixed GUID formatting for legacy NVRAM saving
......
......@@ -279,6 +279,29 @@ For example, this is a working `launch.json` file for both LLDB and GDB debuggin
"traceResponse": true
}
},
{
"name": "OC gdb (32/32)",
"type": "cppdbg",
"request": "launch",
"targetArchitecture": "x86",
"program": "${workspaceFolder}/Debug/GdbSyms/Bin/Ia32_GCC5/GdbSyms.debug",
"cwd": "${workspaceFolder}/Debug",
"MIMode": "gdb",
"stopAtEntry": true,
"setupCommands": [
{"text": "set arch i386"},
{"text": "symbol-file ${workspaceFolder}/Debug/GdbSyms/Bin/Ia32_GCC5/GdbSyms.debug"},
{"text": "target remote localhost:8832"},
{"text": "source ${workspaceFolder}/Debug/Scripts/gdb_uefi.py"},
{"text": "reload-uefi"},
],
"launchCompleteCommand": "exec-continue",
"logging": {
"engineLogging": false,
"trace": true,
"traceResponse": true
}
},
]
}
```
......
......@@ -7,9 +7,13 @@
# GDB - path to GDB debugger
# defaults to finding in PATH
# EFI_ARCH - architecture to debug
# defaults to X64
# defaults to X64; use EFI_ARCH=Ia32 to debug 32-bit firmware on 64-bit CPU
# CPU_ARCH - CPU architecture of target
# defaults to X64; use CPU_ARCH=Ia32 to debug 32-bit firmware on 32-bit CPU
# GDB_ARCH - GDB `set arch` value
# defaults to correct value for CPU_ARCH
# EFI_PORT - debugger TCP connection port
# defaults to 8864 for X64 and 8832 for IA32
# defaults to 8864 for X64 and 8832 for Ia32
# EFI_HOST - debugger TCP connection host
# defaults to localhost
# EFI_DEBUGGER - debugger to use
......@@ -24,6 +28,8 @@
# defaults to x86_64-apple-macosx for XCODE5, x86_64-pc-windows-msvc for CLANGDWARF/CLANGPDB,
# x86_64-linux-gnu otherwise.
#
# Note: This script's support for 32-bit UEFI debugging on LLDB is incomplete, GDB is recommended in that case.
#
RUNDIR=$(dirname "$0")
pushd "${RUNDIR}" >/dev/null || exit 1
......@@ -60,8 +66,27 @@ choose_debugger() {
find_gdb
find_lldb
if [ "${CPU_ARCH}" = "IA32" ]; then
CPU_ARCH="Ia32"
elif [ "${CPU_ARCH}" = "" ]; then
CPU_ARCH="X64"
fi
if [ "${GDB_ARCH}" = "" ]; then
if [ "${CPU_ARCH}" = "X64" ]; then
GDB_ARCH="i386:x86-64:intel"
else
GDB_ARCH="i386"
fi
fi
if [ "${EFI_ARCH}" = "" ]; then
EFI_ARCH="X64"
EFI_ARCH="${CPU_ARCH}"
elif [ "${EFI_ARCH}" = "IA32" ]; then
EFI_ARCH="Ia32"
elif [ "${CPU_ARCH}" = "Ia32" ] && [ "${EFI_ARCH}" = "X64" ] ; then
echo "Invalid CPU_ARCH/EFI_ARCH combination!"
exit 1
fi
if [ "${EFI_HOST}" = "" ]; then
......@@ -135,7 +160,7 @@ choose_debugger() {
choose_debugger
if [ "${EFI_DEBUGGER}" = "GDB" ] || [ "${EFI_DEBUGGER}" = "gdb" ]; then
"${GDB}" -ex "set arch i386:x86-64:intel" \
"${GDB}" -ex "set arch ${GDB_ARCH}" \
-ex "target remote ${EFI_HOST}:${EFI_PORT}" \
-ex "source Scripts/gdb_uefi.py" \
-ex "set pagination off" \
......