From owner-freebsd-hackers@freebsd.org Mon Sep 25 07:50:35 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C52C9E0D313 for ; Mon, 25 Sep 2017 07:50:35 +0000 (UTC) (envelope-from s3erios@gmail.com) Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 579D071A4D for ; Mon, 25 Sep 2017 07:50:35 +0000 (UTC) (envelope-from s3erios@gmail.com) Received: by mail-wr0-x243.google.com with SMTP id b9so1332245wra.0 for ; Mon, 25 Sep 2017 00:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:subject:references:date:cc:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=lceoMN2cmgRORcDo5lBUQ7NUK42XdXfvpHPSxvpLqLk=; b=LsznrgyXvJgoRRQM5Dii8ch7j2BcwJ0SzZ7WzRmGOhiK/w3yLatYARQ4tJEhMWee5A R56uvcrYdKjmnYVXY0TR7E9wMQ3m3JhzN1vfufdqInKIjwqqRB8/f/FoJ+TnEj6+rpa2 W59y1xnmVfkrPT3NfnhDQlqLauXmhUvuJOuWFXwqCG90jj3gvNsHqYCgemxol8RErfM6 CcmH+kJ5YGwYP3pIQlirwKI+KPoVdviW29fMp4+K1KEKK3/Yr8hpYY6zMyDBNjDEgK4R IVK6a4SwmV0SY7owdN1zhcWzNn5BiQckDhxRvBsKrdYsSfmGwX7tACMnPVkqMtRb6bNk 381Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:references:date:cc:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=lceoMN2cmgRORcDo5lBUQ7NUK42XdXfvpHPSxvpLqLk=; b=QK8+D7dH2Q9YBQfUBsxduTjrABtTJsrUd0HFsxDzQI9Q9BewRXiz/jcjgtThDIxpXR +dJ/C7HbmyL0lcGSlVyvsfGCrOSjYqd/Wsg1P9JMTC/3o3N38apsmojlnwv679Fz5R3v l+rwPj++HG3LRm4GUqOLcPfJfYuYHeJ3Tozixjjd+HZCtkLt96JGpIoo5kZwxuxpWXyC FVvejSDhyLAAJqiXAZx271I6yyaGVIzDr75PJGGs/j2YHDcQH3Bwso6r0LPrtcmBpzjO bW9wv7U3BTR5Jn4KgnNv9mHvkOR4n7iPeOl4XugvuxKIUHiysx4K8Fnq+BLPHOgnjA1z STxA== X-Gm-Message-State: AHPjjUhwUx0IIOfiftaVanKMUzK5+2ZTu7+1pET4GkXoIUiUziYQglzK pocRQ0DvEQ0AXAZbuihienc= X-Google-Smtp-Source: AOwi7QDgUISYExx3vXGtEZugx8+WDca9evnOoDI8zXhUSI2DHQGsF33fIVOJRld5IXmg41V8MJUwIg== X-Received: by 10.46.83.81 with SMTP id t17mr2250817ljd.180.1506325833712; Mon, 25 Sep 2017 00:50:33 -0700 (PDT) Received: from thinkpad-x220 (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id t20sm1286483ljb.91.2017.09.25.00.50.32 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 25 Sep 2017 00:50:32 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Farhan Khan" Subject: Re: Debugging symbols on kernel module References: Date: Mon, 25 Sep 2017 10:48:12 +0300 Cc: "freebsd-hackers@freebsd.org" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.15 (FreeBSD) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Sep 2017 07:50:35 -0000 Hi, for debugging purposes I'm adding next line in make.conf: CFLAGS+= -O0 -g Works for modules but not for the kernel (KSTACK_PAGES needs to be increased for the whole kernel build). > Hi all, > > I am working on a kernel module but am getting some unexpected code > execution. Dtrace probes reveal that the kernel executes: > "rtwn.ko`r88ee_init_bb+0x219" and then jumps to an unexpected function. > > I would like to track down exactly which line that is. I compiled the > module with this: > > # make DEBUG_FLAGS=-g3 -C sys/modules/rtwn/ > > This produced the rtwn.ko.debug and rtwn.ko.full files. But when I load > them, I still do not have debugging symbols: > > $ kgdb rtwn.ko > GNU gdb (GDB) 8.0 [GDB v8.0 for FreeBSD] > Copyright (C) 2017 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show > copying" > and "show warranty" for details. > This GDB was configured as "x86_64-portbld-freebsd12.0". > Type "show configuration" for configuration details. > For bug reporting instructions, please see: > . > Find the GDB manual and other documentation resources online at: > . > For help, type "help". > Type "apropos word" to search for commands related to "word"... > Reading symbols from rtwn.ko...Reading symbols from > /usr/src/sys/modules/rtwn/rtwn.ko.debug...(no debugging symbols > found)...done. > (no debugging symbols found)...done. > (kgdb) file rtwn.ko.debug > Reading symbols from rtwn.ko.debug...(no debugging symbols found)...done. > (kgdb) file rtwn.ko.full > Reading symbols from rtwn.ko.full...(no debugging symbols found)...done. > > How do I properly load debugging symbols for the module? > > Thanks, > > Farhan Khan > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org"