Trust argument order to determine argument frame layout when calling
functions, this allows calling optimized functions and removes the
special cases for runtime.mallocgc.
Fixes#1589
Add options to start a stacktrace from the values saved in the
runtime.g struct as well as a way to disable the stackSwitch logic and
just get a normal stacktrace.
If a closure captures a variable but also defines a variable of the
same name in its root scope the shadowed flag would, sometimes, not be
appropriately applied to the captured variable.
This change:
1. sorts the variable list by depth *and* declaration line, so that
closure captured variables always appear before other root-scope
variables, regardless of the order used by the compiler
2. marks variable with the same name as shadowed even if there is only
one scope at play.
This fixes the problem but as a side effect:
1. programs compiled with Go prior to version 1.9 will have the
shadowed flag applied arbitrarily (previously the shadowed flag was not
applied at all)
2. programs compiled with Go prior to versoin 1.11 will still exhibit
the bug, as they do not have DeclLine information.
Fixes#1672
According to the description of "CIE: length, CIE_id, version, augmentation"
in Page 122 of http://dwarfstd.org/doc/Dwarf3.pdf ,
`augmentation` should exclude `version`
The fix for #1428 was buggy, partly because I communicated poorly. Sorry
about that.
The size of the TLS segment should be padded such that TLS addresses
are congruent in the file to where they will end up memory, i.e.
(tlsoffset%align) == (vaddr%align). In most cases, vaddr will be aligned
and it won't matter, but if not then simply aligning the end of the
segment is incorrect. This should be right.
(For the record, the current rounding logic is working in bits, but
PtrSize is in bytes, so it wasn't working as originally intended
either.)
* all: Bump to v1.3.0
Add new version to CHANGELOG and update internal version.
Thank you @Ladicle, @qaisjp, @justinclift, @tschundler, @two,
@dpapastamos, @qingyunha, @rayrapetyan, @briandealwis and @msaf1980,
@jeremyfaller, @stmuk, @dr2chase, @pjot726.
* all: Add date to changelog
Intent here is to bring optargorder up to date with delve
and keep it in sync (and to use optargorder to help monitor
compiler output for debugging quality regressions).
proc.Next and proc.Step will call, after setting their temp
breakpoints, curthread.SetCurrentBreakpoint. This is intended to find
if one of the newly created breakpoints happens to be at the same
instruction that curthread is stopped at.
However SetCurrentBreakpoint is intended to be called after a Continue
and StepInstruction operation so it will also detect if curthread is
stopped one byte after a breakpoint.
If the instruction immediately preceeding the current instruction of
curthread happens to:
1. have one of the newly created temp breakpoints
2. be one byte long
SetCurrentBreakpoint will believe that we just hit that breakpoint and
therefore the instruction should be repeated, and thus rewind the PC of
curthread by 1.
We should distinguish between the two uses of SetCurrentBreakpoint and
disable the check for "just hit" breakpoints when inappropriate.
Fixes#1656
Moves EvalScope methods to the proper file and organizes everything
together. Also makes some EvalScope methods no longer methods and just
pure functions.
* proc: fix stacktraces when a SIGSEGV happens during a cgo call
When a SIGSEGV happens in a cgo call (for example as a result of
dereferencing a NULL pointer) the stack layout will look like this:
(system stack) runtime.fatalthrow
(system stack) runtime.throw
(system stack) runtime.sigpanic
(system stack) offending C function
... other C functions...
(system stack) runtime.asmcgocall
(goroutine stack) call inside cgo
The code in switchStack would switch directly from the
runtime.fatalthrow frame to the first frame in the goroutine stack,
hiding important information.
Disable this switch for runtime.fatalthrow and reintroduce the check
for runtime.mstart that existed before this version of the code was
implemented in commit 7bec20.
This problem was reported in comment:
https://github.com/go-delve/delve/issues/935#issuecomment-512182533
* cmd/dlv: actually disable C compiler optimizations when building
* scripts: use relative path in gen-cli-docs.go
Makes gen-cli-docs.go work outside GOPATH.
* Documentation,cmd/dlv: tidy up --help output
The description of --log-dest, --log-output and --backend is very
verbose and messes up the output of --help, move it to two "additional
help" subcommands.
* *: Add .cirrus.yml for FreeBSD testing
* *: run go mod tidy
* service/test: prefer 127.0.0.1 over localhost
* dwarf/line: fix TestDebugLinePrologueParser
* vendor: rerun go mod vendor
* terminal/command: add support for next [count]
* disallow negative counts.
* handle github comments, and regen docs.
* Fix the fact that we don't print the file info in the last step of the next count.
* Fix a typo, cleanup a few other observations.
Propagate signals when stepping because debugserver will report them,
from the issue:
2019-07-11T16:31:25+02:00 debug layer=gdbconn <- $z0,105525d,1#c9
2019-07-11T16:31:25+02:00 debug layer=gdbconn -> $OK#00
2019-07-11T16:31:25+02:00 debug layer=gdbconn <- $vCont;s:c41c3#50
2019-07-11T16:31:25+02:00 debug layer=gdbconn -> $T1cthread:c41c3;threads:c41c3,c41d7,c41d8,c41d9,c41da;thread-pcs:105525d,7fffc464bf46,7fffc464bbf2,7fffc464bbf2,7fffc46...
2019-07-11T16:31:25+02:00 debug layer=gdbconn <- $Z0,105525d,1#a9
2019-07-11T16:31:25+02:00 debug layer=gdbconn -> $OK#00
in this case we request a single step on thread c41c3 but debugserver
reports instead a signal (in this case SIGWINCH).
Fixes#1610
* Add --continue to continue process on launch/attach
* Add small test of --continue
* regenerate usage docs
* minor cleanup
* Use similar approach to `trace` and connect and detach using a client instance
* back out previous attempt
* regen usage doc
* fix up continue test
* fix TestContinue to properly test --continue
* back out unnecessary changes
* update faq
Add variables flag to mark variables that are allocated on a register
(and have no address) and variables that we read as result of a
function call (and are allocated on a stack that no longer exists when
we show them to the user).
Increases the maximum string length from 64 to 1MB when loading strings
for a binary operator, also delays the loading until it's necessary.
This ensures that comparison between strings will always succeed in
reasonable situations.
Fixes#1615