[tools] Remove chrome-specific gdbinit code

Change-Id: Ie38c77aafbe75f61fc568f1013ca5815d6750364
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1662289
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62284}
This commit is contained in:
Leszek Swirski 2019-06-17 12:35:18 +02:00 committed by Commit Bot
parent 77476cb278
commit e41bdb5eb1

View File

@ -191,25 +191,6 @@ def add_debug_file_directory(dir):
"set debug-file-directory %s" % ":".join(current_dirs), to_string=True)
def load_libcxx_pretty_printers(src_dir):
libcxx_pretty_printers = os.path.join(src_dir, 'third_party',
'libcxx-pretty-printers')
if not os.path.isdir(libcxx_pretty_printers):
return
sys.path.insert(1, libcxx_pretty_printers)
from printers import register_libcxx_printers
register_libcxx_printers(None)
def load_gdb_chrome(src_dir):
tools_gdb = os.path.join(src_dir, 'tools', 'gdb')
sys.path.insert(1, tools_gdb)
import gdb_chrome
gdb.execute('source %s' % os.path.join(tools_gdb, 'viewg.gdb'))
def newobj_handler(event):
global compile_dirs
compile_dir = os.path.dirname(event.new_objfile.filename)
@ -227,24 +208,10 @@ def newobj_handler(event):
# https://crbug.com/603286#c35
add_debug_file_directory(compile_dir)
git = subprocess.Popen(
['git', '-C', compile_dir, 'rev-parse', '--show-toplevel'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
src_dir, _ = git.communicate()
if git.returncode:
return
src_dir = str(src_dir).rstrip()
load_libcxx_pretty_printers(src_dir)
load_gdb_chrome(src_dir)
# Event hook for newly loaded objfiles.
# https://sourceware.org/gdb/onlinedocs/gdb/Events-In-Python.html
gdb.events.new_objfile.connect(newobj_handler)
gdb.execute("set environment CHROMIUM_GDBINIT_SOURCED=1")
gdb.execute("set environment V8_GDBINIT_SOURCED=1")
end