libswiftCore.dylib was compiled with optimization - stepping may behave oddly;


(David liu) #1

Hi all, can any one here give me some pointers on debugging the standard
library?
I may be compiling the toolchain incorrectly when i step through the code
variables on the stack frame are not available.
I think its due to this message when i start the REPL
`libswiftCore.dylib was compiled with optimization - stepping may behave
oddly; variables may not be available.`
I am using the /utils/build-toolchain command and did not touch the
presets.ini file.
Any help is appreciated!

Thanks in advance

Dave

Process 13833 stopped

* thread #1: tid = 0x3a6ffe, 0x00000001000c3603
libswiftCore.dylib`ManagedBufferPointer.init(_uncheckedBufferClass :
AnyObject.Type, minimumCapacity : Int) -> ManagedBufferPointer<A, B>
[inlined] Swift._roundUp (Swift.Int, toAlignment : Swift.Int) -> Swift.Int
at Builtin.swift:72, queue = 'com.apple.main-thread', stop reason = step in

    frame #0: 0x00000001000c3603
libswiftCore.dylib`ManagedBufferPointer.init(_uncheckedBufferClass :
AnyObject.Type, minimumCapacity : Int) -> ManagedBufferPointer<A, B>
[inlined] Swift._roundUp (Swift.Int, toAlignment : Swift.Int) -> Swift.Int
at Builtin.swift:72 [opt]

   69 @_versioned

   70 internal func _roundUp(_ offset: Int, toAlignment alignment: Int) ->
Int {

   71 _sanityCheck(offset >= 0)

-> 72 return Int(_roundUpImpl(UInt(bitPattern: offset), toAlignment:
alignment))

   73 }

   74

   75 // This function takes a raw pointer and returns a typed pointer. It
implicitly

(lldb) fr v

(lldb) po offset

error: <EXPR>:3:1: error: use of unresolved identifier 'offset'

offset

^~~~~~

(lldb) fr v offset

error: no variable named 'offset' found in this frame

(lldb) s

Process 13833 stopped

* thread #1: tid = 0x3a6ffe, 0x00000001000c3603
libswiftCore.dylib`ManagedBufferPointer.init(_uncheckedBufferClass :
AnyObject.Type, minimumCapacity : Int) -> ManagedBufferPointer<A, B>
[inlined] Swift._roundUpImpl (Swift.UInt, toAlignment : Swift.Int) ->
Swift.UInt at Builtin.swift:58, queue = 'com.apple.main-thread', stop
reason = step in

    frame #0: 0x00000001000c3603
libswiftCore.dylib`ManagedBufferPointer.init(_uncheckedBufferClass :
AnyObject.Type, minimumCapacity : Int) -> ManagedBufferPointer<A, B>
[inlined] Swift._roundUpImpl (Swift.UInt, toAlignment : Swift.Int) ->
Swift.UInt at Builtin.swift:58 [opt]

   55 _sanityCheck(_isPowerOf2(alignment))

   56 // Note, given that offset is >= 0, and alignment > 0, we don't

   57 // need to underflow check the -1, as it can never underflow.

-> 58 let x = offset + UInt(bitPattern: alignment) &- 1

   59 // Note, as alignment is a power of 2, we'll use masking to
efficiently

   60 // get the aligned value

   61 return x & ~(UInt(bitPattern: alignment) &- 1)

(lldb) fr v

(lldb) fr v -R

(lldb) fr v aligment

error: no variable named 'aligment' found in this frame

(lldb) fr v alignment

error: no variable named 'alignment' found in this frame


(Michael Gottesman) #2

If you are using the build-toolchain command, the stdlib will be built with optimizations enabled [as one would hope when you compile a toolchain = )].

If you want to have a debug stdlib, you need to make sure that the cmake flag -DSWIFT_STDLIB_BUILD_TYPE=Debug is set. (And probably you also want) -DSWIFT_STDLIB_ASSERTIONS=true.

Now you are not going to be able to get that from build-toolchain without modification. A few thoughts:

1. I would file a bug on bugs.swift.org saying that you want the ability to tell build-toolchain to build a debug standard library. I think that is a reasonable request. Please respond to this thread with the URL.
2. Notice that the build-toolchain script has a build-script invocation inside of it. There is an option to build-script called something along the lines of --expand-build-script-command-line perhaps? Look for expand in the --help. You can add that to the script to grab the internal build-script invocation. Then add to the end of that invocation the option: --debug-swift-stdlib --swift-stdlib-assertions. Keep in mind that this is just from memory so you may need to munge it a little bit.

