From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29613 invoked by alias); 28 Oct 2011 03:40:24 -0000 Received: (qmail 29594 invoked by uid 22791); 28 Oct 2011 03:40:22 -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 03:40:08 +0000 Received: by iagf6 with SMTP id f6so4989366iag.0 for ; Thu, 27 Oct 2011 20:40:08 -0700 (PDT) Received: by 10.42.172.194 with SMTP id o2mr1497872icz.15.1319773208077; Thu, 27 Oct 2011 20:40:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.19.1 with HTTP; Thu, 27 Oct 2011 20:39:47 -0700 (PDT) In-Reply-To: References: <4EA89365.2010807@web.de> From: Vimal Date: Fri, 28 Oct 2011 21:07: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 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/msg00208.txt.bz2 Some more info. This looks interesting. 1. find_pc_sect_symtab has changed quite a bit between the faulty commit noted above (sha 2cdbbe44) and its parent (2cdbbe44^)! 2. Since the module is loaded into the kernel address space, find_pc_sect_symtab seems to think the vmlinux module's symbol table has symbol information for the function I am breaking into. Some prints from find_pc_sect_symtab for a LKM function seems to return vmlinux's symtab! :( find_pc_sect_symtab(pc=0xffffffffa00d5bb8,sec=0x20fb988) objfile=0x11cbc40, name=/usr/src/linux-cfs-bw/vmlinux Returning 0x2690cc0 (objfile=0x11cbc40) # Which is vmlinux So, I checked the BLOCK_START and BLOCK_END for the vmlinux image. I got this: start=0xffffffff8102eb10 end=0xffffffffff60017f and pc=0xffffffffa00d5bb8 was very well within start and end, so it chose vmlinux. :( So, I tired this (without loading vmlinux's symbols) (gdb) target remote localhost:1234 (gdb) add-symbol-file (for module) (gdb) info scope module_function (got info) (gdb) break module_function (correct break) (gdb) info scope module_function (got correct info! it works!) All locals/args info is retained. So, to combat this, I presently do this (load vmlinux _after_ loading module symbols) gdb (without vmlinux) (gdb) target remote ... (gdb) add-symbol-file (for module) (gdb) file vmlinux (gdb) break vport_receive Breakpoint 1, vport_receive (vport=0xffff880115fa7200, skb=0xffff880117580900) at /home/nikhilh/openvswitch/datapath/linux/vport.c:643 643 if (vport->ops->flags & VPORT_F_GEN_STATS) { With full information. I am also able to break into Linux functions, like sys_write for e.g. Jan: can you try this and tell us if it works? Thanks, -- Vimal