Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Failed to set breakpoint in gdb console: (5 Items)
   
Failed to set breakpoint in gdb console  
Hello,

I am developing one wlan Wifi Driver which is built out as devnp-qcwlan.so, I wan trying to debug this shared library in
 IDE.
first, I successfully attached this shared library devnp-qcwlan.so to process io-pkt-v6-hc, IDE stop somewhere
second, i was trying to set breakpoint by 'b wlan_hdd_entry', this function would be hit once wlan driver is loaded.
but i got error message 'can not access memory at address 0x11de38'

How do I fix the issue?

thanks
- wenbin
Re: Failed to set breakpoint in gdb console  
Re: Failed to set breakpoint in gdb console  
sorry, how to set PATH and LD_LIBRARY_PATH?
are these 2 variables in target or host?
Re: Failed to set breakpoint in gdb console  
Debugging network drivers or other dll's.

Note: if debugging networking qconn or pdebug has to be on another network stack. Instructions below do not apply to 
debuging over serial port.

If you using SDP 6.6 armv7le platform you need
- gdb patch for 6.6 from foundry (we have a patch for arm)
- patched IDE for 6.6 (at least of IDE or gdb has to be patched, for x86 only no need for patches)

Then in Momenitcs IDE
1) Create attach configuration for io-pkt, specify io-pkt binary from SDP (io-pkt used as example, use full binary name)

2) Run this configuration and attach to io-pkt. It will stop somewhere and show assembly.
3) Open gdb console from IDE (click on gdb "child" of the debugged process in Debug view, it should open gdb console)
4) In gdb console type
b function_name
where <function_name> is the function in your driver that you expect to execute first.
You should see the message that pending breakpoint is installed. Or you can put breakpoint on "dlsym" function if you 
don't know what function in your dll it will hit.
5) Resume the process
6) On device run mount command to load the driver. Or run any command that will activate it.
7) Breakpoint should be hit now. If not press Pause button. Go to gdb console and type
info shared
You should see your dll in list of loaded libraries. If not something is not right. It also should show that symbols are
 loaded.
Something like
warning: Could not load shared library symbols for libbar.so.
Do you need "set solib-search-path" or "set sysroot"?
From                To                  Syms Read   Shared Object Library

                                        No          libbar.so
0x0000004000000000  0x00000040002ba7b8  No          /Develop/staging/mainline/target/qnx7/x86_64/lib/libc.so.3   

8) Now you can type command to load symbols for this library, by setting the path on where to find symbols, i.e.
set solib-search-path /Develop/runtime-wipe/bar/build/x86_64-debug/
It would reply something like
Reading symbols from /Develop/runtime-wipe/bar/build/x86_64-debug/libbar.so...done.

9) Now you can insert breakpoint/and continue debugging.

If you do that alot save these command into .gdbini file and specify full path to this file in IDE launch configuration
                                                                                      
Re: Failed to set breakpoint in gdb console  
Hi Elena,

thanks for your reply!

sorry, i did not find gdb patch for 6.6, I got one build version IDE 5.0.1 (GA build), i am not sure if this version 
include the gdb patch you said.

actually i got these steps from QNX support team, but i failed to set break point in step 4 
4) In gdb console type
b function_name
where <function_name> is the function in your driver that you expect to execute first.

the command i put is "b wlan_hdd_entry", this function is the entry of our wlan driver.
the error is "Cannot access memory at address 0x11de38 ", 

actually i do not think I could set break point in my wlan driver at this moment because my wlan driver is not loaded at
 this step.

so i am wondering what I should do before step 4?

thanks
- wenbin