summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-03-16 17:07:47 +0100
committerAraq <rumpf_a@web.de>2013-03-16 17:07:47 +0100
commitb63f322a466351bc57f8a4593009f0520c348527 (patch)
treeac80f1cd1a7c8b7b058ef51673dd65593a7dd827 /compiler
parent78b27ed7fa121d2cb032fa1b74ae434034bf8e23 (diff)
downloadNim-b63f322a466351bc57f8a4593009f0520c348527.tar.gz
debugger improvements
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/cgen.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index d06a6cb6f..b7849f074 100755
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -892,6 +892,12 @@ proc getFileHeader(cfilenoext: string): PRope =
   result = getCopyright(cfilenoext)
   addIntTypes(result)
 
+proc genFilenames(m: BModule): PRope =
+  discard cgsym(m, "dbgRegisterFilename")
+  result = nil
+  for i in 0.. <fileInfos.len:
+    result.appf("dbgRegisterFilename($1);$n", fileInfos[i].projPath.makeCString)
+
 proc genMainProc(m: BModule) = 
   const 
     CommonMainBody =
@@ -950,6 +956,8 @@ proc genMainProc(m: BModule) =
     nimMain = PosixNimMain
     otherMain = PosixCMain
   if gBreakpoints != nil: discard cgsym(m, "dbgRegisterBreakpoint")
+  if optEndb in gOptions:
+    gBreakpoints.app(m.genFilenames)
   
   let initStackBottomCall = if emulatedThreadVars() or
                               platform.targetOS == osStandalone: "".toRope