Commit Graph
213 Commits
Author SHA1 Message Date
Pierre-Loup A. Griffaisandbaldurk b335d32424 posix process: don't crash on malformed environment 2017-01-23 19:09:28 +00:00
baldurk 1c29bcfec7 Look for renderdoccmd.exe in development environment folder structure
* This means that if you just build Win32 and x64 matching, then it will
  all work, no need to manually copy into the deployed folder structure.
2017-01-23 19:09:28 +00:00
baldurk 030cbfde9a Batch update copyright years everywhere 2017-01-06 12:13:31 +00:00
Jake TurnerandBaldur Karlsson 93377b377f Use execve instead of execvp & setting environ global variable
If the app name doesn't have a directory separator search PATH directories to find path of application to launch.
Resolve the app name fully then change the working directory
2017-01-02 14:44:07 +00:00
Michael RennieandBaldur Karlsson d249faacd3 Test Android target connection for up to MaxConnectTimeout seconds.
Added new setting to SettingsDialog, and passed it to native code via
RenderDoc::Inst().GetConfigSetting("MaxConnectTimeout")
2016-12-24 19:22:10 +00:00
baldurk 4dfe157861 Fix some minor clang-format issues 2016-12-08 21:08:30 +00:00
baldurk 2a4d2451ff Allow 'promoting' back to capture 64-bit from 32-bit, in 64-bit install
* A 64-bit install has an x86 subfolder to capture 32-bit programs. If
  a 32-bit program then launches a 64-bit program we need to 'promote'
  back to run the original bitness to capture it.
* It's still not supported to capture 64-bit in general from just a
  32-bit install as the support files aren't included.
2016-12-08 19:04:59 +00:00
baldurk c810a96300 Keep debug log the same even when going via cap32for64 2016-12-08 19:04:57 +00:00
baldurk 739b4cb1ab Handle hooking CreateProcessA/W from API sets 2016-12-08 19:04:38 +00:00
baldurk 08bd19a990 Fix compilation (mostly) on OSX, with stubs for VK WSI. 2016-11-28 12:57:55 +01:00
baldurk cd6e99405e Add some default-off verbose logging of IAT hooks. Refs #425 2016-11-25 18:19:46 +01:00
baldurk b2464e1c64 Create logfiles in 0644 2016-11-21 15:05:32 +01:00
baldurk 5ecd4f9437 Hold hooking lock for a shorter time to avoid deadlocks
* In particular, we don't want to hold this lock while potentially
  calling FreeLibrary as that could try to acquire the loader lock that
  another thread might be holding while waiting on our lock.
2016-11-09 12:01:34 +01:00
baldurk 8d0915401f Unify feature macro handling 2016-11-07 18:14:49 +01:00
Michael RennieandBaldur Karlsson a2bdda41ef S_IWRITE is an obsolete synonym of S_IWUSR. Not available on Android. 2016-11-04 16:54:26 +01:00
baldurk 1f2c45a22f Remove log message about failed connections
* This could just be an attempt to connect to see if probe to see if a
  socket is listening, so don't spam the log.
2016-11-03 16:29:38 +01:00
baldurk 8f4a55a3b5 Set all processes under a given UI instance to log to the same file.
* Using OS-specific append writing functions instead of simple fopen/
  fwrite/fclose we can guarantee that multiple processes writing to the
  same log file won't trash or interleave their log output.
* To make the logs readable the PID is now included along with the
  project/timestamp.
* After that, we make sure that when we launch a program we set the
  output log to the same file as the parent UI. This keeps all the logs
  together and removes user confusion over which logfile is needed.
* We also move all of RenderDoc's temporary files under a RenderDoc
  folder in the temp folder, instead of scattering the files in the root
2016-11-02 23:37:38 +01:00
Michael RennieandBaldur Karlsson bcb9914665 Start remoteserver and captured packages by adb commands in native code.
Use adb to enumerate installed 3rd party packages in capture dialog.
Cleaned up all the "adb:" strcmp's.
2016-11-02 16:10:29 +01:00
Michael RennieandBaldur Karlsson 8899cb8e73 If adb path is set, use adb devices to enumerate Android devices.
Process::LaunchProcess() optionally returns the child's stdout & stderr.
Added carriage return to string trim().
2016-11-02 16:10:29 +01:00
baldurk 21b4f94379 Don't try and hook into child processes that failed to create 2016-10-31 01:01:53 +01:00
baldurk cdbcc7f301 Print a message when running a process 2016-10-27 22:17:42 +02:00
baldurk f368a65843 Add easy support for self-hosted captures on windows only
* By renaming the renderdoc and renderdoccmd projects to something else
  (say 'selfhost' and 'selfhostcmd') then they can be used to capture
  renderdocui and the replaying that's happening.
* Only supported on development builds and might break down, but it's
  handy to have as an easy to enable option.
* There's also a couple of handy python functions exposed -
  renderdoc.StaticExports.StartSelfHostCapture(string dllname)
  renderdoc.StaticExports.EndSelfHostCapture(string dllname)
  which can be used to start and stop the capture around e.g. a shader
  debug operation or a pixel history operation or something similar.
2016-10-25 19:50:04 +02:00
baldurk cde22aace7 Hook WSAStartup/WSACleanup to workaround app bugs. Refs #362, #403
* If the application incorrectly calls WSACleanup() before WSAStartup()
  then instead of just an error for invalid use, it will instead kill
  all of the sockets we created from our early WSAStartup().
