Skip to content

Commit 4456f76

Browse files
committed
Fix case where debuggers cannot read the MPIR proctable.
Make sure the definition of the MPIR_Proctable is in a header file that is included in the file orted_mpir_breakpoint.c, which is compiled with -g and compiled without optimizations. Otherwise, the debugger (such as gdb) won't know the complete definition of the proctable, preventing it from being able to read it. Since the MPIR_proctable should be accessed from orted_submit.c and orted_mpir_breakpoint.c, move it to the mpir_orted.h header file. Signed-off-by: Austen Lauria <awlauria@us.ibm.com>
1 parent d6b871d commit 4456f76

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

orte/orted/orted-mpir/orted_mpir.h

+18
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,24 @@ BEGIN_C_DECLS
1818
#define MPIR_MAX_PATH_LENGTH 512
1919
#define MPIR_MAX_ARG_LENGTH 1024
2020

21+
22+
/* Note to future MPIR maintainers:
23+
*
24+
* This struct MUST (along with all other MPIR_* symbols) be declared
25+
* and defined in this file. Otherwise they may be compiled *without* -g
26+
* and *with* optimizations in production. In the case where they are
27+
* not here, the debugger won't have the complete definition of the proctable.
28+
* This will prevent the debugger from reading it properly.
29+
*
30+
* It also needs to be seen by multiple files (orted_submih.c and
31+
* orted_mpir_breakpoint.c), so this is a better place for it anyway.
32+
*/
33+
struct MPIR_PROCDESC {
34+
char *host_name; /* something that can be passed to inet_addr */
35+
char *executable_name; /* name of binary */
36+
int pid; /* process pid */
37+
};
38+
2139
extern struct MPIR_PROCDESC *MPIR_proctable;
2240
extern int MPIR_proctable_size;
2341
extern volatile int MPIR_being_debugged;

orte/orted/orted_submit.c

-7
Original file line numberDiff line numberDiff line change
@@ -2220,13 +2220,6 @@ static void complete_recv(int status, orte_process_name_t* sender,
22202220
#define DUMP_INT(X) fprintf(stderr, " %s = %d\n", # X, X);
22212221
#define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
22222222

2223-
struct MPIR_PROCDESC {
2224-
char *host_name; /* something that can be passed to inet_addr */
2225-
char *executable_name; /* name of binary */
2226-
int pid; /* process pid */
2227-
};
2228-
2229-
22302223
/**
22312224
* Initialization of data structures for running under a debugger
22322225
* using the MPICH/TotalView parallel debugger interface. Before the

0 commit comments

Comments
 (0)