Skip to content

Commit

Permalink
8328614: hsdis: dlsym can't find decode symbol
Browse files Browse the repository at this point in the history
Reviewed-by: ihse, luhenry, mli
  • Loading branch information
robehn committed Apr 9, 2024
1 parent 23d161d commit 1e02a13
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 3 additions & 1 deletion make/Hsdis.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ $(eval $(call SetupJdkLibrary, BUILD_HSDIS, \
NAME := hsdis, \
LINK_TYPE := $(HSDIS_LINK_TYPE), \
SRC := $(TOPDIR)/src/utils/hsdis/$(HSDIS_BACKEND), \
EXTRA_HEADER_DIRS := $(TOPDIR)/src/utils/hsdis, \
EXTRA_HEADER_DIRS := \
java.base:include \
$(TOPDIR)/src/utils/hsdis, \
OUTPUT_DIR := $(HSDIS_OUTPUT_DIR), \
OBJECT_DIR := $(HSDIS_OUTPUT_DIR), \
DISABLED_WARNINGS_gcc := undef format-nonliteral sign-compare, \
Expand Down
8 changes: 2 additions & 6 deletions src/utils/hsdis/binutils/hsdis-binutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,8 @@ static const char* format_insn_close(const char* close,
disassemble_info* dinfo,
char* buf, size_t bufsize);

JNIEXPORT
void*
#ifdef DLL_ENTRY
DLL_ENTRY
#endif
decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va,
unsigned char* buffer, uintptr_t length,
event_callback_t event_callback_arg, void* event_stream_arg,
Expand All @@ -145,10 +143,8 @@ decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va,
}

/* This is the compatability interface for older version of hotspot */
JNIEXPORT
void*
#ifdef DLL_ENTRY
DLL_ENTRY
#endif
decode_instructions(void* start_pv, void* end_pv,
event_callback_t event_callback_arg, void* event_stream_arg,
printf_callback_t printf_callback_arg, void* printf_stream_arg,
Expand Down
4 changes: 1 addition & 3 deletions src/utils/hsdis/capstone/hsdis-capstone.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ static Options parse_options(const char* options, printf_callback_t printf_callb
return ops;
}

#ifdef _WIN32
__declspec(dllexport)
#endif
JNIEXPORT
void* decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va,
unsigned char* buffer, uintptr_t length,
event_callback_t event_callback,
Expand Down
2 changes: 2 additions & 0 deletions src/utils/hsdis/hsdis.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
#ifndef SHARED_TOOLS_HSDIS_H
#define SHARED_TOOLS_HSDIS_H

#include "jni.h"

#ifdef __cplusplus
extern "C"
{
Expand Down
2 changes: 2 additions & 0 deletions src/utils/hsdis/llvm/hsdis-llvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ class hsdis_backend : public hsdis_backend_base {
};


JNIEXPORT
void* decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va,
unsigned char* buffer, uintptr_t length,
event_callback_t event_callback_arg, void* event_stream_arg,
Expand All @@ -342,6 +343,7 @@ void* decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va,
}

/* This is the compatability interface for older version of hotspot */
JNIEXPORT
void* decode_instructions(void* start_pv, void* end_pv,
event_callback_t event_callback_arg, void* event_stream_arg,
printf_callback_t printf_callback_arg, void* printf_stream_arg,
Expand Down

1 comment on commit 1e02a13

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.