[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 272938] New: please provide a gdb wrapper when std{in,out} are
From:       Pierre Habouzit <madcoder () debian ! org>
Date:       2011-05-10 12:53:41
Message-ID: bug-272938-17878 () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=272938

           Summary: please provide a gdb wrapper when std{in,out} are
                    redirected.
           Product: valgrind
           Version: unspecified
          Platform: Unlisted Binaries
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: jseward@acm.org
        ReportedBy: madcoder@debian.org


For example, have that:

----8<----

int main(void)
{
    int c;
    return c ? 0 : -1;
}

---->8----

$ valgrind --db-attach=yes ./a.out < /dev/null
==30353== Memcheck, a memory error detector
==30353== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==30353== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==30353== Command: ./a.out
==30353== 
==30353== Conditional jump or move depends on uninitialised value(s)
==30353==    at 0x40049E: main (in /home/madcoder/a.out)
==30353== 
==30353== 
==30353== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- ==30353== 
==30353== HEAP SUMMARY:
==30353==     in use at exit: 0 bytes in 0 blocks
==30353==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==30353== 
==30353== All heap blocks were freed -- no leaks are possible
==30353== 
==30353== For counts of detected and suppressed errors, rerun with: -v
==30353== Use --track-origins=yes to see where uninitialised values come from
==30353== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 4 from 4)

The debugger isn't actually started because stdin is "empty" already (and if it
wasn't it would be re-read by gdb which is even worse).

valgrind should wrap calling the debugger recreating sensible std{in,out,err}
using /dev/tty.

FWIW this is Debian bug #351823
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=351823)

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic