kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: freeman.zhang1992@gmail.com (Freeman Zhang)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Debug Kernel Modules With KGDB
Date: Mon, 01 Dec 2014 17:56:09 +0800	[thread overview]
Message-ID: <547C3B39.1050900@gmail.com> (raw)

Hi list,

I've been trying to setup a debug environment for linux
kernel(v3.4,Android,ARM) with kgdb. It worked fine untill I tried to use
it to debug a module. Under the instruction from LDD, I add module debug
info in gdb with command:

	add-symbol-file test-module.ko  address

LDD uses `cat /sys/module/test-module/sections/.text` to get the address
where the module has been loaded. However, I got:
	
	0x00000000

When I use `lsmod`, I got:

	test-module 15278 0 - Live 0x00000000 (O)

Why nothing but 0x00000000 ??

So I have to do some research in kernel/module.c, and find out that
struct module -> module_core = 0xbf000000. But when I try these in gdb:

	add-symbol-file test-module.ko  0xbf000000
	break one_of_my_function

I got:

	Cannot access memory at address 0xbf002350

:(
Could somebody help?


All the best!
Freeman Zhang

	
	


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20141201/0c8874e6/attachment.bin 

             reply	other threads:[~2014-12-01  9:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01  9:56 Freeman Zhang [this message]
2014-12-01  9:53 ` Debug Kernel Modules With KGDB Raghavendra
2014-12-01 11:02   ` Freeman Zhang
2014-12-01 11:17     ` Raghavendra
2014-12-01 11:30       ` Freeman Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=547C3B39.1050900@gmail.com \
    --to=freeman.zhang1992@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).