From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27247 invoked by alias); 24 Oct 2011 02:16:46 -0000 Received: (qmail 27235 invoked by uid 22791); 24 Oct 2011 02:16:45 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_QE,T_TO_NO_BRKTS_FREEMAIL 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; Mon, 24 Oct 2011 02:16:30 +0000 Received: by iagf6 with SMTP id f6so9124509iag.0 for ; Sun, 23 Oct 2011 19:16:30 -0700 (PDT) Received: by 10.231.67.209 with SMTP id s17mr9124753ibi.31.1319422590094; Sun, 23 Oct 2011 19:16:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.30.137 with HTTP; Sun, 23 Oct 2011 19:16:10 -0700 (PDT) From: Vimal Date: Mon, 24 Oct 2011 02:20:00 -0000 Message-ID: Subject: Multiple breakpoint issue when debugging loadable kernel module To: 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/msg00171.txt.bz2 Hi, I have a loadable kernel module, and I am facing issues when setting breakpoints. I am using gdb 7.3.1 from ftp://ftp.gnu.org/gnu/gdb. 1. I start the kernel under qemu-kvm and load the kernel module. The kernel module was compiled with CFLAGS=-O0 -g 2. I generate the add-symbol-path command by using section address information from /sys/module/$mod/sections/.* 3. I enter the add-symbol-path command into gdb, which is connected to qemu's gdb stub via "target remote" command. 4. After loading the symbols, I do: "info line function" and am able to see the function name's line number. Also, "list function" shows the source code from the correct file. 5. I do "break function", I see this message: Breakpoint 1 at address (2 locations) After the last step, if I run "info line function", I see "No line number information available for address..." When I type "info break", I see the two breakpoints inserted at "function+4" and "function+31". This error does not happen in gdb-7.1. The reason I am using gdb-7.3.1 is that I want to use gdb.Breakpoint from a python script. Is there a way to fix this error? Why are two breakpoints being set? This error happens across a few kernel modules that I tested. Thanks, -- Vimal