{
/* Filter out any registers eliminated, but whose regnum is
reserved for backward compatibility, e.g. the vfp. */
- if (gdbarch_register_name (gdbarch, regnum) == NULL
- || *gdbarch_register_name (gdbarch, regnum) == '\0')
+ if (*gdbarch_register_name (gdbarch, regnum) == '\0')
return 0;
if (group == all_reggroup)
suspected that some GDB/SIM combinations may rely on this
behaviour. The default should be one2one_register_sim_regno
(below). */
- if (gdbarch_register_name (gdbarch, regnum) != NULL
- && gdbarch_register_name (gdbarch, regnum)[0] != '\0')
+ if (gdbarch_register_name (gdbarch, regnum)[0] != '\0')
return regnum;
else
return LEGACY_SIM_REGNO_IGNORE;
{
int raw_p;
- if (gdbarch_register_name (gdbarch, regnum) == NULL
- || gdbarch_register_name (gdbarch, regnum)[0] == '\0')
+ if (gdbarch_register_name (gdbarch, regnum)[0] == '\0')
return 0;
if (reggroup == all_reggroup)
LONGEST rval;
const char *name = gdbarch_register_name (gdbarch, regno);
- if (!name || !*name)
+ if (*name == '\0')
return;
rval = get_frame_register_signed (frame, regno);
/* If the register name is empty, it is undefined for this
processor, so don't display anything. */
- if (gdbarch_register_name (gdbarch, i) == NULL
- || *(gdbarch_register_name (gdbarch, i)) == '\0')
+ if (*(gdbarch_register_name (gdbarch, i)) == '\0')
continue;
default_print_one_register_info (file,
{
const char *name = gdbarch_register_name (gdbarch, regno);
- if (!name || !*name)
+ if (*name == '\0')
return;
gdb_printf (file, "%-10s ", name);
regnum < numregs;
regnum++)
{
- if (gdbarch_register_name (gdbarch, regnum) == NULL
- || *(gdbarch_register_name (gdbarch, regnum)) == '\0')
+ if (*(gdbarch_register_name (gdbarch, regnum)) == '\0')
uiout->field_string (NULL, "");
else
uiout->field_string (NULL, gdbarch_register_name (gdbarch, regnum));
if (regnum < 0 || regnum >= numregs)
error (_("bad register number"));
- if (gdbarch_register_name (gdbarch, regnum) == NULL
- || *(gdbarch_register_name (gdbarch, regnum)) == '\0')
+ if (*(gdbarch_register_name (gdbarch, regnum)) == '\0')
uiout->field_string (NULL, "");
else
uiout->field_string (NULL, gdbarch_register_name (gdbarch, regnum));
regnum < numregs;
regnum++)
{
- if (gdbarch_register_name (gdbarch, regnum) == NULL
- || *(gdbarch_register_name (gdbarch, regnum)) == '\0')
+ if (*(gdbarch_register_name (gdbarch, regnum)) == '\0')
continue;
if (register_changed_p (regnum, prev_regs.get (),
if (regnum >= 0
&& regnum < numregs
- && gdbarch_register_name (gdbarch, regnum) != NULL
&& *gdbarch_register_name (gdbarch, regnum) != '\000')
{
if (register_changed_p (regnum, prev_regs.get (),
regnum < numregs;
regnum++)
{
- if (gdbarch_register_name (gdbarch, regnum) == NULL
- || *(gdbarch_register_name (gdbarch, regnum)) == '\0')
+ if (*(gdbarch_register_name (gdbarch, regnum)) == '\0')
continue;
output_register (frame, regnum, format, skip_unavailable);
if (regnum >= 0
&& regnum < numregs
- && gdbarch_register_name (gdbarch, regnum) != NULL
&& *gdbarch_register_name (gdbarch, regnum) != '\000')
output_register (frame, regnum, format, skip_unavailable);
else
int regnum = atoi (argv[i]);
if (regnum >= 0 && regnum < numregs
- && gdbarch_register_name (gdbarch, regnum)
- && *gdbarch_register_name (gdbarch, regnum))
+ && *gdbarch_register_name (gdbarch, regnum) != '\0')
{
LONGEST value;
for (regnum = 0; regnum < numregs; regnum++)
{
- if (gdbarch_register_name (gdbarch, regnum) == NULL
- || *(gdbarch_register_name (gdbarch, regnum)) == '\0')
+ if (*(gdbarch_register_name (gdbarch, regnum)) == '\0')
continue;
output_register (frame, regnum, registers_format, 1);
/* FIXME: cagney/2003-04-13: Can't yet use gdbarch_num_regs
(gdbarch), as not all architectures are multi-arch. */
raw_p = rawnum < gdbarch_num_regs (gdbarch);
- if (gdbarch_register_name (gdbarch, regnum) == NULL
- || gdbarch_register_name (gdbarch, regnum)[0] == '\0')
+ if (gdbarch_register_name (gdbarch, regnum)[0] == '\0')
return 0;
if (reggroup == float_reggroup)
return float_p && pseudo;
decide if it is valid. Should instead define a standard sim/gdb
register numbering scheme. */
if (gdbarch_register_name (gdbarch,
- gdbarch_num_regs (gdbarch) + regnum) != NULL
- && gdbarch_register_name (gdbarch,
- gdbarch_num_regs (gdbarch)
- + regnum)[0] != '\0')
+ gdbarch_num_regs (gdbarch) + regnum)[0] != '\0')
return regnum;
else
return LEGACY_SIM_REGNO_IGNORE;
{
const char *regname = gdbarch_register_name (gdbarch, j);
- if (regname != NULL
- && strcmp (regname, nds32_register_aliases[i].name) == 0)
+ if (strcmp (regname, nds32_register_aliases[i].name) == 0)
{
regnum = j;
break;
gdb_printf (gdb_stdlog, "%s ", func);
if (regno >= 0 && regno < gdbarch_num_regs (gdbarch)
- && gdbarch_register_name (gdbarch, regno) != NULL
&& gdbarch_register_name (gdbarch, regno)[0] != '\0')
gdb_printf (gdb_stdlog, "(%s)",
gdbarch_register_name (gdbarch, regno));
{
const char *p = gdbarch_register_name (m_gdbarch, regnum);
- if (p == NULL)
- p = "";
- else if (p[0] == '\0')
+ if (p[0] == '\0')
p = "''";
gdb_printf (file, " %-10s", p);
}
int float_p;
int raw_p;
- if (gdbarch_register_name (gdbarch, regnum) == NULL
- || *gdbarch_register_name (gdbarch, regnum) == '\0')
+ if (*gdbarch_register_name (gdbarch, regnum) == '\0')
return 0;
if (group == all_reggroup)
return 1;
/* Used by 'info registers' and 'info registers <groupname>'. */
- if (gdbarch_register_name (gdbarch, regnum) == NULL
- || gdbarch_register_name (gdbarch, regnum)[0] == '\0')
+ if (gdbarch_register_name (gdbarch, regnum)[0] == '\0')
return 0;
if (regnum > RISCV_LAST_REGNUM && regnum < gdbarch_num_regs (gdbarch))
if (regnum != -1)
{
/* Print one specified register. */
- if (gdbarch_register_name (gdbarch, regnum) == NULL
- || *(gdbarch_register_name (gdbarch, regnum)) == '\0')
+ if (*(gdbarch_register_name (gdbarch, regnum)) == '\0')
error (_("Not a valid register for the current processor type"));
riscv_print_one_register_info (gdbarch, file, frame, regnum);
}
continue;
/* Registers with no name are not valid on this ISA. */
- if (gdbarch_register_name (gdbarch, regnum) == NULL
- || *(gdbarch_register_name (gdbarch, regnum)) == '\0')
+ if (*(gdbarch_register_name (gdbarch, regnum)) == '\0')
continue;
/* Is the register in the group we're interested in? */
sh_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
const struct reggroup *reggroup)
{
- if (gdbarch_register_name (gdbarch, regnum) == NULL
- || *gdbarch_register_name (gdbarch, regnum) == '\0')
+ if (*gdbarch_register_name (gdbarch, regnum) == '\0')
return 0;
if (reggroup == float_reggroup
/* If the register name is empty, it is undefined for this
processor, so don't display anything. */
name = gdbarch_register_name (gdbarch, regnum);
- if (name == 0 || *name == '\0')
+ if (*name == '\0')
continue;
nr_regs++;
/* If the register name is empty, it is undefined for this
processor, so don't display anything. */
name = gdbarch_register_name (gdbarch, regnum);
- if (name == 0 || *name == '\0')
+ if (*name == '\0')
continue;
data_item_win = &m_regs_content[pos];
/* Search register name space first - always let an architecture
specific register override the user registers. */
{
- int i;
int maxregs = gdbarch_num_cooked_regs (gdbarch);
- for (i = 0; i < maxregs; i++)
+ for (int i = 0; i < maxregs; i++)
{
const char *regname = gdbarch_register_name (gdbarch, i);
- if (regname != NULL && len == strlen (regname)
- && strncmp (regname, name, len) == 0)
- {
- return i;
- }
+ if (len == strlen (regname) && strncmp (regname, name, len) == 0)
+ return i;
}
}
regname = gdbarch_register_name (get_frame_arch (frame),
VALUE_REGNUM (val));
- gdb_assert (regname && *regname);
+ gdb_assert (regname != nullptr && *regname != '\0');
error (_("Address requested for identifier "
"\"%s\" which is in register $%s"),