From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9423 invoked by alias); 4 Jan 2007 06:56:59 -0000 Received: (qmail 9409 invoked by uid 22791); 4 Jan 2007 06:56:58 -0000 X-Spam-Check-By: sourceware.org Received: from ug-out-1314.google.com (HELO ug-out-1314.google.com) (66.249.92.172) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 04 Jan 2007 06:56:54 +0000 Received: by ug-out-1314.google.com with SMTP id 75so6747283ugb for ; Wed, 03 Jan 2007 22:56:51 -0800 (PST) Received: by 10.78.183.15 with SMTP id g15mr2435804huf.1167893811573; Wed, 03 Jan 2007 22:56:51 -0800 (PST) Received: by 10.78.122.9 with HTTP; Wed, 3 Jan 2007 22:56:51 -0800 (PST) Message-ID: Date: Thu, 04 Jan 2007 06:56:00 -0000 From: "Sandeep Joshi" To: "Sandeep Joshi" , gdb@sourceware.org Subject: Re: GDB not able to debug files(dwarf2.0) loaded using add-symbol-file In-Reply-To: <20070104033008.GA2223@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20061223212620.GC1091@nevyn.them.org> <20070104033008.GA2223@nevyn.them.org> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-01/txt/msg00055.txt.bz2 Below is what 'find_pc_sect_psymtab' returned when i tried to set breakpoint in the file added with 'add-symbol-file' command. ****************************************** Breakpoint 5, find_pc_sect_psymtab (pc=3D34148, section=3D0x9cd4324) at sym= tab.c:796 796 return (best_pst); (gdb) p *best_pst $2 =3D {next =3D 0x9ad046c, filename =3D 0x9ad0518 "net/sunrpc/auth_gss/gss_krb5_mech.c", fullname =3D 0x0, dirname =3D 0x99f1e78 "/home/joshis/sdk/usr/src/kernel/linux-2.6.11.12", objfile =3D 0x994b650, section_offsets =3D 0x9951800, textlow =3D 288, texthigh =3D 1076066628, dependencies =3D 0x0, number_of_dependencies =3D 0, globals_offset =3D 4596, n_global_syms =3D 0, statics_offset =3D 149919, n_static_syms =3D 259, symtab =3D 0x9ccdc50, read_symtab =3D 0x80fbf84 , read_symtab_private =3D 0x9a01b44 "=F3v=F8", readin =3D 1 '\001'} ****************************************** Here the pc to be looked is is '34148' . It starts with first object file i.e vmlinux and checks all the psymtabs for their code range. Now for the above psymtab, Code range is 'textlow =3D 288, texthigh =3D 1076066628' and our PC lies in this. So this is set as best_pst and function returns without checking the second objfile, which has the perfect match for this PC. That is why gdb is not able to show the sources correct. On 1/4/07, Daniel Jacobowitz wrote: > On Wed, Jan 03, 2007 at 03:14:30PM +0530, Sandeep Joshi wrote: > > Memory layout: > > Entry point: 0x40018000 > > 0x40018000 - 0x40060000 is .init > > 0x40060000 - 0x40259644 is .text > > 0x40259650 - 0x40259f78 is __ex_table > > 0x40259f78 - 0x4025a278 is .pci_fixup > > 0x4025a278 - 0x4025d8f0 is __ksymtab > > 0x4025d8f0 - 0x4025ddf0 is __ksymtab_gpl > > 0x4025ddf0 - 0x40266070 is __ksymtab_strings > > 0x40266070 - 0x40266174 is __param > > 0x40268000 - 0x402b8c10 is .data > > 0x402b8c20 - 0x402d995c is .bss > > > > add-symbol-file ~/arm-linux-gdb/bin/test_trap4.out 0x83d8 > > Then how does that overlap with the symbols for the kernel? It > shouldn't. > > -- > Daniel Jacobowitz > CodeSourcery >