This is the mail archive of the gdb-prs@sources.redhat.com 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]

gdb/680: MI: uiout list/tuple nesting bug on MI_CMD_ERROR


>Number:         680
>Category:       gdb
>Synopsis:       MI: uiout list/tuple nesting bug on MI_CMD_ERROR
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 30 14:58:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Keith Seitz
>Release:        all
>Organization:
>Environment:
linux native; will exist in all configurations
>Description:
-data-list-register-names and the other register functions do stuff like:

   ui_out_list_begin (...);
   foreach register requested
    {
       if register number is invalid
          return MI_CMD_ERROR
       ui_out_field_string (uiout, "name", REGISTER_NAME (register));
    }

    ui_out_list_end (uiout);
    return MI_CMD_DONE;

So when an MI error occurs (one that doesn't occur via error()), the uiout still thinks that it is building a list. It fails to reset the uiout to some starting state with uiout->level = 0.
>How-To-Repeat:
$ ./gdb -i=mi -nw -nx -q
(gdb)
-data-list-register-names -1
^error,msg="bad register number"
(gdb)
-data-list-register-names -1
^error,msg="bad register number"
(gdb)
-data-list-register-names -1
^error,msg="bad register number"
(gdb)
-data-list-register-names -1
^error,msg="bad register number"
(gdb)
-data-list-register-names -1
&"../../src/gdb/ui-out.c:130: gdb-internal-error: push_level: Assertion
`uiout->level>= 0 && uiout->level < MAX_UI_OUT_LEVELS' failed.\n"
~"An internal GDB error was detected.  This may make further\n"
~"debugging unreliable.  Quit this debugging session? (y or n) "
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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