(filename=None, address=0)
Compile and extract symbols from specified file
Compile and extract symbols from specified file
Compile and extract symbols from specified file
def compile(filename=None, address=0):
    """Compile and extract symbols from specified file"""
    if filename is None:
        print("Specify a filename to compile.")
        return

    objectname = os.path.splitext(filename)[0] + ".o"

    if not os.path.exists(objectname):
        gcc     = pwndbg.gcc.which()
        gcc    += ['-w', '-c', '-g', filename, '-o', objectname]
        try:
            subprocess.check_output(gcc)
        except subprocess.CalledProcessError as e:
            return

    add_symbol_file(objectname, address)
def compile ( filename = None , address = 0 ) : if filename is None : print ( "Specify a filename to compile." ) return objectname = os . path . splitext ( filename ) [ 0 ] + ".o" if not os . path . exists ( objectname ) : gcc = pwndbg . gcc . which ( ) gcc += [ '-w' , '-c' , '-g' , filename , '-o' , objectname ] try : subprocess . check_output ( gcc ) except subprocess . CalledProcessError as e : return add_symbol_file ( objectname , address )