GNU Debugger Does Not Display All Data in C ++ Structure

I use the WinPcap library with the C ++, Codelite, and GNU development tools. I have an IP4 structure describing an IP header. When I pass the packet data to the structure, I cannot see all this in the debugger, just random bits of data. For example, the source and destination addresses in the IP4 structure are not displayed in the debugger, but when I run the statements printf, they are displayed fine. Why does the debugger do this? Is the data type in the structure? I find that for the structure, you need to make sure that the data is valid. MinGW-4.4.1 and GNU gdb (GDB) 7.1

+3
source share
2 answers

Perhaps you should recompile the winpcap library with the -gstabs + gcc option. This will allow you to browse the library in the debugger. This option adds debugging characters that only gdb understands (and other debuggers will break), but provides the most comprehensive way to view the code.

0
source

The debugger takes care of the type of data structure. You will see the full data in the debugger only if you use the correct data type.

0
source

Source: https://habr.com/ru/post/1788738/


All Articles