(cherry picked from commit ec20fd3544)
This commit is contained in:
Arne Döring
2019-10-20 11:52:50 +02:00
committed by narimiran
parent 0b134412f8
commit 193b3c66bb
2 changed files with 6 additions and 2 deletions

View File

@@ -997,13 +997,14 @@ proc genProcAux(m: BModule, prc: PSym) =
closureSetup(p, prc)
genStmts(p, procBody) # modifies p.locals, p.init, etc.
var generatedProc: Rope
generatedProc.genCLineDir prc.info, m.config
if sfNoReturn in prc.flags:
if hasDeclspec in extccomp.CC[p.config.cCompiler].props:
header = "__declspec(noreturn) " & header
if sfPure in prc.flags:
if hasDeclspec in extccomp.CC[p.config.cCompiler].props:
header = "__declspec(naked) " & header
generatedProc = ropecg(p.module, "$N$1 {$n$2$3$4}$N$N",
generatedProc.add ropecg(p.module, "$1 {$n$2$3$4}$N$N",
[header, p.s(cpsLocals), p.s(cpsInit), p.s(cpsStmts)])
else:
if m.hcrOn and isReloadable(m, prc):
@@ -1011,7 +1012,7 @@ proc genProcAux(m: BModule, prc: PSym) =
# This fixes the use of methods and also the case when 2 functions within the same module
# call each other using directly the "_actual" versions (an optimization) - see issue #11608
addf(m.s[cfsProcHeaders], "$1;\n", [header])
generatedProc = ropecg(p.module, "$N$1 {$N", [header])
generatedProc.add ropecg(p.module, "$1 {", [header])
add(generatedProc, initGCFrame(p))
if optStackTrace in prc.options:
add(generatedProc, p.s(cpsLocals))

View File

@@ -22,6 +22,9 @@ outputs = [
]
for i, expected in enumerate(outputs):
functionSymbol = gdb.selected_frame().block().function
assert functionSymbol.line == 21
if i == 5:
# myArray is passed as pointer to int to myDebug. I look up myArray up in the stack
gdb.execute("up")