node/lib/metasm/metasm/os/linux.rb
def attach_thread(tid)
		set_tid tid
		@ptrace.pid = tid
		@ptrace.attach
		@state = :stopped
		# store this waitpid so that we can return it in a future check_target
		::Process.waitpid(tid, ::Process::WALL)
		# XXX can $? be safely stored?
		@cached_waitpid << [tid, $?.dup]
		log "attached thread #{tid}"
		set_thread_options
	rescue Errno::ESRCH
		# raced, thread quitted already
		del_tid
	end
# attach a thread of the current process
attach a thread of the current process
attach a thread of the current process
def attach_thread(tid)
		set_tid tid
		@ptrace.pid = tid
		@ptrace.attach
		@state = :stopped
		::Process.waitpid(tid, ::Process::WALL)
		@cached_waitpid << [tid, $?.dup]
		log "attached thread #{tid}"
		set_thread_options
	rescue Errno::ESRCH
		del_tid
	end
def attach_thread ( tid ) set_tid tid @ptrace . pid = tid @ptrace . attach @state = :stopped :: Process . waitpid ( tid , :: Process :: WALL ) @cached_waitpid << [ tid , $? . dup ] log "attached thread #{tid}" set_thread_options rescue Errno :: ESRCH del_tid end
attach a thread of the current process
attach a thread of the current process
# store this waitpid so that we can return it in a future check_target # XXX can $? be safely stored? # raced, thread quitted already
tid