100N/A/*
1879N/A * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
100N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
100N/A *
100N/A * This code is free software; you can redistribute it and/or modify it
100N/A * under the terms of the GNU General Public License version 2 only, as
100N/A * published by the Free Software Foundation.
100N/A *
100N/A * This code is distributed in the hope that it will be useful, but WITHOUT
100N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
100N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
100N/A * version 2 for more details (a copy is included in the LICENSE file that
100N/A * accompanied this code).
100N/A *
100N/A * You should have received a copy of the GNU General Public License version
100N/A * 2 along with this work; if not, write to the Free Software Foundation,
100N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
100N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
100N/A *
100N/A */
100N/A
100N/A/* decode_instructions -- dump a range of addresses as native instructions
100N/A This implements the protocol required by the HotSpot PrintAssembly option.
100N/A
100N/A The starting and ending addresses are within the current process's address space.
100N/A
100N/A The option string, if not empty, is interpreted by the disassembler implementation.
100N/A
100N/A The printf callback is 'fprintf' or any other workalike.
100N/A It is called as (*printf_callback)(printf_stream, "some format...", some, format, args).
100N/A
100N/A The event callback receives an event tag (a string) and an argument (a void*).
100N/A It is called as (*event_callback)(event_stream, "tag", arg).
100N/A
100N/A Events:
100N/A <insn pc='%p'> begin an instruction, at a given location
100N/A </insn pc='%d'> end an instruction, at a given location
100N/A <addr value='%p'/> emit the symbolic value of an address
100N/A
100N/A A tag format is one of three basic forms: "tag", "/tag", "tag/",
100N/A where tag is a simple identifier, signifying (as in XML) a element start,
100N/A element end, and standalone element. (To render as XML, add angle brackets.)
100N/A*/
100N/Aextern
100N/A#ifdef DLL_EXPORT
100N/A DLL_EXPORT
100N/A#endif
100N/Avoid* decode_instructions(void* start, void* end,
100N/A void* (*event_callback)(void*, const char*, void*),
100N/A void* event_stream,
100N/A int (*printf_callback)(void*, const char*, ...),
100N/A void* printf_stream,
100N/A const char* options);
100N/A
100N/A/* convenience typedefs */
100N/A
100N/Atypedef void* (*decode_instructions_event_callback_ftype) (void*, const char*, void*);
100N/Atypedef int (*decode_instructions_printf_callback_ftype) (void*, const char*, ...);
100N/Atypedef void* (*decode_instructions_ftype) (void* start, void* end,
100N/A decode_instructions_event_callback_ftype event_callback,
100N/A void* event_stream,
100N/A decode_instructions_printf_callback_ftype printf_callback,
100N/A void* printf_stream,
100N/A const char* options);