This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS v5.1.0.07001 issue with Linux kernel debugging...another possible bug?



Am doing Linux kernel debug w/JTAG.  When I load my debug configurations all goes well.  Symbols from a debug kernel build get loaded and all seems well.  But if I try to set a CCS breakpoint in a source file it gets added to the Breapoints dialog, but it's not checked.  When I check it I get a popup dialog from the Breakpoint Manager that says:

  No code is associated with "net/ipv4/af_netlink.c", line 991 in "/netshare/vmlinux"

There are a couple of issues here. First, the path on the filename is not correct.  The correct symbol information (obtained from looking at the directory structure, and also corroborated by dumping all debug information in the vmlinux module) is in a file which has a path of "net/netlink/af_netlink.c".

Second, if I then go into the disassembly window and key in the name of a function in af_netlink.c, say netlink_unicast, it will properly bring up the dissasembly window.  From the disassembly window I can then set a CCS breakpoint at the first instruction of this function.  If I then run the target and subsequently run a test program that causes the breakpoint to be hit the proper source code file is loaded and I can then step into/step over with problems.  But if I go down a few lines and then set another CCS breakpoint I get the same behaviour as described in the first paragraph, namely, the breakpoint is added to the breakpoint dialog without being checked, and if I check it I get the same message.  Clearly, there is code associated with the file/line mentioned in the popup, I can see it in the dissasembly window.

There is a workaround, just use the disassembly window to set the brealpoints...but this is problemmatic for a number of reasons...suppose the user doesn't really know the target assembler well enough...suppose, due to optimization, even if you know assembler well enough you can't find the correct place to set the breakpoint, etc.,...

In short, the workaround has it's own issues, not to mention the fact that it's a productivity killer...;(...

 

 

  • Third sentence in the third paragraph is incorrect, it should read instead:

    If I then run the target and subsequently run a test program that causes the breakpoint to be hit the proper source code file is loaded and I can then step into/step over with NO problems.

    sorry...;(...

  • Hi Joe,

    Did you open net/ipv4/af_netlink.c yourself ? OR how do you end up in the file net/ipv4/af_netlink.c

    I search the linux kernel source tree; there is only af_netlink.c in the tree and it is under net/netlink.

    Regards,

    Raymond

  • No, I didn't open the file myself, it poped up when the breakpoint was hit.

     

    You're correct, there is only one file by that name in the Linux kernel tree. At first when I saw the name I thought that maybe there was multiple files by the same name in different directories.  So I removed the Linux source file directory path I had put in the debug configuration and then tried using the method patrick used on the webex, namely, I created a C project and just added the files I was interested in (/net/ipv4/af_netlink.c) to the project as a link, and then added the project to the debug config.  But the same thing occured,.  Then I actually checked the Linux source tree because I thought there might be a file by that name also, but there isn't.

     

    Not sure where/how it came up with the path for that file.

     

    But, in case you haven't noticed, it's not an uncommon practice in Linux kernel development to have source code files with the same name reside in different branches of the source tree.  Sometimes they may even have the same symbols (although they may be static)!  This obviously creates a potential nitemare for debug implementors...;(...

  • Hi Joe,

    How do you set the breakpoint in the first place ?

    I understand that there are files with the same names under different branches.

    We fixed bugs to handle this in the past. I do expect that CSS can handle this correctly.

    Would you detail the steps to reproduce your problem.

    In particular, where did you set your bp ? what is the value of the pc when you set the bp and when the bp hits

    Regards,

    Raymond

  • A correction in my previous post. In the third sentaence the filename should be net/netlink/af_netlink.c, not net/ipv4/af_netlink.c.

     

    Sorry.

     

  • I already detailed in the initial post of this thread what I did.  If you read the third paragraph it tells you how I set the breakpoint...it begins with the sentence "Second, if I then go into the disassembly window"...

    I don't recall the exact place I set my BP...it was an internal static function in the af_netlink.c file...I was tracing some NETLINK functions to see where I was getting an application level failure...some of the functions I set BP's at were netlink_sendmsg and netlink_recvmsg...

    To reach these BP's you'll need a program that sends/receivesNETLINK messages, and probably a kernel module to initialize a NETLINK protocol first (if it's not already in use) because current kernels do not allow user programs to create sockets on NETLINK protocols that aren't in use. 

    Make sure you have compiled the Linux kernel with debug information or else these symbols won't be visible...internally they're defined as static.

    I can't give you my modules because they probably won't load on a kernel you build, you'd need the source code to build your own or my complete binary setup...kernel, modules and test apps...not sure about the file system, you might be able to use the 8148EVM Arago file system in place of ours...of course, you'll also need an ARM test platform...I'm using the TI 8148EVM...;)...

     

     

  • Hi Joe,

    What confused me is that from the first paragraph of your msg:

    Am doing Linux kernel debug w/JTAG.  When I load my debug configurations all goes well.  Symbols from a debug kernel build get loaded and all seems well.  But if I try to set a CCS breakpoint in a source file it gets added to the Breapoints dialog, but it's not checked.  When I check it I get a popup dialog from the Breakpoint Manager that says:

      No code is associated with "net/ipv4/af_netlink.c", line 991 in "/netshare/vmlinux"

    You said you try to set a breakpoint in a source file. Is the source file net/netlink/af_netlink.c ?

    If you tried to set a bp in net/netlink/af_netlink.c, CCS failed to do that and reported such an error. Then, this is a CCS bug.

    If you try to set a bp in a file called af_netlink.c in the folder net/ipv4, then this is expected.

    Regards,

    Raymond

     

  • A couple more clarifications on the finer points of what I describe in the initial post. 

    In the forth sentence of the first paragraph, I manually opened the net/netlink/af_netlink.c file and attempted to set a CCS breakpoint.

    In the third paragraph (starts with "Second, if I then go into the disassembly window")I closed the manually loaded source file window prior to performing the second step. 

    In the third sentence of this paragraph when I say that it loaded the correct source file what I mean is that it loaded net/netlink/af_netlink.c, but the filename in the title bar was not correct, it was net/ipv4/af_netlink.c.

     

  • Hi Joe,

     Line 991, af_netlink.cpp is inside a static inline function do_a_broadcast which is called once by another function

    netlink_broadcast_filtered on line 1077, af_netlink.c.

    CCS does allow you to set breakpoints in an inline function. It will automatically set bps at locations where the inline function is called.

    I try it on M8.5 (beta 2.1). I can set a bp at line 991 successfully. The bp is hit when line 1077 is executed.

    Would you try this with a newer CCS ?

    -Raymond 

  • Sure...tell me how to get it...I'm leaving for the day now but will get it tomorrow when I come in.

  • This is the link where you can download the latest CCS.

    http://processors.wiki.ti.com/index.php/Download_CCS