Mercurial > hg > graal-compiler
diff src/share/tools/hsdis/hsdis.h @ 6782:5a98bf7d847b
6879063: SA should use hsdis for disassembly
Summary: We should in SA to use hsdis for it like the JVM does to replace the current java based disassembler.
Reviewed-by: twisti, jrose, sla
Contributed-by: yumin.qi@oracle.com
author | minqi |
---|---|
date | Mon, 24 Sep 2012 12:44:00 -0700 |
parents | f95d63e2154a |
children | 3d701c802d01 |
line wrap: on
line diff
--- a/src/share/tools/hsdis/hsdis.h Thu Sep 20 03:49:15 2012 -0700 +++ b/src/share/tools/hsdis/hsdis.h Mon Sep 24 12:44:00 2012 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,10 @@ /* decode_instructions -- dump a range of addresses as native instructions This implements the protocol required by the HotSpot PrintAssembly option. - The starting and ending addresses are within the current process's address space. + The start_va, end_va is the virtual address the region of memory to + disasemble and buffer contains the instructions to decode, + Disassembling instructions in the current address space is done by + having start_va == buffer. The option string, if not empty, is interpreted by the disassembler implementation. @@ -48,18 +51,20 @@ #ifdef DLL_EXPORT DLL_EXPORT #endif -void* decode_instructions(void* start, void* end, - void* (*event_callback)(void*, const char*, void*), - void* event_stream, - int (*printf_callback)(void*, const char*, ...), - void* printf_stream, - const char* options); +void* decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va, + unsigned char* buffer, uintptr_t length, + void* (*event_callback)(void*, const char*, void*), + void* event_stream, + int (*printf_callback)(void*, const char*, ...), + void* printf_stream, + 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, +typedef void* (*decode_instructions_ftype) (uintptr_t start_va, uintptr_t end_va, + unsigned char* buffer, uintptr_t length, decode_instructions_event_callback_ftype event_callback, void* event_stream, decode_instructions_printf_callback_ftype printf_callback,