Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
(cherry picked from commit ec20fd3)
  • Loading branch information
krux02 authored and narimiran committed Oct 22, 2019
1 parent 0b13441 commit 193b3c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/cgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -997,21 +997,22 @@ 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):
# Add forward declaration for "_actual"-suffixed functions defined in the same module (or inline).
# 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))
Expand Down
3 changes: 3 additions & 0 deletions tests/untestable/gdb/gdb_pretty_printer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
]

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")
Expand Down

0 comments on commit 193b3c6

Please sign in to comment.