From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9798 invoked by alias); 28 Oct 2011 00:16:13 -0000 Received: (qmail 9772 invoked by uid 22791); 28 Oct 2011 00:16:08 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_VP X-Spam-Check-By: sourceware.org Received: from mail-iy0-f169.google.com (HELO mail-iy0-f169.google.com) (209.85.210.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Oct 2011 00:15:54 +0000 Received: by iagf6 with SMTP id f6so4806208iag.0 for ; Thu, 27 Oct 2011 17:15:54 -0700 (PDT) Received: by 10.42.158.9 with SMTP id f9mr442949icx.31.1319760954166; Thu, 27 Oct 2011 17:15:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.19.1 with HTTP; Thu, 27 Oct 2011 17:15:33 -0700 (PDT) In-Reply-To: References: <4EA89365.2010807@web.de> From: Vimal Date: Fri, 28 Oct 2011 03:40:00 -0000 Message-ID: Subject: Re: Multiple breakpoint issue when debugging loadable kernel module To: Tom Tromey Cc: Jan Kiszka , gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2011-10/txt/msg00207.txt.bz2 On 27 October 2011 13:31, Tom Tromey wrote: > > A recipe to reproduce the bug. =A0I know nothing about the kernel, so if > it requires extensive setup, precise instructions would be best. > > We've been poking at it a bit on irc but, aside from a lot of weird and > inexplicable gdb behavior, we haven't seen anything too useful. I was poking around the gdb-7.3 code from your branch and noticed the following behaviour: As you suggested, I set breakpoint at decode_variable. Then, followed some function calls to see the function that's returning the sal. Turns out it's this function: find_pc_sect_line. So, in that function, I introduced some print statements and noticed the following: 1. info scope function, before setting a breakpoint, prints the following: (gdb) info scope vport_receive exploring s=3D0x20fb810 filename=3D/home/nikhilh/openvswitch/datapath/linux/vport.c section=3D0x1cff988, pc=3D0xffffffffa00d5ba3 best_symtab: 0x20fb810, in filename=3D/home/nikhilh/openvswitch/datapath/linux/vport.c found best_symtab 0x20fb810 exploring s=3D0x20fb810 filename=3D/home/nikhilh/openvswitch/datapath/linux/vport.c section=3D(nil), pc=3D0xffffffffa00d5ba3 best_symtab: 0x20fb810, in filename=3D/home/nikhilh/openvswitch/datapath/linux/vport.c found best_symtab 0x20fb810 exploring s=3D0x20fb810 filename=3D/home/nikhilh/openvswitch/datapath/linux/vport.c section=3D0x1cff988, pc=3D0xffffffffa00d5ba7 best_symtab: 0x20fb810, in filename=3D/home/nikhilh/openvswitch/datapath/linux/vport.c found best_symtab 0x20fb810 exploring s=3D0x20fb810 filename=3D/home/nikhilh/openvswitch/datapath/linux/vport.c section=3D0x1cff988, pc=3D0xffffffffa00d5bb8 best_symtab: 0x20fb810, in filename=3D/home/nikhilh/openvswitch/datapath/linux/vport.c found best_symtab 0x20fb810 [Prints the correct scope information] Here's the portion I made change in the gdb/symtab.c:find_pc_sect_line(..) printf("exploring s=3D%p filename=3D%s section=3D%p, pc=3D%p\n", s, s?s->filename:NULL, section, (void*)pc); ALL_OBJFILE_SYMTABS (objfile, s) { ... The variable 's' is obtained via find_pc_sect_symtab(). When I set a breakpoint for the same function vport_receive, I see the same output as above. But, after setting a breakpoint, when I do "info scope vport_receive", I see this: (gdb) info scope vport_receive exploring s=3D0x2294cc0 filename=3Darch/x86/kernel/hpet.c section=3D0x1cff988, pc=3D0xffffffffa00d5ba3 count't find best_symtab :(, s=3D(nil), filename=3D(null) exploring s=3D0x2294cc0 filename=3Darch/x86/kernel/hpet.c section=3D(nil), pc=3D0xffffffffa00d5ba3 count't find best_symtab :(, s=3D(nil), filename=3D(null) exploring s=3D0x2294cc0 filename=3Darch/x86/kernel/hpet.c section=3D0x1cff988, pc=3D0xffffffffa00d5ba7 count't find best_symtab :(, s=3D(nil), filename=3D(null) Notice that the 's' variable has changed! section and pc variables haven't. It's looking for the function vport_receive in a _different_ file; I don't understand why! :( It seems like find_pc_sect_symtab() is the culprit. Let me step through that function and see what the problem is.... Thanks, --=20 Vimal