mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Timo Teras <timo.teras@iki.fi>
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com
Subject: Re: [PATCH] generate debug_frame info for __syscall_cp_asm (i386) so gdb can get backtrace
Date: Wed, 29 Apr 2015 10:46:41 +0300	[thread overview]
Message-ID: <20150429104641.57185766@vostro> (raw)
In-Reply-To: <20150427205722.GG17573@brightrain.aerifal.cx>

On Mon, 27 Apr 2015 16:57:22 -0400
Rich Felker <dalias@libc.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



  reply	other threads:[~2015-04-29  7:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 11:32 Alex Dowad
2015-04-27 20:57 ` Rich Felker
2015-04-29  7:46   ` Timo Teras [this message]
2015-04-29 13:23     ` Rich Felker
2015-04-29 14:46 Alex Dowad
2015-04-29 16:51 Alex Dowad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150429104641.57185766@vostro \
    --to=timo.teras@iki.fi \
    --cc=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).