Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: <duane@duaneellis.com>
To: "Linux Mercedes" <linuxmercedes@gmail.com>, gdb@sourceware.org
Subject: RE: gdb cannot find "../sysdeps/unix/syscall-template.S"
Date: Thu, 14 Jan 2016 21:47:00 -0000	[thread overview]
Message-ID: <20160114144731.5c1bb9f86d671edec44bb378f25c04cc.7a526e7354.wbe@email03.secureserver.net> (raw)

[resend this time as plain text...]

>> get an error dialog that says "../sysdeps/unix/syscall-template.S

This is most likely (99.9% certainty) caused by some library code,
perhaps "glibc" (the standard C library)

Example (and more detail)
    https://sourceware.org/glibc/wiki/SyscallWrappers

So your application code has hit a break point - deep within the bowels
of the standard C library (aka: GLIBC) and there happens to be debug
information in that file .. which GDB properly reports to DDD the
filename and line number.

Sort of like this:  your code has: printf("hello world") .

The call chain is like this: printf() calls vprintf() -> calls buffer
write -> calls _iowrite() calls the standard posix write(), which is
implemented via the syscall template in assembly language.

DDD - (or GDB) being a source level debugger attempts to find this file
and complains that the file cannot be found. Not sure which one is does
this, but I agree - it is very annoying... but mostly harmless.

====

Why does this happen?

Being a _true_ software engineer, nobody wants to write these ASM
wrappers... so somebody got smart and created a template - that is used
for nearly *ALL* system calls to the linux kernel. [Maybe 100%, but
maybe one or two are done in some manual way]

Hence, the damn debugger wants this file very often.

====

What is the true fix?  The distribution you are using (ie: I'm using
Ubuntu) should *NOT* compile these files for GLIBC with debug records
turned on (or the should *STRIP* all debug info from the object files
and/or library).

If the code does *NOT* have the debug records, then GDB (and ddd) is
very quite about this.

Also note: Debug records might not be *IN* the object, they could be in
a parallel file (next to, or similar place) and the debugger knows how
to find the corresponding symbol files for each library.


-Duane.


         reply	other threads:[~2016-01-14 21:47 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
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 [this message]
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=20160114144731.5c1bb9f86d671edec44bb378f25c04cc.7a526e7354.wbe@email03.secureserver.net \
    --to=duane@duaneellis.com \
    --cc=gdb@sourceware.org \
    --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