Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 29 Apr 2015 10:46:41 +0300
From: Timo Teras <timo.teras@....fi>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: [PATCH] generate debug_frame info for __syscall_cp_asm
 (i386) so gdb can get backtrace

On Mon, 27 Apr 2015 16:57:22 -0400
Rich Felker <dalias@...c.org> wrote:

> On Mon, Apr 27, 2015 at 01:32:35PM +0200, Alex Dowad wrote:
> > Please have a look at this patch, and CC me on any discussion.
> > (I've never worked on musl before and haven't joined the mailing
> > list.) Your feedback will be appreciated. (Just to let you know, I
> > have build-tested this code and tried it in gdb.)
> > 
> > If you would like to add similar stack frame debug information to
> > other asm functions, I would be happy to send more patches. The CFI
> > directives can be made more concise using asm macros if desired.
> 
> This has been requested before, but it really uglifies the asm and
> makes it unreadable. Do you have any ideas for mitigating the problem?
> 
> One possibility would be omitting instruction-grained cfi and just
> having enough to produce meaningful information when blocked at the
> syscall. That's what's actually going to matter in practice for
> debugging. But that's not very elegant.
>
> Another idea would be programmatically generating the cfi from the asm
> with a script that runs at compile-time, and passing the output of the
> script to the assembler. One benefit of this approach is that it could
> be tuned based on whether -g is in use or not. With hard-coded .cfi_*
> I don't see a clear way to suppress it when -g is not in use.

.cfi_sections directive can be used to say if it should go
to .eh_frame, .debug_frame or both. Tuning that right, strip should be
able to get rid of the excess baggage.

I'd at least arm the syscall, and the startup code with manual .cfi
stuff for debugging purposes. If we want to do universal .cfi
annotations for all asm, it'd make sense to have some programmatic way
to generate it.

But I'd really appreciate having usable backtraces.

Thanks,
Timo

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.