[lldb-dev] Problem unwinding from inside of a CRT function

Zachary Turner zturner at google.com
Fri Jan 16 14:21:28 PST 2015


On Fri Jan 16 2015 at 1:53:00 PM Greg Clayton <gclayton at apple.com> wrote:

> Please trust that we know what we are doing when it comes to single
> stepping. I am glad you are thinking about how things are done, but just be
> sure think about the problem in a wider scope than "the code I am thinking
> about is linear" and think about all sorts of single stepping and what you
> would expect to happen.
>
I'm not not-trusting that you know what you're doing.  I'm trying to
understand it for myself, so that I can make the necessary changes to get
it working on Windows.

On the other hand, Windows does have plenty of different rules and
assumptions when it comes to how it generates code.  So while I'm confident
that you guys have thought about it and made something that works well
within the context of non-Windows, it's a given that some of the
functionality is going to be broken when the assumptions change.  Not
because you didn't know what you were doing, but because the code wasn't
designed with these assumptions in mind.   Otherwise it would have just
already worked and this thread would have never been created :)

So it's not enough for me to just say "I have to trust that it works,
therefore I must be doing something wrong", but I also need to understand
the architecture and the details well enough to be able figure out if it
doesn't work because of some fundamental differences in Windows vs.
non-Windows, or if it doesn't work because I have a bug somewhere in my
process plugin, or something else.

One of the questions I keep asking myself is: Why, when using one of the
native Windows debuggers such as MSVC or WinDbg, if I step over a call,
does it *always work* even if the called function has no debug info, no
unwind info, and uses FPO?

Maybe it's related to them having better function bounds in their COFF
parser, as you suggested.  I'm going to look into that, but I just want to
re-emphasize that none of my posts, including this one, are intended to
second guess anyone's decisions.  But at the same time it's only natural
 to expect that since many of the assumptions were made without Windows in
mind, they may prove to be slightly wrong.

There's not very many detailed design documents about how things work, and
in certain areas code documentation is sparse.  So the purpose of me asking
is simply to understand how it works.

Hope this makes sense.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150116/644e2008/attachment.html>


More information about the lldb-dev mailing list