Skip to content

Instantly share code, notes, and snippets.

@tetsuok
Created July 1, 2012 18:22
Show Gist options
  • Select an option

  • Save tetsuok/3029169 to your computer and use it in GitHub Desktop.

Select an option

Save tetsuok/3029169 to your computer and use it in GitHub Desktop.
Memo GDB on OS X Lion
$ uname -a
Darwin shouga 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr 9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64
$ cat test.c
#include <stdio.h>
int main(void) {
printf("test\n");
return 0;
}
$ gcc -g test.c
$ ./gdb a.out
GNU gdb (GDB) 7.4.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin11.4.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /Users/tetsuo-s/Downloads/gdb-7.4.1/gdb/a.out...Reading symbols from /Users/tetsuo-s/Downloads/gdb-7.4.1/gdb/a.out.dSYM/Contents/Resources/DWARF/a.out...done.
done.
(gdb) r
Starting program: /Users/tetsuo-s/Downloads/gdb-7.4.1/gdb/a.out
test
[Inferior 1 (process 58650) exited normally]
(gdb) r
gdb(58649) malloc: *** error for object 0x102cd3b18: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment