mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 14:11:15 +00:00
[Windows] Fix loading debug symbol files over 2GB.
This commit is contained in:
parent
44dfa7e710
commit
a8c8eca74a
4 changed files with 68 additions and 10 deletions
|
|
@ -167,7 +167,10 @@ extern void CrashHandlerException(int signal) {
|
||||||
if (FileAccess::exists(_execpath + ".debugsymbols")) {
|
if (FileAccess::exists(_execpath + ".debugsymbols")) {
|
||||||
_execpath = _execpath + ".debugsymbols";
|
_execpath = _execpath + ".debugsymbols";
|
||||||
}
|
}
|
||||||
data.state = backtrace_create_state(_execpath.utf8().get_data(), 0, &error_callback, reinterpret_cast<void *>(&data));
|
_execpath = _execpath.replace("/", "\\");
|
||||||
|
|
||||||
|
CharString cs = _execpath.utf8(); // Note: should remain in scope during backtrace_simple call.
|
||||||
|
data.state = backtrace_create_state(cs.get_data(), 0, &error_callback, reinterpret_cast<void *>(&data));
|
||||||
if (data.state != nullptr) {
|
if (data.state != nullptr) {
|
||||||
data.index = 1;
|
data.index = 1;
|
||||||
backtrace_simple(data.state, 1, &trace_callback, &error_callback, reinterpret_cast<void *>(&data));
|
backtrace_simple(data.state, 1, &trace_callback, &error_callback, reinterpret_cast<void *>(&data));
|
||||||
|
|
|
||||||
4
thirdparty/README.md
vendored
4
thirdparty/README.md
vendored
|
|
@ -468,6 +468,10 @@ Files extracted from upstream source:
|
||||||
- `*.{c,h}` files for Windows platform
|
- `*.{c,h}` files for Windows platform
|
||||||
- `LICENSE`
|
- `LICENSE`
|
||||||
|
|
||||||
|
Important: Some files have Godot-made changes to load big debug symbol files.
|
||||||
|
They are marked with `/* GODOT start */` and `/* GODOT end */`
|
||||||
|
comments and a patch is provided in the `patches` folder.
|
||||||
|
|
||||||
|
|
||||||
## libktx
|
## libktx
|
||||||
|
|
||||||
|
|
|
||||||
47
thirdparty/libbacktrace/patches/patch_big_files.diff
vendored
Normal file
47
thirdparty/libbacktrace/patches/patch_big_files.diff
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
diff --git a/thirdparty/libbacktrace/read.c b/thirdparty/libbacktrace/read.c
|
||||||
|
index 1811c8d2e0..fda8e222d4 100644
|
||||||
|
--- a/thirdparty/libbacktrace/read.c
|
||||||
|
+++ b/thirdparty/libbacktrace/read.c
|
||||||
|
@@ -52,14 +52,9 @@ backtrace_get_view (struct backtrace_state *state, int descriptor,
|
||||||
|
{
|
||||||
|
uint64_t got;
|
||||||
|
ssize_t r;
|
||||||
|
-
|
||||||
|
- if ((uint64_t) (size_t) size != size)
|
||||||
|
- {
|
||||||
|
- error_callback (data, "file size too large", 0);
|
||||||
|
- return 0;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (lseek (descriptor, offset, SEEK_SET) < 0)
|
||||||
|
+/* GODOT start */
|
||||||
|
+ if (_lseeki64 (descriptor, offset, SEEK_SET) < 0)
|
||||||
|
+/* GODOT end */
|
||||||
|
{
|
||||||
|
error_callback (data, "lseek", errno);
|
||||||
|
return 0;
|
||||||
|
@@ -74,7 +69,13 @@ backtrace_get_view (struct backtrace_state *state, int descriptor,
|
||||||
|
got = 0;
|
||||||
|
while (got < size)
|
||||||
|
{
|
||||||
|
- r = read (descriptor, view->base, size - got);
|
||||||
|
+/* GODOT start */
|
||||||
|
+ uint64_t sz = size - got;
|
||||||
|
+ if (sz > INT_MAX) {
|
||||||
|
+ sz = INT_MAX;
|
||||||
|
+ }
|
||||||
|
+ r = _read (descriptor, view->base, sz);
|
||||||
|
+/* GODOT end */
|
||||||
|
if (r < 0)
|
||||||
|
{
|
||||||
|
error_callback (data, "read", errno);
|
||||||
|
@@ -84,6 +85,9 @@ backtrace_get_view (struct backtrace_state *state, int descriptor,
|
||||||
|
if (r == 0)
|
||||||
|
break;
|
||||||
|
got += (uint64_t) r;
|
||||||
|
+/* GODOT start */
|
||||||
|
+ view->base += r;
|
||||||
|
+/* GODOT end */
|
||||||
|
}
|
||||||
|
|
||||||
|
if (got < size)
|
||||||
22
thirdparty/libbacktrace/read.c
vendored
22
thirdparty/libbacktrace/read.c
vendored
|
|
@ -52,14 +52,9 @@ backtrace_get_view (struct backtrace_state *state, int descriptor,
|
||||||
{
|
{
|
||||||
uint64_t got;
|
uint64_t got;
|
||||||
ssize_t r;
|
ssize_t r;
|
||||||
|
/* GODOT start */
|
||||||
if ((uint64_t) (size_t) size != size)
|
if (_lseeki64 (descriptor, offset, SEEK_SET) < 0)
|
||||||
{
|
/* GODOT end */
|
||||||
error_callback (data, "file size too large", 0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lseek (descriptor, offset, SEEK_SET) < 0)
|
|
||||||
{
|
{
|
||||||
error_callback (data, "lseek", errno);
|
error_callback (data, "lseek", errno);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -74,7 +69,13 @@ backtrace_get_view (struct backtrace_state *state, int descriptor,
|
||||||
got = 0;
|
got = 0;
|
||||||
while (got < size)
|
while (got < size)
|
||||||
{
|
{
|
||||||
r = read (descriptor, view->base, size - got);
|
/* GODOT start */
|
||||||
|
uint64_t sz = size - got;
|
||||||
|
if (sz > INT_MAX) {
|
||||||
|
sz = INT_MAX;
|
||||||
|
}
|
||||||
|
r = _read (descriptor, view->base, sz);
|
||||||
|
/* GODOT end */
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
{
|
{
|
||||||
error_callback (data, "read", errno);
|
error_callback (data, "read", errno);
|
||||||
|
|
@ -84,6 +85,9 @@ backtrace_get_view (struct backtrace_state *state, int descriptor,
|
||||||
if (r == 0)
|
if (r == 0)
|
||||||
break;
|
break;
|
||||||
got += (uint64_t) r;
|
got += (uint64_t) r;
|
||||||
|
/* GODOT start */
|
||||||
|
view->base += r;
|
||||||
|
/* GODOT end */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (got < size)
|
if (got < size)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue