Datapin global/local differentiation
This commit is contained in:
parent
6b716fbd56
commit
59eb91dcdf
@ -12,8 +12,8 @@ ipin <label> <target uid> <field offset>
|
||||
ipin <label> <target uid> <field offset>
|
||||
ipin <label> <target uid> <field offset>
|
||||
...
|
||||
dpin <symbol> <offset> <level> <target uid>
|
||||
dpin <symbol> <offset> <level> <target uid>
|
||||
dpin <local/global> <symbol> <offset> <level> <target uid>
|
||||
dpin <local/global> <symbol> <offset> <level> <target uid>
|
||||
...
|
||||
|
||||
|
||||
|
||||
@ -19,7 +19,8 @@ void on_finish_unit(void* plugin_data, void* user_data) {
|
||||
std::cout << " Target " << uid << " -> \"" << target.name() << "\" (" << target.size() << ")" << std::endl;
|
||||
|
||||
for (const DataPin& dpin : dpins()) {
|
||||
std::cout << " Data pin at symbol \"" << dpin.symbol << "\":" << std::endl;
|
||||
std::cout << " " << (dpin.global ? "Global" : "Local") << " data pin at symbol \""
|
||||
<< dpin.symbol << "\":" << std::endl;
|
||||
for (const DataPin::Component& c : dpin.components)
|
||||
std::cout << " offset " << c.offset << " (level " << c.level << ") -> target " << c.target << std::endl;
|
||||
}
|
||||
|
||||
@ -55,8 +55,7 @@ static void on_static_var(tree var) {
|
||||
return;
|
||||
|
||||
DECL_PRESERVE_P(var) = 1;
|
||||
DECL_VISIBILITY(var) = VISIBILITY_DEFAULT;
|
||||
DECL_VISIBILITY_SPECIFIED(var) = 1;
|
||||
pin.global = static_cast<bool>(TREE_PUBLIC(var));
|
||||
|
||||
tree symbol_tree = DECL_ASSEMBLER_NAME(var);
|
||||
const char* symbol;
|
||||
|
||||
@ -77,6 +77,7 @@ struct DataPin {
|
||||
};
|
||||
|
||||
std::string symbol;
|
||||
bool global;
|
||||
std::list<Component> components;
|
||||
};
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
int second_pid();
|
||||
int third_pid();
|
||||
|
||||
struct task_struct global = { .pid = 42, .comm = "main_global" };
|
||||
extern struct task_struct global = { .pid = 42, .comm = "main_global" };
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user