gnustep-dev
[Top][All Lists]
Advanced

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

Re: 32bit GS on 64bit Win rebuild base from src


From: Giah de Barag
Subject: Re: 32bit GS on 64bit Win rebuild base from src
Date: Sun, 21 Aug 2016 11:40:40 -0400

Further info on this problem with GDB. Here is a C function "prn" that takes a 
char *. If I pass it a C string "foo" from the command-line in GDB, it receives 
a zero. So neither passing NSString convenience variables nor passing plain C 
string convenience variables works on latest GNUstep / MINGW32 / MSYS2.

#import <Foundation/Foundation.h>

void prn(char *a)
{
    // when call prn("foo") from
    // GDB command line breaking
    // here to examine, variable
    // a = 0x0 !!!
    printf("char is \'%s\'\n", a); fflush(stdout);
}

int main( int argc, const char *argv[] )
{
    id    pool = [NSAutoreleasePool new];
    id    foo  = @"foo";
    char *s    = [foo cString];
    prn(s);
    // now invoke prn from gdb
    // b prn
    // p prn("foo")
    // p a
    // $1 = 0x0
    // "foo" --> 0x0 ???
    [pool release];
    return 0;
}






reply via email to

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