public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Liu hua <sdu.liu@huawei.com>
To: <gdb@sourceware.org>
Cc: "xiaofeng.yan" <xiaofeng.yan@huawei.com>,
	       "peifeiyue@huawei.com"	<peifeiyue@huawei.com>,
	       Liu Hua <sdu.liu@huawei.com>
Subject: Fwd: The call stack can't include the right symbol for a weak symbol in dynamic library
Date: Wed, 29 Oct 2014 11:58:00 -0000	[thread overview]
Message-ID: <5450D638.7070801@huawei.com> (raw)
In-Reply-To: <5450D5CC.4050209@huawei.com>

form: xiaofeng.yan@huawei.com
Hi all,

I debug program with gdb on arm platform. The environment is as follow:

platform: vexpress(virtual <app:ds:virtual> machine <app:ds:machine> for arm on qemu)
libc: uclibc

A error information happen when debug the next codes.
0xb6fa0440 in ?? () from /lib/libc.so.0

The call stack can't include the right symbol of function pause(); I found that the function pause() is a weak symbol in dynamic library libc.
I don't know the reason  why gdb can't get the right symbol from the call stack?  Is this error from gdb or uclibc.
Is there any suggestion about this error?  I will be very grateful for your any reply.



code:
 relativedebug.c :
 #include <unistd.h>
#include <stdlib.h>
#include <signal.h>


static void handler (int signo)
{
    abort ();
}

int main (void)
{
    signal (SIGALRM, handler);
    alarm (1);
    pause ();
    pause ();
    return 0;
}

-bash-4.2# '/usr/bin/'gdb relativedebug
delete breakpoints
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> <http://gnu.org/licenses/gpl.html%3E%5EM>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-euler-linux-gnueabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>... <http://www.gnu.org/software/gdb/bugs/%3E...%5EM>
Reading symbols from /tmp/for_gdb_test/base_test/relativedebug...done.
(gdb) delete breakpoints
(gdb) break main
Breakpoint 1 at 0x8548: file relativedebug.c, line 30.
(gdb) run
Starting program: /tmp/for_gdb_test/base_test/relativedebug

Breakpoint 1, main () at relativedebug.c:30
30      signal (SIGALRM, handler);
(gdb) continue
Continuing.

Program received signal SIGABRT, Aborted.
0xb6fdb7f0 in raise () from /lib/libc.so.0
(gdb) bt
#0  0xb6fdb7f0 in raise () from /lib/libc.so.0
#1  0xb6fd5bf4 in abort () from /lib/libc.so.0^M
#2  0x00008540 in handler (signo=14) at relativedebug.c:25^M
#3  <signal handler called>^M
#4  0xb6fa0440 in ?? () from /lib/libc.so.0
#5  0x00008564 in main () at relativedebug.c:32
(gdb)

Thanks
Yan








           reply	other threads:[~2014-10-29 11:58 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <5450D5CC.4050209@huawei.com>]

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=5450D638.7070801@huawei.com \
    --to=sdu.liu@huawei.com \
    --cc=gdb@sourceware.org \
    --cc=peifeiyue@huawei.com \
    --cc=xiaofeng.yan@huawei.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).