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 mi/18833] New: gdb.execute ("set param value", to_string=True) will crash gdb if using MI


https://sourceware.org/bugzilla/show_bug.cgi?id=18833

            Bug ID: 18833
           Summary: gdb.execute ("set param value", to_string=True) will
                    crash gdb if using MI
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mi
          Assignee: unassigned at sourceware dot org
          Reporter: xdje42 at gmail dot com
  Target Milestone: ---

I'm getting a gdb crash due to executing the following from python while using
MI:

gdb.execute ("set debug-file-dir /foo:/bar", to_string=True)

The problem is that MI only supports one level of redirection:

int
mi_redirect (struct ui_out *uiout, struct ui_file *outstream)
{
  mi_out_data *data = ui_out_data (uiout);

  if (outstream != NULL)
    {
      data->original_buffer = data->buffer;
      data->buffer = outstream;
    }
  else if (data->original_buffer != NULL)
    {
      data->buffer = data->original_buffer;
      data->original_buffer = NULL;
    }

  return 0;
}

So when gdb calls mi_command_param_changed, the redirection there loses the
original buffer. The first level of redirection is due to to_string=True.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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