summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2013-10-25 13:35:31 +0200
committerhjk <hjk121@nokiamail.com>2013-10-25 16:12:03 +0200
commit0190eb59f949d642585d624e3341d7b49ea56ab2 (patch)
tree564d9bc063e094f2f96ad227f2e79b33c54533d7 /share
parent7079a835a0fbef0e1b8bc43f801e52065ab34046 (diff)
downloadqt-creator-0190eb59f949d642585d624e3341d7b49ea56ab2.tar.gz
Debugger: Show shadowed variables with LLDB
Change-Id: If93547396384fe5b421c4b601b52476a23cdfa89 Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/debugger/lldbbridge.py32
1 files changed, 20 insertions, 12 deletions
diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py
index 94d485609e..4a465c981f 100644
--- a/share/qtcreator/debugger/lldbbridge.py
+++ b/share/qtcreator/debugger/lldbbridge.py
@@ -53,17 +53,17 @@ proc = subprocess.Popen(args=[sys.argv[1], '-P'], stdout=subprocess.PIPE, stderr
(path, error) = proc.communicate()
if error.startswith('lldb: invalid option -- P'):
- sys.stdout.write('msg=\'Could not run "%s -P". Trying to find lldb.so from Xcode.\'@\n' % sys.argv[1])
+ sys.stdout.write('msg=\'Could not run "%s -P". Trying to find lldb.so from Xcode.\'\n' % sys.argv[1])
proc = subprocess.Popen(args=['xcode-select', '--print-path'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(path, error) = proc.communicate()
if len(error):
path = '/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/Python/'
- sys.stdout.write('msg=\'Could not run "xcode-select --print-path"@\n')
- sys.stdout.write('msg=\'Using hardcoded fallback at %s\'@\n' % path)
+ sys.stdout.write('msg=\'Could not run "xcode-select --print-path"\n')
+ sys.stdout.write('msg=\'Using hardcoded fallback at %s\'\n' % path)
else:
path = path.strip() + '/../SharedFrameworks/LLDB.framework/Versions/A/Resources/Python/'
- sys.stdout.write('msg=\'Using fallback at %s\'@\n' % path)
+ sys.stdout.write('msg=\'Using fallback at %s\'\n' % path)
#sys.path.append(path)
sys.path.insert(1, path.strip())
@@ -142,7 +142,7 @@ stateNames = ["invalid", "unloaded", "connected", "attaching", "launching", "sto
def loggingCallback(args):
s = args.strip()
s = s.replace('"', "'")
- sys.stdout.write('log="%s"@\n' % s)
+ sys.stdout.write('log="%s"\n' % s)
def check(exp):
if not exp:
@@ -1223,13 +1223,22 @@ class Dumper(DumperBase):
self.currentIName = 'local'
self.put('data=[')
self.anonNumber = 0
- for value in frame.GetVariables(True, True, False, False):
+ shadowed = {}
+ values = [v for v in frame.GetVariables(True, True, False, False) if v.IsValid()]
+ values.reverse() # To get shadowed vars numbered backwards.
+ for value in values:
if self.dummyValue is None:
self.dummyValue = value
- with SubItem(self, value):
- if value.IsValid():
- self.put('iname="%s",' % self.currentIName)
- self.putItem(value)
+ name = value.name
+ if value.name in shadowed:
+ level = shadowed[name]
+ shadowed[name] = level + 1
+ name += "@%s" % level
+ else:
+ shadowed[name] = 1
+ with SubItem(self, name):
+ self.put('iname="%s",' % self.currentIName)
+ self.putItem(value)
# 'watchers':[{'id':'watch.0','exp':'23'},...]
if not self.dummyValue is None:
@@ -1283,8 +1292,7 @@ class Dumper(DumperBase):
self.report(result)
def report(self, stuff):
- sys.stdout.write(stuff)
- sys.stdout.write("@\n")
+ sys.stdout.write(stuff + "\n")
def interruptInferior(self, _ = None):
if self.process is None: