LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 04-10-2018, 08:54 PM   #1
915086731
Member
 
Registered: Apr 2010
Posts: 144
Blog Entries: 6

Rep: Reputation: 2
why does kgdb not how function symbols when debugging vmlinux?


I have compiled my kernel with the following kernel option enabled. That should be enough.

Code:
CONFIG_KGDB=y
CONFIG_KGDB_SERIAL_CONSOLE=y
CONFIG_DEBUG_INFO=y
I want to implement a tcp socket server under kernel space. However when I debug my kernel, gdb seems can't recognize function symbol. Question marks are shown.

Code:
#0  0xffffffffb92ef58a in ?? ()
#1  0xffffffffb92ef6dd in ?? ()
#2  0xffffb4a640c73c38 in ?? ()
#3  0xffff9b0c275587c0 in ?? ()
#4  0xffff9b0c5c9fbc00 in ?? ()
#5  0xffff9b0c7c3ec480 in ?? ()
#6  0xffffffffc063d000 in ?? ()
#7  0xffffffffc063b22e in myserver ()
    at /home/river/Desktop/kernel-sock/server.c:75
#8  0xffffffffc063b285 in server_init ()
    at /home/river/Desktop/kernel-sock/server.c:88
#9  0xffffffffb8e0218e in ?? ()
#10 0xffff9b0c7ffeb5c0 in ?? ()
#11 0x000000000000001f in ?? ()
#12 0x85ce74a569aec8a5 in ?? ()
The current kernel version is 4.9.82.
 
Old 04-11-2018, 12:48 AM   #2
915086731
Member
 
Registered: Apr 2010
Posts: 144

Original Poster
Blog Entries: 6

Rep: Reputation: 2
I disabled CONFIG_DEBUG_RODATA and CONFIG_RANDOMIZE_BASE. CONFIG_RANDOMIZE_MEMORY randomizes the virtual addresses of memory sections, including physical memory mappings, vmalloc, and vemmap. I think memory address randomizing is the key.

Now gdb works.
 
Old 04-11-2018, 06:56 AM   #3
915086731
Member
 
Registered: Apr 2010
Posts: 144

Original Poster
Blog Entries: 6

Rep: Reputation: 2
I should

Last edited by 915086731; 04-11-2018 at 06:58 AM.
 
  


Reply

Tags
debug, driver, gdb, kernel, vmlinux



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel module debugging using kgdb aj_patra Linux - Newbie 0 01-18-2012 09:59 AM
kgdb module debugging vkmgeek Programming 1 07-23-2008 05:41 AM
Regarding Kdb/Kgdb kernel debugging ratnakar_78 Linux - Newbie 2 11-29-2007 11:31 AM
Regarding Kdb/Kgdb kernel debugging ratnakar_78 Fedora 2 11-29-2007 09:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 09:02 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration