Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jon Ringle <jon.ringle@comdial.com>
To: gdb@sources.redhat.com
Subject: Re: arm core analysis on x86 host
Date: Tue, 29 Mar 2005 16:19:00 -0000	[thread overview]
Message-ID: <200503291113.53817.jon.ringle@comdial.com> (raw)
In-Reply-To: <20050329045853.GA11420@nevyn.them.org>

[-- Attachment #1: Type: text/plain, Size: 1334 bytes --]

On Monday 28 March 2005 23:58, Daniel Jacobowitz wrote:
> On Mon, Mar 28, 2005 at 11:17:14PM -0500, Jon Ringle wrote:
> > I am now using as an example ppc-linux-tdep.c, however it still seems
> > that a call to deprecated_add_core_fns() is needed. When I use a 'target
> > core /path/to/core' command, core_open() gets called which calls
> > sniff_core_bfd(). sniff_core_bfd() has a loop to iterate over
> > core_file_fns, which as far as I can tell gets populated via
> > deprecated_add_core_fns(). I don't see how else core_file_fns gets
> > populated. Am I misunderstanding the use of 'deprecated' here? My
> > understanding of the word is that use is no longer desired in favor of a
> > (hopefully) better solution or archetecture.
>
> Look harder :-)  sniff_core_bfd is disabled if you provide the new
> mechanism.  It should be all you need.

I assume that you are refering to the test that is done at the beginning of 
sniff_core_bfd():
  /* Don't sniff if we have support for register sets in CORE_GDBARCH.  */
  if (core_gdbarch && gdbarch_regset_from_core_section_p (core_gdbarch))
    return NULL;

Howerver, the value of core_gdbarch is not the same as the gdbarch that was 
used for the set_gdbarch_regset_from_core_section() causing the test to fail 
and fall through to the core_file_fns loop.

Here is a gdb session:


[-- Attachment #2: typescript --]
[-- Type: text/plain, Size: 4753 bytes --]

[ringlej@heavymobile gdb]$ cat topgdb-bp
b set_gdbarch_regset_from_core_section
b gdbarch_regset_from_core_section
b gdbarch_regset_from_core_section_p
b corelow.c:350

[ringlej@heavymobile gdb]$ cat gdbcoreinit
cd /home/ringlej/mp1000/trunk-fixes/Soundpipe/ippbx
set solib-search-path /usr/arm-linux/lib
set solib-absolute-prefix /usr/arm-linux/lib
set radix 16
directory ../sysutil ../pstngw ../sipgw ../phonemgr ../callthd ../Microsip2 ../parkgw ../ringgw
file ippbx.gdb
target core ./core

[ringlej@heavymobile gdb]$ gdb -x topgdb-bp gdb
GNU gdb 6.2-2mdk (Mandrakelinux)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-mandrake-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

Setting up the environment for debugging gdb.
Breakpoint 1 at 0x805cc73: file ../../src/gdb/utils.c, line 817.
Breakpoint 2 at 0x8086a35: file ../../src/gdb/cli/cli-cmds.c, line 193.
Breakpoint 3 at 0x80fcce2: file ../../src/gdb/gdbarch.c, line 3683.
Breakpoint 4 at 0x80fcc38: file ../../src/gdb/gdbarch.c, line 3672.
Breakpoint 5 at 0x80fcbeb: file ../../src/gdb/gdbarch.c, line 3665.
Breakpoint 6 at 0x806bae2: file ../../src/gdb/corelow.c, line 350.
(top-gdb) run -n -x gdbcoreinit
Starting program: /home/ringlej/gdb-cvs/arm/gdb/gdb -x gdbcoreinit
Backtrace limit of 50 exceeded
Backtrace limit of 50 exceeded

Breakpoint 3, set_gdbarch_regset_from_core_section (gdbarch=0x848d2e8, regset_from_core_section=0x8068a47 <arm_linux_regset_from_core_section>) at ../../src/gdb/gdbarch.c:3683
3683	  gdbarch->regset_from_core_section = regset_from_core_section;
(top-gdb) n
Backtrace limit of 50 exceeded
During symbol reading, Incomplete CFI data; unspecified registers at 0x080fcce2.
set_gdbarch_regset_from_core_section (gdbarch=0x848d2e8, regset_from_core_section=0x8068a47 <arm_linux_regset_from_core_section>) at ../../src/gdb/gdbarch.c:3684
3684	}
(top-gdb) p gdbarch
$1 = (struct gdbarch *) 0x848d2e8
(top-gdb) p gdbarch->regset_from_core_section
$2 = (gdbarch_regset_from_core_section_ftype *) 0x8068a47 <arm_linux_regset_from_core_section>
(top-gdb) c
Continuing.
GNU gdb 6.3.50.20050328-cvs
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-linux".
Backtrace limit of 50 exceeded

