Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(442)

Side by Side Diff: gdb/go-typeprint.c

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gdb/go-lang.c ('k') | gdb/go-valprint.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* Support for printing Go types for GDB, the GNU debugger.
2
3 Copyright (C) 2012 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 /* TODO:
21 - lots
22 - if the more complex types get Python pretty-printers, we'll
23 want a Python API for type printing
24 */
25
26 #include "defs.h"
27 #include "gdbtypes.h"
28 #include "c-lang.h"
29 #include "go-lang.h"
30
31 /* Print a description of a type TYPE.
32 Output goes to STREAM (via stdio).
33 If VARSTRING is a non-empty string, print as an Ada variable/field
34 declaration.
35 SHOW+1 is the maximum number of levels of internal type structure
36 to show (this applies to record types, enumerated types, and
37 array types).
38 SHOW is the number of levels of internal type structure to show
39 when there is a type name for the SHOWth deepest level (0th is
40 outer level).
41 When SHOW<0, no inner structure is shown.
42 LEVEL indicates level of recursion (for nested definitions). */
43
44 void
45 go_print_type (struct type *type, const char *varstring,
46 struct ui_file *stream, int show, int level)
47 {
48 /* Borrowed from c-typeprint.c. */
49 if (show > 0)
50 CHECK_TYPEDEF (type);
51
52 /* Print the type of "abc" as "string", not char[4]. */
53 if (TYPE_CODE (type) == TYPE_CODE_ARRAY
54 && TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CHAR)
55 {
56 fputs_filtered ("string", stream);
57 return;
58 }
59
60 /* Punt the rest to C for now. */
61 c_print_type (type, varstring, stream, show, level);
62 }
OLDNEW
« no previous file with comments | « gdb/go-lang.c ('k') | gdb/go-valprint.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698