forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Windows] Fix loading debug symbol files over 2GB.
- Loading branch information
1 parent
368ff04
commit 940cf67
Showing
4 changed files
with
68 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters