Merge trunk version 207649 into gupc branch.
[official-gcc.git] / libgupc / smp / upc_debug.h
blobb936e9219cef5162f50e1532c51d72b96407326d
1 /* Copyright (C) 2003-2014 Free Software Foundation, Inc.
2 This file is part of the UPC runtime library.
3 Written by Gary Funck <gary@intrepid.com>
4 and Nenad Vukicevic <nenad@intrepid.com>
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 Under Section 7 of GPL version 3, you are granted additional
19 permissions described in the GCC Runtime Library Exception, version
20 3.1, as published by the Free Software Foundation.
22 You should have received a copy of the GNU General Public License and
23 a copy of the GCC Runtime Library Exception along with this program;
24 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
25 <http://www.gnu.org/licenses/>. */
28 /*
29 * This file defines an interface to allow a debugger easily to
30 * acquire all of the UPC processes at startup time.
32 * It exploits the interface used by MPICH http://www-unix.mcs.anl.gov/mpi/mpich/
33 * to interface to debuggers.
36 #ifndef _UPC_DEBUG_H_
37 #define _UPC_DEBUG_H_
39 /**************************************************************************
40 * These functions are our interface to the debugger.
43 /* A little struct to hold the target processor name and pid for
44 * each process which forms part of the MPI program.
46 * For UPC we probably don't need the host_name or executable_name,
47 * but it's easier to use the existing interface than bother to leave
48 * them out. Provided we zero them the debugger will assume they're the
49 * same as the initial program.
51 * DO NOT change the name of this structure or its fields. The debugger knows
52 * them, and will be confused if you change them.
54 typedef struct
56 char * host_name; /* Something we can pass to inet_addr */
57 char * executable_name; /* The name of the image */
58 int pid; /* The pid of the process */
59 } MPIR_PROCDESC;
61 /* Array of procdescs for debugging purposes */
62 extern MPIR_PROCDESC *MPIR_proctable;
63 extern int MPIR_proctable_size;
65 /* Various global variables which a debugger can use for
66 * 1) finding out what the state of the program is at
67 * the time the magic breakpoint is hit.
68 * 2) inform the process that it has been attached to and is
69 * now free to run.
71 extern volatile int MPIR_debug_state;
72 extern volatile int MPIR_debug_gate;
73 extern const char * MPIR_debug_abort_string;
74 extern int MPIR_being_debugged; /* Cause extra info on internal state
75 * to be maintained
78 /* Values for the debug_state, this seems to be all we need at the moment
79 * but that may change...
81 #define MPIR_DEBUG_SPAWNED 1
82 #define MPIR_DEBUG_ABORTING 2
84 /* A function we call to tell the debugger that something worthwhile is happening.
86 extern void MPIR_Breakpoint (void);
89 * Other functions whose mere presence in the executable provides information to the
90 * debugger.
92 extern void MPIR_i_am_starter (void);
93 extern void MPIR_ignore_queues (void);
94 extern void MPIR_force_to_main (void);
96 #endif /* _UPC_DEBUG_H_ */