package com.android.internal.telephony.dataconnection;
public abstract class DcTrackerBase extends Handler {
protected BroadcastReceiver mIntentReceiver = new BroadcastReceiver ()
{
@Override
public void onReceive(Context context, Intent intent)
{
String action = intent.getAction();
if (DBG) log("onReceive: action=" + action);
[...]
In the above code, using jdb
, I'd like to set a breakpoint on the onReceive
method. I used the following command :
> stop in com.android.internal.telephony.dataconnection.DcTrackerBase$mIntentReceiver.onReceive
And I get this from jdb
:
> Deferring breakpoint com.android.internal.telephony.dataconnection.DcTrackerBase$mIntentReceiver.onReceive.
It will be set after the class is loaded.
I know that the class is already loaded, so I imagine that jdb is not finding the method I want. How should I set my breakpoint then ?
A breakpoint is a marker that you can set to specify where execution should pause when you are running your application in the IDE's debugger. Breakpoints are stored in the IDE (not in your application's code) and persist between debugging sessions and IDE sessions.
A breakpoint is a signal that tells the debugger to temporarily suspend execution of your program at a certain point in the code. To define a breakpoint in your source code, right-click in the left margin in the Java editor and select Toggle Breakpoint.
The wrangled method name is wrong.
In JDB, issue this command to inspect the DcTrackerBase
class :
> class com.android.internal.telephony.dataconnection.DcTrackerBase
Class: com.android.internal.telephony.dataconnection.DcTrackerBase
extends: android.os.Handler
subclass: com.android.internal.telephony.dataconnection.DcTracker
nested: com.android.internal.telephony.dataconnection.DcTrackerBase$1
As we can see, the nested class DcTrackerBase$1
could be our BroadcastReceiver
class. To verify, issue the following command :
> class com.android.internal.telephony.dataconnection.DcTrackerBase$1
Class: com.android.internal.telephony.dataconnection.DcTrackerBase$1
extends: android.content.BroadcastReceiver
That's it ! To set the breakpoint properly, we type :
> stop in com.android.internal.telephony.dataconnection.DcTrackerBase$1.onReceive
Set breakpoint com.android.internal.telephony.dataconnection.DcTrackerBase$1.onReceive
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With