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. If you're bored on this Friday Afternoon

Vodafone UK are giving away an HTC Magic in their treasure hunt in the next 
hour. You just need to follow @vodafoneuk or #VFTH on Twitter (or use



* Written an Android App? - List it at *

Funky Android Limited is registered in England & Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 


2. How to draw a double underline in radioButton text

I need to draw a double underline in the text inside a RadioButton. I
can draw a "single underline" / "strikethrough" / etc using the flags
from the TextPaint class but I can't find how to draw a double

3. How can I get Browser's sharedpreference.?

4. is there video record intent in 1.5 like we got for Audio MediaStore.Audio.Media.RECORD_SOUND_ACTION

5. Anyone else got a post-Cupcake upgrade on their UK G1

6. Desktop synchronization of Android just like WM-phones

7. Android source 1.0