How do I get the bash debugger to work with ddd?
Solution 1
I was able to get ddd
and bashdb
to play nice on Ubuntu 12.04 today:
-
Remove the repo-supplied
ddd
:sudo apt-get remove ddd
-
Fetch
ddd
v3.3.9 and install from source, e. g.:sudo apt-get build-dep ddd sudo apt-get install libmotif-dev wget http://ftp.gnu.org/gnu/ddd/ddd-3.3.9.tar.gz tar xvf ddd-3.3.9.tar.gz cd ddd-3.3.9 ./configure make sudo make install
Note: I had to make a single patch to the source code to get the build to work -- in
ddd/strclass.C
, we needed a#include <stdio.h>
; at the top to defineEOF
. -
Make sure
bashdb
is installed:sudo apt-get install bashdb
-
Launch with:
ddd --debugger /usr/bin/bashdb -- {script name} {parameters}
Could not live without ddd + Bash.
Optional: gpg verification:
Search for sign on https://www.gnu.org/software/ddd/ will redirect to https://savannah.gnu.org/project/memberlist-gpgkeys.php?group=ddd
Download
ddd-keyring.gpg
.-
Import it into your key chain:
gpg --import ddd-keyring.gpg
-
Verify the signature:
wget http://ftp.gnu.org/gnu/ddd/ddd-3.3.9.tar.gz.sig gpg --verify
Solution 2
To get ddd
to work with the bash debugger on bash scripts, it's necessary to install bashdb
too.
If it's not installed, you get:
Afterwards, ddd
seems to work normally:
Solution 3
This is a regression introduced in DDD 3.3.12, see bug #41649.
The last usable version is 3.3.11.
Related videos on Youtube
Juanu
Updated on September 18, 2022Comments
-
Juanu almost 2 years
In my project, I have a service that connects to an HTTP to see if it's online. Everything works great, It does connect.
The problem is when my device goes to sleep.
I use the AlarmManager to trigger the check events, using RTC_WAKEUP, so that the process is run even when the screen is off...
The problem is that this is not really happening. I created a Logging Method to see what happens behind the curtains of my app.
I log every step, writing the time it happened to see when and how things are happening.
When i set my device to sleep, and come back after a few minutes, I can see that the Alarm is triggering ONLY when I wake the device up, and not while it's sleeping.
Here is the code in which I create the alarm:
public static void AddAlarm(Context pContext, Server pServer) { // Create pending with intent and server object with a helper that creates my pending intent. PendingIntent pending = IntentGenerator.GetPendingIntentForAlarm(pContext,pServer.ServerId); // Get alarm manager AlarmManager alarm = (AlarmManager)pContext.getSystemService("alarm"); // Get current time to start now. long startNow = new Date().getTime()-10; // Set repeating alarm with current time to start, and interval. alarm.setRepeating(AlarmManager.RTC_WAKEUP ,startNow, pServer.GetIntervalInMilliseconds(), pending); }
And in case you are wondering how i create the pending intent:
public static Intent GetIntentForService(Context pContext, int pServerId) { // Comienzo la alarma. Intent retVal = new Intent(pContext, ServerStatusCheckService.class); retVal.putExtra("SERVER_ID", pServerId); return retVal; }
-
ish almost 12 years@JamesMitch, yes, I'm on Precise 12.04 (64-bit, though).
-
James Mitch almost 12 yearsDid you actually test to step through a bash script? I booted the Precise 12.04 64-bit DVD, installed ddd and bashdb and still couldn't open a bash script without seeing the hourglass.
-
Stabledog almost 12 yearsI did get it working on Ubuntu 12.04, by using an old version of ddd (3.3.9). Had to build it from source, and install the libmotif-dev package first.
-
Stabledog almost 12 yearsAdditional details here: askubuntu.com/a/178692/73165
-
Wes Miller over 10 yearsJust followed your instructions on 12.04 / 64. Almost works. After bashdb loads the script I click "step" and go into an infinite wait for bash to finish starting. Suggestions?
-
WinEunuuchs2Unix about 6 yearsYour bug report is from April 2014. The OP's question is from June 2012.
-
Bass about 6 yearsI’ve checked all four versions from 3.3.9 to 3.3.12. There’s definely a regression introduced in 3.3.12 (they’ve made lots of changes related to
remake
,bashdb
andpydb
). And 3.3.12 was released in 2009, so there’s a pretty good chance the OP was running this very version. -
WinEunuuchs2Unix about 6 yearsOK but this is the year 2018. An answer was written and accepted in 2012. Plus the answer received 4 up-votes. The OP hasn't signed on in over five years an is unlikely to comment on your answer.
-
Bass about 6 years@WinEunuuchs2Unix Okay, maybe mine is the answer to a slightly different question, but this page appears in Google's top 10 for those seeking the answer to "why
bashdb
integration doesn't work". So I'm not expecting any comments or upvotes, just accumulating the knowledge. -
Erasmus Cedernaes almost 6 yearsWorks on Ubuntu 16.04