#NEWLINE# @ validate_busy #NEWLINE# @ validate_target #NEWLINE# @ lock_host #NEWLINE# def stack_pointer( self , target_id = 0 , thread_id = None ) : #NEWLINE# #INDENT# '\n            Get the value of the stack pointer register.\n\n            `target_id` is a target ID (or None for the first target)\n            `thread_id` is a thread ID (or None for the selected thread)\n            ' #NEWLINE# regs = self . registers ( target_id = target_id , thread_id = thread_id ) #NEWLINE# target = self . _target ( target_id = target_id ) #NEWLINE# if ( target [ 'arch' ] in thread_id . reg_names ) : #NEWLINE# #INDENT# sp_name = self . reg_names [ target [ 'arch' ] ] [ 'sp' ] #NEWLINE# sp = regs [ sp_name ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( 'Unsupported architecture: {}' . format ( target [ 'arch' ] ) ) #NEWLINE# #UNINDENT# return ( sp_name , sp )