Michael

···

On Aug 26, 2016, at 12:36 AM, David Liu via swift-users <swift-users@swift.org> wrote:

Hi all, can any one here give me some pointers on debugging the standard library?
I may be compiling the toolchain incorrectly when i step through the code variables on the stack frame are not available.
I think its due to this message when i start the REPL
`libswiftCore.dylib was compiled with optimization - stepping may behave oddly; variables may not be available.`
I am using the /utils/build-toolchain command and did not touch the presets.ini file.
Any help is appreciated!

Thanks in advance

Dave

Process 13833 stopped
* thread #1: tid = 0x3a6ffe, 0x00000001000c3603 libswiftCore.dylib`ManagedBufferPointer.init(_uncheckedBufferClass : AnyObject.Type, minimumCapacity : Int) -> ManagedBufferPointer<A, B> [inlined] Swift._roundUp (Swift.Int, toAlignment : Swift.Int) -> Swift.Int at Builtin.swift:72, queue = 'com.apple.main-thread', stop reason = step in
    frame #0: 0x00000001000c3603 libswiftCore.dylib`ManagedBufferPointer.init(_uncheckedBufferClass : AnyObject.Type, minimumCapacity : Int) -> ManagedBufferPointer<A, B> [inlined] Swift._roundUp (Swift.Int, toAlignment : Swift.Int) -> Swift.Int at Builtin.swift:72 [opt]
   69 @_versioned
   70 internal func _roundUp(_ offset: Int, toAlignment alignment: Int) -> Int {
   71 _sanityCheck(offset >= 0)
-> 72 return Int(_roundUpImpl(UInt(bitPattern: offset), toAlignment: alignment))
   73 }
   74
   75 // This function takes a raw pointer and returns a typed pointer. It implicitly
(lldb) fr v
(lldb) po offset
error: <EXPR>:3:1: error: use of unresolved identifier 'offset'
offset
^~~~~~
(lldb) fr v offset
error: no variable named 'offset' found in this frame
(lldb) s
Process 13833 stopped
* thread #1: tid = 0x3a6ffe, 0x00000001000c3603 libswiftCore.dylib`ManagedBufferPointer.init(_uncheckedBufferClass : AnyObject.Type, minimumCapacity : Int) -> ManagedBufferPointer<A, B> [inlined] Swift._roundUpImpl (Swift.UInt, toAlignment : Swift.Int) -> Swift.UInt at Builtin.swift:58, queue = 'com.apple.main-thread', stop reason = step in
    frame #0: 0x00000001000c3603 libswiftCore.dylib`ManagedBufferPointer.init(_uncheckedBufferClass : AnyObject.Type, minimumCapacity : Int) -> ManagedBufferPointer<A, B> [inlined] Swift._roundUpImpl (Swift.UInt, toAlignment : Swift.Int) -> Swift.UInt at Builtin.swift:58 [opt]
   55 _sanityCheck(_isPowerOf2(alignment))
   56 // Note, given that offset is >= 0, and alignment > 0, we don't
   57 // need to underflow check the -1, as it can never underflow.
-> 58 let x = offset + UInt(bitPattern: alignment) &- 1
   59 // Note, as alignment is a power of 2, we'll use masking to efficiently
   60 // get the aligned value
   61 return x & ~(UInt(bitPattern: alignment) &- 1)
(lldb) fr v
(lldb) fr v -R
(lldb) fr v aligment
error: no variable named 'aligment' found in this frame
(lldb) fr v alignment
error: no variable named 'alignment' found in this frame
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


(David liu) #3

Thank you Michael this really helps a lot, i really appreciate your help.
Here is the bug i filed. https://bugs.swift.org/browse/SR-2494 .
Also as a side question, this is my current method of trying to debug the
Standard Library, was wondering is there a better way to debug other than
build toolchain and debug through command line?

Cheers

Dave

···

On Thu, Aug 25, 2016 at 11:31 PM, Michael Gottesman <mgottesman@apple.com> wrote:

If you are using the build-toolchain command, the stdlib will be built
with optimizations enabled [as one would hope when you compile a toolchain
= )].

If you want to have a debug stdlib, you need to make sure that the cmake
flag -DSWIFT_STDLIB_BUILD_TYPE=Debug is set. (And probably you also want)
-DSWIFT_STDLIB_ASSERTIONS=true.

Now you are not going to be able to get that from build-toolchain without
modification. A few thoughts:

1. I would file a bug on bugs.swift.org saying that you want the ability
to tell build-toolchain to build a debug standard library. I think that is
a reasonable request. Please respond to this thread with the URL.
2. Notice that the build-toolchain script has a build-script invocation
inside of it. There is an option to build-script called something along the
lines of --expand-build-script-command-line perhaps? Look for expand in
the --help. You can add that to the script to grab the internal
build-script invocation. Then add to the end of that invocation the option:
--debug-swift-stdlib --swift-stdlib-assertions. Keep in mind that this is
just from memory so you may need to munge it a little bit.

Michael

On Aug 26, 2016, at 12:36 AM, David Liu via swift-users < > swift-users@swift.org> wrote:

Hi all, can any one here give me some pointers on debugging the standard
library?
I may be compiling the toolchain incorrectly when i step through the code
variables on the stack frame are not available.
I think its due to this message when i start the REPL
`libswiftCore.dylib was compiled with optimization - stepping may behave
oddly; variables may not be available.`
I am using the /utils/build-toolchain command and did not touch the
presets.ini file.
Any help is appreciated!

Thanks in advance

Dave

Process 13833 stopped
* thread #1: tid = 0x3a6ffe, 0x00000001000c3603 libswiftCore.dylib`
ManagedBufferPointer.init(_uncheckedBufferClass : AnyObject.Type,
minimumCapacity : Int) -> ManagedBufferPointer<A, B> [inlined]
Swift._roundUp (Swift.Int, toAlignment : Swift.Int) -> Swift.Int at
Builtin.swift:72, queue = 'com.apple.main-thread', stop reason = step in
    frame #0: 0x00000001000c3603 libswiftCore.dylib`
ManagedBufferPointer.init(_uncheckedBufferClass : AnyObject.Type,
minimumCapacity : Int) -> ManagedBufferPointer<A, B> [inlined]
Swift._roundUp (Swift.Int, toAlignment : Swift.Int) -> Swift.Int at
Builtin.swift:72 [opt]
   69 @_versioned
   70 internal func _roundUp(_ offset: Int, toAlignment alignment: Int)
-> Int {
   71 _sanityCheck(offset >= 0)
-> 72 return Int(_roundUpImpl(UInt(bitPattern: offset), toAlignment:
alignment))
   73 }
   74
   75 // This function takes a raw pointer and returns a typed pointer.
It implicitly
(lldb) fr v
(lldb) po offset
error: <EXPR>:3:1: error: use of unresolved identifier 'offset'
offset
^~~~~~
(lldb) fr v offset
error: no variable named 'offset' found in this frame
(lldb) s
Process 13833 stopped
* thread #1: tid = 0x3a6ffe, 0x00000001000c3603 libswiftCore.dylib`
ManagedBufferPointer.init(_uncheckedBufferClass : AnyObject.Type,
minimumCapacity : Int) -> ManagedBufferPointer<A, B> [inlined]
Swift._roundUpImpl (Swift.UInt, toAlignment : Swift.Int) -> Swift.UInt at
Builtin.swift:58, queue = 'com.apple.main-thread', stop reason = step in
    frame #0: 0x00000001000c3603 libswiftCore.dylib`
ManagedBufferPointer.init(_uncheckedBufferClass : AnyObject.Type,
minimumCapacity : Int) -> ManagedBufferPointer<A, B> [inlined]
Swift._roundUpImpl (Swift.UInt, toAlignment : Swift.Int) -> Swift.UInt at
Builtin.swift:58 [opt]
   55 _sanityCheck(_isPowerOf2(alignment))
   56 // Note, given that offset is >= 0, and alignment > 0, we don't
   57 // need to underflow check the -1, as it can never underflow.
-> 58 let x = offset + UInt(bitPattern: alignment) &- 1
   59 // Note, as alignment is a power of 2, we'll use masking to
efficiently
   60 // get the aligned value
   61 return x & ~(UInt(bitPattern: alignment) &- 1)
(lldb) fr v
(lldb) fr v -R
(lldb) fr v aligment
error: no variable named 'aligment' found in this frame
(lldb) fr v alignment
error: no variable named 'alignment' found in this frame
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


(Dmitri Gribenko) #4

If you don't need the whole toolchain, just run:

./utils/build-script -R --debug-swift-stdlib

This will build the compiler, the standard library, and SDK overlays.

Dmitri

···

On Fri, Aug 26, 2016 at 10:14 PM, David Liu via swift-users <swift-users@swift.org> wrote:

Thank you Michael this really helps a lot, i really appreciate your help.
Here is the bug i filed. https://bugs.swift.org/browse/SR-2494 .
Also as a side question, this is my current method of trying to debug the
Standard Library, was wondering is there a better way to debug other than
build toolchain and debug through command line?

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/


(David liu) #5

Hi Dimitri

Thanks for the tip really appreciate the help.

Dave

···

On Fri, Aug 26, 2016 at 12:50 PM, Dmitri Gribenko <gribozavr@gmail.com> wrote:

On Fri, Aug 26, 2016 at 10:14 PM, David Liu via swift-users > <swift-users@swift.org> wrote:
> Thank you Michael this really helps a lot, i really appreciate your help.
> Here is the bug i filed. https://bugs.swift.org/browse/SR-2494 .
> Also as a side question, this is my current method of trying to debug the
> Standard Library, was wondering is there a better way to debug other
than
> build toolchain and debug through command line?

If you don't need the whole toolchain, just run:

./utils/build-script -R --debug-swift-stdlib

This will build the compiler, the standard library, and SDK overlays.

Dmitri

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/


(David liu) #6

Hi Dimitri,

So i have built using ./utils/build-script -R --debug-swift-stdlib how ever
the REPL no longer has line numbers and i can not set a breakpoint via `:b`
and am unable to get to lldb to set breakpoints.
Thanks again for your help.

Cheers

Dave

davids-Mac-Pro:swift dyl$
/Users/dyl/Documents/Apple/build/Ninja-ReleaseAssert+stdlib-DebugAssert/swift-macosx-x86_64/bin/swift

*** You are running Swift's integrated REPL, ***

*** intended for compiler and stdlib ***

*** development and testing purposes only. ***

*** The full REPL is built as part of LLDB. ***

*** Type ':help' for assistance. ***

(swift) :LLDB

Unknown interpreter escape; try :help

(swift) :help

Available commands:

  :quit - quit the interpreter (you can also use :exit or Control+D or
exit(0))

  :autoindent (on|off) - turn on/off automatic indentation of bracketed
lines

  :constraints debug (on|off) - turn on/off the debug output for the
constraint-based type checker

  :dump_ir - dump the LLVM IR generated by the REPL

  :dump_ast - dump the AST representation of the REPL input

  :dump_decl <name> - dump the AST representation of the named declarations

  :dump_source - dump the user input (ignoring lines with errors)

  :print_decl <name> - print the AST representation of the named
declarations

  :print_module <name> - print the decls in the given module, but not
submodules

API documentation etc. will be here eventually.

(swift) func OME(){

          let testData = "some string"

          print(testData)

        }

(swift) :b 1 << this does not work

(swift) breakpoint set --file Range.swift --line 1435 << don't work neither
since not lldb

···

On Sat, Aug 27, 2016 at 12:26 PM, David Liu <david.yang.liu@gmail.com> wrote:

Hi Dimitri

Thanks for the tip really appreciate the help.

Dave

On Fri, Aug 26, 2016 at 12:50 PM, Dmitri Gribenko <gribozavr@gmail.com> > wrote:

On Fri, Aug 26, 2016 at 10:14 PM, David Liu via swift-users >> <swift-users@swift.org> wrote:
> Thank you Michael this really helps a lot, i really appreciate your
help.
> Here is the bug i filed. https://bugs.swift.org/browse/SR-2494 .
> Also as a side question, this is my current method of trying to debug
the
> Standard Library, was wondering is there a better way to debug other
than
> build toolchain and debug through command line?

If you don't need the whole toolchain, just run:

./utils/build-script -R --debug-swift-stdlib

This will build the compiler, the standard library, and SDK overlays.

Dmitri

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/


(Dmitri Gribenko) #7

Hi Dimitri,

So i have built using ./utils/build-script -R --debug-swift-stdlib how ever
the REPL no longer has line numbers and i can not set a breakpoint via `:b`
and am unable to get to lldb to set breakpoints.
Thanks again for your help.

This build does not include LLDB, only the components that I mentioned:

This will build the compiler, the standard library, and SDK overlays.

Add '--lldb' if you need the debugger. (Note that you'd need to start
the REPL from the LLDB build dir, or install everything. Running
'swift' from the build directory will always run the integrated REPL
without LLDB.)

Dmitri

···

On Sat, Aug 27, 2016 at 2:12 PM, David Liu <david.yang.liu@gmail.com> wrote:

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/


