From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE,WEIRD_QUOTING autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!news.mb-net.net!open-news-network.org!news.mind.de!bolzen.all.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Is this my failure or of the compiler's debugger Date: Tue, 10 Jan 2023 20:12:07 +0200 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net 0QZ5GqeV5GS5kuMiqZwFuQXhGyZTMBXvKmaLENUU4+LR04jvCC Cancel-Lock: sha1:r6ppbM+U7DoMr+6N8xQSeN1Udwc= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:64789 List-Id: On 2023-01-10 15:16, ldries46 wrote: > I try to create a program that read Unbounded strings from a file in the > loop: >       Open(C_File, In_File, To_String(Inp_File)); >       while not End_of_File(C_File) loop >          str_line_n := To_Unbounded_String(Get_Line(C_File)); >          Buffer_GL.Set_Buffer(str_line_n); -- breakpoint on this line >          glade_lines := glade_lines + 1; >       end loop; >       Close(C_File); > where str_line_n is of the type Unbounded_String. > I used a test file with the below presented three text lines: > Line 1 abcdef9876543210 > Line 2 " abcdef"9876543210 > Line 3 "abc"de"f"9876543210 > > In the debugger the results were: > "Line 1 abcdef 9876543210" > "Line 2 "" abcdef"" 98765432" > "Line 3 ""abc""de ""f""987654" It seems that the debugger displays the strings in the form of Ada string literals, which are enclosed in quotes (") and within which each quote character has to be duplicated (to show that it is not the terminating quote). So the duplication of the quotes is nothing to worry about. If you were to print out the strings (with Ada.Text_IO) they should appear just as in the input, with only the original quote characters. However, your example also shows some extra blank spaces in the debugger output, for example: Input : Line 1 abcdef9876543210 Debugger: "Line 1 abcdef 9876543210" There seems to be a new blank space between 'f' and '9'. Are you sure that you presented the input and output correctly?