old-cross-binutils/gdb/mi
Keith Seitz 6be47f0c48 Fix for PR mi/15863
If an MI client creates a varobj and attempts to update the root
/before/ the inferior is started, gdb will throw an internal error:

(gdb)
-var-create * - batch_flag
^done,name="var1",numchild="0",value="0",type="int",has_more="0"
(gdb)
-var-update var1
^done,changelist=[]
(gdb)
-var-update *
~"../../src/gdb/thread.c:628: internal-error: is_thread_state: Assertion `tp' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nQuit this debugging session? "
~"(y or n) "

The function that handles the varobj update in the failing case,
mi_cmd_var_udpate_iter, checks if the thread/inferior is stopped before
attempting to update the varobj. It calls is_stopped (inferior_ptid)
which calls is_thread_state:

    tp = find_thread_ptid (ptid);
    gdb_assert (tp);

When there is no inferior, ptid is null_ptid, and find_thread_ptid (null_ptid)
returns NULL and the assertion is triggered.

This patch changes mi_cmd_var_update_iter to behave the same way
"-var-update var1" does: by calling the thread "stopped" if
there is no inferior (and thereby calling varobj_update_one).

ChangeLog
2014-06-16  Keith Seitz  <keiths@redhat.com>

	PR mi/15863
	* mi/mi-cmd-var.c (mi_cmd_var_update_iter): Do not attempt
	to update the varobj if inferior_ptid is null_ptid.

testsuite/ChangeLog
2014-06-16  Keith Seitz  <keiths@redhat.com>

	PR mi/15863
	* gdb.mi/mi-var-cmd.exp: Add test for -var-update before
	the inferior is started.
2014-06-16 11:38:19 -07:00
..
ChangeLog-1999-2003
mi-cmd-break.c
mi-cmd-break.h
mi-cmd-catch.c
mi-cmd-disas.c
mi-cmd-env.c
mi-cmd-file.c
mi-cmd-info.c
mi-cmd-stack.c
mi-cmd-target.c
mi-cmd-var.c Fix for PR mi/15863 2014-06-16 11:38:19 -07:00
mi-cmds.c fix two latent type errors 2014-05-19 14:17:16 -06:00
mi-cmds.h
mi-common.c
mi-common.h PR gdb/13860 - Make MI sync vs async output (closer to) the same. 2014-05-29 13:09:45 +01:00
mi-console.c mi: Use the value in mi_console_file->quote as the quoting character 2014-05-12 15:44:19 -04:00
mi-console.h
mi-getopt.c
mi-getopt.h
mi-interp.c PR mi/15806: Fix quoting of async events 2014-06-05 17:59:46 -04:00
mi-main.c enable target async by default; separate MI and target notions of async 2014-05-29 14:38:02 +01:00
mi-main.h enable target async by default; separate MI and target notions of async 2014-05-29 14:38:02 +01:00
mi-out.c
mi-out.h
mi-parse.c
mi-parse.h
mi-symbol-cmds.c