< prev index next >

src/jdk.jdwp.agent/share/native/libjdwp/error_messages.h

Print this page
rev 52923 : 8226346: Build better binary builders
Reviewed-by: andrew


  25 
  26 #ifndef JDWP_ERROR_MESSAGES_H
  27 #define JDWP_ERROR_MESSAGES_H
  28 
  29 /* It is assumed that ALL strings are UTF-8 safe on entry */
  30 #define TTY_MESSAGE(args) ( tty_message args )
  31 #define ERROR_MESSAGE(args) ( \
  32                 LOG_ERROR(args), \
  33                 error_message args )
  34 
  35 void print_message(FILE *fp, const char *prefix,  const char *suffix,
  36                    const char *format, ...);
  37 void error_message(const char *, ...);
  38 void tty_message(const char *, ...);
  39 void jdiAssertionFailed(char *fileName, int lineNumber, char *msg);
  40 
  41 const char * jvmtiErrorText(jvmtiError);
  42 const char * eventText(int);
  43 const char * jdwpErrorText(jdwpError);
  44 
  45 /* Use THIS_FILE when it is available. */
  46 #ifndef THIS_FILE
  47     #define THIS_FILE __FILE__
  48 #endif
  49 
  50 #define EXIT_ERROR(error, msg) \
  51         { \
  52                 print_message(stderr, "JDWP exit error ", "\n", \
  53                         "%s(%d): %s [%s:%d]", \
  54                         jvmtiErrorText((jvmtiError)error), error, (msg==NULL?"":msg), \
  55                         THIS_FILE, __LINE__); \
  56                 debugInit_exit((jvmtiError)error, msg); \
  57         }
  58 
  59 #define JDI_ASSERT(expression) \
  60 do { \
  61     if (gdata && gdata->assertOn && !(expression)) { \
  62         jdiAssertionFailed(THIS_FILE, __LINE__, #expression); \
  63     } \
  64 } while (0)
  65 
  66 #define JDI_ASSERT_MSG(expression, msg) \
  67 do { \
  68     if (gdata && gdata->assertOn && !(expression)) { \
  69         jdiAssertionFailed(THIS_FILE, __LINE__, msg); \
  70     } \
  71 } while (0)
  72 
  73 #define JDI_ASSERT_FAILED(msg) \
  74    jdiAssertionFailed(THIS_FILE, __LINE__, msg)
  75 
  76 void do_pause(void);
  77 
  78 #endif


  25 
  26 #ifndef JDWP_ERROR_MESSAGES_H
  27 #define JDWP_ERROR_MESSAGES_H
  28 
  29 /* It is assumed that ALL strings are UTF-8 safe on entry */
  30 #define TTY_MESSAGE(args) ( tty_message args )
  31 #define ERROR_MESSAGE(args) ( \
  32                 LOG_ERROR(args), \
  33                 error_message args )
  34 
  35 void print_message(FILE *fp, const char *prefix,  const char *suffix,
  36                    const char *format, ...);
  37 void error_message(const char *, ...);
  38 void tty_message(const char *, ...);
  39 void jdiAssertionFailed(char *fileName, int lineNumber, char *msg);
  40 
  41 const char * jvmtiErrorText(jvmtiError);
  42 const char * eventText(int);
  43 const char * jdwpErrorText(jdwpError);
  44 





  45 #define EXIT_ERROR(error, msg) \
  46         { \
  47                 print_message(stderr, "JDWP exit error ", "\n", \
  48                         "%s(%d): %s [%s:%d]", \
  49                         jvmtiErrorText((jvmtiError)error), error, (msg==NULL?"":msg), \
  50                         __FILE__, __LINE__); \
  51                 debugInit_exit((jvmtiError)error, msg); \
  52         }
  53 
  54 #define JDI_ASSERT(expression) \
  55 do { \
  56     if (gdata && gdata->assertOn && !(expression)) { \
  57         jdiAssertionFailed(__FILE__, __LINE__, #expression); \
  58     } \
  59 } while (0)
  60 
  61 #define JDI_ASSERT_MSG(expression, msg) \
  62 do { \
  63     if (gdata && gdata->assertOn && !(expression)) { \
  64         jdiAssertionFailed(__FILE__, __LINE__, msg); \
  65     } \
  66 } while (0)
  67 
  68 #define JDI_ASSERT_FAILED(msg) \
  69    jdiAssertionFailed(__FILE__, __LINE__, msg)
  70 
  71 void do_pause(void);
  72 
  73 #endif
< prev index next >