2009-06-17 20:45:48 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* binfmt/binfmt_dumpmodule.c
|
|
|
|
*
|
2021-02-03 14:47:23 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2009-06-17 20:45:48 +02:00
|
|
|
*
|
2021-02-03 14:47:23 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2009-06-17 20:45:48 +02:00
|
|
|
*
|
2021-02-03 14:47:23 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2009-06-17 20:45:48 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <sched.h>
|
|
|
|
#include <debug.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
2012-10-24 22:19:44 +02:00
|
|
|
#include <nuttx/binfmt/binfmt.h>
|
2009-06-17 20:45:48 +02:00
|
|
|
|
2015-11-14 14:29:47 +01:00
|
|
|
#include "binfmt.h"
|
2009-06-17 20:45:48 +02:00
|
|
|
|
2016-06-11 22:14:08 +02:00
|
|
|
#if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_DEBUG_BINFMT) && !defined(CONFIG_BINFMT_DISABLE)
|
2009-06-17 20:45:48 +02:00
|
|
|
|
2015-10-03 01:43:18 +02:00
|
|
|
/****************************************************************************
|
2009-06-17 20:45:48 +02:00
|
|
|
* Public Functions
|
2015-10-03 01:43:18 +02:00
|
|
|
****************************************************************************/
|
2009-06-17 20:45:48 +02:00
|
|
|
|
2015-10-03 01:43:18 +02:00
|
|
|
/****************************************************************************
|
2021-05-23 20:32:34 +02:00
|
|
|
* Name: binfmt_dumpmodule
|
2009-06-17 20:45:48 +02:00
|
|
|
*
|
|
|
|
* Description:
|
2021-03-10 21:13:31 +01:00
|
|
|
* Dump the contents of struct binary_s.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* bin - Load structure
|
2009-06-17 20:45:48 +02:00
|
|
|
*
|
2009-06-17 22:25:27 +02:00
|
|
|
* Returned Value:
|
2021-03-10 21:13:31 +01:00
|
|
|
* Zero (OK) on success; a negated errno value on failure
|
2009-06-17 22:25:27 +02:00
|
|
|
*
|
2015-10-03 01:43:18 +02:00
|
|
|
****************************************************************************/
|
2009-06-17 20:45:48 +02:00
|
|
|
|
2021-05-23 20:32:34 +02:00
|
|
|
int binfmt_dumpmodule(FAR const struct binary_s *bin)
|
2009-06-17 20:45:48 +02:00
|
|
|
{
|
|
|
|
if (bin)
|
|
|
|
{
|
2019-08-15 22:41:42 +02:00
|
|
|
binfo("Module:\n");
|
|
|
|
binfo(" entrypt: %p\n", bin->entrypt);
|
2020-11-20 03:37:27 +01:00
|
|
|
binfo(" mapped: %p size=%zd\n", bin->mapped, bin->mapsize);
|
2020-04-22 10:24:15 +02:00
|
|
|
binfo(" alloc: %p %p %p\n", bin->alloc[0],
|
|
|
|
bin->alloc[1],
|
|
|
|
bin->alloc[2]);
|
2012-10-29 20:32:05 +01:00
|
|
|
#ifdef CONFIG_BINFMT_CONSTRUCTORS
|
2019-08-15 22:41:42 +02:00
|
|
|
binfo(" ctors: %p nctors=%d\n", bin->ctors, bin->nctors);
|
|
|
|
binfo(" dtors: %p ndtors=%d\n", bin->dtors, bin->ndtors);
|
2012-12-19 18:54:26 +01:00
|
|
|
#endif
|
2014-08-24 14:42:11 +02:00
|
|
|
#ifdef CONFIG_ARCH_ADDRENV
|
2019-08-15 22:41:42 +02:00
|
|
|
binfo(" addrenv: %p\n", bin->addrenv);
|
2012-10-29 20:32:05 +01:00
|
|
|
#endif
|
2020-11-20 03:37:27 +01:00
|
|
|
binfo(" stacksize: %zd\n", bin->stacksize);
|
2022-10-19 21:27:21 +02:00
|
|
|
#ifndef CONFIG_BUILD_KERNEL
|
|
|
|
binfo(" stackaddr: %p\n", bin->stackaddr);
|
|
|
|
#endif
|
2019-08-15 22:41:42 +02:00
|
|
|
binfo(" unload: %p\n", bin->unload);
|
2009-06-17 20:45:48 +02:00
|
|
|
}
|
2014-05-09 00:58:10 +02:00
|
|
|
|
2009-06-17 20:45:48 +02:00
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
#endif
|