annotate src/share/tools/hsdis/hsdis.h @ 8959:9a18c71dbd25

8208541: non-ASCII characters in hsdis UPL text Summary: replace Unicode left/right double quote pair with normal ASCII double quotes Reviewed-by: jrose
author dbuck
date Wed, 01 Aug 2018 04:15:43 -0400
parents d0613fb2fc3b
children
rev   line source
jrose@100 1 /*
minqi@3658 2 * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
jrose@100 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jrose@100 4 *
dbuck@8956 5 * The Universal Permissive License (UPL), Version 1.0
jrose@100 6 *
dbuck@8956 7 * Subject to the condition set forth below, permission is hereby granted to
dbuck@8956 8 * any person obtaining a copy of this software, associated documentation
dbuck@8956 9 * and/or data (collectively the "Software"), free of charge and under any
dbuck@8956 10 * and all copyright rights in the Software, and any and all patent rights
dbuck@8956 11 * owned or freely licensable by each licensor hereunder covering either (i)
dbuck@8956 12 * the unmodified Software as contributed to or provided by such licensor,
dbuck@8956 13 * or (ii) the Larger Works (as defined below), to deal in both
jrose@100 14 *
dbuck@8956 15 * (a) the Software, and
dbuck@8956 16 *
dbuck@8956 17 * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file
dbuck@8959 18 * if one is included with the Software (each a "Larger Work" to which the
dbuck@8956 19 * Software is contributed by such licensors),
dbuck@8956 20 *
dbuck@8956 21 * without restriction, including without limitation the rights to copy,
dbuck@8956 22 * create derivative works of, display, perform, and distribute the Software
dbuck@8956 23 * and make, use, sell, offer for sale, import, export, have made, and have
dbuck@8956 24 * sold the Software and the Larger Work(s), and to sublicense the foregoing
dbuck@8956 25 * rights on either these or other terms.
dbuck@8956 26 *
dbuck@8956 27 * This license is subject to the following condition:
dbuck@8956 28 *
dbuck@8956 29 * The above copyright notice and either this complete permission notice or
dbuck@8956 30 * at a minimum a reference to the UPL must be included in all copies or
dbuck@8956 31 * substantial portions of the Software.
dbuck@8956 32 *
dbuck@8956 33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
dbuck@8956 34 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
dbuck@8956 35 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
dbuck@8956 36 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
dbuck@8956 37 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
dbuck@8956 38 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
dbuck@8956 39 * USE OR OTHER DEALINGS IN THE SOFTWARE.
jrose@100 40 *
trims@1472 41 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1472 42 * or visit www.oracle.com if you need additional information or have any
trims@1472 43 * questions.
jrose@100 44 *
jrose@100 45 */
jrose@100 46
jrose@100 47 /* decode_instructions -- dump a range of addresses as native instructions
jrose@100 48 This implements the protocol required by the HotSpot PrintAssembly option.
jrose@100 49
minqi@3658 50 The start_va, end_va is the virtual address the region of memory to
minqi@3658 51 disasemble and buffer contains the instructions to decode,
minqi@3658 52 Disassembling instructions in the current address space is done by
minqi@3658 53 having start_va == buffer.
jrose@100 54
jrose@100 55 The option string, if not empty, is interpreted by the disassembler implementation.
jrose@100 56
jrose@100 57 The printf callback is 'fprintf' or any other workalike.
jrose@100 58 It is called as (*printf_callback)(printf_stream, "some format...", some, format, args).
jrose@100 59
jrose@100 60 The event callback receives an event tag (a string) and an argument (a void*).
jrose@100 61 It is called as (*event_callback)(event_stream, "tag", arg).
jrose@100 62
jrose@100 63 Events:
jrose@100 64 <insn pc='%p'> begin an instruction, at a given location
jrose@100 65 </insn pc='%d'> end an instruction, at a given location
jrose@100 66 <addr value='%p'/> emit the symbolic value of an address
jrose@100 67
jrose@100 68 A tag format is one of three basic forms: "tag", "/tag", "tag/",
jrose@100 69 where tag is a simple identifier, signifying (as in XML) a element start,
jrose@100 70 element end, and standalone element. (To render as XML, add angle brackets.)
jrose@100 71 */
minqi@3809 72 #ifndef SHARED_TOOLS_HSDIS_H
minqi@3809 73 #define SHARED_TOOLS_HSDIS_H
minqi@3809 74
jrose@100 75 extern
jrose@100 76 #ifdef DLL_EXPORT
jrose@100 77 DLL_EXPORT
jrose@100 78 #endif
minqi@3658 79 void* decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va,
minqi@3658 80 unsigned char* buffer, uintptr_t length,
minqi@3658 81 void* (*event_callback)(void*, const char*, void*),
minqi@3658 82 void* event_stream,
minqi@3658 83 int (*printf_callback)(void*, const char*, ...),
minqi@3658 84 void* printf_stream,
minqi@3809 85 const char* options,
minqi@3809 86 int newline /* bool value for nice new line */);
minqi@3809 87
minqi@3809 88 /* This is the compatability interface for older versions of hotspot */
minqi@3809 89 extern
minqi@3809 90 #ifdef DLL_ENTRY
minqi@3809 91 DLL_ENTRY
minqi@3809 92 #endif
minqi@3809 93 void* decode_instructions(void* start_pv, void* end_pv,
minqi@3809 94 void* (*event_callback)(void*, const char*, void*),
minqi@3809 95 void* event_stream,
minqi@3809 96 int (*printf_callback)(void*, const char*, ...),
minqi@3809 97 void* printf_stream,
minqi@3809 98 const char* options);
jrose@100 99
jrose@100 100 /* convenience typedefs */
jrose@100 101
jrose@100 102 typedef void* (*decode_instructions_event_callback_ftype) (void*, const char*, void*);
jrose@100 103 typedef int (*decode_instructions_printf_callback_ftype) (void*, const char*, ...);
minqi@3809 104 typedef void* (*decode_func_vtype) (uintptr_t start_va, uintptr_t end_va,
minqi@3809 105 unsigned char* buffer, uintptr_t length,
minqi@3809 106 decode_instructions_event_callback_ftype event_callback,
minqi@3809 107 void* event_stream,
minqi@3809 108 decode_instructions_printf_callback_ftype printf_callback,
minqi@3809 109 void* printf_stream,
minqi@3809 110 const char* options,
minqi@3809 111 int newline);
minqi@3809 112 typedef void* (*decode_func_stype) (void* start_pv, void* end_pv,
minqi@3809 113 decode_instructions_event_callback_ftype event_callback,
minqi@3809 114 void* event_stream,
minqi@3809 115 decode_instructions_printf_callback_ftype printf_callback,
minqi@3809 116 void* printf_stream,
minqi@3809 117 const char* options);
minqi@3809 118 #endif /* SHARED_TOOLS_HSDIS_H */