Git development
 help / color / mirror / Atom feed
* How to build to debug with gdb?
@ 2019-08-27 16:27 Giuseppe Crino'
  2019-08-27 17:55 ` Matheus Tavares Bernardino
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Giuseppe Crino' @ 2019-08-27 16:27 UTC (permalink / raw)
  To: git

Hello, to debug some issues I built and installed git via

$ make prefix=/usr/local DEVELOPER=1 CFLAGS="-O0 -g"
$ sudo make install
$ git --version # git version 2.23.0.40.g4d8aada92f 

But it seems there's still some optimization going on that prevents gdb from working correctly.

For example

(gdb) b builtin/config.c:752
Breakpoint 1 at 0x43942: file builtin/config.c, line 752.
(gdb) r config --global --edit
Starting program: /usr/local/bin/git config --global --edit
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libth
read_db.so.1".

Breakpoint 1, cmd_config (argc=0, argv=<optimized out>,
    prefix=<optimized out>) at builtin/config.c:753
    753                             if (fd >= 0) {
    (gdb) p fd
    $1 = <optimized out>

 What am I missing?

 -Giuseppe

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-08-28 12:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-27 16:27 How to build to debug with gdb? Giuseppe Crino'
2019-08-27 17:55 ` Matheus Tavares Bernardino
2019-08-27 18:07   ` Randall S. Becker
2019-08-27 18:34 ` Johannes Sixt
2019-08-27 18:36 ` SZEDER Gábor
2019-08-28  8:15   ` Giuseppe Crino'
2019-08-28 10:32     ` SZEDER Gábor
2019-08-28 11:00       ` Giuseppe Crino'
2019-08-28 12:43         ` Giuseppe Crino'

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox