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

            Bug ID: 504101
           Summary: Add a "vgstack" script
    Classification: Developer tools
           Product: valgrind
           Version: 3.25 GIT
          Platform: Other
                OS: Other
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: pjfl...@wanadoo.fr
  Target Milestone: ---

I think that it would be useful to add a "vgstack" script. This would work like
pstack/gstack but rather than print the host stack it would print the guest
stack.

gstack does this

$GDB --quiet -nx $GDBARGS /proc/$1/exe $1 <<EOF 2>&1 | 
set width 0
set height 0
set pagination no
$backtrace
EOF
/bin/sed -n \
    -e 's/^\((gdb) \)*//' \
    -e '/^#/p' \
    -e '/^Thread/p'

If I move the exe and pid and put in a vgdb command like this

$GDB --quiet -nx $GDBARGS <<EOF 2>&1 |
set width 0
set height 0
set pagination no
target remote | vgdb --pid=$1
$backtrace
EOF
/bin/sed -n \
    -e 's/^\((gdb) \)*//' \
    -e '/^#/p' \
    -e '/^Thread/p'

then it seems to work reasonably well.

I'll need to adapt it so that it works on FreeBSD (and maybe illumos).

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to