This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/10868] New: 'end' of user comment block is ignored if the 'end' statement has leading spaces


Some of my gdbinit user defined commands stoped working on v7.0 (they used to
work on v6.8). I found the following to be the cause.

In gdb v6.8, the init file processing logic was in
cli/cli-script.c:read_next_line(). The following code ignores all leading (and
trailing) spaces.

  841    /* Strip leading and trailing whitespace.  */
  842    while (*p == ' ' || *p == '\t')
  843      p++;
  844   845    p1 = p + strlen (p);
  846    while (p1 != p && (p1[-1] == ' ' || p1[-1] == '\t'))
  847      p1--;

In gdb v7.0, the processing logic was in cli/cli-script.c:process_next_line().
Apparently, the leading spaces are ignored only for commands and not for
comments. So, if I had a comment section with and 'end' having prefixed spaces,
gdb did not treat it as end of comment section.

  888    if (parse_commands)
  889      {
  890        /* Strip leading whitespace.  */
  891        while (*p == ' ' || *p == '\t')
  892          p++;
  893      }

-- 
           Summary: 'end' of user comment block is ignored if the 'end'
                    statement has leading spaces
           Product: gdb
           Version: 7.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: gdb
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: james dot pandavan at gmail dot com
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=10868

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]