This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: arm core analysis on x86 host


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:

[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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]