Code::Blocks Forums

User forums => Help => Topic started by: visir on July 13, 2017, 11:34:02 am

Title: [solved]debugger, printing huge struct hangs debugger
Post by: visir on July 13, 2017, 11:34:02 am
Looks like gdb expands all fields and subfields in any structure I'm printing. One of those is so big, it hangs debugger. Any gdb option to disable here?

It's more like a gdb question though.
Title: Re: debugger, printing huge struct hangs debugger
Post by: visir on July 13, 2017, 12:53:24 pm
This link (https://stackoverflow.com/questions/20933946/gdb-freezing-when-print-variables-with-tab-completion) just tells me to update to the lastest gdb. Can't really update, this issue (http://forums.codeblocks.org/index.php/topic,21974.msg149469.html#msg149469) probably wasn't solved yet. In short, downgraded to a very old version of gdb because codeblocks and recent gdb had problems with "two commands at once".

This can wait, don't hurry. Actually, watch t (https://www.youtube.com/watch?v=pDBA2_lyxJw)h (https://www.youtube.com/watch?v=P6dUCOS1bM0)i (https://www.youtube.com/watch?v=HU2ftCitvyQ)s (https://www.youtube.com/watch?v=FG6iF7fPzkU) when you're bored. You guys are awesome.
Title: Re: debugger, printing huge struct hangs debugger
Post by: visir on July 13, 2017, 03:04:51 pm
Actually, adding it to watches helped.

Actually no, it still hangs.
Title: Re: debugger, printing huge struct hangs debugger
Post by: oBFusCATed on July 13, 2017, 03:27:50 pm
With the current debugger plugin this problem cannot be solved. In the future it will probably work, but I don't know when.
Title: Re: debugger, printing huge struct hangs debugger
Post by: visir on July 13, 2017, 03:35:54 pm
Well, I got what I paid for.
Title: Re: debugger, printing huge struct hangs debugger
Post by: ollydbg on July 14, 2017, 04:44:00 am
If I remember correctly, GDB has some option to "disable" expanding the sub-fields of a struct.
Another way of solving this problem is write a simple Pretty printer for the struct(in the pretty printer, you can print any thing you want), see GDB's document for more informations. Writing pretty printer is not hard.
Title: Re: debugger, printing huge struct hangs debugger
Post by: visir on July 21, 2017, 04:49:29 pm
set print elements 3

It was set to unlimited before. Now it works.

https://sourceware.org/gdb/current/onlinedocs/gdb/Print-Settings.html#Print-Settings