Skip to content
Snippets Groups Projects
Commit 4cda9ad1 authored by Avi Kivity's avatar Avi Kivity
Browse files

gdb: adjust for release builds

Look up the build directory from the running object.
parent 0ac3dd15
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,9 @@ import re ...@@ -5,6 +5,9 @@ import re
import os, os.path import os, os.path
import struct import struct
build_dir = os.path.dirname(gdb.current_objfile().filename)
external = build_dir + '/../../external'
def load_elf(path, base): def load_elf(path, base):
args = '' args = ''
text_addr = '?' text_addr = '?'
...@@ -31,7 +34,7 @@ def load_elf(path, base): ...@@ -31,7 +34,7 @@ def load_elf(path, base):
def translate(path): def translate(path):
'''given a path, try to find it on the host OS''' '''given a path, try to find it on the host OS'''
name = os.path.basename(path) name = os.path.basename(path)
for top in ['build/debug', 'external', '/usr']: for top in [build_dir, external, '/usr']:
for root, dirs, files in os.walk(top): for root, dirs, files in os.walk(top):
if name in files: if name in files:
return os.path.join(root, name) return os.path.join(root, name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment