On Mon, Jun 27, 2011 at 22:20, Wim Lewis <w...@omnigroup.com> wrote: > > On 27 Jun 2011, at 9:27 AM, yoni londner wrote: > > As you know, on 32bit systems, when using EBP for anything other than > holding the stack base, it is very difficult to get reasonable backtrace. > > this can be fixed if directing the compiler to add a debug record which > tells (at runtime) where we keep EBP value. > > So, I added this record (FPO in ml.exe and cfi in gcc), and now we can > debug/get backtrace at runtime. > > I also fixed source file name, so gdb find's it. > > Patch is attached (against openssl-1.0.0d.tar.gz), and I hope you will > merge it to trunk. > > This seems like a good thing to fix. > > I have some questions/comments: > > 1. Would it be better to use ".cfi_startproc simple"? The GAS documentation > doesn't actually say what opcodes are emitted by cfi_startproc vs. simple > (and I haven't taken the time to check), but I'd expect a frameless leaf > procedure like this one not to want the default opcodes emitted for a normal > procedure. I could be wrong. >
> 2. We could add .cfi_offset directives for the other callee-saved registers > as well (EBX, ESI, EDI). > > > 1. I looked at a generated assembler from gcc. So I am not 100% sure what is the 'most correct', but this is what gcc emits. 2. This is possible, but the frame is the most important. I didn't see those additional registers being a problem when debugging (the debugger may be incorrect about values of local variables in parent function). > > > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > Development Mailing List openssl-dev@openssl.org > Automated List Manager majord...@openssl.org >