From: Mike Frysinger <vapier@gentoo.org>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Linux Mercedes <linuxmercedes@gmail.com>,
duane@duaneellis.com, gdb@sourceware.org
Subject: Re: gdb cannot find "../sysdeps/unix/syscall-template.S"
Date: Fri, 15 Jan 2016 00:02:00 -0000 [thread overview]
Message-ID: <20160115000243.GZ4894@vapier.lan> (raw)
In-Reply-To: <20160114222340.GA4824@host1.jankratochvil.net>
[-- Attachment #1: Type: text/plain, Size: 2961 bytes --]
On 14 Jan 2016 23:23, Jan Kratochvil wrote:
> On Thu, 14 Jan 2016 23:11:02 +0100, Linux Mercedes wrote:
> > As Mike Frysinger points out, that source isn't going to
> > be particularly helpful to look at anyway.
> +
> On Thu, 14 Jan 2016 22:47:31 +0100, duane@duaneellis.com wrote:
> > The distribution you are using (ie: I'm using Ubuntu) should *NOT* compile
> > these files for GLIBC with debug records turned on
> +
> On Thu, 14 Jan 2016 22:55:49 +0100, Mike Frysinger wrote:
> > that is a generated file from glibc, and having its source isn't really useful.
>
> I am very surprised by this reaction.
why ? i'm talking about this one specific file which is literally generated
assembly code for a syscall trampoline. let's look at one example: msgctl
on x86_64.
$ ar x /usr/lib64/libc.a msgctl.o
$ objdump -dr msgctl.o
msgctl.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <__msgctl>:
0: b8 47 00 00 00 mov $0x47,%eax
5: 0f 05 syscall
7: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax
d: 0f 83 00 00 00 00 jae 13 <__msgctl+0x13>
f: R_X86_64_PC32 __syscall_error-0x4
13: c3 retq
what exactly do you expect the syscall-template.S to provide that is useful ?
here's the file in case you were wondering:
...
#if SYSCALL_CANCELLABLE
# include <sysdep-cancel.h>
#else
# include <sysdep.h>
#endif
/* This indirection is needed so that SYMBOL gets macro-expanded. */
#define syscall_hidden_def(SYMBOL) hidden_def (SYMBOL)
#define T_PSEUDO(SYMBOL, NAME, N) PSEUDO (SYMBOL, NAME, N)
#define T_PSEUDO_NOERRNO(SYMBOL, NAME, N) PSEUDO_NOERRNO (SYMBOL, NAME, N)
#define T_PSEUDO_ERRVAL(SYMBOL, NAME, N) PSEUDO_ERRVAL (SYMBOL, NAME, N)
#define T_PSEUDO_END(SYMBOL) PSEUDO_END (SYMBOL)
#define T_PSEUDO_END_NOERRNO(SYMBOL) PSEUDO_END_NOERRNO (SYMBOL)
#define T_PSEUDO_END_ERRVAL(SYMBOL) PSEUDO_END_ERRVAL (SYMBOL)
#if SYSCALL_NOERRNO
/* This kind of system call stub never returns an error.
We return the return value register to the caller unexamined. */
T_PSEUDO_NOERRNO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
ret_NOERRNO
T_PSEUDO_END_NOERRNO (SYSCALL_SYMBOL)
#elif SYSCALL_ERRVAL
/* This kind of system call stub returns the errno code as its return
value, or zero for success. We may massage the kernel's return value
to meet that ABI, but we never set errno here. */
T_PSEUDO_ERRVAL (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
ret_ERRVAL
T_PSEUDO_END_ERRVAL (SYSCALL_SYMBOL)
#else
/* This is a "normal" system call stub: if there is an error,
it returns -1 and sets errno. */
T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
ret
T_PSEUDO_END (SYSCALL_SYMBOL)
#endif
syscall_hidden_def (SYSCALL_SYMBOL)
...
if anything, using disassemble on the function directly is way more useful
and readable.
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-01-15 0:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-14 21:07 Linux Mercedes
2016-01-14 21:10 ` Jan Kratochvil
2016-01-14 22:11 ` Linux Mercedes
2016-01-14 22:23 ` Jan Kratochvil
2016-01-15 0:02 ` Mike Frysinger [this message]
2016-01-15 8:05 ` Jan Kratochvil
2016-01-14 22:25 ` Jan Kratochvil
2016-01-14 21:55 ` Mike Frysinger
2016-01-14 21:47 ` duane
2016-01-14 22:22 ` Linux Mercedes
2016-01-15 9:34 ` Andreas Schwab
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=20160115000243.GZ4894@vapier.lan \
--to=vapier@gentoo.org \
--cc=duane@duaneellis.com \
--cc=gdb@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=linuxmercedes@gmail.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox