Why cannot only the "rtl8139_rx" function be setted breakpoint on whereas the others can?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Why cannot only the "rtl8139_rx" function be setted breakpoint on whereas the others can?
# 1  
Old 11-02-2011
Why cannot only the "rtl8139_rx" function be setted breakpoint on whereas the others can?

Dear all:
Code:
(gdb) add-symbol-file /home/likunlun/rtl8139_driver.ko 0xf80e5000 -s .bss 0xf80e72d4 -s .data 0xf80e70e0
add symbol table from file "/home/likunlun/rtl8139_driver.ko" at
    .text_addr = 0xf80e5000
    .bss_addr = 0xf80e72d4
    .data_addr = 0xf80e70e0
(y or n) y
Reading symbols from /home/likunlun/rtl8139_driver.ko...done.
(gdb) 

(gdb) b rtl8139_start_xmit
Breakpoint 1 at 0xf80e501e: file /home/liklstar/programs/rtl8139/rtl8139_driver.c, line 450.
(gdb) b rtl8139_stop
Breakpoint 2 at 0xf80e5d6d: file /home/liklstar/programs/rtl8139/rtl8139_driver.c, line 433.
(gdb) b rtl8139_interrupt
Breakpoint 3 at 0xf80e5644: file /home/liklstar/programs/rtl8139/rtl8139_driver.c, line 520.
(gdb) 

(gdb) b rtl8139_rx
Function "rtl8139_rx" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) 



*****************In rtl8139_driver.c**********************
... ...
 36 static void rtl8139_hw_start(struct net_device *dev);
 37 static int rtl8139_open (struct net_device *dev);
 38 static int rtl8139_stop (struct net_device *rtl8139_dev);
 39 static int rtl8139_start_xmit(struct sk_buff *skb, struct net_device *dev);
 40 static struct net_device_stats *rtl8139_get_stats(struct net_device *dev);
 41 static int rtl8139_init (struct pci_dev *pdev, struct net_device *dev_out);
 42 static int rtl8139_rx (struct net_device *dev, unsigned int pkt_size);
 43 static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance);
... ...

Why cannot only the "rtl8139_rx" function be setted breakpoint on whereas the others can? All these function are defined in rtl8139_driver.c!

Last edited by Scott; 11-04-2011 at 05:37 AM.. Reason: Use code tags, please...
# 2  
Old 11-02-2011
These are all static functions, which I think adds a _ in front of the symbol.
# 3  
Old 11-02-2011
Hi, corona688:

thanks a lot!

But where shoud I type the "_" at? Give me an exmple please!
# 4  
Old 11-02-2011
In the front of the symbol.

_functionname
# 5  
Old 11-03-2011
Dear corona688:

I type the "_" in front of the symbol(functionname) as you direct, but the debugger report error!
Code:
(gdb) add-symbol-file /home/likunlun/rtl8139_driver.ko 0xf80cf000 -s .bss 0xf80d13d4 -s .data 0xf80d11e0
add symbol table from file "/home/likunlun/rtl8139_driver.ko" at
    .text_addr = 0xf80cf000
    .bss_addr = 0xf80d13d4
    .data_addr = 0xf80d11e0
(y or n) y
Reading symbols from /home/likunlun/rtl8139_driver.ko...done.
(gdb) 

(gdb) b rtl8139_open
Breakpoint 1 at 0xf80cf334: file /home/liklstar/programs/rtl8139/rtl8139_driver.c, line 269.
(gdb) b rtl8139_start_xmit
Breakpoint 2 at 0xf80cf01e: file /home/liklstar/programs/rtl8139/rtl8139_driver.c, line 462.
(gdb) 

(gdb) delete
删除所有断点吗? (y or n) y
(gdb) b _rtl8139_open
Function "_rtl8139_open" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) b _rtl8139_start_xmit
Function "_rtl8139_start_xmit" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n

(gdb) b rtl8139_rx
Function "rtl8139_rx" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) b _rtl8139_rx
Function "_rtl8139_rx" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) 


