Timo Kreuzer writes:
>The problem of the missing Windows x64 unwind tables is already solved!
>I generate them from DWARF2 unwind info in a postprocessing step.

Ok.  The Windows unwind opcodes seemed to be much more limitted than
DWARF2's that I wouldn't have thought this approach would work.

>The problem that I have is simply how to mark the try / except / finally
>blocks in the code with reference to each other, so I can also generate
>the SCOPE_TABLE data in that post processing step

You can output address pairs to a special section to get the mapping
you need.  Something like:

        asm(".section .seh.data, \"n\"\n\t"
            ".quad %0, %1\n\t"
            ".text"
            : : "i" (&addr1), "i" (&addr2));

Unfortunately, I don't think section stack directives work on PE-COFF
targets, so you'd have to assume the function was using the .text section.
btw. don't rely on GCC putting adjacent asm statements together like
you did in your orignal message.  Make them a single asm statement.

Note that the SCOPE_TABLE structure is part of Microsoft's internal
private SEH implementation.  I don't think it's a good idea to use or
copy Microsoft's implementation.  Create your own handler function and
give it whatever data you need.

                                Ross Ridge

Reply via email to