gdb problem viewing variables | Unix Linux Forums | HP-UX

  Go Back    


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

gdb problem viewing variables

HP-UX


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-21-2007
rimon rimon is offline
Registered User
 
Join Date: Oct 2007
Last Activity: 12 October 2008, 7:02 AM EDT
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
gdb problem viewing variables

Hi,

I don't know if this is HP-UX specific, but I'll take my chances with this forum.

I'm using WDB 5.7 on HP Itanium 11.23.
'file' on my executable shows:
ELF-32 executable object file - IA64

The problem is with viewing the contents of the variables.
Following is a sequence that demonstrates this:

Code:
HP gdb 5.7 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 5.7 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
(gdb) stop in main
Breakpoint 1 at 0x400c5b0:1: file loader.cpp, line 902 from loader.
(gdb) run
Starting program: loader

Breakpoint 1, main (argc=Error accessing memory address 0xd08: Bad address.
) at loader.cpp:902
902      ll=new LclsLC_Library;
(gdb) print argc
Error accessing memory address 0xd08: Bad address.
(gdb) print &argc
$1 = (int *) 0xd08
(gdb) p ll
Error accessing memory address 0xcec: Bad address.
(gdb) p &ll
$1 = (LclsLC_Library **) 0xcec
(gdb)

See that both the parameter 'argc' and the local variable ll have a problem.

Now if I put a breakpoint in a function called by main, and then go up in the stack to main, I CAN see argc. See in the following sequence:

Code:
Breakpoint 2, Test (ll=Error accessing memory address 0xd28: Bad address.
) at loader.cpp:716
716      long lv,c,err = 0,j,k,ccv;
(gdb) where
#0  Test (ll=Error accessing memory address 0xd28: Bad address.
) at loader.cpp:716
#1  0x400c8a0:0 in main (argc=0, argv=0x7ffff9b8) at loader.cpp:911
(gdb) up
#1  0x400c8a0:0 in main (argc=0, argv=0x7ffff9b8) at loader.cpp:911
911      Test(ll,ts);
(gdb) p argc
$5 = 0
(gdb) p &argc
$6 = (int *) 0x7efff220
(gdb)

You may notice though that when I'm in the subprocedure I can't view the parameters of this subprocedure, such as ll .

Any ideas?

Thanks,

RO
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
HP-UX: Problem viewing directory with BDF... zixzix01 UNIX for Advanced & Expert Users 17 04-29-2011 03:11 PM
Problem with variables in awk apresa Shell Programming and Scripting 5 05-21-2009 05:43 AM
problem with variables udi Shell Programming and Scripting 2 12-23-2001 01:14 AM
Problem Viewing Text Files In NT/Samba cwong UNIX for Dummies Questions & Answers 1 03-12-2001 08:59 AM



All times are GMT -4. The time now is 03:28 AM.