Author Topic: Cannot debug large arrays  (Read 10562 times)

Offline salexandru

  • Single posting newcomer
  • *
  • Posts: 6
Cannot debug large arrays
« on: December 01, 2017, 01:41:30 pm »
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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Cannot debug large arrays
« Reply #1 on: December 01, 2017, 06:18:50 pm »
Please read the rules http://forums.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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Cannot debug large arrays
« Reply #2 on: December 01, 2017, 08:38:29 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!]

Offline salexandru

  • Single posting newcomer
  • *
  • Posts: 6
Re: Cannot debug large arrays
« Reply #3 on: December 02, 2017, 08:05:30 pm »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Cannot debug large arrays
« Reply #4 on: December 02, 2017, 09:03:59 pm »
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!]

Offline salexandru

  • Single posting newcomer
  • *
  • Posts: 6
Re: Cannot debug large arrays
« Reply #5 on: December 03, 2017, 12:55:19 pm »
Thank you for your help but it still doesn't work. The option was already on "Unlimited". Please see the photo in the attachments.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Cannot debug large arrays
« Reply #6 on: December 03, 2017, 09:18:03 pm »
Then it is some gdb thing and some setting.
This command fixes it for me.
Code
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!]

Offline salexandru

  • Single posting newcomer
  • *
  • Posts: 6
Re: Cannot debug large arrays
« Reply #7 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. Where exactly should I enter this command?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Cannot debug large arrays
« Reply #8 on: January 16, 2018, 04:53:11 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....

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....

Offline salexandru

  • Single posting newcomer
  • *
  • Posts: 6
Re: Cannot debug large arrays
« Reply #9 on: January 17, 2018, 09:07:39 am »
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...?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Cannot debug large arrays
« Reply #10 on: January 17, 2018, 12:25:33 pm »
Settings->Debugger->Default->Debugger initialization commands