Breakpoint 6, core_open (filename=0x8495658 "/home/ringlej/mp1000/trunk-fixes/Soundpipe/ippbx/./core", from_tty=0) at ../../src/gdb/corelow.c:350
350	  core_vec = sniff_core_bfd (core_bfd);
(top-gdb) p core_bfd
$3 = (bfd *) 0x849caf0
(top-gdb) s
Backtrace limit of 50 exceeded
sniff_core_bfd (abfd=0x8495658) at ../../src/gdb/corelow.c:138
138	{
(top-gdb) n
Backtrace limit of 50 exceeded
sniff_core_bfd (abfd=0x849caf0) at ../../src/gdb/corelow.c:140
140	  struct core_fns *yummy = NULL;
(top-gdb) n
Backtrace limit of 50 exceeded
sniff_core_bfd (abfd=0x849caf0) at ../../src/gdb/corelow.c:141
141	  int matches = 0;;
(top-gdb) n
Backtrace limit of 50 exceeded
sniff_core_bfd (abfd=0x849caf0) at ../../src/gdb/corelow.c:144
144	  if (core_gdbarch && gdbarch_regset_from_core_section_p (core_gdbarch))
(top-gdb) p core_gdbarch
$4 = (struct gdbarch *) 0x85723d0
(top-gdb) n
Backtrace limit of 50 exceeded
gdbarch_regset_from_core_section_p (gdbarch=0x849caf0) at ../../src/gdb/gdbarch.c:3664
3664	{
(top-gdb) n
Backtrace limit of 50 exceeded

Breakpoint 5, gdbarch_regset_from_core_section_p (gdbarch=0x85723d0) at ../../src/gdb/gdbarch.c:3665
3665	  gdb_assert (gdbarch != NULL);
(top-gdb) n
Backtrace limit of 50 exceeded
gdbarch_regset_from_core_section_p (gdbarch=0x85723d0) at ../../src/gdb/gdbarch.c:3666
3666	  return gdbarch->regset_from_core_section != NULL;
(top-gdb) p gdbarch
$5 = (struct gdbarch *) 0x85723d0
(top-gdb) p gdbarch->regset_from_core_section
$6 = (gdbarch_regset_from_core_section_ftype *) 0
(top-gdb) n
Backtrace limit of 50 exceeded
gdbarch_regset_from_core_section_p (gdbarch=0x85723d0) at ../../src/gdb/gdbarch.c:3667
3667	}
(top-gdb) n
Backtrace limit of 50 exceeded
Backtrace limit of 50 exceeded
sniff_core_bfd (abfd=0x849caf0) at ../../src/gdb/corelow.c:147
147	  for (cf = core_file_fns; cf != NULL; cf = cf->next)
(top-gdb) quit
The program is running.  Exit anyway? (y or n) y

  reply	other threads:[~2005-03-29 16:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-28 23:29 Jon Ringle
2005-03-28 23:56 ` Daniel Jacobowitz
2005-03-29  0:48   ` Jon Ringle
2005-03-29  1:31     ` Daniel Jacobowitz
2005-03-29  4:17   ` Jon Ringle
2005-03-29  4:57     ` Daniel Jacobowitz
2005-03-29 16:19       ` Jon Ringle [this message]
2005-03-29 16:33         ` Daniel Jacobowitz
2005-03-29 16:39           ` Jon Ringle
2005-03-29 16:52             ` Daniel Jacobowitz
2005-03-29 17:18               ` Jon Ringle
2005-03-29 19:35                 ` Jon Ringle
2005-03-30  2:07               ` Jon Ringle
2005-03-30  4:51                 ` Daniel Jacobowitz
2005-03-30 14:42                   ` Jon Ringle
2005-03-30 15:15                     ` M.M. Kettenis
2005-03-30 15:25                       ` Daniel Jacobowitz
2005-03-30 18:02                         ` Mark Kettenis
2005-03-30 18:18                           ` Daniel Jacobowitz
2005-03-31 14:08                           ` Jon Ringle
2005-03-31 14:28                             ` Daniel Jacobowitz
2005-03-31 14:35                               ` Jon Ringle
2005-04-06 22:16                               ` Jon Ringle
2005-04-06 22:27                                 ` Daniel Jacobowitz

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=200503291113.53817.jon.ringle@comdial.com \
    --to=jon.ringle@comdial.com \
    --cc=gdb@sources.redhat.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