Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Variables viewer on Eclipse debugging truncates the string values [duplicate]

Tags:

I'm debugging Python code and when I try to show the contents of an string variable its showed truncated...

How can show the full contents of a variable debugging Python code with PyDev on Eclipse?

like image 201
FerranB Avatar asked Jul 07 '10 23:07

FerranB


People also ask

How can you see variable references while debugging in Eclipse?

While debugging you can use the "Display" window where you can write pieces of code and "execute" them with inspect (highlight the code -> right click -> inspect). In that window you have access to all variables of the breakpoint's context.


2 Answers

If you right-click on the details pane in either the "Variables" view or the "Expressions" view, there is a Max Length... menu option. You can enter a number there to configure the truncation of string output. Keep in mind that the calculated length includes the type identifier at the beginning, so str: 12345 is actually 10 characters, not 5.

There seems to be a hard limit of 1000 characters, even when entering 0, which the field description claims means "unlimited," so no matter what you put in, you will never see more than 1000 characters. I don't know if that's a known issue or not; I have not looked into it. For strings or other variables longer than this, I generally use the logging module from the standard library and send the string to a log file or stderr.

like image 86
AdmiralNemo Avatar answered Oct 19 '22 15:10

AdmiralNemo


Use interactive commands for printing your big variables and don't rely on variables view. Check how to do it at aptana pydev debug console.

like image 23
dim Avatar answered Oct 19 '22 15:10

dim