-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARTIQException: tell linecache where to look for runtime sources.
Runtime sources can appear in the backtrace when artiq_raise_from_c is used.
- Loading branch information
whitequark
committed
Aug 10, 2015
1 parent
c72267e
commit 4647651
Showing
3 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import os | ||
|
||
class SourceLoader: | ||
def __init__(self, runtime_root): | ||
self.runtime_root = runtime_root | ||
|
||
def get_source(self, filename): | ||
print(os.path.join(self.runtime_root, filename)) | ||
with open(os.path.join(self.runtime_root, filename)) as f: | ||
return f.read() | ||
|
||
artiq_root = os.path.join(os.path.dirname(__file__), "..", "..") | ||
source_loader = SourceLoader(os.path.join(artiq_root, "soc", "runtime")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters