/* Implementation of the GDB variable objects API.
- Copyright (C) 1999-2015 Free Software Foundation, Inc.
+ Copyright (C) 1999-2016 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* String representations of gdb's format codes. */
char *varobj_format_string[] =
- { "natural", "binary", "decimal", "hexadecimal", "octal" };
+ { "natural", "binary", "decimal", "hexadecimal", "octal", "zero-hexadecimal" };
/* True if we want to allow Python-based pretty-printing. */
static int pretty_printing = 0;
not NULL. */
struct frame_id frame;
- /* The thread ID that this varobj_root belong to. This field
+ /* The global thread ID that this varobj_root belongs to. This field
is only valid if valid_block is not NULL.
When not 0, indicates which thread 'frame' belongs to.
When 0, indicates that the thread list was empty when the varobj_root
/* Private data */
/* Mappings of varobj_display_formats enums to gdb's format codes. */
-static int format_code[] = { 0, 't', 'd', 'x', 'o' };
+static int format_code[] = { 0, 't', 'd', 'x', 'o', 'z' };
/* Header of the list of root variable objects. */
static struct varobj_root *rootlist;
/* Prime number indicating the number of buckets in the hash table. */
-/* A prime large enough to avoid too many colisions. */
+/* A prime large enough to avoid too many collisions. */
#define VAROBJ_TABLE_SIZE 227
/* Pointer to the varobj hash table (built at run time). */
}
#endif
-/* Creates a varobj (not its children). */
-
/* Return the full FRAME which corresponds to the given CORE_ADDR
or NULL if no FRAME on the chain corresponds to CORE_ADDR. */
return NULL;
}
+/* Creates a varobj (not its children). */
+
struct varobj *
varobj_create (char *objname,
char *expression, CORE_ADDR frame, enum varobj_type type)
error (_("Failed to find the specified frame"));
var->root->frame = get_frame_id (fi);
- var->root->thread_id = pid_to_thread_id (inferior_ptid);
+ var->root->thread_id = ptid_to_global_thread_id (inferior_ptid);
old_id = get_frame_id (get_selected_frame (NULL));
select_frame (fi);
}
case FORMAT_DECIMAL:
case FORMAT_HEXADECIMAL:
case FORMAT_OCTAL:
+ case FORMAT_ZHEXADECIMAL:
var->format = format;
break;
}
else
{
- ptid_t ptid = thread_id_to_pid (var->root->thread_id);
- if (in_thread_list (ptid))
+ ptid_t ptid = global_thread_id_to_ptid (var->root->thread_id);
+
+ if (!ptid_equal (minus_one_ptid, ptid))
{
switch_to_thread (ptid);
within_scope = check_scope (var);