Forum Stats

  • 3,733,568 Users
  • 2,246,787 Discussions


[dbx] how to view function arguments within a core file

-- dbx information --

(dbx) version

Machine hardware:   sun4v

OS version:         5.10

Processor type:     sparc

Hardware:           sun4v

The following components are installed on your system:

Sun Studio 11

        Sun Studio 11 C Compiler

        Sun Studio 11 C++ Compiler

        Sun Studio 11 Tools.h++ 7.1

        Sun Studio 11 C++ Standard 64-bit Class Library

        Sun Studio 11 Garbage Collector

        Sun Studio 11 Debugging Tools (including dbx)

        Sun Studio 11 IDE

        Sun Studio 11 Debugger GUI

        Sun Studio 11 Performance Analyzer (including collect, ...)

        Sun Studio 11 Native Connector Tool

        Sun Studio 11 Performance Library

        Sun Studio 11 LockLint

        Sun Studio 11 Building Software (including dmake)

        Sun Studio 11 Documentation Set

version of "/apps/sunstudio/sunstudio11/SUNWspro/bin/../prod/bin/../../bin/cc": Sun C 5.8 Patch 121015-05 2007/08/01

version of "/apps/sunstudio/sunstudio11/SUNWspro/bin/../prod/bin/../../bin/CC": Sun C++ 5.8 Patch 121017-11 2007/05/02

version of "/apps/sunstudio/sunstudio11/SUNWspro/bin/../prod/bin/../../bin/dbx": Sun Dbx Debugger 7.5 Patch 121023-05 2007/06/07

version of "/apps/sunstudio/sunstudio11/SUNWspro/bin/../prod/bin/../../bin/analyzer": Sun Performance Analyzer 7.5 Patch 120761-03 2006/11/02

version of "/apps/sunstudio/sunstudio11/SUNWspro/bin/../prod/bin/../../bin/dmake": Sun Distributed Make 7.7 2005/10/13

-- end information --

Hi community,

Part of my job is to analyze some core files generated by our application to find the root-cause of the crash.

As far as I can see the binary is not compiled with '-g' option to get debug information

On the other I have access to the code with Grok

I've been reading document 'Sun Studio 12 update 1: debugging a program with DBX" but can't find out information on how to view the value of arguments provided to a function.

For example, I can see the application crashed on 

=>[9] xx::xx::xx::getLowerLimit(0x0, 0x1b, 0x0, 0x2, 0x2, 0x0), at 0x11206f47c

  [10] xx::xx::xx::xx(0x0, 0x1b, 0x0, 0x2, 0x2, 0x1b), at 0x11206f60c

I have the address of the function, I've been checking 'dis -a 0x11206f47c' but except that I'm a bit stuck.

Is there a way for me to know the value of the arguments to the method getLowerLimit?

Thanks for your help.


  • Peter.Damron-Oracle
    Peter.Damron-Oracle Member Posts: 16
    edited May 2016

    First, your compiler and tools are old, you should upgrade.

    The current version is Studio 12.4, and 12.5 is in beta.

    On SPARC, the first 6 parameters are passed in registers.

    That output in parentheses is the values in those registers ("%o0-%o5")

    at the time you are viewing the stack trace.

    E.g. "(0x0, 0x1b, 0x0, 0x2, 0x2, 0x0)".

    However, the values in the registers may have been changed

    by the code executed after the call was made.

    You can use "dis" to look at the code

    (between the entry point and the next call site on the backtrace)

    and try to figure out if any of those registers

    still have the value of the incoming parameter

    (or if it was stored to memory somewhere).

    If you can run the program,

    you can "stop in getLowerLimit"

    and the values in those registers should

    be the values of the parameters passed into that routine.

    There are some complications about how parameters are passed,

    if your parameters are not basic types.


This discussion has been closed.