Last edited by Scott; 11-04-2011 at 05:38 AM.. Reason: Added code tags (again!)
# 6  
Old 11-03-2011
See the symbols in a module with objdump -t:

Code:
$ objdump -t /lib/modules/2.6.27-gentoo-r8/kernel/drivers/net/tun.ko
tun.ko:     file format elf32-i386

SYMBOL TABLE:
00000000 l    d  .note.gnu.build-id     00000000 .note.gnu.build-id
00000000 l    d  .text  00000000 .text
00000000 l    d  .init.text     00000000 .init.text
00000000 l    d  .altinstr_replacement  00000000 .altinstr_replacement
00000000 l    d  .rodata        00000000 .rodata
00000000 l    d  .smp_locks     00000000 .smp_locks
00000000 l    d  .rodata.str1.1 00000000 .rodata.str1.1
00000000 l    d  __bug_table    00000000 __bug_table
00000000 l    d  .altinstructions       00000000 .altinstructions
00000000 l    d  .modinfo       00000000 .modinfo
00000000 l    d  .data  00000000 .data
00000000 l    d  .gnu.linkonce.this_module      00000000 .gnu.linkonce.this_module
00000000 l    d  .bss   00000000 .bss
00000000 l    d  .comment       00000000 .comment
00000000 l    d  .note.GNU-stack        00000000 .note.GNU-stack
00000000 l    df *ABS*  00000000 tun.c
00000000 l     F .text  00000005 tun_net_mclist
00000005 l     F .text  0000002c tun_net_change_mtu
00000031 l     F .text  00000037 tun_chr_poll
00000068 l     F .text  0000003d tun_get_settings
000000a5 l     F .text  0000000a tun_get_msglevel
000000af l     F .text  00000005 tun_set_msglevel
000000b4 l     F .text  0000001a tun_set_rx_csum
000000ce l     F .text  0000001e tun_cleanup
00000000 l     O .data  0000001c tun_miscdev
00000000 l     O .bss   00000004 tun_net_id
0000001c l     O .data  00000010 tun_net_ops
000000ec l     F .text  00000079 tun_chr_fasync
00000165 l     F .text  0000001c tun_chr_open
00000181 l     F .text  00000063 tun_chr_close
000001e4 l     F .text  00000012 tun_net_open
000001f6 l     F .text  0000004c tun_exit_net
00000242 l     F .text  0000004d tun_init_net
00000000 l     F .init.text     00000083 tun_init
0000028f l     F .text  0000025d tun_chr_aio_read
000004ec l     F .text  00000722 tun_chr_ioctl
0000110d l     F .text  00000080 tun_setup
00000c0e l     F .text  000003c6 tun_chr_aio_write
00000fd4 l     F .text  00000139 tun_net_xmit
0000120c l     F .text  00000012 tun_net_close
00000000 l     O .rodata        000000b4 tun_ethtool_ops
0000118d l     F .text  00000060 tun_get_drvinfo
000011ed l     F .text  0000000b tun_get_link
000011f8 l     F .text  00000014 tun_get_rx_csum
00000000 l     O .modinfo       00000018 __mod_alias1277
00000018 l     O .modinfo       0000000c __mod_license1276
00000040 l     O .modinfo       00000039 __mod_author1275
00000080 l     O .modinfo       0000002c __mod_description1274
000000c0 l     O .rodata        0000006c tun_fops
00000000 l    df *ABS*  00000000 tun.mod.c
000000c0 l     O .modinfo       00000009 __module_depends
000000e0 l     O .modinfo       0000002d __mod_vermagic5
00000000         *UND*  00000000 strcpy
00000000         *UND*  00000000 rtnl_unlock
00000000         *UND*  00000000 misc_deregister
00000000         *UND*  00000000 copy_from_user
00000000         *UND*  00000000 skb_put
00000000         *UND*  00000000 rtnl_is_locked
00000000         *UND*  00000000 skb_copy_datagram_from_iovec
00000000 g     O .gnu.linkonce.this_module      00000240 __this_module
00000000         *UND*  00000000 __netif_schedule
00000000         *UND*  00000000 skb_dequeue
00000000         *UND*  00000000 kill_fasync
00000000         *UND*  00000000 memcpy_fromiovec
00000000         *UND*  00000000 __alloc_pages_internal
000000ce g     F .text  0000001e cleanup_module
00000000         *UND*  00000000 dev_alloc_name
00000000         *UND*  00000000 do_sync_write
00000000         *UND*  00000000 kfree
00000000         *UND*  00000000 add_wait_queue
00000000         *UND*  00000000 __wake_up
00000000         *UND*  00000000 init_waitqueue_head
00000000         *UND*  00000000 bitrev32
00000000         *UND*  00000000 skb_copy_datagram_iovec
00000000         *UND*  00000000 __dev_get_by_name
00000000         *UND*  00000000 ether_setup
00000000         *UND*  00000000 netdev_features_change
00000000 g     F .init.text     00000083 init_module
00000000         *UND*  00000000 eth_type_trans
00000000         *UND*  00000000 dump_stack
00000000         *UND*  00000000 do_sync_read
00000000         *UND*  00000000 kfree_skb
00000000         *UND*  00000000 schedule
00000000         *UND*  00000000 alloc_netdev_mq
00000000         *UND*  00000000 __alloc_skb
00000000         *UND*  00000000 __put_user_4
00000000         *UND*  00000000 memcpy_toiovec
00000000         *UND*  00000000 kmem_cache_alloc
00000000         *UND*  00000000 capable
00000000         *UND*  00000000 skb_queue_tail
00000000         *UND*  00000000 unlock_kernel
00000000         *UND*  00000000 contig_page_data
00000000         *UND*  00000000 crc32_le
00000000         *UND*  00000000 strncmp
00000000         *UND*  00000000 fasync_helper
00000000         *UND*  00000000 copy_to_user
00000000         *UND*  00000000 free_netdev
00000000         *UND*  00000000 lock_kernel
00000000         *UND*  00000000 printk
00000000         *UND*  00000000 dev_set_mac_address
00000000         *UND*  00000000 netif_rx_ni
00000000         *UND*  00000000 skb_queue_purge
00000000         *UND*  00000000 misc_register
00000000         *UND*  00000000 __f_setown
00000000         *UND*  00000000 default_wake_function
00000000         *UND*  00000000 register_pernet_gen_device
00000000         *UND*  00000000 jiffies
00000000         *UND*  00000000 skb_partial_csum_set
00000000         *UND*  00000000 no_llseek
00000000         *UND*  00000000 rtnl_lock
00000000         *UND*  00000000 remove_wait_queue
00000000         *UND*  00000000 get_random_bytes
00000000         *UND*  00000000 net_assign_generic
00000000         *UND*  00000000 strchr
00000000         *UND*  00000000 unregister_netdevice
00000000         *UND*  00000000 unregister_pernet_gen_device
00000000         *UND*  00000000 __kmalloc
00000000         *UND*  00000000 kmalloc_caches
00000000         *UND*  00000000 per_cpu__current_task
00000000         *UND*  00000000 register_netdevice

$

# 7  
Old 11-03-2011
Hi, corona688:

What's your meaning? Could you explain it in detail?


li, kunlun
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

7. HP-UX

ERROR: more than one instance of overloaded function "vprintf" has "C" linkage

Hi people! I've got this own library: -------------------------------------------- Personal.h -------------------------------------------- #ifdef __cplusplus extern "C" { #endif #include <stdio.h> #include <stdarg.h> #include <string.h> ... (0 Replies)
Discussion started by: donatoll
0 Replies

8. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

9. Programming

How to convert the "select" function into a "poll" function

i have a program using the select function but i want to convert it to poll... how can i do this? thanks in advance... :) (1 Reply)
Discussion started by: rbolante
1 Replies
Login or Register to Ask a Question