Sponsored Content
Top Forums Programming Can't debug: assert error with gdb (no problem without) Post 302754881 by jim mcnamara on Friday 11th of January 2013 10:41:29 AM
Old 01-11-2013
Is this relevant to your example? (post #1)

warning: Source file is more recent than executable.

Just because gdb shows line #1 of a multiline construct does not mean that line #1 of your if block is the problem.

If you actually want to debug it, break the if's into singletons(this is logical decompostion to monads, so by a theorem by Courcelle):

Code:
 int do_this=0;
 if (pgm_error->domain == PGM_ERROR_DOMAIN_SOCKET)
 {     
    if(pgm_error->code != PGM_ERROR_INVAL)
    {
       if(pgm_error->code != PGM_ERROR_BADF )
       {
           if(pgm_error->code != PGM_ERROR_FAULT)
             do_this=1;
       }
 }            
 if(pgm_error->domain == PGM_ERROR_DOMAIN_IF) 
 {     
    if(pgm_error->code != PGM_ERROR_INVAL)
    {
       if(pgm_error->code != PGM_ERROR_BADF )
       {
           if(pgm_error->code != PGM_ERROR_FAULT)
             do_this=1;
       }
 }            
 if(do_this)
 {
     original code from inside  if() block goes here 
 }

 

10 More Discussions You Might Find Interesting

1. HP-UX

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... (0 Replies)
Discussion started by: rimon
0 Replies

2. Programming

GNU GDB compile problem

I have to compile gnu-gdb 6.7 on HP-UX 11.11 with /usr/local/pa64/bin/gcc 64-bit compiler, but I'm having some problems during "make": ser-tcp.c: In function `net_open': ser-tcp.c:207: warning: passing arg 5 of `getsockopt' from incompatible pointer type make: *** Error 1 make: Leaving... (8 Replies)
Discussion started by: untamed
8 Replies

3. Programming

gdb: how to debug an executable file with a few command line papameters

If an executalbe file has several parameters, gdb can not pass parameters correctly. Let us see: run: ./executablefile1 agr1 arg2 arg3 debug: gdb executablefile1 run executalbefile1 arg1 arg2 arg3 then argv : executablefile1 argv : executablefile argv : arg1 ... (3 Replies)
Discussion started by: cdbug
3 Replies

4. Programming

gdb: problem while debug an executable file

I created one file (test.cpp)and complied it and get the executable file(test) and run it.It is giving the out put but when I am trying to debug that executable.I am getting the error -- please tell me the solutions?? Thanks in advance ..... (2 Replies)
Discussion started by: smartgupta
2 Replies

5. UNIX for Advanced & Expert Users

a question about debug using gdb(/lib32/libc.so.6: No such file or directory)

Hi all, (gdb) target remote 192.168.185.196:1389 Remote debugging using 192.168.185.196:1389 warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. 0x2fbd0800 in ?? () (gdb) l 1 ... (0 Replies)
Discussion started by: yanglei_fage
0 Replies

6. Programming

Debug two process Using GDB

Hi All I know How to attach a process to beubg it .But for my application I am using client as well server.Both are two separate process .Suppose I need to debug both .How to attach both of them together .Or I have to attach them separetly . Suppose client process id is 1325 and server is... (2 Replies)
Discussion started by: mr_deb
2 Replies

7. Programming

ddd/gdb debugger problem

I hope this is the right thread - not sure if it belongs in the Linux forum. Anyway, I'm having an issue with ddd and gdb. When using ddd to run gdb, there are extra parameters being appended, and my program is picking them up. I'm running on Ubuntu 11.04... Here's my command line entry - ... (1 Reply)
Discussion started by: jalburger
1 Replies

8. UNIX for Dummies Questions & Answers

GDB Debugging Problem

I have added some code in my file. I have created executable rpm file of our code and also I have created debuginfo and debugsource files and installed all three. But when I debug in gdb I see the the code changes in soucre file. But the break point does not hit at that place as if it did not... (1 Reply)
Discussion started by: rupeshkp728
1 Replies

9. Programming

GDB problem accessing static variables in C

Hi, Can anyone explain this please..... This is on AIX with GDB (tried a few versions). It only happens when program compiled in 64 bit and only with static variables.... A simple test program... ### snip #include <stdio.h> main() { static int n; n = 6; printf("hello %d\n", n);... (0 Replies)
Discussion started by: bagpussnz
0 Replies

10. Programming

Odd behavior from GDB while trying to cross-debug an embedded Linux application.

Some background: The application normally runs on an embedded platform. Currently, for development purposes, I have the rootfs located @ /exports and the target is communicating over NFS. That way I can make a change on my local system, save the application @ /exports, and run the altered... (4 Replies)
Discussion started by: Circuits
4 Replies
NANA(1)                                                       General Commands Manual                                                      NANA(1)

NAME
nana - generates debugger commands from C and C++ source code SYNOPSIS
nana [cpp-flags] files... DESCRIPTION
Generates gdb(1) commands from the arguments which implement the assertion and logging operations specified by macros such as DI(3) and DL(3). The output of nana(1) can then be sourced into gdb(1) to perform these operations. Note that you must provide any C preprocessor flags you are using to nana since these can change the code that is generated by the com- piler. SEE ALSO
nana-clg(1), nana(3), I(3), DI(3), L(3), DL(3), Q(3) and nana.info. The nana.info file is the primary documentation. AUTHOR
Phil Maker <pjm@gnu.org> NANA(1)
All times are GMT -4. The time now is 02:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy