/// <summary> /// <para>Connect to a remote debug server with url.</para> /// </summary> /// <param name="listener"> /// <para>An optional listener that will receive all process events.</para> /// <para>If</para> /// <para>is valid then</para> /// <para>will listen to all</para> /// <para>process events. If not valid, then this target's debugger</para> /// <para>(SBTarget::GetDebugger()) will listen to all process events.</para> /// </param> /// <param name="url"> /// <para>The url to connect to, e.g., 'connect://localhost:12345'.</para> /// </param> /// <param name="plugin_name"> /// <para>The plugin name to be used; can be nullptr.</para> /// </param> /// <param name="error"> /// <para>An error explaining what went wrong if the connect fails.</para> /// </param> /// <returns> /// <para>A process object for the connected process.</para> /// </returns> public LLDB.Process ConnectRemote(LLDB.Listener listener, string url, string plugin_name, out LLDB.Error error) { if (ReferenceEquals(listener, null)) throw new global::System.ArgumentNullException("listener", "Cannot be null because it is a C++ reference (&)."); var arg0 = listener.__Instance; var arg1 = Marshal.StringToHGlobalAnsi(url); var arg2 = Marshal.StringToHGlobalAnsi(plugin_name); error = new LLDB.Error(); if (ReferenceEquals(error, null)) throw new global::System.ArgumentNullException("error", "Cannot be null because it is a C++ reference (&)."); var arg3 = error.__Instance; var __ret = new LLDB.Process.Internal(); Internal.ConnectRemote_0((__Instance + __PointerAdjustment), new IntPtr(&__ret), arg0, arg1, arg2, arg3); LLDB.Error __result0; if (arg3 == IntPtr.Zero) __result0 = null; else if (LLDB.Error.NativeToManagedMap.ContainsKey(arg3)) __result0 = (LLDB.Error) LLDB.Error.NativeToManagedMap[arg3]; else __result0 = LLDB.Error.__CreateInstance(arg3); error = __result0; Marshal.FreeHGlobal(arg1); Marshal.FreeHGlobal(arg2); return LLDB.Process.__CreateInstance(__ret); }
/// <summary> /// <para>Launch a new process.</para> /// </summary> /// <remarks> /// <para>Launch a new process by spawning a new process using the</para> /// <para>target object's executable module's file as the file to launch.</para> /// <para>Arguments are given in </para> /// <para>and the environment variables</para> /// <para>are in </para> /// <para>Standard input and output files can be</para> /// <para>optionally re-directed to </para> /// <para> </para> /// <para>and</para> /// </remarks> /// <param name="listener"> /// <para>An optional listener that will receive all process events.</para> /// <para>If</para> /// <para>is valid then</para> /// <para>will listen to all</para> /// <para>process events. If not valid, then this target's debugger</para> /// <para>(SBTarget::GetDebugger()) will listen to all process events.</para> /// </param> /// <param name="argv"> /// <para>The argument array.</para> /// </param> /// <param name="envp"> /// <para>The environment array.</para> /// </param> /// <param name="launch_flags"> /// <para>Flags to modify the launch (</para> /// </param> /// <param name="stdin_path"> /// <para>The path to use when re-directing the STDIN of the new</para> /// <para>process. If all stdXX_path arguments are nullptr, a pseudo</para> /// <para>terminal will be used.</para> /// </param> /// <param name="stdout_path"> /// <para>The path to use when re-directing the STDOUT of the new</para> /// <para>process. If all stdXX_path arguments are nullptr, a pseudo</para> /// <para>terminal will be used.</para> /// </param> /// <param name="stderr_path"> /// <para>The path to use when re-directing the STDERR of the new</para> /// <para>process. If all stdXX_path arguments are nullptr, a pseudo</para> /// <para>terminal will be used.</para> /// </param> /// <param name="working_directory"> /// <para>The working directory to have the child process run in</para> /// </param> /// <param name="launch_flags"> /// <para>Some launch options specified by logical OR'ing</para> /// <para>lldb::LaunchFlags enumeration values together.</para> /// </param> /// <param name="stop_at_entry"> /// <para>If false do not stop the inferior at the entry point.</para> /// </param> /// <param name="error"> /// <para>An error object. Contains the reason if there is some failure.</para> /// </param> /// <returns> /// <para>A process object for the newly created process.</para> /// </returns> public LLDB.Process Launch(LLDB.Listener listener, sbyte** argv, sbyte** envp, string stdin_path, string stdout_path, string stderr_path, string working_directory, uint launch_flags, bool stop_at_entry, out LLDB.Error error) { if (ReferenceEquals(listener, null)) throw new global::System.ArgumentNullException("listener", "Cannot be null because it is a C++ reference (&)."); var arg0 = listener.__Instance; var arg1 = argv; var arg2 = envp; var arg3 = Marshal.StringToHGlobalAnsi(stdin_path); var arg4 = Marshal.StringToHGlobalAnsi(stdout_path); var arg5 = Marshal.StringToHGlobalAnsi(stderr_path); var arg6 = Marshal.StringToHGlobalAnsi(working_directory); error = new LLDB.Error(); if (ReferenceEquals(error, null)) throw new global::System.ArgumentNullException("error", "Cannot be null because it is a C++ reference (&)."); var arg9 = error.__Instance; var __ret = new LLDB.Process.Internal(); Internal.Launch_0(new IntPtr(&__ret), (__Instance + __PointerAdjustment), arg0, arg1, arg2, arg3, arg4, arg5, arg6, launch_flags, stop_at_entry, arg9); LLDB.Error __result0; if (arg9 == IntPtr.Zero) __result0 = null; else if (LLDB.Error.NativeToManagedMap.ContainsKey(arg9)) __result0 = (LLDB.Error) LLDB.Error.NativeToManagedMap[arg9]; else __result0 = LLDB.Error.__CreateInstance(arg9); error = __result0; Marshal.FreeHGlobal(arg3); Marshal.FreeHGlobal(arg4); Marshal.FreeHGlobal(arg5); Marshal.FreeHGlobal(arg6); return LLDB.Process.__CreateInstance(__ret); }
/// <summary> /// <para>Attach to process with pid.</para> /// </summary> /// <param name="listener"> /// <para>An optional listener that will receive all process events.</para> /// <para>If</para> /// <para>is valid then</para> /// <para>will listen to all</para> /// <para>process events. If not valid, then this target's debugger</para> /// <para>(SBTarget::GetDebugger()) will listen to all process events.</para> /// </param> /// <param name="pid"> /// <para>The process ID to attach to.</para> /// </param> /// <param name="error"> /// <para>An error explaining what went wrong if attach fails.</para> /// </param> /// <returns> /// <para>A process object for the attached process.</para> /// </returns> public LLDB.Process AttachToProcessWithID(LLDB.Listener listener, ulong pid, out LLDB.Error error) { if (ReferenceEquals(listener, null)) throw new global::System.ArgumentNullException("listener", "Cannot be null because it is a C++ reference (&)."); var arg0 = listener.__Instance; error = new LLDB.Error(); if (ReferenceEquals(error, null)) throw new global::System.ArgumentNullException("error", "Cannot be null because it is a C++ reference (&)."); var arg2 = error.__Instance; var __ret = new LLDB.Process.Internal(); Internal.AttachToProcessWithID_0((__Instance + __PointerAdjustment), new IntPtr(&__ret), arg0, pid, arg2); LLDB.Error __result0; if (arg2 == IntPtr.Zero) __result0 = null; else if (LLDB.Error.NativeToManagedMap.ContainsKey(arg2)) __result0 = (LLDB.Error) LLDB.Error.NativeToManagedMap[arg2]; else __result0 = LLDB.Error.__CreateInstance(arg2); error = __result0; return LLDB.Process.__CreateInstance(__ret); }
/// <summary> /// <para>Read target memory. If a target process is running then memory </para> /// <para>is read from here. Otherwise the memory is read from the object</para> /// <para>files. For a target whose bytes are sized as a multiple of host</para> /// <para>bytes, the data read back will preserve the target's byte order.</para> /// </summary> /// <param name="addr"> /// <para>A target address to read from.</para> /// </param> /// <param name="buf"> /// <para>The buffer to read memory into.</para> /// </param> /// <param name="size"> /// <para>The maximum number of host bytes to read in the buffer passed</para> /// <para>into this call</para> /// </param> /// <param name="error"> /// <para>Error information is written here if the memory read fails.</para> /// </param> /// <returns> /// <para>The amount of data read in host bytes.</para> /// </returns> public uint ReadMemory(LLDB.Address addr, global::System.IntPtr buf, uint size, out LLDB.Error error) { var arg0 = ReferenceEquals(addr, null) ? new LLDB.Address.Internal() : *(LLDB.Address.Internal*) (addr.__Instance); var arg1 = buf; error = new LLDB.Error(); if (ReferenceEquals(error, null)) throw new global::System.ArgumentNullException("error", "Cannot be null because it is a C++ reference (&)."); var arg3 = error.__Instance; var __ret = Internal.ReadMemory_0((__Instance + __PointerAdjustment), arg0, arg1, size, arg3); LLDB.Error __result0; if (arg3 == IntPtr.Zero) __result0 = null; else if (LLDB.Error.NativeToManagedMap.ContainsKey(arg3)) __result0 = (LLDB.Error) LLDB.Error.NativeToManagedMap[arg3]; else __result0 = LLDB.Error.__CreateInstance(arg3); error = __result0; return __ret; }
public LLDB.Process Launch(LLDB.LaunchInfo launch_info, out LLDB.Error error) { if (ReferenceEquals(launch_info, null)) throw new global::System.ArgumentNullException("launch_info", "Cannot be null because it is a C++ reference (&)."); var arg0 = launch_info.__Instance; error = new LLDB.Error(); if (ReferenceEquals(error, null)) throw new global::System.ArgumentNullException("error", "Cannot be null because it is a C++ reference (&)."); var arg1 = error.__Instance; var __ret = new LLDB.Process.Internal(); Internal.Launch_1((__Instance + __PointerAdjustment), new IntPtr(&__ret), arg0, arg1); LLDB.Error __result0; if (arg1 == IntPtr.Zero) __result0 = null; else if (LLDB.Error.NativeToManagedMap.ContainsKey(arg1)) __result0 = (LLDB.Error) LLDB.Error.NativeToManagedMap[arg1]; else __result0 = LLDB.Error.__CreateInstance(arg1); error = __result0; return LLDB.Process.__CreateInstance(__ret); }
/// <summary> /// <para>Watch this value that this value points to in memory</para> /// </summary> /// <remarks> /// <para>Sets a watchpoint on the value.</para> /// </remarks> /// <param name="resolve_location"> /// <para>Resolve the location of this value once and watch its address.</para> /// <para>This value must currently be set to</para> /// <para>as watching all</para> /// <para>locations of a variable or a variable path is not yet supported,</para> /// <para>though we plan to support it in the future.</para> /// </param> /// <param name="read"> /// <para>Stop when this value is accessed.</para> /// </param> /// <param name="write"> /// <para>Stop when this value is modified</para> /// </param> /// <param name="error"> /// <para>An error object. Contains the reason if there is some failure.</para> /// </param> /// <returns> /// <para>An SBWatchpoint object. This object might not be valid upon</para> /// <para>return due to a value not being contained in memory, too</para> /// <para>large, or watchpoint resources are not available or all in</para> /// <para>use.</para> /// </returns> public LLDB.Watchpoint WatchPointee(bool resolve_location, bool read, bool write, out LLDB.Error error) { error = new LLDB.Error(); if (ReferenceEquals(error, null)) throw new global::System.ArgumentNullException("error", "Cannot be null because it is a C++ reference (&)."); var arg3 = error.__Instance; var __ret = new LLDB.Watchpoint.Internal(); Internal.WatchPointee_0((__Instance + __PointerAdjustment), new IntPtr(&__ret), resolve_location, read, write, arg3); LLDB.Error __result0; if (arg3 == IntPtr.Zero) __result0 = null; else if (LLDB.Error.NativeToManagedMap.ContainsKey(arg3)) __result0 = (LLDB.Error) LLDB.Error.NativeToManagedMap[arg3]; else __result0 = LLDB.Error.__CreateInstance(arg3); error = __result0; return LLDB.Watchpoint.__CreateInstance(__ret); }
/// <summary> /// <para>Load a shared library into this process.</para> /// </summary> /// <param name="local_image_spec"> /// <para>The file spec that points to the shared library that you</para> /// <para>want to load if the library is located on the host. The</para> /// <para>library will be copied over to the location specified by</para> /// <para>remote_image_spec or into the current working directory with</para> /// <para>the same filename if the remote_image_spec isn't specified.</para> /// </param> /// <param name="remote_image_spec"> /// <para>If local_image_spec is specified then the location where the</para> /// <para>library should be copied over from the host. If</para> /// <para>local_image_spec isn't specified, then the path for the</para> /// <para>shared library on the target what you want to load.</para> /// </param> /// <param name="error"> /// <para>An error object that gets filled in with any errors that</para> /// <para>might occur when trying to load the shared library.</para> /// </param> /// <returns> /// <para>A token that represents the shared library that can be</para> /// <para>later used to unload the shared library. A value of</para> /// <para>LLDB_INVALID_IMAGE_TOKEN will be returned if the shared</para> /// <para>library can't be opened.</para> /// </returns> public uint LoadImage(LLDB.FileSpec local_image_spec, LLDB.FileSpec remote_image_spec, out LLDB.Error error) { if (ReferenceEquals(local_image_spec, null)) throw new global::System.ArgumentNullException("local_image_spec", "Cannot be null because it is a C++ reference (&)."); var arg0 = local_image_spec.__Instance; if (ReferenceEquals(remote_image_spec, null)) throw new global::System.ArgumentNullException("remote_image_spec", "Cannot be null because it is a C++ reference (&)."); var arg1 = remote_image_spec.__Instance; error = new LLDB.Error(); if (ReferenceEquals(error, null)) throw new global::System.ArgumentNullException("error", "Cannot be null because it is a C++ reference (&)."); var arg2 = error.__Instance; var __ret = Internal.LoadImage_1((__Instance + __PointerAdjustment), arg0, arg1, arg2); LLDB.Error __result0; if (arg2 == IntPtr.Zero) __result0 = null; else if (LLDB.Error.NativeToManagedMap.ContainsKey(arg2)) __result0 = (LLDB.Error) LLDB.Error.NativeToManagedMap[arg2]; else __result0 = LLDB.Error.__CreateInstance(arg2); error = __result0; return __ret; }