mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
[qfcc] Make print_operand usable from gdb
It not emitting a \n made life difficult, especially whenever gdb decided to make access to printf or puts awkward.
This commit is contained in:
parent
b544a052bf
commit
db06300ddd
1 changed files with 13 additions and 6 deletions
|
@ -158,8 +158,8 @@ operand_string (operand_t *op)
|
|||
return ("??");
|
||||
}
|
||||
|
||||
void
|
||||
print_operand (operand_t *op)
|
||||
static void
|
||||
_print_operand (operand_t *op)
|
||||
{
|
||||
switch (op->op_type) {
|
||||
case op_def:
|
||||
|
@ -224,7 +224,7 @@ print_operand (operand_t *op)
|
|||
break;
|
||||
case op_alias:
|
||||
printf ("alias(%s,", pr_type_name[op->type->type]);
|
||||
print_operand (op->o.alias);
|
||||
_print_operand (op->o.alias);
|
||||
printf (")");
|
||||
break;
|
||||
case op_nil:
|
||||
|
@ -233,18 +233,25 @@ print_operand (operand_t *op)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
print_operand (operand_t *op)
|
||||
{
|
||||
_print_operand (op);
|
||||
puts ("");
|
||||
}
|
||||
|
||||
void
|
||||
print_statement (statement_t *s)
|
||||
{
|
||||
printf ("(%s, ", s->opcode);
|
||||
if (s->opa)
|
||||
print_operand (s->opa);
|
||||
_print_operand (s->opa);
|
||||
printf (", ");
|
||||
if (s->opb)
|
||||
print_operand (s->opb);
|
||||
_print_operand (s->opb);
|
||||
printf (", ");
|
||||
if (s->opc)
|
||||
print_operand (s->opc);
|
||||
_print_operand (s->opc);
|
||||
printf (")\n");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue