User forums > Help

[Solved] C::B Watches window acting weird

(1/3) > >>

stuarte:
Hi,

I have developed a small C program to sort a 2d array of 4 strings.
Before sorting, the Watches window shows the array to have only two elements, names[0] and names[1].

In the Watches window :-
a) names[0] is shown to contain "Florida", '\000' <repeats 12 tiimes>, "Oregon", '\000' <repeats 13
b) names[1] is shown to contain "Georgia", '\000' <repeats 12 times>

The array entry for the third string, California, is missing from the Watches window.

After sorting, in the Watches window :-
names[0] is shown to contain "Florida", '\000' <repeats 12 times>, "California\000\000\000\000\0
names[1] is shown to contain "Georgia\000ia\000\000\000\000\000\000\000\000\000"
names[2] is shown to contain "Oregon", '\000' <repeats 13 times>

Why does the Watches window show only 2 array elements (i.e. names[0] and names[1]) before sorting and three array elements (i.e. names[0], names[1], and names[2]) after sorting ?

Why does the Watches window show more than one array element/string on the same line as though they are part of the same array element ?

Shouldn't the Watches window display each array element/string on its own line ?

BlueHazzard:
This is probably a parsing error.
Can you enable full debug logging (settings->debugger->Common->Full (Debug) log) and post the debug log (from the debugger tab at the log panel) after sorting the watches here?
Also can you post example code what you are using?

stuarte:
Hi BlueHazzard,

Than you for such a swift reply. First, the Watches window does not seem to allow "copy & paste" and so I am thereby unable to provide the contents of the Watches window here.

ASIDE: The site is not allowing me to attach two files to my reply. Could you please advise on how to fix this problem first.

Stuart

Pecan:

--- Quote from: stuarte on August 12, 2022, 04:03:04 pm ---Hi BlueHazzard,

Than you for such a swift reply. First, the Watches window does not seem to allow "copy & paste" and so I am thereby unable to provide the contents of the Watches window here.

ASIDE: The site is not allowing me to attach two files to my reply. Could you please advise on how to fix this problem first.

Stuart

--- End quote ---

I've had the "attach problem" before also. It was because there were utf8 chars in the text. Make sure the text has only ascii chars (values below 256).

stuarte:
Good morning all,

@Pecan: Very(!) early this morning I found out how to change the underlying encoding in C::B. This has allowed me to attach both files as required. I would never have guessed that the underlying encoding was the problem. Thank you very much for that "heads up".

@BlueHazzard: Now that the file attachment problem has been fixed, please find attached the debug log in file "debug_log.txt" and the offending code in file "main.txt". Please note that after changing the underlying encoding to ASCII the program was then rebuilt and executed. This change to the underlying encoding made no difference to how things appeared in the C::B Watches window. Consequently I have attached the full debug log obtained prior to this change to the underlying encoding.

Please also accept my apologies for the tardiness of this reply.

Stuart

Navigation

[0] Message Index

[#] Next page

Go to full version