(David liu) #8

Hi Dimitri,

Thanks again for the help but unfortunately i am still stuck.
I added the --lldb flag and built it and ran in to some errors with this
command./utils/build-script -R --debug-swift-stdlib --lldb
So i decided to start clean and re clone everything and start on fresh
slate and try it with just the -l option ./utils/build-script -l
I got the same error both times, it looks like both of the scripts have to
do with code signing. I did not see any code sign related entry in the
README.md

Cheers

Dave

PBXCp
/Users/dyl/Documents/swift-source/build/Ninja-DebugAssert/lldb-macosx-x86_64/CustomSwift-Debug/repl_swift
/Users/dyl/Documents/swift-source/build/Ninja-DebugAssert/lldb-macosx-x86_64/CustomSwift-Debug/LLDB.framework/Resources/repl_swift

    cd /Users/dyl/Documents/swift-source/lldb

    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude
.git -exclude .hg -resolve-src-symlinks
/Users/dyl/Documents/swift-source/build/Ninja-DebugAssert/lldb-macosx-x86_64/CustomSwift-Debug/repl_swift
/Users/dyl/Documents/swift-source/build/Ninja-DebugAssert/lldb-macosx-x86_64/CustomSwift-Debug/LLDB.framework/Resources

** BUILD FAILED **

The following build commands failed:

PhaseScriptExecution Run\ Script
/Users/dyl/Documents/swift-source/build/Ninja-DebugAssert/lldb-macosx-x86_64/lldb.build/CustomSwift-Debug/lldb-server.build/Script-4C3326CA18B2A2B800EB5DD7.sh

PhaseScriptExecution Run\ Script
/Users/dyl/Documents/swift-source/build/Ninja-DebugAssert/lldb-macosx-x86_64/debugserver.build/CustomSwift-Debug/debugserver.build/Script-4C3326CB18B2A2F600EB5DD7.sh

(2 failures)

./swift/utils/build-script: fatal error: command terminated with a non-zero
exit status 65, aborting

davids-Mac-Pro:swift-source dyl$ ./swift/utils/build-script -l

#!/bin/sh -x

if [ "${CONFIGURATION}" != BuildAndIntegration ]

then

    if [ -n "${DEBUGSERVER_USE_FROM_SYSTEM}" ]

    then

ditto
"${DEVELOPER_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver"
"${TARGET_BUILD_DIR}/${TARGET_NAME}"

    elif [ "${DEBUGSERVER_DISABLE_CODESIGN}" == "" ]

    then

        codesign -f -s lldb_codesign "${TARGET_BUILD_DIR}/${TARGET_NAME}"

    fi

fi

if [ "${CONFIGURATION}" != BuildAndIntegration ]

then

    if [ "${DEBUGSERVER_USE_FROM_SYSTEM}" == "" ]

    then

        if [ "${DEBUGSERVER_DISABLE_CODESIGN}" == "" ]

        then

            codesign -f -s lldb_codesign
"${TARGET_BUILD_DIR}/${TARGET_NAME}"

        fi

    fi

fi

···

On Sat, Aug 27, 2016 at 2:17 PM, Dmitri Gribenko <gribozavr@gmail.com> wrote:

On Sat, Aug 27, 2016 at 2:12 PM, David Liu <david.yang.liu@gmail.com> > wrote:
> Hi Dimitri,
>
> So i have built using ./utils/build-script -R --debug-swift-stdlib how
ever
> the REPL no longer has line numbers and i can not set a breakpoint via
`:b`
> and am unable to get to lldb to set breakpoints.
> Thanks again for your help.

This build does not include LLDB, only the components that I mentioned:

> This will build the compiler, the standard library, and SDK overlays.

Add '--lldb' if you need the debugger. (Note that you'd need to start
the REPL from the LLDB build dir, or install everything. Running
'swift' from the build directory will always run the integrated REPL
without LLDB.)

Dmitri

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/


(David liu) #9

Hi Dimitri

Update, hardcoding the following in the build-script-impl and building
tool-chain
-DSWIFT_STDLIB_BUILD_TYPE="Debug"
-DSWIFT_STDLIB_ASSERTIONS=true
is working for me.
But any attempt to build lldb with -l or -lldb fails with the above error.
I think this unblocks me for now. Will keep investigating

···

On Sat, Aug 27, 2016 at 6:09 PM, David Liu <david.yang.liu@gmail.com> wrote:

Hi Dimitri,

