#include "gdb_assert.h"
#include "block.h"
#include "source.h"
+#include "objfiles.h"
/* Standard set of definitions for printing, dumping, prefixifying,
* and evaluating expressions. */
write_exp_elt (tmp);
}
+void
+write_exp_elt_objfile (struct objfile *objfile)
+{
+ union exp_element tmp;
+ memset (&tmp, 0, sizeof (union exp_element));
+ tmp.objfile = objfile;
+ write_exp_elt (tmp);
+}
+
void
write_exp_elt_longcst (LONGEST expelt)
{
static struct type *msym_text_symbol_type;
static struct type *msym_data_symbol_type;
static struct type *msym_unknown_symbol_type;
+static struct type *msym_tls_symbol_type;
void
write_exp_msymbol (struct minimal_symbol *msymbol,
write_exp_elt_opcode (OP_LONG);
+ if (SYMBOL_BFD_SECTION (msymbol)->flags & SEC_THREAD_LOCAL)
+ {
+ bfd *bfd = SYMBOL_BFD_SECTION (msymbol)->owner;
+ struct objfile *ofp;
+
+ ALL_OBJFILES (ofp)
+ if (ofp->obfd == bfd)
+ break;
+
+ write_exp_elt_opcode (UNOP_MEMVAL_TLS);
+ write_exp_elt_objfile (ofp);
+ write_exp_elt_type (msym_tls_symbol_type);
+ write_exp_elt_opcode (UNOP_MEMVAL_TLS);
+ return;
+ }
+
write_exp_elt_opcode (UNOP_MEMVAL);
switch (msymbol->type)
{
args = 1;
break;
+ case UNOP_MEMVAL_TLS:
+ oplen = 4;
+ args = 1;
+ break;
+
case UNOP_ABS:
case UNOP_CAP:
case UNOP_CHR:
init_type (TYPE_CODE_INT, 1, 0,
"<variable (not text or data), no debug info>",
NULL);
+
+ msym_tls_symbol_type =
+ init_type (TYPE_CODE_INT, TARGET_INT_BIT / HOST_CHAR_BIT, 0,
+ "<thread local variable, no debug info>", NULL);
}
/* This function avoids direct calls to fprintf