- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- errors by debugger
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 10:17 AM
04-08-2003 10:17 AM
errors by debugger
I have problems debugging a c-program on hpux 11.0 The debugger (gdb or wdb or dde or ddd) prints wrong contents of variables or structures. I.e. the program works allright, but the information shown by the debugger is not correct.
The same program, same compiler, same flags, same debugger on HPUX 10.20 works well.
Any suggestions are appreciated.
Thanks a lot for your help.
Malte
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 10:30 AM
04-08-2003 10:30 AM
Re: errors by debugger
Write a smaller program containing the exact statements that cause problems, compile with the same options on both 10.20 and 11.0 and debug these two a.out's. if they go fine, there may probably be some #ifdef's in the source code in your original program which is causing the difference.
r u sure the values you view are wrong???
FWIW.
- ramd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2003 11:44 PM
04-08-2003 11:44 PM
Re: errors by debugger
here are just a few lines out of the source code to demonstarte what I mean with wrong values:
Definition of a structure in .h file:
typedef struct _INTRA
{
enum _FIELDTYP intra_fieldtyp; /*!< type of field */
int intra_rank; /*!< proc's intra-rank */
int intra_nprocs; /*!< number of procs in this intracomm. */
} INTRA;
Somewhere in th code, including the above:
INTRA *actintra;
actintra = (INTRA*)CCACALLOC(1,sizeof(INTRA));
/* debugger: print *actintra */
/* *actintra: 1 */
if (!actintra) dserror("Allocation of INTRA failed");
actintra->intra_fieldtyp = fluid;
/* debugger: print actintra->intra_fieldtyp */
/* Attempt to take member of something that is not a structure. */
actintra->intra_rank = 0;
actintra->intra_nprocs = 1;
The parts in the comments are the request to and the responses from the debugger.Maybe this helps you to understand the problem a little better.
How can #ifdef's cause such difference?
Thanks for your response.
Malte
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2003 02:06 AM
04-09-2003 02:06 AM
Re: errors by debugger
I have been informed that there will be a new debugger version in the third week of April
Wait and try it
Steve steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2003 03:18 AM
04-09-2003 03:18 AM
Re: errors by debugger
If your program works well than everything is correct.
I suspect compiling options, esspecially optimizations.
After your structure is allocated, when you initiate the fields - for the program to work well it is not essential to refresh the contents of the pointer variable. I guess compiler decided to keep the value in the CPU register and use it.
If you want to be absolutelly sure, you can try to check it in assembly under debugger (if you're not aware of it, as its more complicated to analyse). Values are returned in 'rp' register.
You have do disable optimalisation. Mayby you have to ensure somehow that every variable must be up to date at the moment of line change of your source file. Check the documentation of your compiler about it.
Good luck
Adam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2003 03:44 AM
04-09-2003 03:44 AM
Re: errors by debugger
Thanks a lot for your help!
The solution is:
We are using fortran subroutines in our program which make use of the PARAMETER statement. These PARAMETER statements compiled with f90 cause the debugger to print the wrong contents of variables/structures.
So we will simply resign from using the PARAMETER statement.
BTW, on HPUX 10.20 we are using f77 which causes no problems.
Malte