1846964 Members
4350 Online
110257 Solutions
New Discussion

core dump question

 
yatin
Frequent Advisor

core dump question

I am reading coredump using cr_read. how can I read value stored at 0x440c4000.I cannot use adb or q4 or any other debuger as i want to read the value into variable in c program
11 REPLIES 11
Laurent Menase
Honored Contributor

Re: core dump question

you can use adb
echo "0x440c4000/X\n0x440c4000?X"|adb myexecutable thecorefile

the first will be read from the core dump.
the second from the executable


Dietmar Konermann
Honored Contributor

Re: core dump question

Hmm... cr_read(3) and libcrash(5) are designed for _system_ crash dumps. Are you really talking about system crash dumps... or are you trying to read from a standard user process core file?
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
yatin
Frequent Advisor

Re: core dump question

I am talking about system crash dumps
Laurent Menase
Honored Contributor

Re: core dump question

which version of HPUX?
yatin
Frequent Advisor

Re: core dump question

I am using HP 11
Laurent Menase
Honored Contributor

Re: core dump question

On 11.X usually crashdump don't contain user data pages,
This can be configured with crashconf.

If you have a full dump - usually not-
then with q4:
1) find the process structure in the proctable,
2)look at the pregions in the vas of that process,
3) and look for your address in the vas ( look only at the vaddr ) to find the space.
4) ex thespace.theaddress using L
( L is for long)

you have to do the same with cr_read()
If your program is able to display its spaceid for that address, it is more simple.
yatin
Frequent Advisor

Re: core dump question

hi Laurent
Thanks for your help but can u be more specific i din't understand what u meant can u explain me with some example
Don Morris_1
Honored Contributor

Re: core dump question

If 0x440c4000 is the *physical* address of what you want to read, just divide by the system page size (you can get that from sysconf() ).

If you're trying to read the data at kernel virtual address 0x440c4000, then you'll have to translate the virtual address first. That means you'll need to load up the hashed page directory first.... and you'll need to know how to calculate the indices properly, etc.

If you know HP-UX kernel internals well, this should be doable.

If not (and you don't want to take the classes to learn), I'd seriously rethink your approach. You could after all just use the system() call to invoke adb to go find this for you. (And if your heart is set on reading the dump yourself... you could creatively let adb do your translating for you as well).
Paddy_1
Valued Contributor

Re: core dump question

Alternatively use a expect script that can automate the fetching of the variables and then plug these values into a C program.

The sufficiency of my merit is to know that my merit is NOT sufficient
yatin
Frequent Advisor

Re: core dump question

Paddy i dint get u.
yatin
Frequent Advisor

Re: core dump question

How can i use adb to to just translate kernel virtual address to physical address