[RTEMS Project] #4985: Build error: building srg9xwm1

RTEMS trac trac at rtems.org
Tue Jan 30 21:51:25 UTC 2024


#4985: Build error: building srg9xwm1
-----------------------+---------------------------------------------
  Reporter:  Dustin    |      Owner:  (none)
      Type:  defect    |     Status:  new
  Priority:  normal    |  Milestone:
 Component:  tool/gdb  |    Version:  5
  Severity:  normal    |   Keywords:  gdb, build, completer, srg9xwm1
Blocked By:            |   Blocking:
-----------------------+---------------------------------------------
 I am attempting to build the RTEMS 5.3 toolset on Windows using MSYS2 with
 mingw64. I have been following the quick-start guide in the 5.3 user
 guide.

 I have included a source builder error report for reference.



 {{{
 #!div style="font-size: 80%"
 I entered the following command to initiate the build:
   {{{#!python
   ../source-builder/sb-set-builder --prefix=C:/msys64/home/<REDACT>/quick-
 start/rtems/5 5/rtems-sparc
   }}}
 }}}

 The build progressed as expected until building gdb-9.1.

 {{{
 #!div style="font-size: 80%"
 The error report indicated the following error:
   {{{#!python
 ../../gdb-9.1/gdb/completer.c: In function 'char*
 gdb_completion_word_break_characters_throw()':

 ../../gdb-9.1/gdb/completer.c:1933:10: error: invalid conversion from
 'const char*' to 'char*' [-fpermissive]

  1933 |   return rl_completer_word_break_characters;

       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

       |          |

       |          const char*
   }}}
 }}}



 Here is the referenced section of code from completer.c. Specifically
 "return rl_completer_word_break_characters;"

 {{{
 const char *
 gdb_completion_word_break_characters_throw ()
 {
   /* New completion starting.  Get rid of the previous tracker and
      start afresh.  */
   delete current_completion.tracker;
   current_completion.tracker = new completion_tracker ();

   completion_tracker &tracker = *current_completion.tracker;

   complete_line_internal (tracker, NULL, rl_line_buffer,
                           rl_point, handle_brkchars);

   if (tracker.use_custom_word_point ())
     {
       gdb_assert (tracker.custom_word_point () > 0);
       rl_point = tracker.custom_word_point () - 1;

       gdb_assert (rl_point >= 0 && rl_point < strlen (rl_line_buffer));

       gdb_custom_word_point_brkchars[0] = rl_line_buffer[rl_point];
       rl_completer_word_break_characters = gdb_custom_word_point_brkchars;
       rl_completer_quote_characters = NULL;

       /* Clear this too, so that if we're completing a quoted string,
          readline doesn't consider the quote character a delimiter.
          If we didn't do this, readline would auto-complete {b
          'fun<tab>} to {'b 'function()'}, i.e., add the terminating
          \', but, it wouldn't append the separator space either, which
          is not desirable.  So instead we take care of appending the
          quote character to the LCD ourselves, in
          gdb_rl_attempted_completion_function.  Since this global is
          not just completer-specific, we'll restore it back to the
          default in gdb_rl_attempted_completion_function.  */
       rl_basic_quote_characters = NULL;
     }

   return rl_completer_word_break_characters;
 }

 char *
 gdb_completion_word_break_characters ()
 {
   /* New completion starting.  */
   current_completion.aborted = false;

   try
     {
       return gdb_completion_word_break_characters_throw ();
     }
   catch (const gdb_exception &ex)
     {
       /* Set this to that gdb_rl_attempted_completion_function knows
          to abort early.  */
       current_completion.aborted = true;
     }

   return NULL;
 }
 }}}

--
Ticket URL: <http://devel.rtems.org/ticket/4985>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list