Bug 1705087 - Please, update cgdb to 0.7.0 (released 2 years ago)
Summary: Please, update cgdb to 0.7.0 (released 2 years ago)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cgdb
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gilboa Davara
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1720851 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-01 12:46 UTC by Jan Pokorný [poki]
Modified: 2019-07-23 01:07 UTC (History)
3 users (show)

Fixed In Version: cgdb-0.6.8-13.fc30
Clone Of:
Environment:
Last Closed: 2019-07-23 01:07:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jan Pokorný [poki] 2019-05-01 12:46:10 UTC
I would likely not notice but suffered a problem with relatively recent
gdb update (bring "style" support) and mistakenly reported that to
upstream without checking versions:

https://github.com/cgdb/cgdb/issues/199

Recently, I revisited that problem, and spotted this version
discrepancy.

Please, update the package, it will also solve my very problem :-)

This is the diff I used to rebuild:

diff --git a/cgdb.spec b/cgdb.spec
index a806816..df85890 100644
--- a/cgdb.spec
+++ b/cgdb.spec
@@ -1,22 +1,18 @@
 Name:			cgdb
-Version:		0.6.8
-Release:		12%{?dist}
+Version:		0.7.0
+Release:		1%{?dist}
 Summary:		CGDB is a curses-based interface to the GNU Debugger (GDB)
 
 License:		GPLv2
 URL:			http://cgdb.sourceforge.net/
-Source0:		http://heanet.dl.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.gz
-Source1:		http://cgdb.sourceforge.net/cgdb.png
+Source0:                https://cgdb.me/files/%{name}-%{version}.tar.gz
 
-BuildRequires:  gcc
-BuildRequires:	readline-devel
+BuildRequires:	flex
+BuildRequires:	gcc-c++
 BuildRequires:	ncurses-devel
-BuildRequires:	autoconf
-BuildRequires:	automake
-BuildRequires:	help2man
+BuildRequires:	readline-devel
 BuildRequires:	texinfo
-BuildRequires:	flex
-Requires:		gdb
+Requires:	gdb
 
 
 %description
@@ -34,7 +30,6 @@ Those familiar with vi should feel right at home using CGDB.
 
 
 %build
-autoconf
 %configure
 make %{?_smp_mflags}
 
@@ -47,11 +42,10 @@ rm -rf $RPM_BUILD_ROOT/%{_infodir}/dir
 
 
 %files
-%doc AUTHORS COPYING NEWS TODO README ChangeLog
+%doc AUTHORS COPYING NEWS README ChangeLog
 %{_bindir}/cgdb
 %{_datadir}/cgdb
 %{_infodir}/cgdb.info.*
-%{_mandir}/man1/cgdb.1.gz
 
 %changelog
 * Wed Apr 24 2019 Björn Esser <besser82> - 0.6.8-12

Comment 1 Gilboa Davara 2019-05-04 04:01:01 UTC
Hello,

0.7 is missing major functionality present in the 0.6.8, namely TTY support.
https://groups.google.com/forum/#!topic/cgdb-dev/m_FMkda4Ua8

If exporting TERM=dumb is all that is needed, I prefer patching 0.6.8 over using 0.7.

- Gilboa

Comment 2 Jan Pokorný [poki] 2019-05-04 18:00:33 UTC
Hm, I now see that it wasn't the case of sleeping Fedora maintainer but
a deliberate choice.  Thanks for explanation, and my sympathies for the
current state that doesn't accommodate some use cases it used to.

The best compromise I could come up with to handle this, free of any
patching (which I perceive as a last resort):

