mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 11:26:11 +00:00
Replace afcf with C api. (#2940)
This commit is contained in:
parent
e022e44474
commit
6345604172
@ -1266,7 +1266,16 @@ RzAnalysisFunction *CutterCore::functionIn(ut64 addr)
|
|||||||
RzAnalysisFunction *CutterCore::functionAt(ut64 addr)
|
RzAnalysisFunction *CutterCore::functionAt(ut64 addr)
|
||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
return rz_analysis_get_function_at(core->analysis, addr);
|
RzAnalysisFunction *fcn = rz_analysis_get_function_at(core->analysis, addr);
|
||||||
|
if (fcn) {
|
||||||
|
return fcn;
|
||||||
|
}
|
||||||
|
RzList *list = rz_analysis_get_functions_in(core->analysis, addr);
|
||||||
|
if (rz_list_length(list) == 1) {
|
||||||
|
fcn = static_cast<RzAnalysisFunction *>(rz_list_first(list));
|
||||||
|
}
|
||||||
|
rz_list_free(list);
|
||||||
|
return fcn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -84,11 +84,13 @@ QString GraphWidget::getWidgetType()
|
|||||||
|
|
||||||
void GraphWidget::prepareHeader()
|
void GraphWidget::prepareHeader()
|
||||||
{
|
{
|
||||||
QString afcf = Core()->cmdRawAt("afcf", seekable->getOffset()).trimmed();
|
RzAnalysisFunction *f = Core()->functionAt(seekable->getOffset());
|
||||||
if (afcf.isEmpty()) {
|
char *str = f ? rz_analysis_function_get_signature(f) : nullptr;
|
||||||
|
if (!str) {
|
||||||
header->hide();
|
header->hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
header->show();
|
header->show();
|
||||||
header->setText(afcf);
|
header->setText(str);
|
||||||
|
free(str);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user