parent
f19b269360
commit
3361651e9e
|
@ -53,6 +53,13 @@ namespace Linker {
|
||||||
*/
|
*/
|
||||||
extern bool bind_now;
|
extern bool bind_now;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print diagnostic information
|
||||||
|
*
|
||||||
|
* The value corresponds to the config attribute "ld_verbose".
|
||||||
|
*/
|
||||||
|
extern bool verbose;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find symbol via index
|
* Find symbol via index
|
||||||
*
|
*
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
/* Genode includes */
|
/* Genode includes */
|
||||||
#include <base/component.h>
|
#include <base/component.h>
|
||||||
#include <base/printf.h>
|
#include <base/printf.h>
|
||||||
#include <os/config.h>
|
#include <base/attached_rom_dataspace.h>
|
||||||
#include <util/list.h>
|
#include <util/list.h>
|
||||||
#include <util/string.h>
|
#include <util/string.h>
|
||||||
#include <base/thread.h>
|
#include <base/thread.h>
|
||||||
|
@ -37,6 +37,7 @@ namespace Linker {
|
||||||
|
|
||||||
static Binary *binary = 0;
|
static Binary *binary = 0;
|
||||||
bool Linker::bind_now = false;
|
bool Linker::bind_now = false;
|
||||||
|
bool Linker::verbose = false;
|
||||||
Link_map *Link_map::first;
|
Link_map *Link_map::first;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -550,11 +551,13 @@ void Component::construct(Genode::Env &env)
|
||||||
if (!Ld::linker()->file())
|
if (!Ld::linker()->file())
|
||||||
Ld::linker()->load_phdr();
|
Ld::linker()->load_phdr();
|
||||||
|
|
||||||
/* read configuration */
|
/* read configuration, release ROM afterwards */
|
||||||
try {
|
try {
|
||||||
/* bind immediately */
|
Genode::Attached_rom_dataspace config(env, "config");
|
||||||
bind_now = Genode::config()->xml_node().attribute("ld_bind_now").has_value("yes");
|
|
||||||
} catch (...) { }
|
bind_now = config.xml().attribute_value("ld_bind_now", false);
|
||||||
|
verbose = config.xml().attribute_value("ld_verbose", false);
|
||||||
|
} catch (Genode::Rom_connection::Rom_connection_failed) { }
|
||||||
|
|
||||||
/* load binary and all dependencies */
|
/* load binary and all dependencies */
|
||||||
try {
|
try {
|
||||||
|
@ -566,7 +569,7 @@ void Component::construct(Genode::Env &env)
|
||||||
|
|
||||||
/* print loaded object information */
|
/* print loaded object information */
|
||||||
try {
|
try {
|
||||||
if (Genode::config()->xml_node().attribute("ld_verbose").has_value("yes")) {
|
if (verbose) {
|
||||||
PINF(" %lx .. %lx: stack area",
|
PINF(" %lx .. %lx: stack area",
|
||||||
Genode::Thread::stack_area_virtual_base(),
|
Genode::Thread::stack_area_virtual_base(),
|
||||||
Genode::Thread::stack_area_virtual_base() +
|
Genode::Thread::stack_area_virtual_base() +
|
||||||
|
|
|
@ -11,9 +11,6 @@
|
||||||
* under the terms of the GNU General Public License version 2.
|
* under the terms of the GNU General Public License version 2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Genode includes */
|
|
||||||
#include <os/config.h>
|
|
||||||
|
|
||||||
/* local includes */
|
/* local includes */
|
||||||
#include <linker.h>
|
#include <linker.h>
|
||||||
|
|
||||||
|
@ -70,7 +67,7 @@ Genode::Shared_object::Shared_object(char const *file, unsigned flags)
|
||||||
|
|
||||||
/* print loaded object information */
|
/* print loaded object information */
|
||||||
try {
|
try {
|
||||||
if (Genode::config()->xml_node().attribute("ld_verbose").has_value("yes"))
|
if (Linker::verbose)
|
||||||
Linker::dump_link_map(to_root(_handle)->dep.head()->obj);
|
Linker::dump_link_map(to_root(_handle)->dep.head()->obj);
|
||||||
} catch (...) { }
|
} catch (...) { }
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,10 @@
|
||||||
#include <base/thread.h>
|
#include <base/thread.h>
|
||||||
#include <base/component.h>
|
#include <base/component.h>
|
||||||
#include <base/heap.h>
|
#include <base/heap.h>
|
||||||
#include <os/config.h>
|
#include <base/attached_rom_dataspace.h>
|
||||||
#include <util/volatile_object.h>
|
#include <util/volatile_object.h>
|
||||||
#include <cpu_session/connection.h>
|
#include <cpu_session/connection.h>
|
||||||
|
|
||||||
|
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
|
|
||||||
|
@ -340,7 +339,7 @@ void Component::construct(Env &env)
|
||||||
{
|
{
|
||||||
log("--- thread test started ---");
|
log("--- thread test started ---");
|
||||||
|
|
||||||
Xml_node config = Genode::config()->xml_node();
|
Attached_rom_dataspace config(env, "config");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
test_stack_alloc(env);
|
test_stack_alloc(env);
|
||||||
|
@ -348,7 +347,7 @@ void Component::construct(Env &env)
|
||||||
test_main_thread();
|
test_main_thread();
|
||||||
test_cpu_session(env);
|
test_cpu_session(env);
|
||||||
|
|
||||||
if (config.has_sub_node("pause_resume"))
|
if (config.xml().has_sub_node("pause_resume"))
|
||||||
test_pause_resume(env);
|
test_pause_resume(env);
|
||||||
|
|
||||||
test_create_as_many_threads(env);
|
test_create_as_many_threads(env);
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
TARGET = test-thread
|
TARGET = test-thread
|
||||||
SRC_CC = main.cc
|
SRC_CC = main.cc
|
||||||
LIBS = base config
|
LIBS = base
|
||||||
|
|
Loading…
Reference in New Issue
Block a user