X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fnto-tdep.c;h=82a4fcbbb94312dacd1de4c7c1e313619df30546;hb=22ad8107d35d833db000e5a5050c0f53af7af51f;hp=0b53c4b9feb23c0db45485c12af51f711ff51228;hpb=14278e1fdbe045df184d6dd546ff6a1e9e3c3797;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c index 0b53c4b9fe..82a4fcbbb9 100644 --- a/gdb/nto-tdep.c +++ b/gdb/nto-tdep.c @@ -1,6 +1,6 @@ /* nto-tdep.c - general QNX Neutrino target functionality. - Copyright (C) 2003-2017 Free Software Foundation, Inc. + Copyright (C) 2003-2018 Free Software Foundation, Inc. Contributed by QNX Software Systems Ltd. @@ -31,6 +31,8 @@ #include "solib-svr4.h" #include "gdbcore.h" #include "objfiles.h" +#include "source.h" +#include "common/pathstuff.h" #define QNX_NOTE_NAME "QNX" #define QNX_INFO_SECT_NAME "QNX_info" @@ -88,7 +90,7 @@ nto_map_arch_to_cputype (const char *arch) int nto_find_and_open_solib (const char *solib, unsigned o_flags, - char **temp_pathname) + gdb::unique_xmalloc_ptr *temp_pathname) { char *buf, *arch_path, *nto_root; const char *endian; @@ -142,9 +144,9 @@ nto_find_and_open_solib (const char *solib, unsigned o_flags, if (temp_pathname) { if (ret >= 0) - *temp_pathname = gdb_realpath (arch_path).release (); + *temp_pathname = gdb_realpath (arch_path); else - *temp_pathname = NULL; + temp_pathname->reset (NULL); } } return ret; @@ -380,9 +382,13 @@ static const char *nto_thread_state_str[] = const char * nto_extra_thread_info (struct target_ops *self, struct thread_info *ti) { - if (ti && ti->priv - && ti->priv->state < ARRAY_SIZE (nto_thread_state_str)) - return (char *)nto_thread_state_str [ti->priv->state]; + if (ti != NULL && ti->priv != NULL) + { + nto_thread_info *priv = get_nto_thread_info (ti); + + if (priv->state < ARRAY_SIZE (nto_thread_state_str)) + return nto_thread_state_str [priv->state]; + } return ""; } @@ -533,9 +539,6 @@ nto_inferior_data (struct inferior *const inferior) return inf_data; } -/* Provide a prototype to silence -Wmissing-prototypes. */ -extern initialize_file_ftype _initialize_nto_tdep; - void _initialize_nto_tdep (void) {