hotspot/src/share/vm/utilities/vmError.cpp
changeset 2129 e810a33b5c67
parent 1887 0ed88ac17540
child 2154 72a9b7284ccf
equal deleted inserted replaced
2128:c08c265de2f5 2129:e810a33b5c67
     1 /*
     1 /*
     2  * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
     2  * Copyright 2003-2009 Sun Microsystems, Inc.  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.
   304          size_t len = strlen(file);
   304          size_t len = strlen(file);
   305          size_t buflen = sizeof(buf);
   305          size_t buflen = sizeof(buf);
   306 
   306 
   307          strncpy(buf, file, buflen);
   307          strncpy(buf, file, buflen);
   308          if (len + 10 < buflen) {
   308          if (len + 10 < buflen) {
   309            sprintf(buf + len, ":" SIZE_FORMAT, _lineno);
   309            sprintf(buf + len, ":%d", _lineno);
   310          }
   310          }
   311          st->print(" (%s)", buf);
   311          st->print(" (%s)", buf);
   312        } else {
   312        } else {
   313          st->print(" (0x%x)", _id);
   313          st->print(" (0x%x)", _id);
   314        }
   314        }
   418        frame fr = _context ? os::fetch_frame_from_context(_context)
   418        frame fr = _context ? os::fetch_frame_from_context(_context)
   419                            : os::current_frame();
   419                            : os::current_frame();
   420 
   420 
   421        if (fr.sp()) {
   421        if (fr.sp()) {
   422          st->print(",  sp=" PTR_FORMAT, fr.sp());
   422          st->print(",  sp=" PTR_FORMAT, fr.sp());
   423          st->print(",  free space=%dk",
   423          st->print(",  free space=%" INTPTR_FORMAT "k",
   424                      ((intptr_t)fr.sp() - (intptr_t)stack_bottom) >> 10);
   424                      ((intptr_t)fr.sp() - (intptr_t)stack_bottom) >> 10);
   425        }
   425        }
   426 
   426 
   427        st->cr();
   427        st->cr();
   428      }
   428      }