cat /etc/gdbinit.d/cgdb.gdb
> shell readlink /proc/$$/fd/* | grep -q cgdb_log && printf '%s\n%s\n' "set style enabled off" "shell truncate -s0 ~/.cgdb/gdbinit" > ~/.cgdb/gdbinit || truncate -s0 ~/.cgdb/gdbinit
> source ~/.cgdb/gdbinit

Provided that it works (haven't actually downgraded back, but behaved
as expected with 0.7.0) without any interferences (at worst, colours
will be disabled with a regular gdb sessions if one happens to debug
something with "cgdb_log" in the name or so), could such a file be
shipped with currently packaged version of cgdb, then?

Comment 3 Jan Pokorný [poki] 2019-05-13 07:12:18 UTC
Sadly, while the above workaround is nicely self-contained and worked,
I cannot recommend it unconditionally -- there's a sife effect of
the portion of other (Fedora/EL-specific) "post-processing hook" being
dropped:

- under gdb:

> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  0x00000000004c8bb3 in strcoll ()
> Missing separate debuginfos, use: dnf debuginfo-install busybox-1.28.3-3.fc30.x86_64
> (gdb) 

- under cgdb:

> Program terminated with signal SIGSEGV, Segmentation fault.
> #0
> (gdb) 

That may be a bug of gdb on it's own that it's prone to forget about
commands to execute, and for me, it's less intrusive that having to
disable "style" each time around, but thought I'd share this finding.

Comment 4 Jan Pokorný [poki] 2019-05-14 16:05:41 UTC
re [comment 3]:

> Sadly, while the above workaround is nicely self-contained and worked,
> I cannot recommend it unconditionally -- there's a sife effect of
> the portion of other (Fedora/EL-specific) "post-processing hook" being
> dropped:

To make it more interesting, I stand corrected per more observations,
it happens only under rather rare circumstances, so perhaps it's still
a viable solution for now?

Comment 5 Gilboa Davara 2019-05-21 13:18:34 UTC
Now that I've finally switched to F30, I'm seeing the same.
AFAIK, adding 'set style enabled off' to ~/.gdbinit solves the problem.
I'll see if I can somehow change the cgdb code to inject this line.

- Gilboa

Comment 6 Jan Pokorný [poki] 2019-05-22 11:54:55 UTC
Note that while that'd be a solution of the first choice, it's not
so great for people flipping between both cgdb and plain gdb.

That's what I tried address with the proposed solution in [comment 2].

Comment 7 Jan Pokorný [poki] 2019-05-24 12:02:24 UTC
Hmm, actually two corrections, replace s/cgdb_log/tgdb_log/ in the gdb
script from [comment 2] (accidentally, I tested that with cgdb 0.7.0,
but it works also with older, currently packaged version when such change
is made).

And the other is that my observations regarding missing
"[...] use: dnf debuginfo-install [...]" messages were also only
relevant to 0.7.0, it's just fine with cgdb-0.6.8-12.fc31.x86_64.

All in all, unless cgdb is updated 0.7.0, all should be fine with the
proposed /etc/gdbinit.d/cgdb.gdb script (after the correction per above).

Comment 8 Gilboa Davara 2019-07-04 09:04:28 UTC
Hello,

Sorry for the long AFK. I finally managed to free some time to work on it.

I must admit solution #2 doesn't make me feel comfortable, as it changes/overwrites the user's gdbinit.
I've began looking at the code, and it seems that I can 'set style enabled off' without it.

I'll keep you posted.

- Gilboa

Comment 9 Gilboa Davara 2019-07-04 09:06:10 UTC
*** Bug 1720851 has been marked as a duplicate of this bug. ***

Comment 10 Gilboa Davara 2019-07-04 13:52:06 UTC
--- /home/gilboa/work/fedora/cgdb/f30/cgdb.spec	2019-07-01 14:27:50.344421213 +0300
+++ SPECS/cgdb.spec	2019-07-04 16:43:51.197166843 +0300
@@ -1,12 +1,13 @@
 Name:			cgdb
 Version:		0.6.8
-Release:		11%{?dist}
+Release:		12%{?dist}
 Summary:		CGDB is a curses-based interface to the GNU Debugger (GDB)
 
 License:		GPLv2
 URL:			http://cgdb.sourceforge.net/
 Source0:		http://heanet.dl.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.gz
 Source1:		http://cgdb.sourceforge.net/cgdb.png
+Patch0:			disable_style.patch
 
 BuildRequires:  gcc
 BuildRequires:	readline-devel
@@ -31,6 +32,7 @@
 
 %prep
 %setup -q
+%patch0 -p2 -b .disable_shell_style
 
 
 %build
@@ -54,6 +56,9 @@
 %{_mandir}/man1/cgdb.1.gz
 
 %changelog
+* Thu Jul 4 2019 Gilboa Davara <gilboad [AT] gmail.com> - 0.6.8-12
+- Automatically disable gdb's shell style.
+
 * Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain> - 0.6.8-11
 - Rebuild for readline 8.0


--- BUILD/cgdb-0.6.8/lib/util/fork_util.c.disable_shell_style	2014-07-23 04:43:00.000000000 +0300
+++ BUILD/cgdb-0.6.8/lib/util/fork_util.c	2019-07-04 16:42:04.749828019 +0300
@@ -187,10 +187,12 @@
     const char *const NW = "--nw";
     const char *const X = "-x";
     const char *const ANNOTATE_TWO = "--annotate=2";
+	const char *const DISABLE_STYLE_P = "-init-eval-command";
+	const char *const DISABLE_STYLE_V = "set style enabled off";
     const char *const GDBMI = "-i=mi2";
     char *F = filename;
     char **local_argv;
-    int i, j = 0, extra = 6;
+    int i, j = 0, extra = 8;
     int malloc_size = argc + extra;
     char slavename[64];
     int masterfd;
@@ -203,6 +205,10 @@
     else
         local_argv[j++] = cgdb_strdup(GDB);
 
+    /* Gilboa: Disable extended shell style. */
+    local_argv[j++] = cgdb_strdup(DISABLE_STYLE_P);
+    local_argv[j++] = cgdb_strdup(DISABLE_STYLE_V);
+
     /* NOTE: These options have to come first, since if the user
      * typed '--args' to GDB, everything at the end of the 
      * users options become parameters to the inferior.

Comment 11 Gilboa Davara 2019-07-04 13:52:37 UTC
Seems to work for me. Anyone feel like testing before I commit?

- Gilboa

Comment 12 Fedora Update System 2019-07-08 16:04:49 UTC
FEDORA-2019-4522aec0c4 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-4522aec0c4

Comment 13 Fedora Update System 2019-07-09 01:22:09 UTC
cgdb-0.6.8-13.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-4522aec0c4

Comment 14 Fedora Update System 2019-07-23 01:07:37 UTC
cgdb-0.6.8-13.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.