使用 DBX 运行脚本

发布于 2024-12-06 14:23:03 字数 2010 浏览 2 评论 0 原文

我有一个这样的脚本 script = GF1_dd_Daemon_Sh PROCESS_NAME=RG INSTANCE=RG PART_ID=1

其中有一个被调用的可执行文件。当我运行这个脚本(#!/bin/ksh)时,它会创建一个核心转储,并在我分析堆栈跟踪时使用 dbx,我无法获得任何太多信息。

有没有办法使用 DBX 运行脚本并可以跟踪可执行文件创建核心转储的点。

我正在使用SOLARIS。

谢谢。

堆栈跟踪

  (dbx) where
    current thread: t@1
      [1] xercesc_2_6::SAXParser::SAXParser(0xffffffff70b833b8, 0xffffffff70b83480, 0x0, 0x0, 0xffffffff70b833f8, 0xffffffff7d12ccd8), at 0xffffffff7ce22fc0
    =>[2] __SLIP.INIT_D() (optimized), at 0xffffffff70a447b8 (line ~35) in "Parser.h"
      [3] __STATIC_CONSTRUCTOR() (optimized), at 0xffffffff70a46f04 (line ~35) in "Parser.h"
      [4] 0xffffffff70a74718(0xffffffff7f7361b8, 0xffffffff7f738d60, 0x11a340, 0x0, 0xffffffff7f736c60, 0x821), at 0xffffffff70a74718
      [5] call_init(0xffffffff7f736530, 0x1, 0xffffffff70a74618, 0xffdfffff, 0xffffffff7f736c60, 0xffffffffffffffff), at 0xffffffff7f618674
      [6] dlmopen_intn(0xffffffff7ffe6b0c, 0x8, 0x4a, 0x52, 0xffffffff7ffe6b0c, 0xffffffff77800a60), at 0xffffffff7f61df7c
      [7] dlmopen_check(0xffffffff7f7361b8, 0xffffffff7ffe6c18, 0x1, 0xffffffff7f400ef0, 0xffffffff7ffe6b0c, 0x118cc8), at 0xffffffff7f61e0f0
      [8] _dlopen(0xffffffff7ffe6c18, 0x1, 0x1, 0xffffffff7ea56d30, 0x11, 0xffffffff7fffc226), at 0xffffffff7f61e130
      [9] GMF_sfg_ACTIVITY(i_pgmName = ???, i_instance = ???, i_coreReplaceRegister_func_p = ???) (optimized), at 0xffffffff7e926ff0 (line ~200) in "GMF_sfg_ACTIVITY.c"
      [10] GMF_mdg_EXECinit(i_pcProcessName = ???, i_argc = ???, i_argv = ???) (optimized), at 0xffffffff7eb33394 (line ~556) in "GMF_mdg_EXECinit.c"
      [11] GMF_mdg_EXECmain(argc = ???, argv = ???) (optimized), at 0xffffffff7eb25ae8 (line ~163) in "GMF_mdg_EXECfunc.c"
      [12] main(argc = ???, argv = ???) (optimized), at 0x100001eb8 (line ~52) in "GMF_mdg_EXECproc.c"
    (dbx) down
    0xffffffff7ce22fc0: SAXParser+0x0110:   ldx      [%i2], %o3

I have a script like this
script = GF1_dd_Daemon_Sh PROCESS_NAME=RG INSTANCE=RG PART_ID=1

Inside this there is an executable which is called. When I run this script(#!/bin/ksh ) it creates a core dump and using dbx when i analyse the stack trace I cannot get any much info.

Is there any way to run the script using DBX and can trace the point where the executable is creating the core dump.

I am using SOLARIS.

Thanks.

Stack Trace

  (dbx) where
    current thread: t@1
      [1] xercesc_2_6::SAXParser::SAXParser(0xffffffff70b833b8, 0xffffffff70b83480, 0x0, 0x0, 0xffffffff70b833f8, 0xffffffff7d12ccd8), at 0xffffffff7ce22fc0
    =>[2] __SLIP.INIT_D() (optimized), at 0xffffffff70a447b8 (line ~35) in "Parser.h"
      [3] __STATIC_CONSTRUCTOR() (optimized), at 0xffffffff70a46f04 (line ~35) in "Parser.h"
      [4] 0xffffffff70a74718(0xffffffff7f7361b8, 0xffffffff7f738d60, 0x11a340, 0x0, 0xffffffff7f736c60, 0x821), at 0xffffffff70a74718
      [5] call_init(0xffffffff7f736530, 0x1, 0xffffffff70a74618, 0xffdfffff, 0xffffffff7f736c60, 0xffffffffffffffff), at 0xffffffff7f618674
      [6] dlmopen_intn(0xffffffff7ffe6b0c, 0x8, 0x4a, 0x52, 0xffffffff7ffe6b0c, 0xffffffff77800a60), at 0xffffffff7f61df7c
      [7] dlmopen_check(0xffffffff7f7361b8, 0xffffffff7ffe6c18, 0x1, 0xffffffff7f400ef0, 0xffffffff7ffe6b0c, 0x118cc8), at 0xffffffff7f61e0f0
      [8] _dlopen(0xffffffff7ffe6c18, 0x1, 0x1, 0xffffffff7ea56d30, 0x11, 0xffffffff7fffc226), at 0xffffffff7f61e130
      [9] GMF_sfg_ACTIVITY(i_pgmName = ???, i_instance = ???, i_coreReplaceRegister_func_p = ???) (optimized), at 0xffffffff7e926ff0 (line ~200) in "GMF_sfg_ACTIVITY.c"
      [10] GMF_mdg_EXECinit(i_pcProcessName = ???, i_argc = ???, i_argv = ???) (optimized), at 0xffffffff7eb33394 (line ~556) in "GMF_mdg_EXECinit.c"
      [11] GMF_mdg_EXECmain(argc = ???, argv = ???) (optimized), at 0xffffffff7eb25ae8 (line ~163) in "GMF_mdg_EXECfunc.c"
      [12] main(argc = ???, argv = ???) (optimized), at 0x100001eb8 (line ~52) in "GMF_mdg_EXECproc.c"
    (dbx) down
    0xffffffff7ce22fc0: SAXParser+0x0110:   ldx      [%i2], %o3

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

许一世地老天荒 2024-12-13 14:23:03

一种常见的方法是向脚本添加一个名为 $DEBUGGER 的变量。

#!/bin/sh
echo "this is the script"
$DEBUGGER the_executable arg1 arg2

如果将 DEBUGGER 环境变量设置为“dbx”,那么当您运行脚本时,
dbx 将启动,并且会给您一个 dbx 提示符。

如果您使用的是 Solaris Studio IDE,则可以使用“ss_attach”而不是“dbx”,它会将调试会话附加到已运行的 IDE。

检查 ss_attach 的手册页。

One common approach is to add a variable to the script called something like $DEBUGGER

#!/bin/sh
echo "this is the script"
$DEBUGGER the_executable arg1 arg2

If you set the DEBUGGER environment variable to "dbx", then when you run the script,
dbx will be started and it will give you a dbx prompt.

If you're using the Solaris Studio IDE, you can use "ss_attach" instead of "dbx" and it will attach the debugging session to an IDE that is already running.

Check the man page for ss_attach.

北城孤痞 2024-12-13 14:23:03
  1. 在脚本内部检查传递给可执行文件(二进制)的参数是什么。
  2. 在启动后使用该可执行文件启动 dbx
  3. 设置您在步骤 1 中发现的参数
  4. 在 GMF_mdg_EXECmain 中停止
  5. 然后开始检查代码流
  1. Inside the script check what are the arguments that are being passed to the executable (binary).
  2. start the dbx with that executable
  3. after it start set the arguments which you have discovered in step 1
  4. stop in GMF_mdg_EXECmain
  5. then start checking the code flow
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文