Fix dt a bit

This commit is contained in:
Zach Riggle 2015-02-22 14:05:17 -08:00
parent a3d6255552
commit 2c844f2dd7
1 changed files with 5 additions and 11 deletions

View File

@ -64,7 +64,7 @@ def load(name):
except gdb.error:
pass
s, _ = gdb.lookup_symbol
# s, _ = gdb.lookup_symbol(name)
# Try to find an architecture-specific include path
arch = gef.arch.current.split(':')[0]
@ -88,15 +88,7 @@ def load(name):
source += '''
#ifdef %(name)s
#pragma push("%(name)s")
#undef %(name)s
long long %(name)s =
#pragma pop("%(name)s")
%(name)s;
#else
%(name)s foo;
#endif
{name} foo;
'''.format(**locals())
filename = '%s/%s_%s' % (tempdir, arch, name)
@ -106,7 +98,9 @@ long long %(name)s =
f.write(source)
f.flush()
subprocess.check_output('g++ -w -c -g %s.cc -o %s.o' % (filename, filename), shell=True)
command = 'g++ -w -c -g %s.cc -o %s.o'
command = command % (filename, filename)
subprocess.check_output(command, shell=True)
gdb.execute('add-symbol-file %s.o 0' % filename, from_tty=False, to_string=True)