src/share/tools/hsdis/hsdis.c

changeset 9477
bbd1da3f538f
parent 9476
9a18c71dbd25
child 9493
882a55369341
equal deleted inserted replaced
9476:9a18c71dbd25 9477:bbd1da3f538f
1 /* 1 /*
2 * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * The Universal Permissive License (UPL), Version 1.0 5 * The Universal Permissive License (UPL), Version 1.0
6 * 6 *
7 * Subject to the condition set forth below, permission is hereby granted to 7 * Subject to the condition set forth below, permission is hereby granted to
48 This implements the plugin protocol required by the 48 This implements the plugin protocol required by the
49 HotSpot PrintAssembly option. 49 HotSpot PrintAssembly option.
50 */ 50 */
51 51
52 #include <config.h> /* required by bfd.h */ 52 #include <config.h> /* required by bfd.h */
53 #include <errno.h>
54 #include <inttypes.h>
55 #include <string.h>
56
53 #include <libiberty.h> 57 #include <libiberty.h>
54 #include <bfd.h> 58 #include <bfd.h>
59 #include <bfdver.h>
55 #include <dis-asm.h> 60 #include <dis-asm.h>
56 #include <inttypes.h> 61
57 #include <string.h>
58 #include <errno.h>
59 #include "hsdis.h" 62 #include "hsdis.h"
60 63
61 #ifndef bool 64 #ifndef bool
62 #define bool int 65 #define bool int
63 #define true 1 66 #define true 1
332 /* On PowerPC we get warnings, if we pass empty options */ 335 /* On PowerPC we get warnings, if we pass empty options */
333 (caller_options == NULL) ? NULL : app_data->insn_options); 336 (caller_options == NULL) ? NULL : app_data->insn_options);
334 337
335 /* Finish linking together the various callback blocks. */ 338 /* Finish linking together the various callback blocks. */
336 app_data->dinfo.application_data = (void*) app_data; 339 app_data->dinfo.application_data = (void*) app_data;
337 app_data->dfn = disassembler(native_bfd); 340 app_data->dfn = disassembler(bfd_get_arch(native_bfd),
341 bfd_big_endian(native_bfd),
342 bfd_get_mach(native_bfd),
343 native_bfd);
338 app_data->dinfo.print_address_func = hsdis_print_address_func; 344 app_data->dinfo.print_address_func = hsdis_print_address_func;
339 app_data->dinfo.read_memory_func = hsdis_read_memory_func; 345 app_data->dinfo.read_memory_func = hsdis_read_memory_func;
340 346
341 if (app_data->dfn == NULL) { 347 if (app_data->dfn == NULL) {
342 const char* bad = app_data->arch_name; 348 const char* bad = app_data->arch_name;

mercurial