From owner-freebsd-hackers@freebsd.org Sun Sep 24 21:01:18 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 1309BE0161A for ; Sun, 24 Sep 2017 21:01:18 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: from mail-qt0-x233.google.com (mail-qt0-x233.google.com [IPv6:2607:f8b0:400d:c0d::233]) (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 C0A1733A4 for ; Sun, 24 Sep 2017 21:01:17 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: by mail-qt0-x233.google.com with SMTP id q8so5207117qtb.5 for ; Sun, 24 Sep 2017 14:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=Tfk+Fwd5WNZuuk1kqFKZJFpVeLyocSbo1WHHq/j9BkU=; b=s3k6cmLtdpyMAOJpUCy517gxeVx4AAyKevWFyxTXT7nIWR1Kr5nAbv79m52qRfhiNX TWx5kR6Vgv1eKboqCZWDjSSkOLCMV5FdLSglcbSCdYtlrkR+Jh1YK4KSn8hOXeOLwghU sTzdlBSG9oX50z5+85cCPuMjZeJBQIopfD/k/siTD8fSeR6vSMF7C0QuZvA53MmZgqGh 5ZQUHtludD+4YutlpRf3dCOoY5CjF/iTWvvocmL+qRqavYnCAOuPS5nw+1Z8Mg0aK0Ud 2BAxNj/PfPnJTf3MyMt4i7gXred1jhUhLI7Jjg/f8lhAD2UnjS59r39xjZOGlW8vDDvY GyNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=Tfk+Fwd5WNZuuk1kqFKZJFpVeLyocSbo1WHHq/j9BkU=; b=QGSM5AH0LFWUA17Ma6CwxmSmAJ7GSfII4lgLUvWRBwRrHzFWMXUkeMBEDRMC3F4G0E ydSo238AGXc2/RYaWF/Mru4PQ1xfGnyCKoXhMvPwgsd5zkjb4aSt9J2fYCf8+7Fbc1D/ tYBDvwmfDPwfbcn7mrxGOjuPd49AOUoJgFjEGm0WSoV2EOqyT1p/IYx2S05PqDUyfymv bgWxtWK3OVye41DY/7mRsydy/aUaNu4yVSnJ2xVk+xHYhQ9sp6Cy/sIp9fhkFYIZCdQt VUxhB+wTFZfMHKQMshbZeklSveLTEiGI/0+N7xI56snbSbntOwbne8K0SUK5AmMDaC1J EZwg== X-Gm-Message-State: AHPjjUiOX9D+Z1eD1ulFG0SWDMkwQ+5GDzTe3ajK8oIz/1q0t6hNzzHK +H3LMUpMt3rwTn2mVjIjcmBGmkQH X-Google-Smtp-Source: AOwi7QDLl040mgm2x1asqM+B8LjFweGpWpKxRlNVHXi+vFSd/A2OSIadsN6iESyPqTPpNLO+gO+dBQ== X-Received: by 10.237.33.162 with SMTP id l31mr9027815qtc.255.1506286876543; Sun, 24 Sep 2017 14:01:16 -0700 (PDT) Received: from pc.farhan.codes ([2001:470:8:209::dead:c0de]) by smtp.gmail.com with ESMTPSA id d186sm3809589qkg.46.2017.09.24.14.01.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Sep 2017 14:01:15 -0700 (PDT) To: freebsd-hackers@freebsd.org From: Farhan Khan Subject: Debugging symbols on kernel module Message-ID: Date: Sun, 24 Sep 2017 17:01:15 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Sun, 24 Sep 2017 21:01:18 -0000 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