gdbarch_wchar_signed (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Check variable changed from pre-default. */
+ /* Check variable changed from its initial value. */
gdb_assert (gdbarch->wchar_signed != -1);
if (gdbarch_debug >= 2)
gdb_printf (gdb_stdlog, "gdbarch_wchar_signed called\n");
gdbarch_addr_bit (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Check variable changed from pre-default. */
+ /* Check variable changed from its initial value. */
gdb_assert (gdbarch->addr_bit != 0);
if (gdbarch_debug >= 2)
gdb_printf (gdb_stdlog, "gdbarch_addr_bit called\n");
gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Check variable changed from pre-default. */
+ /* Check variable changed from its initial value. */
gdb_assert (gdbarch->dwarf2_addr_size != 0);
if (gdbarch_debug >= 2)
gdb_printf (gdb_stdlog, "gdbarch_dwarf2_addr_size called\n");
gdbarch_char_signed (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Check variable changed from pre-default. */
+ /* Check variable changed from its initial value. */
gdb_assert (gdbarch->char_signed != -1);
if (gdbarch_debug >= 2)
gdb_printf (gdb_stdlog, "gdbarch_char_signed called\n");
gdbarch_num_regs (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Check variable changed from pre-default. */
+ /* Check variable changed from its initial value. */
gdb_assert (gdbarch->num_regs != -1);
if (gdbarch_debug >= 2)
gdb_printf (gdb_stdlog, "gdbarch_num_regs called\n");
gdbarch_gcore_bfd_target (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Check variable changed from pre-default. */
- gdb_assert (gdbarch->gcore_bfd_target != 0);
+ /* Check predicate was used. */
+ gdb_assert (gdbarch_gcore_bfd_target_p (gdbarch));
if (gdbarch_debug >= 2)
gdb_printf (gdb_stdlog, "gdbarch_gcore_bfd_target called\n");
return gdbarch->gcore_bfd_target;
gdbarch_max_insn_length (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Check variable changed from pre-default. */
- gdb_assert (gdbarch->max_insn_length != 0);
+ /* Check predicate was used. */
+ gdb_assert (gdbarch_max_insn_length_p (gdbarch));
if (gdbarch_debug >= 2)
gdb_printf (gdb_stdlog, "gdbarch_max_insn_length called\n");
return gdbarch->max_insn_length;
if isinstance(c.invalid, str):
print(" /* Check variable is valid. */", file=f)
print(f" gdb_assert (!({c.invalid}));", file=f)
- elif c.postdefault is not None and c.predefault is not None:
- print(" /* Check variable changed from pre-default. */", file=f)
- print(f" gdb_assert (gdbarch->{c.name} != {c.predefault});", file=f)
- elif c.invalid:
- if c.predefault:
- print(" /* Check variable changed from pre-default. */", file=f)
- print(
- f" gdb_assert (gdbarch->{c.name} != {c.predefault});", file=f
- )
+ elif c.predicate:
+ print(" /* Check predicate was used. */", file=f)
+ print(f" gdb_assert (gdbarch_{c.name}_p (gdbarch));", file=f)
+ elif c.invalid or c.postdefault is not None:
+ init_value = c.predefault or "0"
+ print(" /* Check variable changed from its initial value. */", file=f)
+ print(f" gdb_assert (gdbarch->{c.name} != {init_value});", file=f)
else:
print(f" /* Skip verify of {c.name}, invalid_p == 0 */", file=f)
print(" if (gdbarch_debug >= 2)", file=f)