Thanks again for the help but unfortunately i am still stuck.
I added the --lldb flag and built it and ran in to some errors with this
command./utils/build-script -R --debug-swift-stdlib --lldb
So i decided to start clean and re clone everything and start on fresh
slate and try it with just the -l option ./utils/build-script -l
I got the same error both times, it looks like both of the scripts have to
do with code signing. I did not see any code sign related entry in the
README.md

Cheers

Dave

PBXCp /Users/dyl/Documents/swift-source/build/Ninja-
DebugAssert/lldb-macosx-x86_64/CustomSwift-Debug/repl_swift
/Users/dyl/Documents/swift-source/build/Ninja-DebugAssert/lldb-macosx-x86_
64/CustomSwift-Debug/LLDB.framework/Resources/repl_swift

    cd /Users/dyl/Documents/swift-source/lldb

    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude
.git -exclude .hg -resolve-src-symlinks /Users/dyl/Documents/swift-
source/build/Ninja-DebugAssert/lldb-macosx-x86_64/CustomSwift-Debug/repl_swift
/Users/dyl/Documents/swift-source/build/Ninja-DebugAssert/lldb-macosx-x86_
64/CustomSwift-Debug/LLDB.framework/Resources

** BUILD FAILED **

The following build commands failed:

PhaseScriptExecution Run\ Script /Users/dyl/Documents/swift-
source/build/Ninja-DebugAssert/lldb-macosx-x86_64/lldb.build/CustomSwift-
Debug/lldb-server.build/Script-4C3326CA18B2A2B800EB5DD7.sh

PhaseScriptExecution Run\ Script /Users/dyl/Documents/swift-
source/build/Ninja-DebugAssert/lldb-macosx-x86_64/debugserver.build/
CustomSwift-Debug/debugserver.build/Script-4C3326CB18B2A2F600EB5DD7.sh

(2 failures)

./swift/utils/build-script: fatal error: command terminated with a
non-zero exit status 65, aborting

davids-Mac-Pro:swift-source dyl$ ./swift/utils/build-script -l

#!/bin/sh -x

if [ "${CONFIGURATION}" != BuildAndIntegration ]

then

    if [ -n "${DEBUGSERVER_USE_FROM_SYSTEM}" ]

    then

ditto "${DEVELOPER_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver"
"${TARGET_BUILD_DIR}/${TARGET_NAME}"

    elif [ "${DEBUGSERVER_DISABLE_CODESIGN}" == "" ]

    then

        codesign -f -s lldb_codesign "${TARGET_BUILD_DIR}/${TARGET_NAME}"

    fi

fi

if [ "${CONFIGURATION}" != BuildAndIntegration ]

then

    if [ "${DEBUGSERVER_USE_FROM_SYSTEM}" == "" ]

    then

        if [ "${DEBUGSERVER_DISABLE_CODESIGN}" == "" ]

        then

            codesign -f -s lldb_codesign "${TARGET_BUILD_DIR}/${TARGET_
NAME}"

        fi

    fi

fi

On Sat, Aug 27, 2016 at 2:17 PM, Dmitri Gribenko <gribozavr@gmail.com> > wrote:

On Sat, Aug 27, 2016 at 2:12 PM, David Liu <david.yang.liu@gmail.com> >> wrote:
> Hi Dimitri,
>
> So i have built using ./utils/build-script -R --debug-swift-stdlib how
ever
> the REPL no longer has line numbers and i can not set a breakpoint via
`:b`
> and am unable to get to lldb to set breakpoints.
> Thanks again for your help.

This build does not include LLDB, only the components that I mentioned:

> This will build the compiler, the standard library, and SDK overlays.

Add '--lldb' if you need the debugger. (Note that you'd need to start
the REPL from the LLDB build dir, or install everything. Running
'swift' from the build directory will always run the integrated REPL
without LLDB.)

Dmitri

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/


(Dmitri Gribenko) #10

Hi Dimitri

Update, hardcoding the following in the build-script-impl and building
tool-chain
-DSWIFT_STDLIB_BUILD_TYPE="Debug"
-DSWIFT_STDLIB_ASSERTIONS=true
is working for me.

These two options is what --debug-swift-stdlib expands to.

But any attempt to build lldb with -l or -lldb fails with the above error. I
think this unblocks me for now.

+ Sean for LLDB build issues.

Dmitri

···

On Sun, Aug 28, 2016 at 12:51 AM, David Liu <david.yang.liu@gmail.com> wrote:

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/