Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(16)  |  Call(0)  |  Derive(0)  |  Import(16)
int(x=0) -> int or long
int(x, base=10) -> int or long

Convert a number or string to an integer, or return 0 if no arguments
are given.  If x is floating point, the conversion truncates towards zero.
If x is outside the integer range, the function returns a long instead.

If x is not a number or if base is given, then x must be a string or
Unicode object representing an integer literal in the given base.  The
literal can be preceded by '+' or '-' and be surrounded by whitespace.(more...)

src/s/e/segvault-HEAD/fusil/ptrace/ptrace/debugger/process.py   segvault(Download)
from ptrace.os_tools import HAS_PROC, RUNNING_BSD
from ptrace.tools import dumpRegs
from ptrace.cpu_info import CPU_WORD_SIZE, CPU_64BITS
from ptrace.ctypes_tools import bytes2word, word2bytes, bytes2type, bytes2array
from signal import SIGTRAP, SIGSTOP, SIGKILL
            # FIXME: Optimize getreg() when used with this function
            words = []
            nb_words = sizeof(ptrace_registers_t) // CPU_WORD_SIZE
            for offset in xrange(nb_words):
                word = ptrace_peekuser(self.pid, offset*CPU_WORD_SIZE)
    def _readBytes(self, address, size):
        offset = address % CPU_WORD_SIZE
        if offset:
            # Read word
            address -= offset
            word = self.readWord(address)
            bytes = word2bytes(word)
 
            # Read some bytes from the word
            subsize = min(CPU_WORD_SIZE - offset, size)

src/p/y/python-ptrace-0.7/ptrace/syscall/ptrace_syscall.py   python-ptrace(Download)
from ptrace.syscall.socketcall import setupSocketCall
from ptrace.os_tools import RUNNING_LINUX, RUNNING_BSD
from ptrace.cpu_info import CPU_WORD_SIZE
from ptrace.binding.cpu import CPU_INSTR_POINTER
 
        if RUNNING_BSD:
            sp = self.process.getStackPointer()
            return [ self.process.readWord(sp + index*CPU_WORD_SIZE)
                for index in range(1, 6+1) ]
        if CPU_I386:

src/s/e/segvault-HEAD/fusil/ptrace/ptrace/syscall/ptrace_syscall.py   segvault(Download)
from ptrace.syscall.socketcall import setupSocketCall
from ptrace.os_tools import RUNNING_LINUX, RUNNING_BSD
from ptrace.cpu_info import CPU_WORD_SIZE
from ptrace.binding.cpu import CPU_INSTR_POINTER
 
    def readArgumentValues(self, regs):
        if RUNNING_BSD:
            sp = self.process.getStackPointer()
            return [ self.process.readWord(sp + index*CPU_WORD_SIZE)
                for index in xrange(1, 6+1) ]

src/p/y/python-ptrace-0.7/ptrace/debugger/process.py   python-ptrace(Download)
from ptrace.os_tools import HAS_PROC, RUNNING_BSD, RUNNING_PYTHON3
from ptrace.tools import dumpRegs
from ptrace.cpu_info import CPU_WORD_SIZE
from ptrace.ctypes_tools import bytes2word, word2bytes, bytes2type, bytes2array
from signal import SIGTRAP, SIGSTOP, SIGKILL
            # FIXME: Optimize getreg() when used with this function
            words = []
            nb_words = sizeof(ptrace_registers_t) // CPU_WORD_SIZE
            for offset in range(nb_words):
                word = ptrace_peekuser(self.pid, offset * CPU_WORD_SIZE)
    def _readBytes(self, address, size):
        offset = address % CPU_WORD_SIZE
        if offset:
            # Read word
            address -= offset
            word = self.readWord(address)
            bytes = word2bytes(word)
 
            # Read some bytes from the word
            subsize = min(CPU_WORD_SIZE - offset, size)

src/s/e/segvault-HEAD/fusil/ptrace/ptrace/binding/func.py   segvault(Download)
from ptrace.ctypes_tools import formatAddress
from ptrace.os_tools import RUNNING_LINUX, RUNNING_BSD, RUNNING_OPENBSD
from ptrace.cpu_info import CPU_64BITS, CPU_WORD_SIZE, CPU_POWERPC
 
