Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 26
Registered: ‎11-03-2009
My Device: BB Storm 2 9550 v5.0.0.713 (Platform 4.2.0.323)
My Carrier: Verizon

Device Debugging - null variable values

I recall reading someone else having this issue at one time, but, I can't seem to find that post.

 

I am having an issue trying to debug my application on a device (Storm 2). I get the debugger running and I can step through the code running on the device, but, all of the variables show up as null. Obviously, this makes it a bit difficult to debug Smiley Happy.

 

Could some kind soul point me in the right direction to view the actual value of these variables? Heck, I'll even take pointers from a mean soul at this point...

 

IDE: Eclipse plug-in v1.1.2.201003212304-12 (5.0.0.25)

Device: Storm 2 - 9550 v5.0.0.607 (Platform 4.2.0.275)

 

-Mohkev

 

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Device Debugging - null variable values

I have more luck with System.out.printlin() when it comes to on-device debugging.

 

You can attach to the device single-step with the debugger, and view your variables in the output window.

 

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Device Debugging - null variable values

I think the post you were thinking of was resolved because the data was not being returned.  The poster thought that this was a bug in the OS, but he had missed the lack of response, and the debugger was not being helpful with him finding it. 

 

When the variable show up as null, you mean they actually say null, or the debugger is telling  you it doesn't understand them>

 

Does this apply to your objects, or RIM objects (like Strings). 

 

if so, the likely problem is that the debug files on Eclipse don't match those for the device, so the debugger can't interpret the objects correctly.

 

I must admit, I don't know how t resolve this problem, but can you confirm this is actually what your problem is?

Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Device Debugging - null variable values

I have a feeling that is what it is because I get the same issue. Plug the device into the computer, debugger says debug files don't match, everything says that it is null.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
New Developer
Posts: 18
Registered: ‎08-27-2010
My Device: Torch
My Carrier: Rogers

Re: Device Debugging - null variable values

Is there any known resolution for this? I am trying to debug using the Eclipse Plug In Mac beta and all of the variables show up as null, though I get no other error messages.

New Developer
Posts: 26
Registered: ‎11-03-2009
My Device: BB Storm 2 9550 v5.0.0.713 (Platform 4.2.0.323)
My Carrier: Verizon

Re: Device Debugging - null variable values

To tell you the truth, I don't recall. It could have been objects out of sync like Peter suggested. I would have thought that I would have marked this thread as solved, though. But, quite frankly, I barely remember this problem.  Sorry, I wish I had a better answer.

New Developer
Posts: 18
Registered: ‎08-27-2010
My Device: Torch
My Carrier: Rogers

Re: Device Debugging - null variable values

Well it's pretty consistent for objects out of sync. It happens every time regardless of the code involved.

New Developer
Posts: 53
Registered: ‎06-07-2011
My Device: 9800 torch
My Carrier: o2

Re: Device Debugging - null variable values

Don't like to bring up old threads but this is exactly the problem I'm having. Even with java objects like Vector, it still shows null

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Device Debugging - null variable values

Do you have the matching debug files?  If not, then the debugger does not know how to handle the Objects. 

 

I've also got very squiffy results sometimes when the code I had in the Development Environment had been updated, so was not the same as that on the device.  Perhaps you could do a Build, sign and put it on the device and see if that helps anything?   

New Developer
Posts: 53
Registered: ‎06-07-2011
My Device: 9800 torch
My Carrier: o2

Re: Device Debugging - null variable values

i did what rexDoug said, with breakpoints just after/before the output.

 

I think they are the same, its the same version of firmware for the sim as on the phone