[Bug gdb/18840] New: interp_exec doesn't use a cleanup

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/18840] New: interp_exec doesn't use a cleanup

giuliomoro at yahoo dot it
https://sourceware.org/bugzilla/show_bug.cgi?id=18840

            Bug ID: 18840
           Summary: interp_exec doesn't use a cleanup
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: dje at google dot com
  Target Milestone: ---

Filing this so I don't forget it.

interp_exec has this:

struct gdb_exception
interp_exec (struct interp *interp, const char *command_str)
{
  struct gdb_exception ex;
  struct interp *save_command_interp;

  gdb_assert (interp->procs->exec_proc != NULL);

  /* See `command_interp' for why we do this.  */
  save_command_interp = command_interpreter;
  command_interpreter = interp;

  ex = interp->procs->exec_proc (interp->data, command_str);

  command_interpreter = save_command_interp;

  return ex;
}

so it's assuming interp->procs->exec_proc won't throw an exception.
But MI's version calls bpstat_do_actions outside of any TRY/CATCH.
I don't see any guarantees that bpstat_do_actions won't throw an exception.
See mi_execute_command.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/18840] interp_exec doesn't use a cleanup

giuliomoro at yahoo dot it
https://sourceware.org/bugzilla/show_bug.cgi?id=18840

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |good-first-bug

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug gdb/18840] interp_exec doesn't use a cleanup

giuliomoro at yahoo dot it
In reply to this post by giuliomoro at yahoo dot it
https://sourceware.org/bugzilla/show_bug.cgi?id=18840

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |tromey at sourceware dot org
         Resolution|---                         |FIXED
   Target Milestone|---                         |8.3

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
This is fixed now:

  scoped_restore save_command_interp
    = make_scoped_restore (&ui_interp->command_interpreter, interp);

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