xref: /dflybsd-src/contrib/gdb-7/gdb/go-lang.h (revision de8e141f24382815c10a4012d209bbbf7abf1112)
1*ef5ccd6cSJohn Marino /* Go language support definitions for GDB, the GNU debugger.
2*ef5ccd6cSJohn Marino 
3*ef5ccd6cSJohn Marino    Copyright (C) 2012-2013 Free Software Foundation, Inc.
4*ef5ccd6cSJohn Marino 
5*ef5ccd6cSJohn Marino    This file is part of GDB.
6*ef5ccd6cSJohn Marino 
7*ef5ccd6cSJohn Marino    This program is free software; you can redistribute it and/or modify
8*ef5ccd6cSJohn Marino    it under the terms of the GNU General Public License as published by
9*ef5ccd6cSJohn Marino    the Free Software Foundation; either version 3 of the License, or
10*ef5ccd6cSJohn Marino    (at your option) any later version.
11*ef5ccd6cSJohn Marino 
12*ef5ccd6cSJohn Marino    This program is distributed in the hope that it will be useful,
13*ef5ccd6cSJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
14*ef5ccd6cSJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*ef5ccd6cSJohn Marino    GNU General Public License for more details.
16*ef5ccd6cSJohn Marino 
17*ef5ccd6cSJohn Marino    You should have received a copy of the GNU General Public License
18*ef5ccd6cSJohn Marino    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19*ef5ccd6cSJohn Marino 
20*ef5ccd6cSJohn Marino #if !defined (GO_LANG_H)
21*ef5ccd6cSJohn Marino #define GO_LANG_H 1
22*ef5ccd6cSJohn Marino 
23*ef5ccd6cSJohn Marino struct type_print_options;
24*ef5ccd6cSJohn Marino 
25*ef5ccd6cSJohn Marino #include "gdbtypes.h"
26*ef5ccd6cSJohn Marino #include "symtab.h"
27*ef5ccd6cSJohn Marino #include "value.h"
28*ef5ccd6cSJohn Marino 
29*ef5ccd6cSJohn Marino struct builtin_go_type
30*ef5ccd6cSJohn Marino {
31*ef5ccd6cSJohn Marino   struct type *builtin_void;
32*ef5ccd6cSJohn Marino   struct type *builtin_char;
33*ef5ccd6cSJohn Marino   struct type *builtin_bool;
34*ef5ccd6cSJohn Marino   struct type *builtin_int;
35*ef5ccd6cSJohn Marino   struct type *builtin_uint;
36*ef5ccd6cSJohn Marino   struct type *builtin_uintptr;
37*ef5ccd6cSJohn Marino   struct type *builtin_int8;
38*ef5ccd6cSJohn Marino   struct type *builtin_int16;
39*ef5ccd6cSJohn Marino   struct type *builtin_int32;
40*ef5ccd6cSJohn Marino   struct type *builtin_int64;
41*ef5ccd6cSJohn Marino   struct type *builtin_uint8;
42*ef5ccd6cSJohn Marino   struct type *builtin_uint16;
43*ef5ccd6cSJohn Marino   struct type *builtin_uint32;
44*ef5ccd6cSJohn Marino   struct type *builtin_uint64;
45*ef5ccd6cSJohn Marino   struct type *builtin_float32;
46*ef5ccd6cSJohn Marino   struct type *builtin_float64;
47*ef5ccd6cSJohn Marino   struct type *builtin_complex64;
48*ef5ccd6cSJohn Marino   struct type *builtin_complex128;
49*ef5ccd6cSJohn Marino };
50*ef5ccd6cSJohn Marino 
51*ef5ccd6cSJohn Marino enum go_type
52*ef5ccd6cSJohn Marino {
53*ef5ccd6cSJohn Marino   GO_TYPE_NONE, /* Not a Go object.  */
54*ef5ccd6cSJohn Marino   GO_TYPE_STRING
55*ef5ccd6cSJohn Marino };
56*ef5ccd6cSJohn Marino 
57*ef5ccd6cSJohn Marino /* Defined in go-exp.y.  */
58*ef5ccd6cSJohn Marino 
59*ef5ccd6cSJohn Marino extern int go_parse (void);
60*ef5ccd6cSJohn Marino 
61*ef5ccd6cSJohn Marino extern void go_error (char *);
62*ef5ccd6cSJohn Marino 
63*ef5ccd6cSJohn Marino /* Defined in go-lang.c.  */
64*ef5ccd6cSJohn Marino 
65*ef5ccd6cSJohn Marino extern const char *go_main_name (void);
66*ef5ccd6cSJohn Marino 
67*ef5ccd6cSJohn Marino extern enum go_type go_classify_struct_type (struct type *type);
68*ef5ccd6cSJohn Marino 
69*ef5ccd6cSJohn Marino extern char *go_demangle (const char *mangled, int options);
70*ef5ccd6cSJohn Marino 
71*ef5ccd6cSJohn Marino extern char *go_symbol_package_name (const struct symbol *sym);
72*ef5ccd6cSJohn Marino 
73*ef5ccd6cSJohn Marino extern char *go_block_package_name (const struct block *block);
74*ef5ccd6cSJohn Marino 
75*ef5ccd6cSJohn Marino extern const struct builtin_go_type *builtin_go_type (struct gdbarch *);
76*ef5ccd6cSJohn Marino 
77*ef5ccd6cSJohn Marino /* Defined in go-typeprint.c.  */
78*ef5ccd6cSJohn Marino 
79*ef5ccd6cSJohn Marino extern void go_print_type (struct type *type, const char *varstring,
80*ef5ccd6cSJohn Marino 			   struct ui_file *stream, int show, int level,
81*ef5ccd6cSJohn Marino 			   const struct type_print_options *flags);
82*ef5ccd6cSJohn Marino 
83*ef5ccd6cSJohn Marino /* Defined in go-valprint.c.  */
84*ef5ccd6cSJohn Marino 
85*ef5ccd6cSJohn Marino extern void go_val_print (struct type *type, const gdb_byte *valaddr,
86*ef5ccd6cSJohn Marino 			  int embedded_offset, CORE_ADDR address,
87*ef5ccd6cSJohn Marino 			  struct ui_file *stream, int recurse,
88*ef5ccd6cSJohn Marino 			  const struct value *val,
89*ef5ccd6cSJohn Marino 			  const struct value_print_options *options);
90*ef5ccd6cSJohn Marino 
91*ef5ccd6cSJohn Marino #endif /* !defined (GO_LANG_H) */
92