if RUNNING_OPENBSD:
def _peek(command, pid, address):
    if address % CPU_WORD_SIZE:
        raise PtraceError(
            "ptrace can't read a word from an unaligned address (%s)!"
            % formatAddress(address), pid=pid)
    return ptrace(command, pid, address, check_errno=True)
 
def _poke(command, pid, address, word):
    if address % CPU_WORD_SIZE:

src/s/e/segvault-HEAD/fusil/ptrace/ptrace/debugger/backtrace.py   segvault(Download)
from ptrace.ctypes_tools import formatAddress, formatWordHex
from ptrace.cpu_info import CPU_WORD_SIZE, CPU_MAX_UINT
from ptrace import PtraceError
 
class BacktraceFrame:
        # Guess number of function argument
        if fp and nextfp:
            nargs = ((nextfp - fp) // CPU_WORD_SIZE) - 2
            nargs = min(nargs, max_args)
        else:
 
        # Move to next instruction/frame pointer
        ip = process.readWord(fp+CPU_WORD_SIZE)
        if ip == CPU_MAX_UINT:
            # Linux hack to detect end of the stack
    """
    frame = BacktraceFrame(ip)
    address = fp + CPU_WORD_SIZE
    try:
        for index in xrange(nargs):
            address += CPU_WORD_SIZE

src/p/y/python-ptrace-0.7/ptrace/binding/func.py   python-ptrace(Download)
from ptrace.ctypes_tools import formatAddress
from ptrace.os_tools import RUNNING_LINUX, RUNNING_BSD, RUNNING_OPENBSD
from ptrace.cpu_info import CPU_64BITS, CPU_WORD_SIZE, CPU_POWERPC
 
if RUNNING_OPENBSD:
def _peek(command, pid, address):
    if address % CPU_WORD_SIZE:
        raise PtraceError(
            "ptrace can't read a word from an unaligned address (%s)!"
            % formatAddress(address), pid=pid)
    return ptrace(command, pid, address, check_errno=True)
 
def _poke(command, pid, address, word):
    if address % CPU_WORD_SIZE:

src/p/y/python-ptrace-0.7/ptrace/debugger/backtrace.py   python-ptrace(Download)
from ptrace.ctypes_tools import formatAddress, formatWordHex
from ptrace.cpu_info import CPU_WORD_SIZE, CPU_MAX_UINT
from ptrace import PtraceError
from ptrace.six.moves import xrange
 
        # Guess number of function argument
        if fp and nextfp:
            nargs = ((nextfp - fp) // CPU_WORD_SIZE) - 2
            nargs = min(nargs, max_args)
        else:
 
        # Move to next instruction/frame pointer
        ip = process.readWord(fp+CPU_WORD_SIZE)
        if ip == CPU_MAX_UINT:
            # Linux hack to detect end of the stack
    """
    frame = BacktraceFrame(ip)
    address = fp + CPU_WORD_SIZE
    try:
        for index in xrange(nargs):
            address += CPU_WORD_SIZE

src/s/e/segvault-HEAD/fusil/ptrace/ptrace/debugger/breakpoint.py   segvault(Download)
from ptrace.ctypes_tools import formatAddress
from ptrace import PtraceError
from logging import info
from weakref import ref
from ptrace.cpu_info import CPU_POWERPC, CPU_WORD_SIZE
        self.address = address
        if CPU_POWERPC:
            size = CPU_WORD_SIZE
        elif size is None:
            size = 1

src/p/y/python-ptrace-0.7/ptrace/debugger/breakpoint.py   python-ptrace(Download)
from ptrace.ctypes_tools import formatAddress
from ptrace import PtraceError
from logging import info
from weakref import ref
from ptrace.cpu_info import CPU_POWERPC, CPU_WORD_SIZE
        self.address = address
        if CPU_POWERPC:
            size = CPU_WORD_SIZE
        elif size is None:
            size = 1

  1 | 2  Next