Commit Graph

84 Commits

Author SHA1 Message Date
baldurk fc85e44a06 Output stderr as warnings, not necessarily errors 2026-03-13 13:07:44 +00:00
baldurk a72ea34c6c Don't use sys.stdout to find global handle
* Instead store sys._renderdoc_internal that won't be overwritten.
2026-03-13 13:07:44 +00:00
baldurk 856c838def Update copyright years to 2026 and fix copyright ranges
* In a previous update in 2021 many copyright ranges were truncated
  accidentally, and some files have been copy-pasted with wrong years. These
  dates have been fixed based on git history and original copyright messages.
2026-01-05 14:17:28 +00:00
Jake Turner 39c7dc1027 Fix python message handling reading out of bounds read 2025-09-24 15:47:14 +01:00
baldurk 2322e165de Update copyright years to 2025 2025-03-14 18:54:37 +00:00
baldurk a9cc63904e Catch and print errors properly if unregister() fails 2025-02-21 13:46:59 +00:00
baldurk 783e7d47a5 Make python extension loading more robust to missing register/unregister 2025-02-21 13:46:59 +00:00
baldurk d5cc1cf626 Import threading on python context startup on main thread for debuggers 2024-07-15 16:22:38 +01:00
kb1000 bb7ec408cb Use pythoncapi-compat to simplify Python C API backwards compatibility 2024-04-08 10:57:28 +01:00
kb1000 d0a24b31cd Fix some deprecated and internal Python C API usages 2024-04-08 10:57:28 +01:00
baldurk 9f4f0e6aa1 Update copyright years to 2024 2024-02-12 11:04:52 +00:00
baldurk 9d39b8e1a8 Reformat code for clang-format 15 2023-09-05 11:02:08 +01:00
baldurk d47e79ae07 Update copyright years to 2023 2023-02-01 12:23:32 +00:00
baldurk 2cf7b911c7 Fix refcounting issue with python frame objects 2022-11-09 12:20:48 +00:00
baldurk 9df7d40241 Fix compilation on python version update on mac CI 2022-11-02 12:22:33 +00:00
baldurk 8aa0390948 Add string messages to returned result codes to display to user
* Most of the main entry points that can fail with relevant reasons now has a
  way of specifying a message to return with it. This message can be displayed
  to the user to give more information or context about an error.
2022-04-26 16:21:54 +01:00
baldurk fcdea67879 Update copyright years to 2022 2022-02-17 17:38:32 +00:00
baldurk 026da176bb Update copyright years to 2021 2021-01-13 13:56:10 +00:00
baldurk 0163328884 Fix error messages not being printed from async python callbacks 2020-12-15 22:52:38 +00:00
baldurk e5f4ca7bb8 Remove use of const char * in public API and OS specific where possible
* This prevents unnecessary conversions back and forth between rdcstr and const
  char * when going through interfaces. In the OS specific layer this is rarely
  an issue because most of the implementations don't convert to rdcstr, but it
  is convenient to be able to pass in an rdcstr directly. The few cases where
  there's an unecessary construction of an rdcstr is acceptable.
* A couple of places in the public API need to return a string from a global
  function, so can't return an rdcstr due to C ABI, so they still return a const
  char *.
* Similarly const char * is kept for logging, to avoid a dependency on rdcstr
  and because that's one place where unnecessary conversions/constructions may
  be impactful.
2020-12-07 17:44:50 +00:00
baldurk 6f7e8bb396 Add python interface consistency check that we don't use non-class enums
* These enums are generally not preferred anyway, but they also can't have
  docstrings so can't be checked for *missing* docstrings.
2020-12-05 09:57:40 +00:00
baldurk 6bc4e007a0 Fix C++ invokes being responsible for destroying python callbacks
* If the last refcount on a python lambda/temp function is released when a
  wrapping std::function is destroyed in a C++ invoke, we can't destroy it
  safely. Instead we queue up that decref and process it the next chance we're
  able (which is either when the current execution finishes for a python shell
  execution, or on the next function call which handles extensions).
