how to build library without optimization in order to properly debug it

by dmitry » Fri, 13 Mar 2009 01:43:13 GMT

Sponsored Links

I'm trying to debug native library (in particular,
Everythig is going fine, breakpoint is being hit, I can go thru the
lines of RIL_onRequestComplete() function. But when I tried to print
out particular struct I got,

(gdb) print pRI
$2 = <value optimized out>
(gdb) print pRI->pCI
$3 = (android::._115 *) 0x613
(gdb) print pRI->pCI->requestNumber
Cannot access memory at address 0x613

I suspect it could be due to optimization done by compiler. But when I
tried to add,


into makefile of the lib, I've got another problem when I cannot
correctly set breakpoint on desired function. Instead of correct one,

(gdb) break RIL_onRequestComplete
Breakpoint 1 at 0xae402e4e: file hardware/ril/libril/ril.cpp, line

I got,

(gdb) break RIL_onRequestComplete
Breakpoint 1 at 0xffffab44: file bionic/libm/src/s_tanf.c, line 42.

Does anybody know what could be a problem, and what is the right way
to handle this?



Other Threads

1. Zip inflate error while scaning the /system/app

hi fadden,

i get this error only  when i enable the L2 cache on.
With L2 cache off i dont get this error.

Kishor Lala | ST Microelectronics |  Mobile Platform Application Unit India
 | Bangalore Design Centre |  +91 988 676 3453


2. VGA Out (for external monitor/projector)

+ Dev Phone 1



3. MyLocation blinking dot

4. kernel sensor drivers limitation

5. MapsApplication missing from source code?

6. Translators for German, Polish and Spanish

7. Help needed regarding Maps application in Emulator