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