News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Cannot debug large arrays

Started by salexandru, December 01, 2017, 01:41:30 PM

Previous topic - Next topic

salexandru

Hi! I have a problem that bugged over the few monthss and I decided to share because this bug is not listed anywhere. When I try to enter large arrays in the watches I get in the value field "value requires 400012 bytes, which is more than max-value-size". What should I do, because this never occured to me until some time ago and I have a fresh installation of Ubuntu 16.04 LTS. As I said a little earlier, this bug is not documented anywhere. Please help me, this problem is frustrating.

stahta01

Please read the rules http://forums.next.codeblocks.org/index.php/topic,9996.0.html

Then, try to post an clear Code::Blocks question. I decided your question is a clear C::B Question; but, it is not one I understand.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

oBFusCATed

Quote from: stahta01 on December 01, 2017, 06:18:50 PM
I decided your question is a clear C::B Question; but, it is not one I understand.
Yes, it is valid question and the answer is below.

To enable unlimited arrays do Debug -> Information -> Print elements -> Unlimited. This is only available while the debugger is running.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

salexandru

Thanks for your help, but I cannot see the option. I tried with and without debugger active. Please tell me what I'm doing wrong. In the meanwhile, in the attachments there are some pictures of my debugger settings.

oBFusCATed

Steps to enable the option:
1. Start debugger
2. Stop on a breakpoint
3. Debug -> Information -> Print elements -> Unlimited
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

salexandru

Thank you for your help but it still doesn't work. The option was already on "Unlimited". Please see the photo in the attachments.

oBFusCATed

Then it is some gdb thing and some setting.
This command fixes it for me.

set max-value-size unlimited


But, are you really sure you want to see in the ui so many elements better approach is to just view parts of the array. See the options in right click->properties menu for the watch.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

salexandru

It's easier for me to see all an array's elements in one debug space instead of manually typing array[0], array[1], array[2] ... every time. Where exactly should I enter this command?

BlueHazzard

Quote from: salexandru on January 16, 2018, 04:45:06 PM
Where exactly should I enter this command?
In the debugger tab of the log windows at the bottom is a text control. Enter the gdb command and hit enter. But note: This will be painfull slow....

Quote from: salexandru on January 16, 2018, 04:45:06 PM
It's easier for me to see all an array's elements in one debug space instead of manually typing array[0], array[1], array[2] ... every time.
You do not have to do this by hand. As Obfuscated hinted you can a start point and a range in the properties of the watch....

salexandru

Thanks a lot. It worked! One more thing though: can I make this change persistent so that I can debug without entering everytime gdb set...?

BlueHazzard

Settings->Debugger->Default->Debugger initialization commands