Fixed --debugger:on option. Removed c_line from termios.
This commit is contained in:
parent
d230b75e0a
commit
c42b05adb4
5 changed files with 13 additions and 15 deletions
|
|
@ -102,7 +102,7 @@ proc assignLabel(b: var TBlock): Rope {.inline.} =
|
||||||
proc blockBody(b: var TBlock): Rope =
|
proc blockBody(b: var TBlock): Rope =
|
||||||
result = b.sections[cpsLocals]
|
result = b.sections[cpsLocals]
|
||||||
if b.frameLen > 0:
|
if b.frameLen > 0:
|
||||||
result.addf("F.len+=$1;$n", [b.frameLen.rope])
|
result.addf("FR.len+=$1;$n", [b.frameLen.rope])
|
||||||
result.add(b.sections[cpsInit])
|
result.add(b.sections[cpsInit])
|
||||||
result.add(b.sections[cpsStmts])
|
result.add(b.sections[cpsStmts])
|
||||||
|
|
||||||
|
|
@ -123,7 +123,7 @@ proc endBlock(p: BProc) =
|
||||||
~"}$n"
|
~"}$n"
|
||||||
let frameLen = p.blocks[topBlock].frameLen
|
let frameLen = p.blocks[topBlock].frameLen
|
||||||
if frameLen > 0:
|
if frameLen > 0:
|
||||||
blockEnd.addf("F.len-=$1;$n", [frameLen.rope])
|
blockEnd.addf("FR.len-=$1;$n", [frameLen.rope])
|
||||||
endBlock(p, blockEnd)
|
endBlock(p, blockEnd)
|
||||||
|
|
||||||
proc genSimpleBlock(p: BProc, stmts: PNode) {.inline.} =
|
proc genSimpleBlock(p: BProc, stmts: PNode) {.inline.} =
|
||||||
|
|
|
||||||
|
|
@ -375,7 +375,7 @@ proc localDebugInfo(p: BProc, s: PSym) =
|
||||||
var a = "&" & s.loc.r
|
var a = "&" & s.loc.r
|
||||||
if s.kind == skParam and ccgIntroducedPtr(s): a = s.loc.r
|
if s.kind == skParam and ccgIntroducedPtr(s): a = s.loc.r
|
||||||
lineF(p, cpsInit,
|
lineF(p, cpsInit,
|
||||||
"F.s[$1].address = (void*)$3; F.s[$1].typ = $4; F.s[$1].name = $2;$n",
|
"FR.s[$1].address = (void*)$3; FR.s[$1].typ = $4; FR.s[$1].name = $2;$n",
|
||||||
[p.maxFrameLen.rope, makeCString(normalize(s.name.s)), a,
|
[p.maxFrameLen.rope, makeCString(normalize(s.name.s)), a,
|
||||||
genTypeInfo(p.module, s.loc.t)])
|
genTypeInfo(p.module, s.loc.t)])
|
||||||
inc(p.maxFrameLen)
|
inc(p.maxFrameLen)
|
||||||
|
|
@ -597,7 +597,7 @@ proc cgsym(m: BModule, name: string): Rope =
|
||||||
of skProc, skMethod, skConverter, skIterators: genProc(m, sym)
|
of skProc, skMethod, skConverter, skIterators: genProc(m, sym)
|
||||||
of skVar, skResult, skLet: genVarPrototype(m, sym)
|
of skVar, skResult, skLet: genVarPrototype(m, sym)
|
||||||
of skType: discard getTypeDesc(m, sym.typ)
|
of skType: discard getTypeDesc(m, sym.typ)
|
||||||
else: internalError("cgsym: " & name)
|
else: internalError("cgsym: " & name & ": " & $sym.kind)
|
||||||
else:
|
else:
|
||||||
# we used to exclude the system module from this check, but for DLL
|
# we used to exclude the system module from this check, but for DLL
|
||||||
# generation support this sloppyness leads to hard to detect bugs, so
|
# generation support this sloppyness leads to hard to detect bugs, so
|
||||||
|
|
@ -623,7 +623,7 @@ proc retIsNotVoid(s: PSym): bool =
|
||||||
proc initFrame(p: BProc, procname, filename: Rope): Rope =
|
proc initFrame(p: BProc, procname, filename: Rope): Rope =
|
||||||
discard cgsym(p.module, "nimFrame")
|
discard cgsym(p.module, "nimFrame")
|
||||||
if p.maxFrameLen > 0:
|
if p.maxFrameLen > 0:
|
||||||
discard cgsym(p.module, "TVarSlot")
|
discard cgsym(p.module, "VarSlot")
|
||||||
result = rfmt(nil, "\tnimfrs($1, $2, $3, $4)$N",
|
result = rfmt(nil, "\tnimfrs($1, $2, $3, $4)$N",
|
||||||
procname, filename, p.maxFrameLen.rope,
|
procname, filename, p.maxFrameLen.rope,
|
||||||
p.blocks[0].frameLen.rope)
|
p.blocks[0].frameLen.rope)
|
||||||
|
|
@ -1017,7 +1017,7 @@ proc genInitCode(m: BModule) =
|
||||||
var procname = makeCString(m.module.name.s)
|
var procname = makeCString(m.module.name.s)
|
||||||
add(prc, initFrame(m.initProc, procname, m.module.info.quotedFilename))
|
add(prc, initFrame(m.initProc, procname, m.module.info.quotedFilename))
|
||||||
else:
|
else:
|
||||||
add(prc, ~"\tTFrame F; F.len = 0;$N")
|
add(prc, ~"\tTFrame F; FR.len = 0;$N")
|
||||||
|
|
||||||
add(prc, genSectionStart(cpsInit))
|
add(prc, genSectionStart(cpsInit))
|
||||||
add(prc, m.preInitProc.s(cpsInit))
|
add(prc, m.preInitProc.s(cpsInit))
|
||||||
|
|
@ -1329,4 +1329,3 @@ proc cgenWriteModules* =
|
||||||
if generatedHeader != nil: writeHeader(generatedHeader)
|
if generatedHeader != nil: writeHeader(generatedHeader)
|
||||||
|
|
||||||
const cgenPass* = makePass(myOpen, myOpenCached, myProcess, myClose)
|
const cgenPass* = makePass(myOpen, myOpenCached, myProcess, myClose)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -347,7 +347,7 @@ struct TFrame {
|
||||||
FR.procname = proc; FR.filename = file; FR.line = 0; FR.len = 0; nimFrame(&FR);
|
FR.procname = proc; FR.filename = file; FR.line = 0; FR.len = 0; nimFrame(&FR);
|
||||||
|
|
||||||
#define nimfrs(proc, file, slots, length) \
|
#define nimfrs(proc, file, slots, length) \
|
||||||
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; TVarSlot s[slots];} FR; \
|
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR; \
|
||||||
FR.procname = proc; FR.filename = file; FR.line = 0; FR.len = length; nimFrame((TFrame*)&FR);
|
FR.procname = proc; FR.filename = file; FR.line = 0; FR.len = length; nimFrame((TFrame*)&FR);
|
||||||
|
|
||||||
#define nimln(n, file) \
|
#define nimln(n, file) \
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ type
|
||||||
c_oflag*: Cflag # output mode flags
|
c_oflag*: Cflag # output mode flags
|
||||||
c_cflag*: Cflag # control mode flags
|
c_cflag*: Cflag # control mode flags
|
||||||
c_lflag*: Cflag # local mode flags
|
c_lflag*: Cflag # local mode flags
|
||||||
c_line*: cuchar # line discipline
|
|
||||||
c_cc*: array[NCCS, cuchar] # control characters
|
c_cc*: array[NCCS, cuchar] # control characters
|
||||||
|
|
||||||
# cc characters
|
# cc characters
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ type
|
||||||
# only slots that are
|
# only slots that are
|
||||||
# needed are allocated and not 10_000,
|
# needed are allocated and not 10_000,
|
||||||
# except for the global data description.
|
# except for the global data description.
|
||||||
f: Frame
|
f: TFrame
|
||||||
slots: array[0..10_000, VarSlot]
|
slots: array[0..10_000, VarSlot]
|
||||||
{.deprecated: [TVarSlot: VarSlot, TExtendedFrame: ExtendedFrame].}
|
{.deprecated: [TVarSlot: VarSlot, TExtendedFrame: ExtendedFrame].}
|
||||||
|
|
||||||
|
|
@ -66,7 +66,7 @@ var
|
||||||
dbgBP: array[0..127, Breakpoint] # breakpoints
|
dbgBP: array[0..127, Breakpoint] # breakpoints
|
||||||
dbgBPlen: int
|
dbgBPlen: int
|
||||||
dbgBPbloom: int64 # we use a bloom filter to speed up breakpoint checking
|
dbgBPbloom: int64 # we use a bloom filter to speed up breakpoint checking
|
||||||
|
|
||||||
dbgFilenames*: array[0..300, cstring] ## registered filenames;
|
dbgFilenames*: array[0..300, cstring] ## registered filenames;
|
||||||
## 'nil' terminated
|
## 'nil' terminated
|
||||||
dbgFilenameLen: int
|
dbgFilenameLen: int
|
||||||
|
|
@ -197,7 +197,7 @@ proc genericHashAux(dest: pointer, n: ptr TNimNode, shallow: bool,
|
||||||
result = genericHashAux(cast[pointer](d +% n.offset), n.typ, shallow, h)
|
result = genericHashAux(cast[pointer](d +% n.offset), n.typ, shallow, h)
|
||||||
of nkList:
|
of nkList:
|
||||||
result = h
|
result = h
|
||||||
for i in 0..n.len-1:
|
for i in 0..n.len-1:
|
||||||
result = result !& genericHashAux(dest, n.sons[i], shallow, result)
|
result = result !& genericHashAux(dest, n.sons[i], shallow, result)
|
||||||
of nkCase:
|
of nkCase:
|
||||||
result = h !& hash(cast[pointer](d +% n.offset), n.typ.size)
|
result = h !& hash(cast[pointer](d +% n.offset), n.typ.size)
|
||||||
|
|
@ -205,7 +205,7 @@ proc genericHashAux(dest: pointer, n: ptr TNimNode, shallow: bool,
|
||||||
if m != nil: result = genericHashAux(dest, m, shallow, result)
|
if m != nil: result = genericHashAux(dest, m, shallow, result)
|
||||||
of nkNone: sysAssert(false, "genericHashAux")
|
of nkNone: sysAssert(false, "genericHashAux")
|
||||||
|
|
||||||
proc genericHashAux(dest: pointer, mt: PNimType, shallow: bool,
|
proc genericHashAux(dest: pointer, mt: PNimType, shallow: bool,
|
||||||
h: Hash): Hash =
|
h: Hash): Hash =
|
||||||
sysAssert(mt != nil, "genericHashAux 2")
|
sysAssert(mt != nil, "genericHashAux 2")
|
||||||
case mt.kind
|
case mt.kind
|
||||||
|
|
@ -257,7 +257,7 @@ proc genericHashAux(dest: pointer, mt: PNimType, shallow: bool,
|
||||||
|
|
||||||
proc genericHash(dest: pointer, mt: PNimType): int =
|
proc genericHash(dest: pointer, mt: PNimType): int =
|
||||||
result = genericHashAux(dest, mt, false, 0)
|
result = genericHashAux(dest, mt, false, 0)
|
||||||
|
|
||||||
proc dbgRegisterWatchpoint(address: pointer, name: cstring,
|
proc dbgRegisterWatchpoint(address: pointer, name: cstring,
|
||||||
typ: PNimType) {.compilerproc.} =
|
typ: PNimType) {.compilerproc.} =
|
||||||
let L = watchPointsLen
|
let L = watchPointsLen
|
||||||
|
|
@ -285,7 +285,7 @@ var
|
||||||
## Only code compiled with the ``debugger:on`` switch calls this hook.
|
## Only code compiled with the ``debugger:on`` switch calls this hook.
|
||||||
|
|
||||||
dbgWatchpointHook*: proc (watchpointName: cstring) {.nimcall.}
|
dbgWatchpointHook*: proc (watchpointName: cstring) {.nimcall.}
|
||||||
|
|
||||||
proc checkWatchpoints =
|
proc checkWatchpoints =
|
||||||
let L = watchPointsLen
|
let L = watchPointsLen
|
||||||
for i in 0.. <L:
|
for i in 0.. <L:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue