git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Lift --stdout restriction for using reachability bitmap in pack-objects?

From
Jeff King <peff@peff.net>
Date
Feb 17, 2015, 10:42 UTC
Message-ID
<20150217104228.GA26301@peff.net>
In-Reply-To
<CACsJy8C=MC2xVbkXE-RBcLtcn0yEX4iqBLjgOw+M0iK5n-Kyhw@mail.gmail.com>
On Tue, Feb 17, 2015 at 05:36:30PM +0700, Duy Nguyen wrote:
Show 9 quoted lines
> On Tue, Feb 17, 2015 at 5:13 PM, Jeff King <peff@peff.net> wrote:
> > If the only reason is for gdb, then perhaps:
> >
> >   set args pack-objects --stdout </dev/null >/dev/null
> >
> > in gdb would help?
> 
> Right. I used "gdb --args command >/dev/null" instead. Stupid
> question. Sorry for the noise.

I've made the same mistake myself many times. I really wish gdb would interact over /dev/tty by default. The perl debugger does this, and I find it quite handy. But I've never managed to make gdb do it. Maybe there is an option I've missed[1].

The downside of what approach, though, is that you cannot restart the program reliably from within the debugger (it cannot know how to re-set-up the descriptors). So you have to quit and restart, which loses any breakpoints, etc.

-Peff
[1] Having written that, I'm not sure I ever tried a script that does
    something like:
      program=$1; shift
      exec 3<&0
      exec 4>&1
      gdb </dev/tty >/dev/tty -ex "set args <&3 >&4 gdb $*" "$program"
    I think that would work, but it does screw up quoting/whitespace in
    your arguments.
Previous: Duy NguyenNext: Kyle J. McKay
Message 4 of 5 in “Lift --stdout restriction for using reachability bitmap in pack-objects?”
  1. Duy NguyenFeb 17, 2015
  2. Jeff KingFeb 17, 2015
  3. Duy NguyenFeb 17, 2015
  4. Jeff KingFeb 17, 2015
  5. Kyle J. McKayFeb 19, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.