LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
LinkBack Search this Thread
Old 06-09-2011, 06:23 AM   #1
LinLove
Member
 
Registered: Apr 2006
Posts: 30

Rep: Reputation: 15
GDB can not find line numbers


I am using GDB for debugging a Linux kernel module. After loading the module, i use
Code:
add-symbol-file
to add module symbols.

When i use list command in GDB to find a symbol in module, it will find it for example:

Code:
(gdb) list __do_restart
122  *      would provide type of error or success. In the case of early restart support from
123  *      cr_mods a signal will be posted at appropriate time.
124  *
125  *      NOTE: This type of restarting could be used for migrating parallel processes.
126  */
127 int __do_restart(void *data){
128     struct siginfo info;
129     struct object_stored_data *sd;
130     struct crmod_clients *clt = get_client(data);
131     memset(&info, 0, sizeof(struct siginfo));
(gdb) b __do_restart
Breakpoint 1 at 0xe081740e: file /home/amrzar/Workspace/common/commod.c, line 130.
I can even set a breakpoint for it. But after the first interrupt in execution when i use
Code:
list
it says:

Code:
 (gdb) list __do_restart
    No line number known for __do_restart
It simply lost symbols! Why? (I am sure about presence of debugging information in object file) Thanks
 
Old 06-11-2011, 09:53 AM   #2
Anisha Kaul
Senior Member
 
Registered: Dec 2008
Location: Gurgaon, India
Distribution: Slackware 13.37, OpenSuse 11.3
Posts: 4,373
Blog Entries: 21

Rep: Reputation: 706Reputation: 706Reputation: 706Reputation: 706Reputation: 706Reputation: 706Reputation: 706
Shouldn't you be using Kdb for debugging the kernel modules?

Anyway -g option is used when compiling before usage of the Gdb, see if this FAQ entry (though not directly related to Linux) helps: http://cegcc.sourceforge.net/docs/fa...#GdbStippedExe

Last edited by Anisha Kaul; 06-11-2011 at 09:55 AM.
 
  


Reply

Tags
gdb, kernel module


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] find the total of numbers that are higher than x in a text file with numbers (using awk??) Mike_V Programming 12 11-24-2010 09:51 AM
[SOLVED] Trying to number every other line and append those numbers to end of line kmkocot Programming 7 04-23-2010 11:17 AM
code line in gdb kshkid Programming 4 06-12-2008 02:06 AM
Grep's line numbers parsed into one line of output. judgex Programming 8 08-14-2006 04:22 AM
can't find source files / line numbers with gdb dnijaguar Linux - Software 0 07-14-2003 01:30 AM


All times are GMT -5. The time now is 07:51 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration