This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Debugging on OSX marvericks


Hi all,

This is my first time to send mail :)

I'm trying to debug PostgreSQL with gdb on OSX marvericks(10.9.1).
But It does not work fine.
Please give me some helps.

I did the following step:
1. Install gdb refer to
<http://wiki.lazarus.freepascal.org/GDB_on_OS_X_Mavericks_and_Xcode_5>
2. Compile PostgreSQL with debug symbol (i.g. use gcc -g option)
3. Starts PostgreSQL server
4. Starts gdb, and attach the process of PostgreSQL server
 $ gdb
 (gdb) attach <server pid>
 Reading symbols from /Users/testuser/pgsql/master/bin/postgres...done.
 (gdb) b ServerLoop
 Cannot access memory at <address>
 (gdb) bt
 #0  0x0000000000??????
 #1  0x0000000000??????
 #2  0x0000000000??????
 :

I can see that debug symbol is read successfully. But I can not set
the break point, and name of function is not output normally.

On the other hand, the following step works fine.
1. Stops PostgreSQL server
2. Starts gdb with PostgreSQL server program
$ gdb postgres
 Reading symbols from /Users/testuser/pgsql/master/bin/postgres...done.
(gdb) b ServerLoop
Breakpoint 1 at 0x7044fd: file postmaster.c, line 1517.
(gdb) bt
#0  0x0000003d726e14d3 in __select_nocancel () from /lib64/libc.so.6
#1  0x00000000008cbf50 in pg_usleep (microsec=30000000) at pgsleep.c:43
#2  0x00000000004ff10f in StartupXLOG () at xlog.c:4919
#3  0x000000000070a182 in StartupProcessMain () at startup.c:224
#4  0x0000000000510270 in AuxiliaryProcessMain (argc=2,
argv=0x7fff85e351a0) at bootstrap.c:429
#5  0x0000000000708cc1 in StartChildProcess (type=StartupProcess) at
postmaster.c:4966
#6  0x0000000000703eac in PostmasterMain (argc=1, argv=0x2c44a70) at
postmaster.c:1251
#7  0x000000000066a9a8 in main (argc=1, argv=0x2c44a70) at main.c:196

i.g., I failed to debug only when I attach the process.
- What is the different between them?
- What is cause of problem?
- The gdb can not work on OSX marvericks?

Regards,

-------
Sawada Masahiko


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]