src/hotspot/share/utilities/exceptions.cpp
changeset 49177 eebf559c9e0d
parent 48826 c4d9d1b08e2e
child 49480 d7df2dd501ce
equal deleted inserted replaced
49176:f413e471a6ab 49177:eebf559c9e0d
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    31 #include "memory/resourceArea.hpp"
    31 #include "memory/resourceArea.hpp"
    32 #include "oops/oop.inline.hpp"
    32 #include "oops/oop.inline.hpp"
    33 #include "runtime/init.hpp"
    33 #include "runtime/init.hpp"
    34 #include "runtime/java.hpp"
    34 #include "runtime/java.hpp"
    35 #include "runtime/javaCalls.hpp"
    35 #include "runtime/javaCalls.hpp"
       
    36 #include "runtime/os.hpp"
    36 #include "runtime/thread.inline.hpp"
    37 #include "runtime/thread.inline.hpp"
    37 #include "runtime/threadCritical.hpp"
    38 #include "runtime/threadCritical.hpp"
    38 #include "utilities/events.hpp"
    39 #include "utilities/events.hpp"
    39 #include "utilities/exceptions.hpp"
    40 #include "utilities/exceptions.hpp"
    40 
    41 
   237 void Exceptions::fthrow(Thread* thread, const char* file, int line, Symbol* h_name, const char* format, ...) {
   238 void Exceptions::fthrow(Thread* thread, const char* file, int line, Symbol* h_name, const char* format, ...) {
   238   const int max_msg_size = 1024;
   239   const int max_msg_size = 1024;
   239   va_list ap;
   240   va_list ap;
   240   va_start(ap, format);
   241   va_start(ap, format);
   241   char msg[max_msg_size];
   242   char msg[max_msg_size];
   242   vsnprintf(msg, max_msg_size, format, ap);
   243   os::vsnprintf(msg, max_msg_size, format, ap);
   243   msg[max_msg_size-1] = '\0';
       
   244   va_end(ap);
   244   va_end(ap);
   245   _throw_msg(thread, file, line, h_name, msg);
   245   _throw_msg(thread, file, line, h_name, msg);
   246 }
   246 }
   247 
   247 
   248 
   248