Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3336660
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:09:43+00:00 2026-05-18T00:09:43+00:00

Like in for((;;)) { gdb -batch -n -ex ‘set pagination off’ -ex ‘thread apply

  • 0

Like in

for((;;)) { 
    gdb -batch -n -ex 'set pagination off' -ex 'thread apply all bt' ffplay_g `pidof ffplay_g` >> /tmp/qq;
}

, but faster, without reloading GDB and symbols every time?

Backtraces need to be taken by timer, not by triggering some breakpoints.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:09:44+00:00Added an answer on May 18, 2026 at 12:09 am

    As recommended by the comment If you want to stick with gdb, then why not script a gdb session? Your controller process can sleep for 50 ms, then wake up, send a ^C, t a a bt, c, and then go back to sleep. – Jeremy W. Sherman

    http://vi-server.org/vi/bin/gdbdriver.pl

    #!/usr/bin/perl -w
    
    use strict;
    use IPC::Open2;
    
    my $init = "run";
    my $command = "bt";
    my $delay = 1;
    
    my $need_int=0;
    
    $init = shift @ARGV;
    $delay = shift @ARGV;
    $command = shift @ARGV;
    
    die("Usage: gdbpriver.pl '' 0.1 'bt' gdb -q /path/to/proc 33344\n\tgdbdriver.pl init_command period_seconds backtrace_command startup_arguments\n") unless $ARGV[0];
    
    my $pid = open2(\*OUT, \*IN, @ARGV);
    
    print "pid=$pid\n";
    
    print IN "set pagination off\n";
    print IN "$init\n";
    
    while(<OUT>) {
        if (/Starting program:/) {
        $need_int=1;
        last;
        }
        last if /\(gdb\)/;
    }
    
    sub intr() {
        kill 9, $pid;
        exit(0);
    }
    $SIG{'INT'} = \&intr;
    sub spipe() {
        print "PIPE!\n";
    }
    $SIG{'PIPE'} = \&spipe;
    
    if($need_int) {
        kill 2, $pid;
    }
    
    for(;;) {
        print IN "$command\n"; # backtrace
        print IN "c\n"; # continue the program
        while(<OUT>) {
        last if /Continuing./;
        print;
        }
        select undef, undef, undef, $delay; # sorry, nanosleep fails
        print "INT\n";
        kill 2, $pid; # SIGINT to gdb to make it interrupt the program
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to list all the loaded modules using gdb, just like
Does anyone know how to save gdb settings (like set print pretty on or
Is there any debugger, like gdb or something else, aimed for C/C++, that runs
I'd like to use gdb or Xcode's debugger to watch every message sent to
I would like to use GDB to step though the C++ code that makes
I'm trying to get a GDB backtrace output from GDB through PHP. I'd like
Is it possible to store shell output into GDB variable in gdbinit? Something like:
In debuggers like GDB , when you stop at a breakpoint, you can easily
I am debugging code with exception throwing and exception handling. I would like gdb
I am getting error code like follows (gdb) continue Current language: auto; currently objective-c

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.