src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c
author michaelm
Tue, 29 Oct 2019 19:55:34 +0000
branchunixdomainchannels
changeset 58848 c3df0f8b6d93
parent 53379 e47074d2d8cc
permissions -rw-r--r--
second part of cleanup reducing number of files touched in main line
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
53379
e47074d2d8cc 8181313: SA: Remove libthread_db dependency on Linux
ysuenaga
parents: 53004
diff changeset
     2
 * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5045
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5045
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5045
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
#include <stdarg.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
#include <stdio.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
#include <stdlib.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
#include <string.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
#include <fcntl.h>
53379
e47074d2d8cc 8181313: SA: Remove libthread_db dependency on Linux
ysuenaga
parents: 53004
diff changeset
    29
#include <sys/procfs.h>
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
#include "libproc_impl.h"
53379
e47074d2d8cc 8181313: SA: Remove libthread_db dependency on Linux
ysuenaga
parents: 53004
diff changeset
    31
#include "proc_service.h"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
#define SA_ALTROOT "SA_ALTROOT"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
int pathmap_open(const char* name) {
22789
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    36
  static const char *alt_root = NULL;
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    37
  static int alt_root_initialized = 0;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
22789
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    39
  int fd;
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    40
  char alt_path[PATH_MAX + 1], *alt_path_end;
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    41
  const char *s;
33794
41ef3dc95179 8140482: Various minor code improvements (runtime)
goetz
parents: 30281
diff changeset
    42
  int free_space;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
22789
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    44
  if (!alt_root_initialized) {
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    45
    alt_root_initialized = -1;
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    46
    alt_root = getenv(SA_ALTROOT);
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    47
  }
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    48
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    49
  if (alt_root == NULL) {
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    50
    return open(name, O_RDONLY);
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    51
  }
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    52
33794
41ef3dc95179 8140482: Various minor code improvements (runtime)
goetz
parents: 30281
diff changeset
    53
43671
a152f2d3320e 8171084: heapdump/JMapHeapCore fails with java.lang.RuntimeException: Heap segment size overflow
jgeorge
parents: 35516
diff changeset
    54
  if (strlen(alt_root) + strlen(name) > PATH_MAX) {
33794
41ef3dc95179 8140482: Various minor code improvements (runtime)
goetz
parents: 30281
diff changeset
    55
    // Buffer too small.
41ef3dc95179 8140482: Various minor code improvements (runtime)
goetz
parents: 30281
diff changeset
    56
    return -1;
41ef3dc95179 8140482: Various minor code improvements (runtime)
goetz
parents: 30281
diff changeset
    57
  }
41ef3dc95179 8140482: Various minor code improvements (runtime)
goetz
parents: 30281
diff changeset
    58
41ef3dc95179 8140482: Various minor code improvements (runtime)
goetz
parents: 30281
diff changeset
    59
  strncpy(alt_path, alt_root, PATH_MAX);
41ef3dc95179 8140482: Various minor code improvements (runtime)
goetz
parents: 30281
diff changeset
    60
  alt_path[PATH_MAX] = '\0';
22789
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    61
  alt_path_end = alt_path + strlen(alt_path);
33794
41ef3dc95179 8140482: Various minor code improvements (runtime)
goetz
parents: 30281
diff changeset
    62
  free_space = PATH_MAX + 1 - (alt_path_end-alt_path);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
33794
41ef3dc95179 8140482: Various minor code improvements (runtime)
goetz
parents: 30281
diff changeset
    64
  // Strip path items one by one and try to open file with alt_root prepended.
22789
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    65
  s = name;
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    66
  while (1) {
33794
41ef3dc95179 8140482: Various minor code improvements (runtime)
goetz
parents: 30281
diff changeset
    67
    strncat(alt_path, s, free_space);
41ef3dc95179 8140482: Various minor code improvements (runtime)
goetz
parents: 30281
diff changeset
    68
    s += 1;  // Skip /.
22789
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    69
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    70
    fd = open(alt_path, O_RDONLY);
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    71
    if (fd >= 0) {
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    72
      print_debug("path %s substituted for %s\n", alt_path, name);
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    73
      return fd;
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    74
    }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
22789
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    76
    // Linker always put full path to solib to process, so we can rely
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    77
    // on presence of /. If slash is not present, it means, that SOlib doesn't
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    78
    // physically exist (e.g. linux-gate.so) and we fail opening it anyway
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    79
    if ((s = strchr(s, '/')) == NULL) {
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    80
      break;
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    81
    }
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    82
33794
41ef3dc95179 8140482: Various minor code improvements (runtime)
goetz
parents: 30281
diff changeset
    83
    // Cut off what we appended above.
41ef3dc95179 8140482: Various minor code improvements (runtime)
goetz
parents: 30281
diff changeset
    84
    *alt_path_end = '\0';
22789
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    85
  }
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    86
34433eb78a66 7127191: SA JSDB does not display native symbols correctly for transported Linux cores
dsamersoff
parents: 15734
diff changeset
    87
  return -1;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
static bool _libsaproc_debug;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
void print_debug(const char* format,...) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
   if (_libsaproc_debug) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
     va_list alist;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
     va_start(alist, format);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
     fputs("libsaproc DEBUG: ", stderr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
     vfprintf(stderr, format, alist);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
     va_end(alist);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
15734
68f78eb98356 8008088: SA can hang the VM
rbackman
parents: 11763
diff changeset
   103
void print_error(const char* format,...) {
68f78eb98356 8008088: SA can hang the VM
rbackman
parents: 11763
diff changeset
   104
  va_list alist;
68f78eb98356 8008088: SA can hang the VM
rbackman
parents: 11763
diff changeset
   105
  va_start(alist, format);
68f78eb98356 8008088: SA can hang the VM
rbackman
parents: 11763
diff changeset
   106
  fputs("ERROR: ", stderr);
68f78eb98356 8008088: SA can hang the VM
rbackman
parents: 11763
diff changeset
   107
  vfprintf(stderr, format, alist);
68f78eb98356 8008088: SA can hang the VM
rbackman
parents: 11763
diff changeset
   108
  va_end(alist);
68f78eb98356 8008088: SA can hang the VM
rbackman
parents: 11763
diff changeset
   109
}
68f78eb98356 8008088: SA can hang the VM
rbackman
parents: 11763
diff changeset
   110
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
bool is_debug() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
   return _libsaproc_debug;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
// initialize libproc
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   116
JNIEXPORT bool JNICALL
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   117
init_libproc(bool debug) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
   // init debug mode
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
   _libsaproc_debug = debug;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
   return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
static void destroy_lib_info(struct ps_prochandle* ph) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
   lib_info* lib = ph->libs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
   while (lib) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
     lib_info *next = lib->next;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
     if (lib->symtab) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
        destroy_symtab(lib->symtab);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
     }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
     free(lib);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
     lib = next;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
static void destroy_thread_info(struct ps_prochandle* ph) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
   thread_info* thr = ph->threads;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
   while (thr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
     thread_info *next = thr->next;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
     free(thr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
     thr = next;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
// ps_prochandle cleanup
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
// ps_prochandle cleanup
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   147
JNIEXPORT void JNICALL
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   148
Prelease(struct ps_prochandle* ph) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
   // do the "derived class" clean-up first
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
   ph->ops->release(ph);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
   destroy_lib_info(ph);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
   destroy_thread_info(ph);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
   free(ph);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
lib_info* add_lib_info(struct ps_prochandle* ph, const char* libname, uintptr_t base) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
   return add_lib_info_fd(ph, libname, -1, base);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
lib_info* add_lib_info_fd(struct ps_prochandle* ph, const char* libname, int fd, uintptr_t base) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
   lib_info* newlib;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
   if ( (newlib = (lib_info*) calloc(1, sizeof(struct lib_info))) == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
      print_debug("can't allocate memory for lib_info\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
      return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
30281
b1608535e50f 8076475: Misuses of strncpy/strncat
stuefe
parents: 22789
diff changeset
   168
   if (strlen(libname) >= sizeof(newlib->name)) {
b1608535e50f 8076475: Misuses of strncpy/strncat
stuefe
parents: 22789
diff changeset
   169
     print_debug("libname %s too long\n", libname);
35516
f0d335e847c5 8145698: Memory leak in add_lib_info_fd of libproc_impl.c:174
dsamersoff
parents: 35217
diff changeset
   170
     free(newlib);
30281
b1608535e50f 8076475: Misuses of strncpy/strncat
stuefe
parents: 22789
diff changeset
   171
     return NULL;
b1608535e50f 8076475: Misuses of strncpy/strncat
stuefe
parents: 22789
diff changeset
   172
   }
b1608535e50f 8076475: Misuses of strncpy/strncat
stuefe
parents: 22789
diff changeset
   173
   strcpy(newlib->name, libname);
b1608535e50f 8076475: Misuses of strncpy/strncat
stuefe
parents: 22789
diff changeset
   174
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
   newlib->base = base;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
   if (fd == -1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
      if ( (newlib->fd = pathmap_open(newlib->name)) < 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
         print_debug("can't open shared object %s\n", newlib->name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
         free(newlib);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
         return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
   } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
      newlib->fd = fd;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
   // check whether we have got an ELF file. /proc/<pid>/map
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
   // gives out all file mappings and not just shared objects
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
   if (is_elf_file(newlib->fd) == false) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
      close(newlib->fd);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
      free(newlib);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
      return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
5045
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 1
diff changeset
   195
   newlib->symtab = build_symtab(newlib->fd, libname);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
   if (newlib->symtab == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
      print_debug("symbol table build failed for %s\n", newlib->name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
   // even if symbol table building fails, we add the lib_info.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
   // This is because we may need to read from the ELF file for core file
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
   // address read functionality. lookup_symbol checks for NULL symtab.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
   if (ph->libs) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
      ph->lib_tail->next = newlib;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
      ph->lib_tail = newlib;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
   }  else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
      ph->libs = ph->lib_tail = newlib;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
   ph->num_libs++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
   return newlib;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
// lookup for a specific symbol
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
uintptr_t lookup_symbol(struct ps_prochandle* ph,  const char* object_name,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
                       const char* sym_name) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
   // ignore object_name. search in all libraries
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
   // FIXME: what should we do with object_name?? The library names are obtained
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
   // by parsing /proc/<pid>/maps, which may not be the same as object_name.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
   // What we need is a utility to map object_name to real file name, something
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
   // dlopen() does by looking at LD_LIBRARY_PATH and /etc/ld.so.cache. For
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
   // now, we just ignore object_name and do a global search for the symbol.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
   lib_info* lib = ph->libs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
   while (lib) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
      if (lib->symtab) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
         uintptr_t res = search_symbol(lib->symtab, lib->base, sym_name, NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
         if (res) return res;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
      lib = lib->next;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
   print_debug("lookup failed for symbol '%s' in obj '%s'\n",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
                          sym_name, object_name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
   return (uintptr_t) NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
const char* symbol_for_pc(struct ps_prochandle* ph, uintptr_t addr, uintptr_t* poffset) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
   const char* res = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
   lib_info* lib = ph->libs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
   while (lib) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
      if (lib->symtab && addr >= lib->base) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
         res = nearest_symbol(lib->symtab, addr - lib->base, poffset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
         if (res) return res;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
      lib = lib->next;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
   return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
// add a thread to ps_prochandle
53379
e47074d2d8cc 8181313: SA: Remove libthread_db dependency on Linux
ysuenaga
parents: 53004
diff changeset
   253
thread_info* add_thread_info(struct ps_prochandle* ph, lwpid_t lwp_id) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
   thread_info* newthr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
   if ( (newthr = (thread_info*) calloc(1, sizeof(thread_info))) == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
      print_debug("can't allocate memory for thread_info\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
      return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
   // initialize thread info
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
   newthr->lwp_id = lwp_id;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
   // add new thread to the list
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
   newthr->next = ph->threads;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
   ph->threads = newthr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
   ph->num_threads++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
   return newthr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
53004
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   270
void delete_thread_info(struct ps_prochandle* ph, thread_info* thr_to_be_removed) {
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   271
    thread_info* current_thr = ph->threads;
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   272
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   273
    if (thr_to_be_removed == ph->threads) {
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   274
      ph->threads = ph->threads->next;
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   275
    } else {
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   276
      thread_info* previous_thr;
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   277
      while (current_thr && current_thr != thr_to_be_removed) {
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   278
        previous_thr = current_thr;
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   279
        current_thr = current_thr->next;
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   280
      }
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   281
      if (current_thr == NULL) {
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   282
        print_error("Could not find the thread to be removed");
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   283
        return;
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   284
      }
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   285
      previous_thr->next = current_thr->next;
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   286
    }
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   287
    ph->num_threads--;
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   288
    free(current_thr);
b9d34a97a4be 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
jgeorge
parents: 49440
diff changeset
   289
}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
// get number of threads
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
int get_num_threads(struct ps_prochandle* ph) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
   return ph->num_threads;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
// get lwp_id of n'th thread
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
lwpid_t get_lwp_id(struct ps_prochandle* ph, int index) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
   int count = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
   thread_info* thr = ph->threads;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
   while (thr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
      if (count == index) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
         return thr->lwp_id;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
      count++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
      thr = thr->next;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
   return -1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
// get regs for a given lwp
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
bool get_lwp_regs(struct ps_prochandle* ph, lwpid_t lwp_id, struct user_regs_struct* regs) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
  return ph->ops->get_lwp_regs(ph, lwp_id, regs);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
// get number of shared objects
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
int get_num_libs(struct ps_prochandle* ph) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
   return ph->num_libs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
// get name of n'th solib
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
const char* get_lib_name(struct ps_prochandle* ph, int index) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
   int count = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
   lib_info* lib = ph->libs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
   while (lib) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
      if (count == index) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
         return lib->name;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
      count++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
      lib = lib->next;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
   return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
// get base address of a lib
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
uintptr_t get_lib_base(struct ps_prochandle* ph, int index) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
   int count = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
   lib_info* lib = ph->libs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
   while (lib) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
      if (count == index) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
         return lib->base;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
      count++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
      lib = lib->next;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
   return (uintptr_t)NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
bool find_lib(struct ps_prochandle* ph, const char *lib_name) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
  lib_info *p = ph->libs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
  while (p) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
    if (strcmp(p->name, lib_name) == 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
      return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
    p = p->next;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
  return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
//--------------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
// proc service functions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
// get process id
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   363
JNIEXPORT pid_t JNICALL
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   364
ps_getpid(struct ps_prochandle *ph) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
   return ph->pid;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
// ps_pglobal_lookup() looks up the symbol sym_name in the symbol table
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
// of the load object object_name in the target process identified by ph.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
// It returns the symbol's value as an address in the target process in
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
// *sym_addr.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   373
JNIEXPORT ps_err_e JNICALL
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   374
ps_pglobal_lookup(struct ps_prochandle *ph, const char *object_name,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
                    const char *sym_name, psaddr_t *sym_addr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
  *sym_addr = (psaddr_t) lookup_symbol(ph, object_name, sym_name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
  return (*sym_addr ? PS_OK : PS_NOSYM);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
// read "size" bytes info "buf" from address "addr"
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   381
JNIEXPORT ps_err_e JNICALL
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   382
ps_pdread(struct ps_prochandle *ph, psaddr_t  addr,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
                   void *buf, size_t size) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
  return ph->ops->p_pread(ph, (uintptr_t) addr, buf, size)? PS_OK: PS_ERR;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
// write "size" bytes of data to debuggee at address "addr"
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   388
JNIEXPORT ps_err_e JNICALL
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   389
ps_pdwrite(struct ps_prochandle *ph, psaddr_t addr,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
                    const void *buf, size_t size) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
  return ph->ops->p_pwrite(ph, (uintptr_t)addr, buf, size)? PS_OK: PS_ERR;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
// ------------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
// Functions below this point are not yet implemented. They are here only
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
// to make the linker happy.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   398
JNIEXPORT ps_err_e JNICALL
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   399
ps_lsetfpregs(struct ps_prochandle *ph, lwpid_t lid, const prfpregset_t *fpregs) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
  print_debug("ps_lsetfpregs not implemented\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
  return PS_OK;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   404
JNIEXPORT ps_err_e JNICALL
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   405
ps_lsetregs(struct ps_prochandle *ph, lwpid_t lid, const prgregset_t gregset) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
  print_debug("ps_lsetregs not implemented\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
  return PS_OK;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   410
JNIEXPORT ps_err_e  JNICALL
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   411
ps_lgetfpregs(struct  ps_prochandle  *ph,  lwpid_t lid, prfpregset_t *fpregs) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
  print_debug("ps_lgetfpregs not implemented\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
  return PS_OK;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   416
JNIEXPORT ps_err_e JNICALL
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   417
ps_lgetregs(struct ps_prochandle *ph, lwpid_t lid, prgregset_t gregset) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
  print_debug("ps_lgetfpregs not implemented\n");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
  return PS_OK;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421