correct history file no longer being used after running cgdb as root

36 views
Skip to first unread message

Tyler Sample

unread,
Aug 17, 2018, 6:12:25 PM8/17/18
to cgdb
I ran cgdb as root to attach to a running process `sudo cgdb -p 555`, and ctrl-r and up arrow no longer work when running as myself.

gdb still works as expected.  Permissions and owners on `~/.cgdb`, `.gdb_history`, and `.gdbinit` are still as expected.  cgdbrc is unchanged and I have no other config files in `~/.cgdb`...just logs and history.

To some degree, it looks like it is now using `~/.cgdb/readline_history.txt` (which only has about 20 entries now) However, even that seems flaky and unreliable (some commands don't seem to get saved into it)

The contents of my `.gdbinit` follow (and seem to otherwise be honored by cgdb)

    handle SIGPIPE nostop
    set print object on
    set print pretty on
    set print asm-demangle on
    set print symbol on
    set pagination off
    set history filename ~/.gdb_history
    set history save on
    set history expansion on
    set history size 10000

Anyone have any ideas on a potential solve for this?  

Robert Rossi

unread,
Sep 7, 2018, 8:56:32 PM9/7/18
to cgdb
When you sudo to a bash shell as root, does ctrl-r and up arrow work there?

Which version of cgdb are you using?

--
You received this message because you are subscribed to the Google Groups "cgdb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cgdb-users+unsubscribe@googlegroups.com.
To post to this group, send email to cgdb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cgdb-users/83d5dc54-be7d-4025-b51c-60a197500d6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tyler Sample

unread,
Sep 7, 2018, 9:33:55 PM9/7/18
to cgdb-...@googlegroups.com
£ cgdb --version
CGDB 20180619

Yes, ctrl-r and up arrow work from a bash shell running as root.

A few notes:
1. The machine got rebooted during an update and this problem went away.
2. It's possible I 'kill -9'ed cgdb (perhaps even the root session that caused the problem)
3. Root's shell is bash, mine is zsh

Happy to provide more info or attempt to reproduce, although I'm guessing given #1 and #2.....

On Fri, Sep 7, 2018 at 5:56 PM Robert Rossi <b...@brasko.net> wrote:
When you sudo to a bash shell as root, does ctrl-r and up arrow work there?

Which version of cgdb are you using?
On Fri, Aug 17, 2018 at 6:12 PM, Tyler Sample <tyler....@gmail.com> wrote:
I ran cgdb as root to attach to a running process `sudo cgdb -p 555`, and ctrl-r and up arrow no longer work when running as myself.

gdb still works as expected.  Permissions and owners on `~/.cgdb`, `.gdb_history`, and `.gdbinit` are still as expected.  cgdbrc is unchanged and I have no other config files in `~/.cgdb`...just logs and history.

To some degree, it looks like it is now using `~/.cgdb/readline_history.txt` (which only has about 20 entries now) However, even that seems flaky and unreliable (some commands don't seem to get saved into it)

The contents of my `.gdbinit` follow (and seem to otherwise be honored by cgdb)

    handle SIGPIPE nostop
    set print object on
    set print pretty on
    set print asm-demangle on
    set print symbol on
    set pagination off
    set history filename ~/.gdb_history
    set history save on
    set history expansion on
    set history size 10000

Anyone have any ideas on a potential solve for this?  

--
You received this message because you are subscribed to the Google Groups "cgdb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cgdb-users+...@googlegroups.com.

To post to this group, send email to cgdb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cgdb-users/83d5dc54-be7d-4025-b51c-60a197500d6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "cgdb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cgdb-users+...@googlegroups.com.

To post to this group, send email to cgdb-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages