Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
258 additions
and
49 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,14 @@ | ||
--- a/renderdoc/CMakeLists.txt | ||
+++ b/renderdoc/CMakeLists.txt | ||
@@ -54,6 +54,11 @@ elseif(UNIX) | ||
find_package(PkgConfig REQUIRED) | ||
find_package(Threads REQUIRED) | ||
|
||
+ option(NEED_LIBEXECINFO "need libexecinfo" OFF) | ||
+ if (NEED_LIBEXECINFO) | ||
+ list(APPEND RDOC_LIBRARIES PRIVATE -lexecinfo) | ||
+ endif() | ||
+ | ||
list(APPEND RDOC_LIBRARIES | ||
PRIVATE -lm | ||
PRIVATE -ldl |
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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
Index: CMakeLists.txt | ||
=================================================================== | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -315,6 +315,7 @@ set(RELEASE_MODE 0) | ||
@@ -346,6 +346,7 @@ set(RELEASE_MODE 0) | ||
|
||
if(cmake_build_type_lower STREQUAL "release" OR | ||
cmake_build_type_lower STREQUAL "relwithdebinfo" OR | ||
+ cmake_build_type_lower STREQUAL "none" OR | ||
cmake_build_type_lower STREQUAL "minsizerel") | ||
add_definitions(-D_RELEASE) | ||
add_definitions(-DRELEASE) | ||
message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}") |
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
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,98 @@ | ||
--- a/renderdoc/os/posix/linux/linux_hook.cpp | ||
+++ b/renderdoc/os/posix/linux/linux_hook.cpp | ||
@@ -70,8 +70,10 @@ __attribute__((visibility("default"))) v | ||
|
||
void *ret = passthru(filename, flag); | ||
|
||
+#ifdef __GLIBC__ | ||
if(filename && ret && (flag & RTLD_DEEPBIND)) | ||
plthook_lib(ret); | ||
+#endif | ||
|
||
return ret; | ||
} | ||
@@ -506,8 +508,10 @@ void *intercept_dlopen(const char *filen | ||
if(filename == NULL) | ||
return ret; | ||
|
||
+#ifdef __GLIBC__ | ||
if(flag & RTLD_DEEPBIND) | ||
plthook_lib(ret); | ||
+#endif | ||
|
||
rdcstr base = get_basename(filename); | ||
|
||
--- a/renderdoc/3rdparty/plthook/plthook_elf.c | ||
+++ b/renderdoc/3rdparty/plthook/plthook_elf.c | ||
@@ -62,7 +62,7 @@ | ||
#include <link.h> | ||
#include "plthook.h" | ||
|
||
-#if defined __UCLIBC__ && !defined RTLD_NOLOAD | ||
+#if !defined(__GLIBC__) && !defined(RTLD_NOLOAD) | ||
#define RTLD_NOLOAD 0 | ||
#endif | ||
|
||
@@ -204,7 +204,7 @@ static int check_elf_header(const Elf_Eh | ||
#endif | ||
static void set_errmsg(const char *fmt, ...) __attribute__((__format__ (__printf__, 1, 2))); | ||
|
||
-#if defined __ANDROID__ || defined __UCLIBC__ | ||
+#if defined(__linux__) && !defined(__GLIBC__) | ||
struct dl_iterate_data { | ||
char* addr; | ||
struct link_map lmap; | ||
@@ -249,7 +249,7 @@ int plthook_open(plthook_t **plthook_out | ||
|
||
int plthook_open_by_handle(plthook_t **plthook_out, void *hndl) | ||
{ | ||
-#if defined __ANDROID__ || defined __UCLIBC__ | ||
+#if defined (__linux__) && !defined(__GLIBC__) | ||
const static char *symbols[] = { | ||
"__INIT_ARRAY__", | ||
"_end", | ||
@@ -288,7 +288,7 @@ int plthook_open_by_address(plthook_t ** | ||
{ | ||
#if defined __FreeBSD__ | ||
return PLTHOOK_NOT_IMPLEMENTED; | ||
-#elif defined __ANDROID__ || defined __UCLIBC__ | ||
+#elif defined(__linux__) && !defined(__GLIBC__) | ||
struct dl_iterate_data data = {0,}; | ||
data.addr = address; | ||
dl_iterate_phdr(dl_iterate_cb, &data); | ||
@@ -312,7 +312,7 @@ int plthook_open_by_address(plthook_t ** | ||
|
||
static int plthook_open_executable(plthook_t **plthook_out) | ||
{ | ||
-#if defined __ANDROID__ || defined __UCLIBC__ | ||
+#if defined(__linux__) && !defined(__GLIBC__) | ||
return plthook_open_shared_library(plthook_out, NULL); | ||
#elif defined __linux__ | ||
return plthook_open_real(plthook_out, _r_debug.r_map); | ||
@@ -351,7 +351,7 @@ static int plthook_open_executable(pltho | ||
static int plthook_open_shared_library(plthook_t **plthook_out, const char *filename) | ||
{ | ||
void *hndl = dlopen(filename, RTLD_LAZY | RTLD_NOLOAD); | ||
-#if defined __ANDROID__ || defined __UCLIBC__ | ||
+#if defined(__linux__) && !defined(__GLIBC__) | ||
int rv; | ||
#else | ||
struct link_map *lmap = NULL; | ||
@@ -361,7 +361,7 @@ static int plthook_open_shared_library(p | ||
set_errmsg("dlopen error: %s", dlerror()); | ||
return PLTHOOK_FILE_NOT_FOUND; | ||
} | ||
-#if defined __ANDROID__ || defined __UCLIBC__ | ||
+#if defined(__linux__) && !defined(__GLIBC__) | ||
rv = plthook_open_by_handle(plthook_out, hndl); | ||
dlclose(hndl); | ||
return rv; | ||
@@ -553,7 +553,7 @@ static int plthook_open_real(plthook_t * | ||
|
||
#if defined __linux__ | ||
plthook.plt_addr_base = (char*)lmap->l_addr; | ||
-#if defined __ANDROID__ || defined __UCLIBC__ | ||
+#if !defined(__GLIBC__) | ||
dyn_addr_base = (const char*)lmap->l_addr; | ||
#endif | ||
#elif defined __FreeBSD__ || defined __sun |
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,85 @@ | ||
--- a/qrenderdoc/Code/pyrenderdoc/function_conversion.h | ||
+++ b/qrenderdoc/Code/pyrenderdoc/function_conversion.h | ||
@@ -303,11 +303,19 @@ funcType ConvertFunc(const char *funcnam | ||
|
||
while(frame) | ||
{ | ||
+#if PY_VERSION_HEX >= 0x030B0000 | ||
+ global_internal_handle = PyDict_GetItemString(PyFrame_GetGlobals(frame), "_renderdoc_internal"); | ||
+#else | ||
global_internal_handle = PyDict_GetItemString(frame->f_globals, "_renderdoc_internal"); | ||
+#endif | ||
|
||
if(global_internal_handle) | ||
break; | ||
+#if PY_VERSION_HEX >= 0x03090000 | ||
+ frame = PyFrame_GetBack(frame); | ||
+#else | ||
frame = frame->f_back; | ||
+#endif | ||
} | ||
} | ||
|
||
--- a/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp | ||
+++ b/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp | ||
@@ -85,6 +85,15 @@ extern "C" PyObject *PyInit_qrenderdoc(v | ||
extern "C" PyObject *WrapBareQWidget(QWidget *); | ||
extern "C" QWidget *UnwrapBareQWidget(PyObject *); | ||
|
||
+#if PY_VERSION_HEX <=0x030B0000 | ||
+#define PyFrame_GetGlobals(x) (x)->f_globals | ||
+#endif | ||
+ | ||
+#if PY_VERSION_HEX <=0x03090000 | ||
+#define PyFrame_GetBack(x) (x)->f_back | ||
+#define PyFrame_GetCode(x) (x)->f_code | ||
+#endif | ||
+ | ||
// little utility function to convert a PyObject * that we know is a string to a QString | ||
static inline QString ToQStr(PyObject *value) | ||
{ | ||
@@ -1213,7 +1222,7 @@ PyObject *PythonContext::outstream_write | ||
|
||
while(frame) | ||
{ | ||
- PyObject *globals = frame->f_globals; | ||
+ PyObject *globals = PyFrame_GetGlobals(frame); | ||
if(globals) | ||
{ | ||
OutputRedirector *global = | ||
@@ -1225,7 +1234,7 @@ PyObject *PythonContext::outstream_write | ||
if(context) | ||
break; | ||
|
||
- frame = frame->f_back; | ||
+ frame = PyFrame_GetBack(frame); | ||
} | ||
} | ||
|
||
@@ -1248,7 +1257,7 @@ PyObject *PythonContext::outstream_write | ||
|
||
if(frame) | ||
{ | ||
- filename = ToQStr(frame->f_code->co_filename); | ||
+ filename = ToQStr(PyFrame_GetCode(frame)->co_filename); | ||
line = PyFrame_GetLineNumber(frame); | ||
} | ||
|
||
@@ -1278,7 +1287,7 @@ int PythonContext::traceEvent(PyObject * | ||
PythonContext *context = (PythonContext *)thisint; | ||
|
||
PyObject *compiled = PyDict_GetItemString(obj, "compiled"); | ||
- if(compiled == (PyObject *)frame->f_code && what == PyTrace_LINE) | ||
+ if(compiled == (PyObject *)PyFrame_GetCode(frame) && what == PyTrace_LINE) | ||
{ | ||
context->location.line = PyFrame_GetLineNumber(frame); | ||
|
||
@@ -1361,7 +1370,7 @@ extern "C" void HandleException(PyObject | ||
|
||
if(frame) | ||
{ | ||
- filename = ToQStr(frame->f_code->co_filename); | ||
+ filename = ToQStr(PyFrame_GetCode(frame)->co_filename); | ||
linenum = PyFrame_GetLineNumber(frame); | ||
} | ||
|
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,10 @@ | ||
--- a/renderdoc/os/os_specific.h | ||
+++ b/renderdoc/os/os_specific.h | ||
@@ -35,6 +35,7 @@ | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
#include <stdio.h> | ||
+#include <time.h> | ||
#include <functional> | ||
#include "api/replay/rdcarray.h" | ||
#include "api/replay/rdcpair.h" |
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
Oops, something went wrong.