1 /**[txh]********************************************************************
3 Copyright (c) 2004 by Salvador E. Tropea.
4 Covered by the GPL license.
6 Module: Miscellaneous commands.
8 GDB/MI commands for the "Miscellaneous Commands" section. @<p>
11 gdb command: Implemented?
19 GDB Bug workaround for "-gdb-show architecture": gdb 6.1 and olders doesn't
20 report it in "value", but they give the output of "show architecture". In
21 6.4 we observed that not even a clue is reported. So now we always use
24 ***************************************************************************/
29 /* Low level versions. */
31 void mi_gdb_exit(mi_h *h)
33 mi_send(h,"-gdb-exit\n");
36 void mi_gdb_version(mi_h *h)
38 mi_send(h,"-gdb-version\n");
41 void mi_gdb_set(mi_h *h, const char *var, const char *val)
43 mi_send(h,"-gdb-set %s %s\n",var,val);
46 void mi_gdb_show(mi_h *h, const char *var)
48 if (strcmp(var,"architecture")==0)
49 mi_send(h,"show %s\n",var);
51 mi_send(h,"-gdb-show %s\n",var);
54 /* High level versions. */
56 /**[txh]********************************************************************
59 Exit gdb killing the child is it is running.
63 ***************************************************************************/
65 void gmi_gdb_exit(mi_h *h)
68 mi_res_simple_exit(h);
71 /**[txh]********************************************************************
74 Send the version to the console.
79 ***************************************************************************/
81 int gmi_gdb_version(mi_h *h)
84 return mi_res_simple_done(h);
87 /**[txh]********************************************************************
95 ***************************************************************************/
97 int gmi_gdb_set(mi_h *h, const char *var, const char *val)
99 mi_gdb_set(h,var,val);
100 return mi_res_simple_done(h);
103 /**[txh]********************************************************************
109 Return: The current value of the variable or NULL on error.
111 ***************************************************************************/
113 char *gmi_gdb_show(mi_h *h, const char *var)
116 return mi_res_value(h);