discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gdb SIGSEGV when prining variables


From: Christian Swinehart
Subject: gdb SIGSEGV when prining variables
Date: Tue, 19 Dec 2000 09:46:56 -0800 (PST)

I've been having trouble getting gdb to give me any
information about objects wihtout crashing the program
in the process. I'm running gdb 4.17 with the objc
patch applied, and compiled with gcc 2.95.2 under
GNUstep.

I'd really like to be able to debug without having to
resort to printf's, so any advice anyone could offer
would be appreciated.



My test program was:

#import <Foundation/Foundation.h>

int main(int argc, char *argv[])
{
  NSString *message = @"Hello world";
  printf("%s\n",[message cString]);

  return 0;
}



The gdb session was:

(gdb) b main.m:6                    
Breakpoint 1 at 0x804b002: file main.m, line 6.
(gdb) r
Starting program:
/home/p/demo/csw/tmp/src/./shared_obj/ix86/linux-gnu/gnu-fd-gnu-nil/ttt


Breakpoint 1, main (argc=1, argv=0xbfffea34) at
main.m:6
6         printf("%s\n",[message cString]);
(gdb) p message

Program terminated with signal SIGSEGV, Segmentation
fault.
The program no longer exists.
The program being debugged stopped while in a function
called from GDB.
When the function (malloc) is done executing, GDB will
silently
stop (instead of continuing to evaluate the expression
containing
the function call).


__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]