public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug mi/18833] New: gdb.execute ("set param value", to_string=True) will crash gdb if using MI
@ 2015-08-17  1:35 xdje42 at gmail dot com
  2015-08-17  2:08 ` [Bug mi/18833] " xdje42 at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: xdje42 at gmail dot com @ 2015-08-17  1:35 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug mi/18833] gdb.execute ("set param value", to_string=True) will crash gdb if using MI
  2015-08-17  1:35 [Bug mi/18833] New: gdb.execute ("set param value", to_string=True) will crash gdb if using MI xdje42 at gmail dot com
@ 2015-08-17  2:08 ` xdje42 at gmail dot com
  2015-08-17 22:09 ` dje at google dot com
  2015-08-22 17:09 ` xdje42 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: xdje42 at gmail dot com @ 2015-08-17  2:08 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Doug Evans <xdje42 at gmail dot com> ---
The cli version of uiout redirection support handles multiple levels of
redirection.

static int
cli_redirect (struct ui_out *uiout, struct ui_file *outstream)
{
  cli_out_data *data = ui_out_data (uiout);

  if (outstream != NULL)
    VEC_safe_push (ui_filep, data->streams, outstream);
  else
    VEC_pop (ui_filep, data->streams);

  return 0;
}

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug mi/18833] gdb.execute ("set param value", to_string=True) will crash gdb if using MI
  2015-08-17  1:35 [Bug mi/18833] New: gdb.execute ("set param value", to_string=True) will crash gdb if using MI xdje42 at gmail dot com
  2015-08-17  2:08 ` [Bug mi/18833] " xdje42 at gmail dot com
@ 2015-08-17 22:09 ` dje at google dot com
  2015-08-22 17:09 ` xdje42 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: dje at google dot com @ 2015-08-17 22:09 UTC (permalink / raw)
  To: gdb-prs

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

dje at google dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dje at google dot com

--- Comment #2 from dje at google dot com ---
For a previous patch, see:

https://sourceware.org/ml/gdb-patches/2015-08/msg00438.html

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug mi/18833] gdb.execute ("set param value", to_string=True) will crash gdb if using MI
  2015-08-17  1:35 [Bug mi/18833] New: gdb.execute ("set param value", to_string=True) will crash gdb if using MI xdje42 at gmail dot com
  2015-08-17  2:08 ` [Bug mi/18833] " xdje42 at gmail dot com
  2015-08-17 22:09 ` dje at google dot com
@ 2015-08-22 17:09 ` xdje42 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: xdje42 at gmail dot com @ 2015-08-22 17:09 UTC (permalink / raw)
  To: gdb-prs

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

Doug Evans <xdje42 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Doug Evans <xdje42 at gmail dot com> ---
Patch checked in.

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-22 17:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-17  1:35 [Bug mi/18833] New: gdb.execute ("set param value", to_string=True) will crash gdb if using MI xdje42 at gmail dot com
2015-08-17  2:08 ` [Bug mi/18833] " xdje42 at gmail dot com
2015-08-17 22:09 ` dje at google dot com
2015-08-22 17:09 ` xdje42 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).