view: show syscall numbers even when the function has a name
This commit is contained in:
parent
593d486185
commit
10e7334524
|
@ -73,10 +73,12 @@ struct ViewAssemblyOptions
|
|||
Promotion PCAddr_to_Location = Promote;
|
||||
/* In a read with a know location, promote address to pointed value */
|
||||
Promotion ReadLocation_to_Constant = Promote;
|
||||
/* Promote an integer to a binary object's name */
|
||||
Promotion Constant_to_ObjectName = Promote;
|
||||
/* Promote an integer to a syscall number (if no name is available) */
|
||||
/* Promote an integer to a syscall number */
|
||||
Promotion Constant_to_SyscallNumber = Promote;
|
||||
/* Promote an integer (not a syscall) to a binary object's name */
|
||||
Promotion Constant_to_ObjectName = Promote;
|
||||
/* Promote a syscall number to a binary object's name */
|
||||
Promotion SyscallNumber_to_ObjectName = Append;
|
||||
} promotions;
|
||||
|
||||
/* Binary to get symbols from */
|
||||
|
|
|
@ -96,18 +96,6 @@ static void renderOperand(AsmOperand const &op, u32 pc, int opsize,
|
|||
type = Constant;
|
||||
}
|
||||
|
||||
/* Promote to object name first if available... */
|
||||
if(type == Constant && hasValue && opts.binary) {
|
||||
auto p = opts.promotions.Constant_to_ObjectName;
|
||||
BinaryObject *obj = opts.binary->objectAt(value);
|
||||
|
||||
if(obj) {
|
||||
if(output(out, p, {}, obj->name()))
|
||||
return;
|
||||
type = ObjectName;
|
||||
}
|
||||
}
|
||||
/* ... or, as a default, a syscall number */
|
||||
if(type == Constant && hasValue && os) {
|
||||
int syscall_id = os->find_syscall(value);
|
||||
if(syscall_id >= 0) {
|
||||
|
@ -117,6 +105,25 @@ static void renderOperand(AsmOperand const &op, u32 pc, int opsize,
|
|||
type = SyscallNumber;
|
||||
}
|
||||
}
|
||||
|
||||
if(type == Constant && hasValue && opts.binary) {
|
||||
auto p = opts.promotions.Constant_to_ObjectName;
|
||||
BinaryObject *obj = opts.binary->objectAt(value);
|
||||
if(obj) {
|
||||
if(output(out, p, {}, obj->name()))
|
||||
return;
|
||||
type = ObjectName;
|
||||
}
|
||||
}
|
||||
if(type == SyscallNumber && hasValue && opts.binary) {
|
||||
auto p = opts.promotions.SyscallNumber_to_ObjectName;
|
||||
BinaryObject *obj = opts.binary->objectAt(value);
|
||||
if(obj) {
|
||||
if(output(out, p, {}, obj->name()))
|
||||
return;
|
||||
type = ObjectName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=== Legacy-style instruction printer ===//
|
||||
|
|
Loading…
Reference in New Issue