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: Ivan Vučica
Subject: Re: 32bit GS on 64bit Win rebuild base from src
Date: Sun, 21 Aug 2016 23:32:59 +0100

If so, that sounds more like a problem with gdb and/or mingw?

Does this installation of gdb work with plain C programs?

On Sun, Aug 21, 2016 at 4:40 PM, Giah de Barag <address@hidden> wrote:
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;
}




_______________________________________________
Gnustep-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/gnustep-dev


reply via email to

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