Fix `GDBFrame >> file`
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 26 Mar 2019 10:35:31 +0000
changeset 182 c5347cf090ea
parent 181 33b61ec94acf
child 183 6c82549bdb21
Fix `GDBFrame >> file` When resolving source file path, try both the absolute path (`fullname`) and "relative" path (`file`). This helps to handle cases where a absolute path is recorded byt not valid (for example because the object file has been compiled on a different computer).
GDBFrame.st
--- a/GDBFrame.st	Wed Mar 20 12:46:39 2019 +0000
+++ b/GDBFrame.st	Tue Mar 26 10:35:31 2019 +0000
@@ -144,19 +144,28 @@
     ].
 
     "/ ...if not, try to look it up in source directories...
-    self debugger directories do:[:d | 
-        f := d asFilename / (fullname ? file).
-        f exists ifTrue:[ 
-            fullname := f.
-            ^ fullname pathName.
+    self debugger directories do:[:d |
+        fullname notNil ifTrue:[
+            f := d asFilename / fullname.
+            f exists ifTrue:[ 
+                fullname := f.
+                ^ fullname pathName.
+            ].
+        ].
+        file notNil ifTrue:[
+            f := d asFilename / file.
+            f exists ifTrue:[ 
+                fullname := f.
+                ^ fullname pathName.
+            ]. 
         ].
     ].
 
     "/ ...if not found there...
     ^ nil
 
-    "Modified: / 12-03-2018 / 10:32:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 22-03-2018 / 16:52:52 / jv"
+    "Modified: / 26-03-2019 / 10:30:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 from
@@ -253,7 +262,7 @@
     ^ variables value
 
     "Created: / 27-02-2015 / 14:56:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 25-02-2019 / 17:42:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 26-03-2019 / 10:29:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !GDBFrame methodsFor:'initialization'!