2020-12-03 14:55:02 +00:00
baldurk 0aefcced95 Add a small interface into Qt widgets to our own python wrapping
* This by no means replaces PySide2, but it allows python extensions to write
  simple UIs without needing to rely on PySide2, which might not be available
  (generally all windows builds have it as well as recent binary linux builds,
  but local windows builds may not and most linux builds probably won't).
2020-11-18 18:21:20 +00:00
baldurk 91d8c30cd3 Fix python object conversion for NULL QWidgets 2020-11-18 13:11:58 +00:00
baldurk 804fddcdf7 Allow python extensions to be loaded from app folder as well as user
* This will let us distribute extensions with the renderdoc builds.
2020-11-10 13:57:27 +00:00
baldurk 716c72f399 Remove custom FindPySide2.cmake, rely on normal packaging
* It seems PySide2 packaging is much more stable now, so we can generally rely
  on the distro packages.
2020-08-28 19:06:06 +01:00
baldurk 285c4b95df Add Qt5Qml.dll stub for 32-bit pyside2 distribution
* When the pyside2 we ship was built it accidentally included a small dependency
  on Qt5Qml, which we don't distribute so the pyside2 libraries wouldn't load.
* We can generate a tiny stub with the right exports and load it manually from
  the PySide2 folder on 32-bit qrenderdoc builds to allow pyside2 to load
  subsequently. The stub source is tiny, and added alongside.
* Putting it in the PySide2 folder means that even if someone puts RenderDoc's
  build folder in their PATH, our stub Qt5Qml won't break anything because it
  won't be loaded. If they put PySide2 in the PATH it might, but then it's their
  fault!
2020-08-28 19:06:05 +01:00
baldurk 36d74b32b9 Add optional output file for qrenderdoc unit tests 2020-06-11 20:06:43 +01:00
baldurk 14dc2a57f6 Fix refcounting on python traceback object 2020-03-06 17:56:27 +00:00
baldurk 7d4685fc17 Fix exception catch-and-rethrow in extension BlockInvoke. Closes #1721 2020-02-13 11:01:45 +00:00
baldurk 2916c0f9f7 Update copyright years to 2020 2020-01-06 16:20:45 +00:00
baldurk 14d01ff995 Remove support for serialising STL types, remove STL interop 2019-12-16 18:10:32 +00:00
baldurk ec7a852582 Refactor and improve rdcarray/rdcstr interface
* We are going to replace all std::string/std::vector use with these.
2019-12-16 17:06:15 +00:00
baldurk ff08748238 Ensure all files have trailing new-lines and enforce with clang warning 2019-12-02 20:28:05 +00:00
baldurk c67995b85a Make it easier to run tests from within UI 2019-09-20 11:20:45 +01:00
baldurk 699f8753af Convert ToStr, Serialise, and TypeName to use literal strings 2019-05-15 14:12:17 +01:00
baldurk a9a64242f6 Don't crash if python output happens without a stack frame
* This can happen if SyntaxWarning message are printed during parsing before
  execution.
2019-04-16 19:33:57 +01:00
baldurk 72d3c0ee3e Set 'pyrenderdoc' global after extension registration. Closes #1291 2019-03-01 08:32:35 +00:00
baldurk 86ff87863e Update copyright years to 2019 2019-02-01 18:32:13 +00:00
baldurk e437919e78 Linux compile fixes 2018-10-23 19:11:22 +01:00
baldurk 1720d321e5 Set general global handle for extension registration work
* When calling the register() function there is no frame or globals, so we need
  to set an internal handle external to that.
* This means functions that get wrapped know that there's a global handler for
  exceptions, which just prints to the log. Otherwise they think they're running
  synchronously and write to an invalid exception handling object.
2018-10-23 15:36:35 +01:00
baldurk 94dfb9890b Allow registering window, panel and context menu items with callbacks 2018-10-23 14:23:12 +01:00
baldurk dd3a352408 Add registration and loading of extensions through a management window 2018-10-23 14:23:11 +01:00
baldurk 2dd293d691 Add the ability to load/reload global python extensions 2018-10-23 14:23:11 +01:00
baldurk 21a7584c40 Don't import built-in renderdoc modules with prefixed underscores
* This prevents any modules loaded from doing 'import renderdoc' and having it
  work as expected.
2018-10-18 19:16:25 +01:00
baldurk 082ab4d75d GUIInvoke takes a QObject* to avoid callbacks after object lifetime
* The GUIInvoke object takes a QObject, and uses QPointer to check that
  it hasn't been deleted when the callback fires. This prevents delayed
  callbacks from executing after the object has been deleted and
  crashing.
* In most cases the pointer is just 'this'.
2018-05-08 11:54:34 +01:00
baldurk ab7fa9e281 Ignore python env vars which might load incompatible libs. Refs #902
* PYTHONHOME is used *ahead* of the python36.zip on Python's default
  search path, so we need to suppress that to make sure it doesn't
  interfere.
2018-03-07 22:18:55 +00:00
baldurk c1ceb3b02a Make PySide2 optional on windows
* It's already optional on linux due to distributions not necessarily
  carrying packages for it yet. We also make it optional on windows
  since by the same measure it's not a huge problem if it's missing, and
  official builds will include it. This means we don't have to ship the
  binary dependencies
2018-02-02 20:47:19 +00:00
baldurk e305029ddd Update copyright years to 2018 2018-01-01 17:55:29 +00:00
baldurk 21d5943d82 Remove dependency on Qt in qrenderdoc python module
* The main addition here apart from some extra stubs is a new rdc type
  for date time objects.
* Although the module doesn't do anything and is only used for docs
  reflection it is desirable to not have to link against Qt as this
  can cause problems when linking the module without unresolved symbols.
2017-12-27 16:05:15 +00:00