Hi,
I am facing some issue in debugging Android webkit.
Could anyone help me to solve the following issue:
I am working on Ubuntu 8.04 and downloaded android source code release
1.6.
I have built the code and launched emulator succcessfully.
I am tring to debug Webkit present in source code but there is some
problem.
I have followed all the following steps to make the debug setup :
1. Make sure that $PATH variable contains the paths to toolchain and
host side binaries.
2. ‘export PATH=$PATH:$SOURCE_ROOT/host/linux-x86/bin:$SOURCE_ROOT/
prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin’
3. Build Android with webcore and xml2 modules in debug mode.
* Copy buildspec.mk.default to $SOURCE_ROOT/buildspec.mk
* Edit the same and add following lines
i.
DEBUG_MODULE_libwebcore:=true
ii.
DEBUG_MODULE_libxml2:=true
iii.
TARGET_CUSTOM_DEBUG_CFLAGS:=-O0 -mlong-calls
1. Start the emulator.
2. Open DevTools->Development Settings from Android apps.
3. Select com.android.browser and check the “wait for debugger”
option. – This makes the app wait for debugger to be connected. Note
that this is jdb and not gdb. This lets the developer debug the early
application initialization code as well and so that gdbserver can be
attached to the process.
4. Redirect the tcp port 5039 (default one used by env setup
scripts, can be changed) from host to target by ‘telnetting’ the
emulator (Not the actual target).
‘telnet localhost:5554 (port number on which the emulator starts)’
‘redir add tcp:5039:5039’
This makes sure that host and target both share the same data
transferred to/fro over 5039 port.
1. Start ddms – Dalvik Debug Monitor Systems from the host side
tools.
2. Start adb shell.
3. From the emulator phone screen, start Browser application. Note
that this shows up the dialog box stating that the application is
waiting for the debugger client to be connected.
4. From adb shell, determine the pid of the browser process and
attach the gdbserver to the same.
‘gdbserver :5039 --attach <pid>’
This makes the application ready for C++ debugging (Code below the
dalvik VM in software architecture)
1. Now, from a different shell, at the $SOURCE_ROOT level, start
environment setup script provided by google.
* Edit the $SOURCE_ROOT/build/envsetup.sh
* At the end of all function definition, call a function
gdbclient.
* Run the script as ‘. build/envsetup.sh’
2. Now the gdb client has started and the control is in app_process.
Set the breakpoints in C++ code. Note that the breakpoints are to be
put using the sourcefile:linenumber format. For example,
b SOURCE_ROOT/external/webkit/WebKit/android/jni/webviewcode.cpp:1399
1. Now from a new shell, connect the jdb to device.
‘jdb –attach localhost:8700’
1. Now the application moves ahead and the control stops at the
specified breakpoints. From jdb, the java code can be debugged.
I have given the following command in gdb to set the breakpoint:
b /root/mydroid/external/webkit/WebkitTools/DumpRenderTree/gtk/
DumpRenderTree.cpp:138
But when i press enter it gives me the error like no such file or
directory.
I am not getting what exactly is the problem.
How to check whether the breakpoint is set or not?
If I dont press anything then there is no error.
After that when i start jdb and give run command I get the following
error:
VM Started:
Exception occurred: java.lang.ClassNotFoundException
(uncaught)"thread=main", java.net.URLClassLoader$1.run(), line=200
bci=72
When i searched on andoid groups for the same i get the solution to
unset the path.
I gave command 'classpath' on jdb then i got :
main[1] classpath
base directory: /root/mydroid
classpath: [.]
bootclasspath: [/usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/rt.jar, /
usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i18n.jar, /usr/lib/jvm/
java-1.5.0-sun-1.5.0.16/jre/lib/sunrsasign.jar, /usr/lib/jvm/
java-1.5.0-sun-1.5.0.16/jre/lib/jsse.jar, /usr/lib/jvm/java-1.5.0-
sun-1.5.0.16/jre/lib/jce.jar, /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/
lib/charsets.jar, /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/classes]
I am not getting what exactly i have to follow the steps.
Could anyone please help me out of this?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en