* To fix this, we hook those functions and track the process wide ref-
  count, to prevent it from every going to 0 until we shut down our own.
* This was found on GTA 5 in particular but possibly some other
  application will do this too.
2016-10-25 12:03:28 +02:00
baldurk c71225e4be Don't skip over hooked programs when doing a ordinals fixup pass 2016-10-14 17:24:36 +02:00
baldurk a1fa1c0ca6 Handle more than 2k of saved ignored PDBs 2016-10-13 16:06:25 +02:00
baldurk 5352494aa7 Refresh module list before enumerating, to catch dynamic DLLs. Refs #364 2016-10-13 16:06:25 +02:00
baldurk 83334f01d1 Make sure we don't accidentally propagate bad GetLastError() values
* When relevant we do SetLastError(S_OK) before calling the 'real'
  function, and likewise do GetLastError() to preserve the result if
  we're doing work after the real function.
2016-10-07 22:08:48 +02:00
baldurk 9f4a60028e Handle injecting environment variable params
* This also fixes the problem of capturing 32-bit programs with 64-bit
  RenderDoc failing to properly insert environment variables and
  error'ing when it tries to do it directly.
2016-09-28 17:55:45 +02:00
baldurk 6f24ed7cca Use RENDERDOC_TEMP override on posix systems, don't just ignore it! 2016-09-28 13:14:51 +02:00
baldurk 0729f5dc06 Compile fix for android and apple 2016-09-27 12:52:14 +02:00
baldurk aeb0f3a005 For libraries opened with RTLD_DEEPBIND, use plthook to hook dlopen
* Split out the hook functions into linux and apple/android (which are
  currently unimplemented).
2016-09-26 17:33:51 +02:00
baldurk 20ecde678a Add more informative error for processes dying in startup. Refs #358 2016-09-21 22:36:43 +02:00
baldurk c0b3f39f06 Add a couple of log lines about sockets for diagnostics. Refs #362 2016-09-16 21:30:00 +02:00
baldurk fa6079d4cd Appveyor compile fix for ordinal-as-pointer down cast 2016-09-16 20:06:46 +02:00
baldurk 99c51259e3 Support hooking GetProcAddress for ordinals. Used for delay-load d3d12 2016-09-16 10:19:23 +02:00
baldurk cf5059706e Fix a crash if calling GetProcAddress for GetProcAddress (what?!)
* Would also happen for LoadLibrary variants, but the crashdump I got
  was for GetProcAddress.
2016-09-15 17:10:16 +02:00
Michael Rennie b32bb1cc55 Keep target as Android package name instead of "unknown". 2016-09-13 13:00:13 +01:00
Michael Rennie 687744cf6d Save captures to /sdcard, so that APK can replay it immediately. 2016-09-13 11:01:06 +01:00
baldurk c6fc2cc315 Reverse CmpExch parameters to the sensible way around 2016-09-09 20:53:20 +02:00
baldurk 5cc7519e92 Add compare-exchange function to Atomic 2016-09-08 20:19:56 +02:00
baldurk 0df4a0e2f3 If GetProcAddress for the real function returns NULL, don't hook func 2016-09-08 10:45:27 +02:00
baldurk 74bd568724 As a last fallback for locating qrenderdoc, return the binary name
* This way if the binary is in the PATH somewhere but not in any of our
  expected locations, we can still execute it.
2016-08-26 13:35:55 +02:00
Norbert Nopperandbaldurk b180aaaf11 Last, maximum wait time is 32 milliseconds. 2016-08-24 18:34:56 +02:00
Norbert Nopperandbaldurk 3dad918ad1 Increased wait time and changed retries for gathering proc entry.
(Not tested)
2016-08-24 18:34:49 +02:00
baldurk a1d0b72e79 Fix select() calls - nfds must be the highest fd value plus 1
* This was copy-pasted from windows where unfortunately the nfds
  argument is ignored and we could get away with just passing 0 (which
  I suspect is where the broken code came from originally - a windows
  example code that passed 0)
2016-08-24 15:53:53 +02:00
Michael Rennie 86fd623a54 Fix char* format specifier. 2016-08-23 20:26:28 +01:00
baldurk 872fbe017b Make xlib and xcb support optional (but default on) on linux
* Also allow disabling GL a little better by removing the dependency in
  renderdoccmd.
* Disabling them now completely removes all xcb and xlib build
  dependencies. The resulting library/executable is only useful in
  limited situations - e.g. replaying vulkan remotely which doesn't need
  any window system interaction. Or capturing vulkan as well with the
  KHR_display WSI extension which doesn't need any built-time includes
  or libs.
2016-08-23 16:25:21 +02:00
baldurk 1b06e2b553 Handle EAGAIN and EINPROGRESS where appropriate as well as EWOULDBLOCK 2016-08-23 11:31:01 +02:00
baldurk d2faf76356 Save machine ident in captures and compare to machine ident on open
* If the machine idents differ in significant ways that we'd consider
  it to be a different platform (currently just OS), and if so mark it
  as supported but suggested to be replayed remotely.
2016-08-19 17:26:36 +02:00
baldurk 52a754d4c1 Add function to get a coarse machine identifier
* This can be used to determine what kind of machine a capture came from
  and potentially decide to alert the user and suggest replaying on that
  kind of machine if it's very different.
2016-08-19 17:26:35 +02:00