gdb: remove COMPUNIT_PRODUCER macro, add getter/setter
Add a getter and a setter for a compunit_symtab's producer. Remove the corresponding macro and adjust all callers. Change-Id: Ia1d6d8a0e247a08a21af23819d71e49b37d8931b
This commit is contained in:
parent
422f1ea279
commit
ab5f850eed
10 changed files with 33 additions and 25 deletions
|
@ -2474,8 +2474,8 @@ amd64_skip_xmm_prologue (CORE_ADDR pc, CORE_ADDR start_pc)
|
||||||
|
|
||||||
start_pc_sal = find_pc_sect_line (start_pc, NULL, 0);
|
start_pc_sal = find_pc_sect_line (start_pc, NULL, 0);
|
||||||
if (start_pc_sal.symtab == NULL
|
if (start_pc_sal.symtab == NULL
|
||||||
|| producer_is_gcc_ge_4 (COMPUNIT_PRODUCER
|
|| producer_is_gcc_ge_4 (SYMTAB_COMPUNIT
|
||||||
(SYMTAB_COMPUNIT (start_pc_sal.symtab))) < 6
|
(start_pc_sal.symtab)->producer ()) < 6
|
||||||
|| start_pc_sal.pc != start_pc || pc >= start_pc_sal.end)
|
|| start_pc_sal.pc != start_pc || pc >= start_pc_sal.end)
|
||||||
return pc;
|
return pc;
|
||||||
|
|
||||||
|
@ -2545,9 +2545,9 @@ amd64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
|
||||||
compilers to emit usable line notes. */
|
compilers to emit usable line notes. */
|
||||||
if (post_prologue_pc
|
if (post_prologue_pc
|
||||||
&& (cust != NULL
|
&& (cust != NULL
|
||||||
&& COMPUNIT_PRODUCER (cust) != NULL
|
&& cust->producer () != nullptr
|
||||||
&& (producer_is_llvm (COMPUNIT_PRODUCER (cust))
|
&& (producer_is_llvm (cust->producer ())
|
||||||
|| producer_is_icc_ge_19 (COMPUNIT_PRODUCER (cust)))))
|
|| producer_is_icc_ge_19 (cust->producer ()))))
|
||||||
return std::max (start_pc, post_prologue_pc);
|
return std::max (start_pc, post_prologue_pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1394,9 +1394,9 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||||
missing (e.g. for -gstabs), assuming the GNU tools. */
|
missing (e.g. for -gstabs), assuming the GNU tools. */
|
||||||
if (post_prologue_pc
|
if (post_prologue_pc
|
||||||
&& (cust == NULL
|
&& (cust == NULL
|
||||||
|| COMPUNIT_PRODUCER (cust) == NULL
|
|| cust->producer () == NULL
|
||||||
|| startswith (COMPUNIT_PRODUCER (cust), "GNU ")
|
|| startswith (cust->producer (), "GNU ")
|
||||||
|| producer_is_llvm (COMPUNIT_PRODUCER (cust))))
|
|| producer_is_llvm (cust->producer ())))
|
||||||
return post_prologue_pc;
|
return post_prologue_pc;
|
||||||
|
|
||||||
if (post_prologue_pc != 0)
|
if (post_prologue_pc != 0)
|
||||||
|
|
|
@ -1013,7 +1013,7 @@ buildsym_compunit::end_symtab_with_blockvector (struct block *static_block,
|
||||||
cu->set_debugformat (m_debugformat);
|
cu->set_debugformat (m_debugformat);
|
||||||
|
|
||||||
/* Similarly for the producer. */
|
/* Similarly for the producer. */
|
||||||
COMPUNIT_PRODUCER (cu) = m_producer;
|
cu->set_producer (m_producer);
|
||||||
|
|
||||||
COMPUNIT_BLOCKVECTOR (cu) = blockvector;
|
COMPUNIT_BLOCKVECTOR (cu) = blockvector;
|
||||||
{
|
{
|
||||||
|
|
|
@ -561,11 +561,11 @@ get_selected_pc_producer_options (void)
|
||||||
struct compunit_symtab *symtab = find_pc_compunit_symtab (pc);
|
struct compunit_symtab *symtab = find_pc_compunit_symtab (pc);
|
||||||
const char *cs;
|
const char *cs;
|
||||||
|
|
||||||
if (symtab == NULL || symtab->producer == NULL
|
if (symtab == NULL || symtab->producer () == NULL
|
||||||
|| !startswith (symtab->producer, "GNU "))
|
|| !startswith (symtab->producer (), "GNU "))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
cs = symtab->producer;
|
cs = symtab->producer ();
|
||||||
while (*cs != 0 && *cs != '-')
|
while (*cs != 0 && *cs != '-')
|
||||||
cs = skip_spaces (skip_to_space (cs));
|
cs = skip_spaces (skip_to_space (cs));
|
||||||
if (*cs != '-')
|
if (*cs != '-')
|
||||||
|
|
|
@ -745,7 +745,7 @@ dwarf2_frame_find_quirks (struct dwarf2_frame_state *fs,
|
||||||
if (cust == NULL)
|
if (cust == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (producer_is_realview (COMPUNIT_PRODUCER (cust)))
|
if (producer_is_realview (cust->producer ()))
|
||||||
{
|
{
|
||||||
if (fde->cie->version == 1)
|
if (fde->cie->version == 1)
|
||||||
fs->armcc_cfa_offsets_sf = 1;
|
fs->armcc_cfa_offsets_sf = 1;
|
||||||
|
|
|
@ -1853,9 +1853,9 @@ i386_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
|
||||||
compilers to emit usable line notes. */
|
compilers to emit usable line notes. */
|
||||||
if (post_prologue_pc
|
if (post_prologue_pc
|
||||||
&& (cust != NULL
|
&& (cust != NULL
|
||||||
&& COMPUNIT_PRODUCER (cust) != NULL
|
&& cust->producer () != NULL
|
||||||
&& (producer_is_llvm (COMPUNIT_PRODUCER (cust))
|
&& (producer_is_llvm (cust->producer ())
|
||||||
|| producer_is_icc_ge_19 (COMPUNIT_PRODUCER (cust)))))
|
|| producer_is_icc_ge_19 (cust->producer ()))))
|
||||||
return std::max (start_pc, post_prologue_pc);
|
return std::max (start_pc, post_prologue_pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -132,9 +132,9 @@ stpy_get_producer (PyObject *self, void *closure)
|
||||||
|
|
||||||
STPY_REQUIRE_VALID (self, symtab);
|
STPY_REQUIRE_VALID (self, symtab);
|
||||||
cust = SYMTAB_COMPUNIT (symtab);
|
cust = SYMTAB_COMPUNIT (symtab);
|
||||||
if (COMPUNIT_PRODUCER (cust) != NULL)
|
if (cust->producer () != nullptr)
|
||||||
{
|
{
|
||||||
const char *producer = COMPUNIT_PRODUCER (cust);
|
const char *producer = cust->producer ();
|
||||||
|
|
||||||
return host_string_to_python_string (producer).release ();
|
return host_string_to_python_string (producer).release ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -724,8 +724,8 @@ info_source_command (const char *ignore, int from_tty)
|
||||||
|
|
||||||
printf_filtered (_("Source language is %s.\n"), language_str (s->language));
|
printf_filtered (_("Source language is %s.\n"), language_str (s->language));
|
||||||
printf_filtered (_("Producer is %s.\n"),
|
printf_filtered (_("Producer is %s.\n"),
|
||||||
COMPUNIT_PRODUCER (cust) != NULL
|
(cust->producer ()) != nullptr
|
||||||
? COMPUNIT_PRODUCER (cust) : _("unknown"));
|
? cust->producer () : _("unknown"));
|
||||||
printf_filtered (_("Compiled with %s debugging format.\n"),
|
printf_filtered (_("Compiled with %s debugging format.\n"),
|
||||||
cust->debugformat ());
|
cust->debugformat ());
|
||||||
printf_filtered (_("%s preprocessor macro info.\n"),
|
printf_filtered (_("%s preprocessor macro info.\n"),
|
||||||
|
|
|
@ -779,9 +779,8 @@ maintenance_info_symtabs (const char *regexp, int from_tty)
|
||||||
printf_filtered (" debugformat %s\n",
|
printf_filtered (" debugformat %s\n",
|
||||||
cust->debugformat ());
|
cust->debugformat ());
|
||||||
printf_filtered (" producer %s\n",
|
printf_filtered (" producer %s\n",
|
||||||
COMPUNIT_PRODUCER (cust) != NULL
|
(cust->producer () != nullptr
|
||||||
? COMPUNIT_PRODUCER (cust)
|
? cust->producer () : "(null)"));
|
||||||
: "(null)");
|
|
||||||
printf_filtered (" dirname %s\n",
|
printf_filtered (" dirname %s\n",
|
||||||
COMPUNIT_DIRNAME (cust) != NULL
|
COMPUNIT_DIRNAME (cust) != NULL
|
||||||
? COMPUNIT_DIRNAME (cust)
|
? COMPUNIT_DIRNAME (cust)
|
||||||
|
|
13
gdb/symtab.h
13
gdb/symtab.h
|
@ -1492,6 +1492,16 @@ struct compunit_symtab
|
||||||
m_debugformat = debugformat;
|
m_debugformat = debugformat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *producer () const
|
||||||
|
{
|
||||||
|
return m_producer;
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_producer (const char *producer)
|
||||||
|
{
|
||||||
|
m_producer = producer;
|
||||||
|
}
|
||||||
|
|
||||||
/* Make PRIMARY_FILETAB the primary filetab of this compunit symtab.
|
/* Make PRIMARY_FILETAB the primary filetab of this compunit symtab.
|
||||||
|
|
||||||
PRIMARY_FILETAB must already be a filetab of this compunit symtab. */
|
PRIMARY_FILETAB must already be a filetab of this compunit symtab. */
|
||||||
|
@ -1538,7 +1548,7 @@ struct compunit_symtab
|
||||||
const char *m_debugformat;
|
const char *m_debugformat;
|
||||||
|
|
||||||
/* String of producer version information, or NULL if we don't know. */
|
/* String of producer version information, or NULL if we don't know. */
|
||||||
const char *producer;
|
const char *m_producer;
|
||||||
|
|
||||||
/* Directory in which it was compiled, or NULL if we don't know. */
|
/* Directory in which it was compiled, or NULL if we don't know. */
|
||||||
const char *dirname;
|
const char *dirname;
|
||||||
|
@ -1587,7 +1597,6 @@ struct compunit_symtab
|
||||||
|
|
||||||
using compunit_symtab_range = next_range<compunit_symtab>;
|
using compunit_symtab_range = next_range<compunit_symtab>;
|
||||||
|
|
||||||
#define COMPUNIT_PRODUCER(cust) ((cust)->producer)
|
|
||||||
#define COMPUNIT_DIRNAME(cust) ((cust)->dirname)
|
#define COMPUNIT_DIRNAME(cust) ((cust)->dirname)
|
||||||
#define COMPUNIT_BLOCKVECTOR(cust) ((cust)->blockvector)
|
#define COMPUNIT_BLOCKVECTOR(cust) ((cust)->blockvector)
|
||||||
#define COMPUNIT_BLOCK_LINE_SECTION(cust) ((cust)->block_line_section)
|
#define COMPUNIT_BLOCK_LINE_SECTION(cust) ((cust)->block_line_section)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue