2009-06-18 02:45:48 +08:00
|
|
|
/****************************************************************************
|
|
|
|
* binfmt/binfmt_dumpmodule.c
|
|
|
|
*
|
2024-09-09 15:12:59 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
2021-02-03 21:47:23 +08: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-18 02:45:48 +08:00
|
|
|
*
|
2021-02-03 21:47:23 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2009-06-18 02:45:48 +08:00
|
|
|
*
|
2021-02-03 21:47:23 +08: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-18 02:45:48 +08:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <sched.h>
|
|
|
|
#include <debug.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
2012-10-25 04:19:44 +08:00
|
|
|
#include <nuttx/binfmt/binfmt.h>
|
2009-06-18 02:45:48 +08:00
|
|
|
|
2015-11-14 21:29:47 +08:00
|
|
|
#include "binfmt.h"
|
2009-06-18 02:45:48 +08:00
|
|
|
|
2016-06-12 04:14:08 +08:00
|
|
|
#if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_DEBUG_BINFMT) && !defined(CONFIG_BINFMT_DISABLE)
|
2009-06-18 02:45:48 +08:00
|
|
|
|
2015-10-03 07:43:18 +08:00
|
|
|
/****************************************************************************
|
2009-06-18 02:45:48 +08:00
|
|
|
* Public Functions
|
2015-10-03 07:43:18 +08:00
|
|
|
****************************************************************************/
|
2009-06-18 02:45:48 +08:00
|
|
|
|
2015-10-03 07:43:18 +08:00
|
|
|
/****************************************************************************
|
2021-05-24 02:32:34 +08:00
|
|
|
* Name: binfmt_dumpmodule
|
2009-06-18 02:45:48 +08:00
|
|
|
*
|
|
|
|
* Description:
|
2021-03-11 04:13:31 +08:00
|
|
|
* Dump the contents of struct binary_s.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* bin - Load structure
|
2009-06-18 02:45:48 +08:00
|
|
|
*
|
2009-06-18 04:25:27 +08:00
|
|
|
* Returned Value:
|
2021-03-11 04:13:31 +08:00
|
|
|
* Zero (OK) on success; a negated errno value on failure
|
2009-06-18 04:25:27 +08:00
|
|
|
*
|
2015-10-03 07:43:18 +08:00
|
|
|
****************************************************************************/
|
2009-06-18 02:45:48 +08:00
|
|
|
|
2021-05-24 02:32:34 +08:00
|
|
|
int binfmt_dumpmodule(FAR const struct binary_s *bin)
|
2009-06-18 02:45:48 +08:00
|
|
|
{
|
|
|
|
if (bin)
|
|
|
|
{
|
2019-08-16 04:41:42 +08:00
|
|
|
binfo("Module:\n");
|
|
|
|
binfo(" entrypt: %p\n", bin->entrypt);
|
2020-11-20 10:37:27 +08:00
|
|
|
binfo(" mapped: %p size=%zd\n", bin->mapped, bin->mapsize);
|
2014-08-24 20:42:11 +08:00
|
|
|
#ifdef CONFIG_ARCH_ADDRENV
|
2019-08-16 04:41:42 +08:00
|
|
|
binfo(" addrenv: %p\n", bin->addrenv);
|
2012-10-30 03:32:05 +08:00
|
|
|
#endif
|
2020-11-20 10:37:27 +08:00
|
|
|
binfo(" stacksize: %zd\n", bin->stacksize);
|
2022-10-20 03:27:21 +08:00
|
|
|
#ifndef CONFIG_BUILD_KERNEL
|
|
|
|
binfo(" stackaddr: %p\n", bin->stackaddr);
|
|
|
|
#endif
|
2019-08-16 04:41:42 +08:00
|
|
|
binfo(" unload: %p\n", bin->unload);
|
2009-06-18 02:45:48 +08:00
|
|
|
}
|
2014-05-09 06:58:10 +08:00
|
|
|
|
2009-06-18 02:45:48 +08:00
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
#endif
|