Test run by simark on Thu Jul 28 22:30:24 2022 Native configuration is x86_64-pc-linux-gnu === gdb tests === Schedule of variations: unix Running target unix Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target. Using /usr/share/dejagnu/config/unix.exp as generic interface file for target. Using /home/simark/src/binutils-gdb/gdb/testsuite/config/unix.exp as tool-and-target-specific interface file. Running /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.exp ... Executing on host: gcc -fdiagnostics-color=never -c -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/ccopts2942025.o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/ccopts2942025.c (timeout = 300) builtin_spawn -ignore SIGHUP gcc -fdiagnostics-color=never -c -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/ccopts2942025.o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/ccopts2942025.c get_compiler_info: gcc-12-1-0 Executing on host: gcc -fno-stack-protector /home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/has_argv0-2942025.c -fdiagnostics-color=never -w -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/has_argv0-2942025.x (timeout = 300) builtin_spawn -ignore SIGHUP gcc -fno-stack-protector /home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/has_argv0-2942025.c -fdiagnostics-color=never -w -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/has_argv0-2942025.x builtin_spawn /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../../gdb/gdb -nw -nx -iex set height 0 -iex set width 0 -data-directory /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../data-directory warning: Found custom handler for signal 7 (Bus error) preinstalled. warning: Found custom handler for signal 8 (Floating point exception) preinstalled. warning: Found custom handler for signal 11 (Segmentation fault) preinstalled. Some signal dispositions inherited from the environment (SIG_DFL/SIG_IGN) won't be propagated to spawned programs. GNU gdb (GDB) 13.0.50.20220728-git Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) set height 0 (gdb) set width 0 (gdb) dir Reinitialize source path to empty? (y or n) y Source directories searched: $cdir:$cwd (gdb) dir /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile Source directories searched: /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile:$cdir:$cwd (gdb) kill The program is not being run. (gdb) file /home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/has_argv0-2942025.x Reading symbols from /home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/has_argv0-2942025.x... (gdb) break -q main Breakpoint 1 at 0x1124: file /home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/has_argv0-2942025.c, line 3. (gdb) run Starting program: /home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/has_argv0-2942025.x [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/../lib/libthread_db.so.1". Breakpoint 1, main (argc=1, argv=0x7fffffffd278) at /home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/has_argv0-2942025.c:3 3 /home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/has_argv0-2942025.c: No such file or directory. (gdb) show print elements Limit on string chars or array elements to print is 200. (gdb) show print repeats Threshold for repeated print elements is 10. (gdb) set print elements unlimited (gdb) gdb_do_cache_wrap ignoring pass: set print elements unlimited set print repeats unlimited (gdb) gdb_do_cache_wrap ignoring pass: set print repeats unlimited p argc $1 = 1 (gdb) p argv[0] $2 = 0x7fffffffd734 "/home/simark/build/binutils-gdb-one-target/gdb/testsuite/temp/2942025/has_argv0-2942025.x" (gdb) set print elements 200 (gdb) gdb_do_cache_wrap ignoring pass: set print elements 200 set print repeats 10 (gdb) gdb_do_cache_wrap ignoring pass: set print repeats 10 Executing on host: gcc -fno-stack-protector -fdiagnostics-color=never -c -g -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c (timeout = 300) builtin_spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -c -g -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c Executing on host: gcc -fno-stack-protector /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value.o -fdiagnostics-color=never -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value (timeout = 300) builtin_spawn -ignore SIGHUP gcc -fno-stack-protector /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value.o -fdiagnostics-color=never -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value builtin_spawn /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../../gdb/gdb -nw -nx -iex set height 0 -iex set width 0 -data-directory /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../data-directory warning: Found custom handler for signal 7 (Bus error) preinstalled. warning: Found custom handler for signal 8 (Floating point exception) preinstalled. warning: Found custom handler for signal 11 (Segmentation fault) preinstalled. Some signal dispositions inherited from the environment (SIG_DFL/SIG_IGN) won't be propagated to spawned programs. GNU gdb (GDB) 13.0.50.20220728-git Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) set height 0 (gdb) set width 0 (gdb) dir Reinitialize source path to empty? (y or n) y Source directories searched: $cdir:$cwd (gdb) dir /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile Source directories searched: /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile:$cdir:$cwd (gdb) kill The program is not being run. (gdb) file /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value Reading symbols from /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value... (gdb) guile (display "test\n") test (gdb) guile (define (print x) (format #t "= ~A" x) (newline)) (gdb) guile (define (raw-print x) (format #t "= ~S" x) (newline)) (gdb) guile (use-modules (gdb)) (gdb) gu (print (parse-and-eval "23")) = 23 (gdb) PASS: gdb.guile/scm-value.exp: parse-and-eval constant test gu (print (parse-and-eval "5 + 7")) = 12 (gdb) PASS: gdb.guile/scm-value.exp: parse-and-eval simple expression test gu (raw-print (parse-and-eval "5 + 7")) = # (gdb) PASS: gdb.guile/scm-value.exp: parse-and-eval type test guile >PASS: gdb.guile/scm-value.exp: Simple Guile value dictionary: input 1: guile (define one (make-value 1)) >PASS: gdb.guile/scm-value.exp: Simple Guile value dictionary: input 2: (define one (make-value 1)) (define two (make-value 2)) >PASS: gdb.guile/scm-value.exp: Simple Guile value dictionary: input 3: (define two (make-value 2)) (define three (make-value 3)) >PASS: gdb.guile/scm-value.exp: Simple Guile value dictionary: input 4: (define three (make-value 3)) (define vdict (make-hash-table 5)) >PASS: gdb.guile/scm-value.exp: Simple Guile value dictionary: input 5: (define vdict (make-hash-table 5)) (hash-set! vdict one "one str") >PASS: gdb.guile/scm-value.exp: Simple Guile value dictionary: input 6: (hash-set! vdict one "one str") (hash-set! vdict two "two str") >PASS: gdb.guile/scm-value.exp: Simple Guile value dictionary: input 7: (hash-set! vdict two "two str") (hash-set! vdict three "three str") >PASS: gdb.guile/scm-value.exp: Simple Guile value dictionary: input 8: (hash-set! vdict three "three str") end (gdb) PASS: gdb.guile/scm-value.exp: Simple Guile value dictionary: input 9: end gu (print (hash-ref vdict one)) = one str (gdb) PASS: gdb.guile/scm-value.exp: Test dictionary hash 1 gu (print (hash-ref vdict two)) = two str (gdb) PASS: gdb.guile/scm-value.exp: Test dictionary hash 2 gu (print (hash-ref vdict three)) = three str (gdb) PASS: gdb.guile/scm-value.exp: Test dictionary hash 3 delete breakpoints (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break -qualified main Breakpoint 1 at 0x117b: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c, line 76. (gdb) run Starting program: /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/../lib/libthread_db.so.1". Breakpoint 1, main (argc=1, argv=0x7fffffffd268) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c:76 76 char *cp = argv[0]; /* Prevent gcc from optimizing argv[] out. */ (gdb) guile (define (print x) (format #t "= ~A" x) (newline)) (gdb) guile (define (raw-print x) (format #t "= ~S" x) (newline)) (gdb) guile (use-modules (gdb)) (gdb) break 99 Breakpoint 2 at 0x55555555525b: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c, line 99. (gdb) continue Continuing. void function called Breakpoint 2, main (argc=1, argv=0x7fffffffd268) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c:99 99 save_argv = argv; /* break to inspect struct and union */ (gdb) PASS: gdb.guile/scm-value.exp: continue to breakpoint: break to inspect struct and union print s $1 = {a = 3, b = 5} (gdb) PASS: gdb.guile/scm-value.exp: print s gu (define s (history-ref 0)) (gdb) PASS: gdb.guile/scm-value.exp: set s gu (print (value-field s "a")) = 3 (gdb) PASS: gdb.guile/scm-value.exp: access element inside struct using string name gu (define i (history-append! (make-value 42))) (gdb) PASS: gdb.guile/scm-value.exp: append 42 gu i 2 (gdb) PASS: gdb.guile/scm-value.exp: gu i gu (history-ref i) # (gdb) PASS: gdb.guile/scm-value.exp: gu (history-ref i) p $ $3 = 42 (gdb) PASS: gdb.guile/scm-value.exp: p $ guile (gc) (gdb) PASS: gdb.guile/scm-value.exp: guile (gc) p $$ $4 = 42 (gdb) PASS: gdb.guile/scm-value.exp: p $$ gu (history-append! 123) ERROR: In procedure history-append!: ERROR: In procedure gdbscm_history_append_x: Wrong type argument in position 1 (expecting gdb:value): 123 Error while executing Scheme code. (gdb) PASS: gdb.guile/scm-value.exp: history-append! type error print argv $5 = (char **) 0x7fffffffd268 (gdb) PASS: gdb.guile/scm-value.exp: print argv gu (define argv (history-ref 0)) (gdb) PASS: gdb.guile/scm-value.exp: set argv gu (define arg0 (value-dereference argv)) (gdb) PASS: gdb.guile/scm-value.exp: set arg0 set print elements unlimited (gdb) PASS: gdb.guile/scm-value.exp: set print elements unlimited set print repeats unlimited (gdb) PASS: gdb.guile/scm-value.exp: set print repeats unlimited gu (print arg0) = 0x7fffffffd725 "/home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value" (gdb) PASS: gdb.guile/scm-value.exp: verify dereferenced value gu (print (value-optimized-out? arg0)) = #f (gdb) PASS: gdb.guile/scm-value.exp: Test value-optimized-out? gu (print (value-address arg0)) = 0x7fffffffd268 (gdb) PASS: gdb.guile/scm-value.exp: Test address attribute gu (print (value-address (make-value 42))) = #f (gdb) PASS: gdb.guile/scm-value.exp: Test address attribute in non-addressable value x 0 0x0: Cannot access memory at address 0x0 (gdb) gu (print (parse-and-eval "*(int*)0")) = ERROR: Cannot access memory at address 0x0 Error while executing Scheme code. (gdb) PASS: gdb.guile/scm-value.exp: parse_and_eval with memory error gu (define inval (parse-and-eval "*(int*)0")) (gdb) PASS: gdb.guile/scm-value.exp: gu (define inval (parse-and-eval "*(int*)0")) gu (print (value-lazy? inval)) = #t (gdb) PASS: gdb.guile/scm-value.exp: gu (print (value-lazy? inval)) gu (define inval2 (value-add inval 1)) ERROR: Cannot access memory at address 0x0 Error while executing Scheme code. (gdb) PASS: gdb.guile/scm-value.exp: memory error and lazy values, using value in value-add gu (value-fetch-lazy! inval)) ERROR: Cannot access memory at address 0x0 Error while executing Scheme code. (gdb) PASS: gdb.guile/scm-value.exp: memory error and lazy values, using value in value-fetch-lazy! gu (define argc-lazy (parse-and-eval "argc")) (gdb) PASS: gdb.guile/scm-value.exp: gu (define argc-lazy (parse-and-eval "argc")) gu (define argc-notlazy (parse-and-eval "argc")) (gdb) PASS: gdb.guile/scm-value.exp: gu (define argc-notlazy (parse-and-eval "argc")) gu (value-fetch-lazy! argc-notlazy) (gdb) PASS: gdb.guile/scm-value.exp: gu (value-fetch-lazy! argc-notlazy) gu (print (value-lazy? argc-lazy)) = #t (gdb) PASS: gdb.guile/scm-value.exp: argc-lazy is initially lazy gu (print (value-lazy? argc-notlazy)) = #f (gdb) PASS: gdb.guile/scm-value.exp: gu (print (value-lazy? argc-notlazy)) print argc $6 = 1 (gdb) PASS: gdb.guile/scm-value.exp: sanity check argc gu (print (value-lazy? argc-lazy)) = #t (gdb) PASS: gdb.guile/scm-value.exp: argc-lazy is still lazy after argc is printed set argc=2 (gdb) PASS: gdb.guile/scm-value.exp: set argc=2 gu (print argc-notlazy) = 1 (gdb) PASS: gdb.guile/scm-value.exp: gu (print argc-notlazy) gu (print argc-lazy) = 2 (gdb) PASS: gdb.guile/scm-value.exp: gu (print argc-lazy) gu (print (value-lazy? argc-lazy)) = #f (gdb) PASS: gdb.guile/scm-value.exp: argc-lazy is no longer lazy print st $7 = "divide et impera" (gdb) PASS: gdb.guile/scm-value.exp: print st gu (define st (history-ref 0)) (gdb) PASS: gdb.guile/scm-value.exp: inf: get st value from history gu (print (value->string st)) = divide et impera (gdb) PASS: gdb.guile/scm-value.exp: Test string with no length gu (print (value->string st #:length -1)) = divide et impera (gdb) PASS: gdb.guile/scm-value.exp: Test string (length = -1) is all of the string gu (print (value->string st #:length 6)) = divide (gdb) PASS: gdb.guile/scm-value.exp: gu (print (value->string st #:length 6)) gu (print (string-append "---" (value->string st #:length 0) "---")) = ------ (gdb) PASS: gdb.guile/scm-value.exp: Test string (length = 0) is empty gu (print (string-length (value->string st #:length 0))) = 0 (gdb) PASS: gdb.guile/scm-value.exp: Test length is 0 print nullst $8 = "divide\000et\000impera" (gdb) PASS: gdb.guile/scm-value.exp: print nullst gu (define nullst (history-ref 0)) (gdb) PASS: gdb.guile/scm-value.exp: inf: get nullst value from history gu (print (value->string nullst)) = divide (gdb) PASS: gdb.guile/scm-value.exp: Test string to first null gu (set! nullst (value->string nullst #:length 9)) (gdb) PASS: gdb.guile/scm-value.exp: get string beyond null gu (print nullst) = divide\000et (gdb) PASS: gdb.guile/scm-value.exp: gu (print nullst) gu (define argv-ref (value-reference-value argv)) (gdb) PASS: gdb.guile/scm-value.exp: test value-reference-value gu (equal? argv (value-referenced-value argv-ref)) #t (gdb) PASS: gdb.guile/scm-value.exp: gu (equal? argv (value-referenced-value argv-ref)) gu (eqv? (type-code (value-type argv-ref)) TYPE_CODE_REF) #t (gdb) PASS: gdb.guile/scm-value.exp: gu (eqv? (type-code (value-type argv-ref)) TYPE_CODE_REF) gu (define argv-rref (value-rvalue-reference-value argv)) (gdb) PASS: gdb.guile/scm-value.exp: test value-rvalue-reference-value gu (equal? argv (value-referenced-value argv-rref)) #t (gdb) PASS: gdb.guile/scm-value.exp: gu (equal? argv (value-referenced-value argv-rref)) gu (eqv? (type-code (value-type argv-rref)) TYPE_CODE_RVALUE_REF) #t (gdb) PASS: gdb.guile/scm-value.exp: gu (eqv? (type-code (value-type argv-rref)) TYPE_CODE_RVALUE_REF) gu (equal? (value-type (value-const-value argv)) (type-const (value-type argv))) #t (gdb) PASS: gdb.guile/scm-value.exp: gu (equal? (value-type (value-const-value argv)) (type-const (value-type argv))) p/x fp1 $9 = 0x555555555139 (gdb) PASS: gdb.guile/scm-value.exp: p/x fp1 gu (define fp1 (history-ref 0)) (gdb) PASS: gdb.guile/scm-value.exp: get fp1 value from history gu (set! fp1 (value-dereference fp1)) (gdb) PASS: gdb.guile/scm-value.exp: dereference fp1 gu (print (value-call fp1 '())) void function called = void (gdb) PASS: gdb.guile/scm-value.exp: gu (print (value-call fp1 '())) p/x fp2 $10 = 0x55555555514f (gdb) PASS: gdb.guile/scm-value.exp: place fp2 into value history, the first time gu (define fp2 (history-ref 0)) (gdb) PASS: gdb.guile/scm-value.exp: get fp2 value from history gu (set! fp2 (value-dereference fp2)) (gdb) PASS: gdb.guile/scm-value.exp: dereference fp2 gu (print (value-call fp2 (list 10 20))) = 30 (gdb) PASS: gdb.guile/scm-value.exp: gu (print (value-call fp2 (list 10 20))) p i $11 = 2 (gdb) PASS: gdb.guile/scm-value.exp: p i gu (define i (history-ref 0)) (gdb) PASS: gdb.guile/scm-value.exp: inf call: get i value from history gu (print (value-call i '())) ERROR: In procedure value-call: ERROR: In procedure gdbscm_value_call: Wrong type argument in position 1 (expecting function (value of TYPE_CODE_FUNC)): # Error while executing Scheme code. (gdb) PASS: gdb.guile/scm-value.exp: gu (print (value-call i '())) p/x fp2 $12 = 0x55555555514f (gdb) PASS: gdb.guile/scm-value.exp: place fp2 into value history, the second time gu (define fp3 (history-ref 0)) (gdb) PASS: gdb.guile/scm-value.exp: get fp3 value from history gu (set! fp3 (value-dereference fp3)) (gdb) PASS: gdb.guile/scm-value.exp: dereference fp3 gu (print (value-call fp3 (list 10))) ERROR: Too few arguments in function call. Error while executing Scheme code. (gdb) PASS: gdb.guile/scm-value.exp: gu (print (value-call fp3 (list 10))) gu (make-value "test") # (gdb) PASS: gdb.guile/scm-value.exp: make string show target-charset The target character set is "auto; currently ANSI_X3.4-1968". (gdb) set target-charset UTF-8 (gdb) PASS: gdb.guile/scm-value.exp: set target-charset UTF-8 gu (set-port-conversion-strategy! #f 'error) (gdb) PASS: gdb.guile/scm-value.exp: gu (set-port-conversion-strategy! #f 'error) gu (print (value->string (make-value (string #\x1234)) #:encoding "ASCII")) ERROR: In procedure value->string: ERROR: Throw to key `decoding-error' with args `("scm_from_stringn" "input locale conversion error" 84 #vu8(225 136 180))'. Error while executing Scheme code. (gdb) PASS: gdb.guile/scm-value.exp: value->string with default #:errors = 'error gu (set-port-conversion-strategy! #f 'escape) (gdb) PASS: gdb.guile/scm-value.exp: gu (set-port-conversion-strategy! #f 'escape) gu (print (value->string (make-value (string #\x1234)) #:encoding "ASCII" #:errors #f)) = ??? (gdb) PASS: gdb.guile/scm-value.exp: value->string with default #:errors = 'escape gu (set-port-conversion-strategy! #f 'substitute) (gdb) PASS: gdb.guile/scm-value.exp: gu (set-port-conversion-strategy! #f 'substitute) gu (print (value->string (make-value (string #\x1234)) #:encoding "ASCII")) = ??? (gdb) PASS: gdb.guile/scm-value.exp: value->string with default #:errors = 'substitute gu (print (value->string (make-value (string #\x1234)) #:encoding "ASCII" #:errors 'error)) ERROR: In procedure value->string: ERROR: Throw to key `decoding-error' with args `("scm_from_stringn" "input locale conversion error" 84 #vu8(225 136 180))'. Error while executing Scheme code. (gdb) PASS: gdb.guile/scm-value.exp: value->string #:errors 'error gu (print (value->string (make-value (string #\x1234)) #:encoding "ASCII" #:errors 'substitute)) = ??? (gdb) PASS: gdb.guile/scm-value.exp: value->string #:errors 'substitute gu (print (value->string (make-value "abc") #:errors "foo")) ERROR: In procedure value->string: ERROR: In procedure gdbscm_value_to_string: Out of range: invalid error kind in position 3: "foo" Error while executing Scheme code. (gdb) PASS: gdb.guile/scm-value.exp: bad value for #:errors set target-charset ANSI_X3.4-1968 (gdb) PASS: gdb.guile/scm-value.exp: restore target-charset gu (define ptrtype (lookup-type "PTR")) (gdb) PASS: gdb.guile/scm-value.exp: create PTR type kill Kill the program being debugged? (y or n) y [Inferior 1 (process 2942164) killed] (gdb) PASS: gdb.guile/scm-value.exp: kill the inferior file No executable file now. Discard symbol table from `/home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value'? (y or n) y Fatal signal: Aborted ----- Backtrace ----- 0x56313bf2b26a gdb_internal_backtrace_1 /home/simark/src/binutils-gdb/gdb/bt-utils.c:122 0x56313bf2b761 _Z22gdb_internal_backtracev /home/simark/src/binutils-gdb/gdb/bt-utils.c:168 0x56313cb3bfe6 handle_fatal_signal /home/simark/src/binutils-gdb/gdb/event-top.c:946 0x7f04cf03e8df ??? 0x7f04cf08e36c ??? 0x7f04cf03e837 ??? 0x7f04cf028534 ??? 0x7f04d08dfce3 _ZN11__sanitizer5AbortEv /usr/src/debug/gcc/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp:143 0x7f04d08ed1c1 _ZN11__sanitizer3DieEv /usr/src/debug/gcc/libsanitizer/sanitizer_common/sanitizer_termination.cpp:58 0x7f04d08c9c1f _ZN6__asan19ScopedInErrorReportD2Ev /usr/src/debug/gcc/libsanitizer/asan/asan_report.cpp:190 0x7f04d08c910b _ZN6__asan18ReportGenericErrorEmmmmbmjb /usr/src/debug/gcc/libsanitizer/asan/asan_report.cpp:479 0x7f04d08ca4ab __asan_report_load8 /usr/src/debug/gcc/libsanitizer/asan/asan_rtl.cpp:123 0x56313b8a1a0c _ZNK4type16is_objfile_ownedEv /home/simark/src/binutils-gdb/gdb/gdbtypes.h:1380 0x56313ccb7849 _Z19copy_type_recursiveP4typeP4htab /home/simark/src/binutils-gdb/gdb/gdbtypes.c:5638 0x56313cda6dc4 tyscm_copy_type_recursive /home/simark/src/binutils-gdb/gdb/guile/scm-type.c:383 0x56313ea22b35 htab_traverse_noresize /home/simark/src/binutils-gdb/libiberty/hashtab.c:775 0x56313cdae16d _ZN13tyscm_deleterclEP4htab /home/simark/src/binutils-gdb/gdb/guile/scm-type.c:100 0x56313cdae471 _ZN8registryI7objfileE3keyI4htab13tyscm_deleterE7cleanupEPv /home/simark/src/binutils-gdb/gdb/registry.h:159 0x56313d568978 _ZN8registryI7objfileE14clear_registryEv /home/simark/src/binutils-gdb/gdb/registry.h:176 0x56313d564adb _ZN8registryI7objfileED2Ev /home/simark/src/binutils-gdb/gdb/registry.h:78 0x56313d5556b5 _ZN7objfileD2Ev /home/simark/src/binutils-gdb/gdb/objfiles.c:590 0x56313d568dc8 _ZNKSt14default_deleteI7objfileEclEPS0_ /usr/include/c++/12.1.0/bits/unique_ptr.h:95 0x56313d564e98 _ZNSt10unique_ptrI7objfileSt14default_deleteIS0_EED2Ev /usr/include/c++/12.1.0/bits/unique_ptr.h:396 0x56313d6aa172 _ZNSt15__new_allocatorINSt9__cxx199810_List_nodeISt10unique_ptrI7objfileSt14default_deleteIS3_EEEEE7destroyIS6_EEvPT_ /usr/include/c++/12.1.0/bits/new_allocator.h:181 0x56313d69f2f2 _ZNSt16allocator_traitsISaINSt9__cxx199810_List_nodeISt10unique_ptrI7objfileSt14default_deleteIS3_EEEEEE7destroyIS6_EEvRS8_PT_ /usr/include/c++/12.1.0/bits/alloc_traits.h:535 0x56313d6af5a6 _ZNSt9__cxx19987__cxx114listISt10unique_ptrI7objfileSt14default_deleteIS3_EESaIS6_EE8_M_eraseENS_14_List_iteratorIS6_EE /usr/include/c++/12.1.0/bits/stl_list.h:2019 0x56313d6a4b7d _ZNSt9__cxx19987__cxx114listISt10unique_ptrI7objfileSt14default_deleteIS3_EESaIS6_EE5eraseENS_20_List_const_iteratorIS6_EE /usr/include/c++/12.1.0/bits/list.tcc:158 0x56313d6994b1 _ZNSt7__debug4listISt10unique_ptrI7objfileSt14default_deleteIS2_EESaIS5_EE8_M_eraseENSt9__cxx199820_List_const_iteratorIS5_EE /usr/include/c++/12.1.0/debug/list:521 0x56313d692f44 _ZNSt7__debug4listISt10unique_ptrI7objfileSt14default_deleteIS2_EESaIS5_EE5eraseEN11__gnu_debug14_Safe_iteratorINSt9__cxx199820_List_const_iteratorIS5_EES7_St26bidirectional_iterator_tagEE /usr/include/c++/12.1.0/debug/list:533 0x56313d6884dd _ZN13program_space14remove_objfileEP7objfile /home/simark/src/binutils-gdb/gdb/progspace.c:175 0x56313d5542be _ZN7objfile6unlinkEv /home/simark/src/binutils-gdb/gdb/objfiles.c:478 0x56313d687228 _ZN13program_space17free_all_objfilesEv /home/simark/src/binutils-gdb/gdb/progspace.c:135 0x56313dd64a39 _Z17symbol_file_cleari /home/simark/src/binutils-gdb/gdb/symfile.c:1232 0x56313dd6754d _Z19symbol_file_commandPKci /home/simark/src/binutils-gdb/gdb/symfile.c:1598 0x56313cb4a532 file_command /home/simark/src/binutils-gdb/gdb/exec.c:555 0x56313c173dd0 do_simple_func /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:95 0x56313c18977b _Z8cmd_funcP16cmd_list_elementPKci /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:2516 0x56313e0db5ca _Z15execute_commandPKci /home/simark/src/binutils-gdb/gdb/top.c:699 0x56313cb3a5a9 _Z15command_handlerPKc /home/simark/src/binutils-gdb/gdb/event-top.c:598 0x56313cb3b3b1 _Z20command_line_handlerOSt10unique_ptrIcN3gdb13xfree_deleterIcEEE /home/simark/src/binutils-gdb/gdb/event-top.c:842 0x56313e2272e6 tui_command_line_handler /home/simark/src/binutils-gdb/gdb/tui/tui-interp.c:104 0x56313cb3859e gdb_rl_callback_handler /home/simark/src/binutils-gdb/gdb/event-top.c:230 0x7f04d10429df ??? 0x56313cb37fa9 gdb_rl_callback_read_char_wrapper_noexcept /home/simark/src/binutils-gdb/gdb/event-top.c:188 0x56313cb381ec gdb_rl_callback_read_char_wrapper /home/simark/src/binutils-gdb/gdb/event-top.c:205 0x56313cb39b77 _Z19stdin_event_handleriPv /home/simark/src/binutils-gdb/gdb/event-top.c:525 0x56313e998e3b handle_file_event /home/simark/src/binutils-gdb/gdbsupport/event-loop.cc:549 0x56313e999777 gdb_wait_for_event /home/simark/src/binutils-gdb/gdbsupport/event-loop.cc:670 0x56313e997531 _Z16gdb_do_one_eventv /home/simark/src/binutils-gdb/gdbsupport/event-loop.cc:235 0x56313d25e714 start_event_loop /home/simark/src/binutils-gdb/gdb/main.c:411 0x56313d25eb6e captured_command_loop /home/simark/src/binutils-gdb/gdb/main.c:471 0x56313d264000 captured_main /home/simark/src/binutils-gdb/gdb/main.c:1329 0x56313d2640dd _Z8gdb_mainP18captured_main_args /home/simark/src/binutils-gdb/gdb/main.c:1344 0x56313b877c9d main /home/simark/src/binutils-gdb/gdb/gdb.c:32 --------------------- A fatal error internal to GDB has been detected, further debugging is not possible. GDB will now terminate. This is a bug, please report it. For instructions, see: . ERROR: GDB process no longer exists GDB process exited with wait status 2942127 exp9 0 0 CHILDKILLED SIGABRT SIGABRT UNRESOLVED: gdb.guile/scm-value.exp: discard the symbols ERROR: Couldn't send gu (gc) to GDB. ERROR: can not find channel named "exp9" while executing "expect { -i exp9 -timeout 10 -re ".*A problem internal to GDB has been detected" { fail "$message (GDB internal error)" gdb_internal_error..." ("uplevel" body line 1) invoked from within "uplevel $body" TCL LOOKUP CHANNEL exp9 can not find channel named "exp9" ERROR: Couldn't send gu (define castval (value-cast arg0 (type-pointer ptrtype))) to GDB. ERROR: can not find channel named "exp9" while executing "expect { -i exp9 -timeout 10 -re ".*A problem internal to GDB has been detected" { fail "$message (GDB internal error)" gdb_internal_error..." ("uplevel" body line 1) invoked from within "uplevel $body" TCL LOOKUP CHANNEL exp9 can not find channel named "exp9" ERROR: Couldn't send gu (set! ptrtype #f) to GDB. ERROR: can not find channel named "exp9" while executing "expect { -i exp9 -timeout 10 -re ".*A problem internal to GDB has been detected" { fail "$message (GDB internal error)" gdb_internal_error..." ("uplevel" body line 1) invoked from within "uplevel $body" TCL LOOKUP CHANNEL exp9 can not find channel named "exp9" ERROR: Couldn't send gu (print (value-type castval)) to GDB. ERROR: can not find channel named "exp9" while executing "expect { -i exp9 -timeout 10 -re ".*A problem internal to GDB has been detected" { fail "$message (GDB internal error)" gdb_internal_error..." ("uplevel" body line 1) invoked from within "uplevel $body" TCL LOOKUP CHANNEL exp9 can not find channel named "exp9" builtin_spawn /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../../gdb/gdb -nw -nx -iex set height 0 -iex set width 0 -data-directory /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../data-directory warning: Found custom handler for signal 7 (Bus error) preinstalled. warning: Found custom handler for signal 8 (Floating point exception) preinstalled. warning: Found custom handler for signal 11 (Segmentation fault) preinstalled. Some signal dispositions inherited from the environment (SIG_DFL/SIG_IGN) won't be propagated to spawned programs. GNU gdb (GDB) 13.0.50.20220728-git Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) set height 0 (gdb) set width 0 (gdb) dir Reinitialize source path to empty? (y or n) y Source directories searched: $cdir:$cwd (gdb) dir /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile Source directories searched: /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile:$cdir:$cwd (gdb) kill The program is not being run. (gdb) file /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value Reading symbols from /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value... (gdb) delete breakpoints (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break -qualified main Breakpoint 1 at 0x117b: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c, line 76. (gdb) run Starting program: /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/../lib/libthread_db.so.1". Breakpoint 1, main (argc=1, argv=0x7fffffffd268) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c:76 76 char *cp = argv[0]; /* Prevent gcc from optimizing argv[] out. */ (gdb) guile (define (print x) (format #t "= ~A" x) (newline)) (gdb) guile (define (raw-print x) (format #t "= ~S" x) (newline)) (gdb) guile (use-modules (gdb)) (gdb) break 99 Breakpoint 2 at 0x55555555525b: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c, line 99. (gdb) continue Continuing. void function called Breakpoint 2, main (argc=1, argv=0x7fffffffd268) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c:99 99 save_argv = argv; /* break to inspect struct and union */ (gdb) PASS: gdb.guile/scm-value.exp: continue to breakpoint: break to inspect struct and union in c gu (define intv (make-value 1)) (gdb) PASS: gdb.guile/scm-value.exp: Create int value for subscript test gu (define stringv (make-value "foo")) (gdb) PASS: gdb.guile/scm-value.exp: Create string value for subscript test gu (print intv) = 1 (gdb) PASS: gdb.guile/scm-value.exp: Baseline print of an int Guile value gu (print (value-subscript intv 0)) ERROR: Cannot subscript requested type Error while executing Scheme code. (gdb) PASS: gdb.guile/scm-value.exp: Attempt to access an integer with a subscript gu (print stringv) = "foo" (gdb) PASS: gdb.guile/scm-value.exp: Baseline print of a string Guile value gu (print (value-subscript stringv 0)) = 102 'f' (gdb) PASS: gdb.guile/scm-value.exp: Attempt to access a string with a subscript print p $1 = (int *) 0x7fffffffd0c4 (gdb) PASS: gdb.guile/scm-value.exp: Build pointer to array gu (define pointer (history-ref 0)) (gdb) PASS: gdb.guile/scm-value.exp: set pointer gu (print (value-subscript pointer 0)) = 1 (gdb) PASS: gdb.guile/scm-value.exp: Access array via pointer with int subscript gu (print (value-subscript pointer intv)) = 2 (gdb) PASS: gdb.guile/scm-value.exp: Access array via pointer with value subscript gu (print (value-subscript (value-subscript pointer intv) 0)) ERROR: Cannot subscript requested type Error while executing Scheme code. (gdb) PASS: gdb.guile/scm-value.exp: Attempt to access an integer with a subscript 2 print {"fu ","foo","bar"} $2 = {"fu ", "foo", "bar"} (gdb) PASS: gdb.guile/scm-value.exp: Build array gu (define marray (history-ref 0)) (gdb) PASS: gdb.guile/scm-value.exp: gu (print (value-subscript (value-subscript marray 1) 2)) = 111 'o' (gdb) PASS: gdb.guile/scm-value.exp: Test multiple subscript Executing on host: g++ -fno-stack-protector -fdiagnostics-color=never -c -g -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value-cxx.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c (timeout = 300) builtin_spawn -ignore SIGHUP g++ -fno-stack-protector -fdiagnostics-color=never -c -g -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value-cxx.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c Executing on host: g++ -fno-stack-protector /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value-cxx.o -fdiagnostics-color=never -L/home/simark/build/binutils-gdb-one-target/libiberty -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value-cxx (timeout = 300) builtin_spawn -ignore SIGHUP g++ -fno-stack-protector /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value-cxx.o -fdiagnostics-color=never -L/home/simark/build/binutils-gdb-one-target/libiberty -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value-cxx builtin_spawn /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../../gdb/gdb -nw -nx -iex set height 0 -iex set width 0 -data-directory /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../data-directory warning: Found custom handler for signal 7 (Bus error) preinstalled. warning: Found custom handler for signal 8 (Floating point exception) preinstalled. warning: Found custom handler for signal 11 (Segmentation fault) preinstalled. Some signal dispositions inherited from the environment (SIG_DFL/SIG_IGN) won't be propagated to spawned programs. GNU gdb (GDB) 13.0.50.20220728-git Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) set height 0 (gdb) set width 0 (gdb) dir Reinitialize source path to empty? (y or n) y Source directories searched: $cdir:$cwd (gdb) dir /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile Source directories searched: /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile:$cdir:$cwd (gdb) kill The program is not being run. (gdb) file /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value-cxx Reading symbols from /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value-cxx... (gdb) delete breakpoints (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break -qualified main Breakpoint 1 at 0x1196: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c, line 76. (gdb) run Starting program: /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.guile/scm-value/scm-value-cxx [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/../lib/libthread_db.so.1". Breakpoint 1, main (argc=1, argv=0x7fffffffd258) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c:76 76 char *cp = argv[0]; /* Prevent gcc from optimizing argv[] out. */ (gdb) guile (define (print x) (format #t "= ~A" x) (newline)) (gdb) guile (define (raw-print x) (format #t "= ~S" x) (newline)) (gdb) guile (use-modules (gdb)) (gdb) break 57 Breakpoint 2 at 0x555555555151: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c, line 57. (gdb) continue Continuing. void function called Breakpoint 2, ptr_ref (rptr_int=@0x7fffffffd0b8: 0x7fffffffd0c0) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c:57 57 return; /* break to inspect pointer by reference. */ (gdb) PASS: gdb.guile/scm-value.exp: c++: continue to breakpoint: break to inspect pointer by reference print rptr_int $1 = (int *&) @0x7fffffffd0b8: 0x7fffffffd0c0 (gdb) PASS: gdb.guile/scm-value.exp: c++: Obtain address gu (define rptr (history-ref 0)) (gdb) PASS: gdb.guile/scm-value.exp: c++: set rptr gu (print (value-subscript rptr 0)) = 2 (gdb) PASS: gdb.guile/scm-value.exp: c++: Check pointer passed as reference gu (print (value->bool (value-dynamic-cast (parse-and-eval "base") (type-pointer (lookup-type "Derived"))))) = #t (gdb) PASS: gdb.guile/scm-value.exp: c++: gu (print (value->bool (value-dynamic-cast (parse-and-eval "base") (type-pointer (lookup-type "Derived"))))) gu (print (value-dynamic-type (parse-and-eval "base"))) = Derived * (gdb) PASS: gdb.guile/scm-value.exp: c++: gu (print (value-dynamic-type (parse-and-eval "base"))) gu (print (value-dynamic-type (parse-and-eval "base_ref"))) = Derived & (gdb) PASS: gdb.guile/scm-value.exp: c++: gu (print (value-dynamic-type (parse-and-eval "base_ref"))) gu (print (value-dynamic-type (parse-and-eval "5"))) = int (gdb) PASS: gdb.guile/scm-value.exp: c++: gu (print (value-dynamic-type (parse-and-eval "5"))) break 99 Breakpoint 3 at 0x555555555276: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c, line 99. (gdb) continue Continuing. Breakpoint 3, main (argc=1, argv=0x7fffffffd258) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.c:99 99 save_argv = argv; /* break to inspect struct and union */ (gdb) PASS: gdb.guile/scm-value.exp: c++: continue to breakpoint: break to inspect struct and union in c++ gu (define intv (make-value 1)) (gdb) PASS: gdb.guile/scm-value.exp: c++: Create int value for subscript test gu (define stringv (make-value "foo")) (gdb) PASS: gdb.guile/scm-value.exp: c++: Create string value for subscript test gu (print intv) = 1 (gdb) PASS: gdb.guile/scm-value.exp: c++: Baseline print of an int Guile value gu (print (value-subscript intv 0)) ERROR: Cannot subscript requested type Error while executing Scheme code. (gdb) PASS: gdb.guile/scm-value.exp: c++: Attempt to access an integer with a subscript gu (print stringv) = "foo" (gdb) PASS: gdb.guile/scm-value.exp: c++: Baseline print of a string Guile value gu (print (value-subscript stringv 0)) = 102 'f' (gdb) PASS: gdb.guile/scm-value.exp: c++: Attempt to access a string with a subscript print p $2 = (int *) 0x7fffffffd0c4 (gdb) PASS: gdb.guile/scm-value.exp: c++: Build pointer to array gu (define pointer (history-ref 0)) (gdb) PASS: gdb.guile/scm-value.exp: c++: set pointer gu (print (value-subscript pointer 0)) = 1 (gdb) PASS: gdb.guile/scm-value.exp: c++: Access array via pointer with int subscript gu (print (value-subscript pointer intv)) = 2 (gdb) PASS: gdb.guile/scm-value.exp: c++: Access array via pointer with value subscript gu (print (value-subscript (value-subscript pointer intv) 0)) ERROR: Cannot subscript requested type Error while executing Scheme code. (gdb) PASS: gdb.guile/scm-value.exp: c++: Attempt to access an integer with a subscript 2 print {"fu ","foo","bar"} $3 = {"fu ", "foo", "bar"} (gdb) PASS: gdb.guile/scm-value.exp: c++: Build array gu (define marray (history-ref 0)) (gdb) PASS: gdb.guile/scm-value.exp: c++: gu (print (value-subscript (value-subscript marray 1) 2)) = 111 'o' (gdb) PASS: gdb.guile/scm-value.exp: c++: Test multiple subscript testcase /home/simark/src/binutils-gdb/gdb/testsuite/gdb.guile/scm-value.exp completed in 4 seconds Running /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.exp ... Executing on host: g++ -fno-stack-protector /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.cc -fdiagnostics-color=never -L/home/simark/build/binutils-gdb-one-target/libiberty -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-template/py-template (timeout = 300) builtin_spawn -ignore SIGHUP g++ -fno-stack-protector /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.cc -fdiagnostics-color=never -L/home/simark/build/binutils-gdb-one-target/libiberty -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-template/py-template builtin_spawn /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../../gdb/gdb -nw -nx -iex set height 0 -iex set width 0 -data-directory /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../data-directory warning: Found custom handler for signal 7 (Bus error) preinstalled. warning: Found custom handler for signal 8 (Floating point exception) preinstalled. warning: Found custom handler for signal 11 (Segmentation fault) preinstalled. Some signal dispositions inherited from the environment (SIG_DFL/SIG_IGN) won't be propagated to spawned programs. GNU gdb (GDB) 13.0.50.20220728-git Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) set height 0 (gdb) set width 0 (gdb) dir Reinitialize source path to empty? (y or n) y Source directories searched: $cdir:$cwd (gdb) dir /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python Source directories searched: /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python:$cdir:$cwd (gdb) python print ('test') test (gdb) Executing on host: g++ -fno-stack-protector /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.cc -fdiagnostics-color=never "-DTYPE=const int" -L/home/simark/build/binutils-gdb-one-target/libiberty -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-template/py-template-ci (timeout = 300) builtin_spawn -ignore SIGHUP g++ -fno-stack-protector /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.cc -fdiagnostics-color=never -DTYPE=const int -L/home/simark/build/binutils-gdb-one-target/libiberty -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-template/py-template-ci kill The program is not being run. (gdb) file /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-template/py-template-ci Reading symbols from /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-template/py-template-ci... (gdb) delete breakpoints (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break -qualified main Breakpoint 1 at 0x111d: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.cc, line 29. (gdb) run Starting program: /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-template/py-template-ci [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/../lib/libthread_db.so.1". Breakpoint 1, main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.cc:29 29 return 0; // break here (gdb) print (foo) $1 = {} (gdb) PASS: gdb.python/py-template.exp: print (foo) in template test of const int python foo = gdb.history(0) (gdb) PASS: gdb.python/py-template.exp: fetch foo from gdb.history(0) in template test of const int python print (foo.type.template_argument(0)) const int (gdb) PASS: gdb.python/py-template.exp: const int python print(foo.type.template_argument(-1)) Traceback (most recent call last): File "", line 1, in RuntimeError: Template argument number must be non-negative Error while executing Python code. (gdb) PASS: gdb.python/py-template.exp: negative template argument number in template test of const int Executing on host: g++ -fno-stack-protector /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.cc -fdiagnostics-color=never "-DTYPE=volatile int" -L/home/simark/build/binutils-gdb-one-target/libiberty -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-template/py-template-vi (timeout = 300) builtin_spawn -ignore SIGHUP g++ -fno-stack-protector /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.cc -fdiagnostics-color=never -DTYPE=volatile int -L/home/simark/build/binutils-gdb-one-target/libiberty -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-template/py-template-vi kill Kill the program being debugged? (y or n) y [Inferior 1 (process 2942339) killed] (gdb) file /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-template/py-template-vi Load new symbol table from "/home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-template/py-template-vi"? (y or n) y Reading symbols from /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-template/py-template-vi... Fatal signal: Aborted ----- Backtrace ----- 0x55ba2245e26a gdb_internal_backtrace_1 /home/simark/src/binutils-gdb/gdb/bt-utils.c:122 0x55ba2245e761 _Z22gdb_internal_backtracev /home/simark/src/binutils-gdb/gdb/bt-utils.c:168 0x55ba2306efe6 handle_fatal_signal /home/simark/src/binutils-gdb/gdb/event-top.c:946 0x7f2d30a3e8df ??? 0x7f2d30a8e36c ??? 0x7f2d30a3e837 ??? 0x7f2d30a28534 ??? 0x7f2d322dfce3 _ZN11__sanitizer5AbortEv /usr/src/debug/gcc/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp:143 0x7f2d322ed1c1 _ZN11__sanitizer3DieEv /usr/src/debug/gcc/libsanitizer/sanitizer_common/sanitizer_termination.cpp:58 0x7f2d322c9c1f _ZN6__asan19ScopedInErrorReportD2Ev /usr/src/debug/gcc/libsanitizer/asan/asan_report.cpp:190 0x7f2d322c910b _ZN6__asan18ReportGenericErrorEmmmmbmjb /usr/src/debug/gcc/libsanitizer/asan/asan_report.cpp:479 0x7f2d322ca4ab __asan_report_load8 /usr/src/debug/gcc/libsanitizer/asan/asan_rtl.cpp:123 0x55ba21dd4a0c _ZNK4type16is_objfile_ownedEv /home/simark/src/binutils-gdb/gdb/gdbtypes.h:1380 0x55ba231ea849 _Z19copy_type_recursiveP4typeP4htab /home/simark/src/binutils-gdb/gdb/gdbtypes.c:5638 0x55ba23d8355c _ZN12typy_deleterclEP11type_object /home/simark/src/binutils-gdb/gdb/python/py-type.c:1132 0x55ba23d83d1c _ZN8registryI7objfileE3keyI11type_object12typy_deleterE7cleanupEPv /home/simark/src/binutils-gdb/gdb/registry.h:159 0x55ba23a9b978 _ZN8registryI7objfileE14clear_registryEv /home/simark/src/binutils-gdb/gdb/registry.h:176 0x55ba23a97adb _ZN8registryI7objfileED2Ev /home/simark/src/binutils-gdb/gdb/registry.h:78 0x55ba23a886b5 _ZN7objfileD2Ev /home/simark/src/binutils-gdb/gdb/objfiles.c:590 0x55ba23a9bdc8 _ZNKSt14default_deleteI7objfileEclEPS0_ /usr/include/c++/12.1.0/bits/unique_ptr.h:95 0x55ba23a97e98 _ZNSt10unique_ptrI7objfileSt14default_deleteIS0_EED2Ev /usr/include/c++/12.1.0/bits/unique_ptr.h:396 0x55ba23bdd172 _ZNSt15__new_allocatorINSt9__cxx199810_List_nodeISt10unique_ptrI7objfileSt14default_deleteIS3_EEEEE7destroyIS6_EEvPT_ /usr/include/c++/12.1.0/bits/new_allocator.h:181 0x55ba23bd22f2 _ZNSt16allocator_traitsISaINSt9__cxx199810_List_nodeISt10unique_ptrI7objfileSt14default_deleteIS3_EEEEEE7destroyIS6_EEvRS8_PT_ /usr/include/c++/12.1.0/bits/alloc_traits.h:535 0x55ba23be25a6 _ZNSt9__cxx19987__cxx114listISt10unique_ptrI7objfileSt14default_deleteIS3_EESaIS6_EE8_M_eraseENS_14_List_iteratorIS6_EE /usr/include/c++/12.1.0/bits/stl_list.h:2019 0x55ba23bd7b7d _ZNSt9__cxx19987__cxx114listISt10unique_ptrI7objfileSt14default_deleteIS3_EESaIS6_EE5eraseENS_20_List_const_iteratorIS6_EE /usr/include/c++/12.1.0/bits/list.tcc:158 0x55ba23bcc4b1 _ZNSt7__debug4listISt10unique_ptrI7objfileSt14default_deleteIS2_EESaIS5_EE8_M_eraseENSt9__cxx199820_List_const_iteratorIS5_EE /usr/include/c++/12.1.0/debug/list:521 0x55ba23bc5f44 _ZNSt7__debug4listISt10unique_ptrI7objfileSt14default_deleteIS2_EESaIS5_EE5eraseEN11__gnu_debug14_Safe_iteratorINSt9__cxx199820_List_const_iteratorIS5_EES7_St26bidirectional_iterator_tagEE /usr/include/c++/12.1.0/debug/list:533 0x55ba23bbb4dd _ZN13program_space14remove_objfileEP7objfile /home/simark/src/binutils-gdb/gdb/progspace.c:175 0x55ba23a872be _ZN7objfile6unlinkEv /home/simark/src/binutils-gdb/gdb/objfiles.c:478 0x55ba24294a30 syms_from_objfile_1 /home/simark/src/binutils-gdb/gdb/symfile.c:938 0x55ba24295204 syms_from_objfile /home/simark/src/binutils-gdb/gdb/symfile.c:985 0x55ba24296255 symbol_file_add_with_addrs /home/simark/src/binutils-gdb/gdb/symfile.c:1088 0x55ba24297175 _Z24symbol_file_add_from_bfdP3bfdPKc10enum_flagsI16symfile_add_flagEPNSt7__debug6vectorI14other_sectionsSaIS8_EEES3_I12objfile_flagEP7objfile /home/simark/src/binutils-gdb/gdb/symfile.c:1168 0x55ba24297321 _Z15symbol_file_addPKc10enum_flagsI16symfile_add_flagEPNSt7__debug6vectorI14other_sectionsSaIS6_EEES1_I12objfile_flagE /home/simark/src/binutils-gdb/gdb/symfile.c:1181 0x55ba242976c9 symbol_file_add_main_1 /home/simark/src/binutils-gdb/gdb/symfile.c:1205 0x55ba2429abca _Z19symbol_file_commandPKci /home/simark/src/binutils-gdb/gdb/symfile.c:1653 0x55ba2307d532 file_command /home/simark/src/binutils-gdb/gdb/exec.c:555 0x55ba226a6dd0 do_simple_func /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:95 0x55ba226bc77b _Z8cmd_funcP16cmd_list_elementPKci /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:2516 0x55ba2460e5ca _Z15execute_commandPKci /home/simark/src/binutils-gdb/gdb/top.c:699 0x55ba2306d5a9 _Z15command_handlerPKc /home/simark/src/binutils-gdb/gdb/event-top.c:598 0x55ba2306e3b1 _Z20command_line_handlerOSt10unique_ptrIcN3gdb13xfree_deleterIcEEE /home/simark/src/binutils-gdb/gdb/event-top.c:842 0x55ba2475a2e6 tui_command_line_handler /home/simark/src/binutils-gdb/gdb/tui/tui-interp.c:104 0x55ba2306b59e gdb_rl_callback_handler /home/simark/src/binutils-gdb/gdb/event-top.c:230 0x7f2d32a629df ??? 0x55ba2306afa9 gdb_rl_callback_read_char_wrapper_noexcept /home/simark/src/binutils-gdb/gdb/event-top.c:188 0x55ba2306b1ec gdb_rl_callback_read_char_wrapper /home/simark/src/binutils-gdb/gdb/event-top.c:205 0x55ba2306cb77 _Z19stdin_event_handleriPv /home/simark/src/binutils-gdb/gdb/event-top.c:525 0x55ba24ecbe3b handle_file_event /home/simark/src/binutils-gdb/gdbsupport/event-loop.cc:549 0x55ba24ecc777 gdb_wait_for_event /home/simark/src/binutils-gdb/gdbsupport/event-loop.cc:670 0x55ba24eca531 _Z16gdb_do_one_eventv /home/simark/src/binutils-gdb/gdbsupport/event-loop.cc:235 0x55ba23791714 start_event_loop /home/simark/src/binutils-gdb/gdb/main.c:411 0x55ba23791b6e captured_command_loop /home/simark/src/binutils-gdb/gdb/main.c:471 0x55ba23797000 captured_main /home/simark/src/binutils-gdb/gdb/main.c:1329 0x55ba237970dd _Z8gdb_mainP18captured_main_args /home/simark/src/binutils-gdb/gdb/main.c:1344 0x55ba21daac9d main /home/simark/src/binutils-gdb/gdb/gdb.c:32 --------------------- A fatal error internal to GDB has been detected, further debugging is not possible. GDB will now terminate. This is a bug, please report it. For instructions, see: . ERROR: Couldn't load py-template-vi -- with new symbol table into GDB (eof). ERROR: Couldn't send delete breakpoints to GDB. ERROR: : spawn id exp9 not open while executing "expect { -i exp9 -timeout 100 -re ".*A problem internal to GDB has been detected" { fail "$message (GDB internal error)" gdb_internal_erro..." ("uplevel" body line 1) invoked from within "uplevel $body" NONE : spawn id exp9 not open ERROR: breakpoints not deleted ERROR: : spawn id exp9 not open while executing "expect { -i exp9 -timeout 30 -re "$break_message \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {} -re "$break_message \[0-9\]*: file .*..." ("uplevel" body line 1) invoked from within "uplevel $body" NONE : spawn id exp9 not open ERROR: GDB process no longer exists GDB process exited with wait status 2942293 exp9 0 0 CHILDKILLED SIGABRT SIGABRT UNRESOLVED: gdb.python/py-template.exp: gdb_breakpoint: set breakpoint at main (eof) ERROR: couldn't run to breakpoint Executing on host: g++ -fno-stack-protector /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.cc -fdiagnostics-color=never "-DTYPE=const int &" -L/home/simark/build/binutils-gdb-one-target/libiberty -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-template/py-template-cir (timeout = 300) builtin_spawn -ignore SIGHUP g++ -fno-stack-protector /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.cc -fdiagnostics-color=never -DTYPE=const int & -L/home/simark/build/binutils-gdb-one-target/libiberty -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-template/py-template-cir ERROR: can not find channel named "exp9" while executing "expect { -i exp9 -timeout 120 -re "Kill the program being debugged. .y or n. $" { send_gdb "y\n" answer verbose "\t\tKilling previous prog..." ("uplevel" body line 1) invoked from within "uplevel $body" TCL LOOKUP CHANNEL exp9 can not find channel named "exp9" WARNING: remote_expect statement without a default case ERROR: can not find channel named "exp9" while executing "expect { -i exp9 -timeout 120 -re "(Reading symbols from.*LZMA support was disabled.*$gdb_prompt $)" { verbose "\t\tLoaded $arg into $GDB; .gnu..." ("uplevel" body line 1) invoked from within "uplevel $body" TCL LOOKUP CHANNEL exp9 can not find channel named "exp9" ERROR: Couldn't load py-template-cir into GDB (eof). ERROR: Couldn't send delete breakpoints to GDB. ERROR: can not find channel named "exp9" while executing "expect { -i exp9 -timeout 100 -re ".*A problem internal to GDB has been detected" { fail "$message (GDB internal error)" gdb_internal_erro..." ("uplevel" body line 1) invoked from within "uplevel $body" TCL LOOKUP CHANNEL exp9 can not find channel named "exp9" ERROR: breakpoints not deleted ERROR: can not find channel named "exp9" while executing "expect { -i exp9 -timeout 30 -re "$break_message \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {} -re "$break_message \[0-9\]*: file .*..." ("uplevel" body line 1) invoked from within "uplevel $body" TCL LOOKUP CHANNEL exp9 can not find channel named "exp9" ERROR: GDB process no longer exists ERROR: tcl error sourcing /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.exp. ERROR: tcl error code TCL LOOKUP CHANNEL exp9 ERROR: can not find channel named "exp9" while executing "wait -i $gdb_spawn_id" ("uplevel" body line 4) invoked from within "uplevel $error_sect" invoked from within "remote_expect host 30 { -re "$break_message \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {} -re "$break_message \[0-9\]*: file .*, line..." ("uplevel" body line 1) invoked from within "uplevel remote_expect host $tmt $expcode" invoked from within "gdb_expect 30 { -re "$break_message \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {} -re "$break_message \[0-9\]*: file .*, line $decima..." (procedure "gdb_breakpoint" line 36) invoked from within "gdb_breakpoint $linespec qualified" ("eval" body line 1) invoked from within "eval gdb_breakpoint {$linespec} $args" (procedure "runto" line 25) invoked from within "runto main qualified" (procedure "runto_main" line 2) invoked from within "runto_main " (procedure "test_template_arg" line 8) invoked from within "test_template_arg "${binfile}-cir" "const int &"" (file "/home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.exp" line 67) invoked from within "source /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.exp" ("uplevel" body line 1) invoked from within "uplevel #0 source /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.exp" invoked from within "catch "uplevel #0 source $test_file_name" msg" UNRESOLVED: gdb.python/py-template.exp: testcase '/home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.exp' aborted due to Tcl error PATH: gdb.python/py-template.exp: testcase '/home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.exp' aborted due to Tcl error testcase /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.exp completed in 2 seconds Running /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.exp ... Executing on host: gcc -fno-stack-protector -fdiagnostics-color=never -c -g -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c (timeout = 300) builtin_spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -c -g -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c Executing on host: gcc -fno-stack-protector /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value.o -fdiagnostics-color=never -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value (timeout = 300) builtin_spawn -ignore SIGHUP gcc -fno-stack-protector /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value.o -fdiagnostics-color=never -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value builtin_spawn /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../../gdb/gdb -nw -nx -iex set height 0 -iex set width 0 -data-directory /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../data-directory warning: Found custom handler for signal 7 (Bus error) preinstalled. warning: Found custom handler for signal 8 (Floating point exception) preinstalled. warning: Found custom handler for signal 11 (Segmentation fault) preinstalled. Some signal dispositions inherited from the environment (SIG_DFL/SIG_IGN) won't be propagated to spawned programs. GNU gdb (GDB) 13.0.50.20220728-git Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) set height 0 (gdb) set width 0 (gdb) dir Reinitialize source path to empty? (y or n) y Source directories searched: $cdir:$cwd (gdb) dir /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python Source directories searched: /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python:$cdir:$cwd (gdb) kill The program is not being run. (gdb) file /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value Reading symbols from /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value... (gdb) python print ('test') test (gdb) python print('history count is %d' % gdb.history_count()) history count is 0 (gdb) PASS: gdb.python/py-value.exp: history count is 0 print 0 $1 = 0 (gdb) PASS: gdb.python/py-value.exp: print 0 python print('history count is %d' % gdb.history_count()) history count is 1 (gdb) PASS: gdb.python/py-value.exp: history count is 1 print 1 $2 = 1 (gdb) PASS: gdb.python/py-value.exp: print 1 python print('history count is %d' % gdb.history_count()) history count is 2 (gdb) PASS: gdb.python/py-value.exp: history count is 2 print 2 $3 = 2 (gdb) PASS: gdb.python/py-value.exp: print 2 python print('history count is %d' % gdb.history_count()) history count is 3 (gdb) PASS: gdb.python/py-value.exp: history count is 3 print 3 $4 = 3 (gdb) PASS: gdb.python/py-value.exp: print 3 python print('history count is %d' % gdb.history_count()) history count is 4 (gdb) PASS: gdb.python/py-value.exp: history count is 4 print 4 $5 = 4 (gdb) PASS: gdb.python/py-value.exp: print 4 python i = gdb.Value (True) (gdb) PASS: gdb.python/py-value.exp: create boolean value python i = gdb.Value (5) (gdb) PASS: gdb.python/py-value.exp: create integer value python i = gdb.Value (3,None) (gdb) PASS: gdb.python/py-value.exp: create integer value, with None type python l = gdb.Value(0xffffffff12345678) (gdb) PASS: gdb.python/py-value.exp: create large unsigned 64-bit value python print (int(l)) 18446744069720004216 (gdb) PASS: gdb.python/py-value.exp: large unsigned 64-bit int conversion to python python f = gdb.Value (1.25) (gdb) PASS: gdb.python/py-value.exp: create double value python a = gdb.Value ('string test') (gdb) PASS: gdb.python/py-value.exp: create 8-bit string value python print (a) "string test" (gdb) PASS: gdb.python/py-value.exp: print 8-bit string python print (a.__class__) (gdb) PASS: gdb.python/py-value.exp: verify type of 8-bit string python print ('result = %s' % i.address) result = None (gdb) PASS: gdb.python/py-value.exp: test address attribute in non-addressable value python print(gdb.Value(gdb.Value(5).type.optimized_out())) (gdb) PASS: gdb.python/py-value.exp: python print(gdb.Value(gdb.Value(5).type.optimized_out())) python v = gdb.Value (3) (gdb) PASS: gdb.python/py-value.exp: create initial integer value python print(v) 3 (gdb) PASS: gdb.python/py-value.exp: check initial value contents python v.__init__(5) (gdb) PASS: gdb.python/py-value.exp: call gdb.Value.__init__ manually python print(v) 5 (gdb) PASS: gdb.python/py-value.exp: check new value contents python i = gdb.Value (5) (gdb) python j = gdb.Value (2) (gdb) python f = gdb.Value (1.25) (gdb) python g = gdb.Value (2.5) (gdb) python print ('result = ' + str(i+j)) result = 7 (gdb) PASS: gdb.python/py-value.exp: add two integer values python print ((i+j).__class__) (gdb) PASS: gdb.python/py-value.exp: verify type of integer add result python print ('result = ' + str(f+g)) result = 3.75 (gdb) PASS: gdb.python/py-value.exp: add two double values python print ('result = ' + str(i-j)) result = 3 (gdb) PASS: gdb.python/py-value.exp: subtract two integer values python print ('result = ' + str(f-g)) result = -1.25 (gdb) PASS: gdb.python/py-value.exp: subtract two double values python print ('result = ' + str(i*j)) result = 10 (gdb) PASS: gdb.python/py-value.exp: multiply two integer values python print ('result = ' + str(f*g)) result = 3.125 (gdb) PASS: gdb.python/py-value.exp: multiply two double values python print ('result = ' + str(i/j)) result = 2 (gdb) PASS: gdb.python/py-value.exp: divide two integer values python print ('result = ' + str(f/g)) result = 0.5 (gdb) PASS: gdb.python/py-value.exp: divide two double values python print ('result = ' + str(i%j)) result = 1 (gdb) PASS: gdb.python/py-value.exp: take remainder of two integer values python print ('result = ' + str(i**j)) result = 25 (gdb) PASS: gdb.python/py-value.exp: integer value raised to the power of another integer value python print ('result = ' + str(g**j)) result = 6.25 (gdb) PASS: gdb.python/py-value.exp: double value raised to the power of integer value python print ('result = ' + str(-i)) result = -5 (gdb) PASS: gdb.python/py-value.exp: negated integer value python print ('result = ' + str(+i)) result = 5 (gdb) PASS: gdb.python/py-value.exp: positive integer value python print ('result = ' + str(-f)) result = -1.25 (gdb) PASS: gdb.python/py-value.exp: negated double value python print ('result = ' + str(+f)) result = 1.25 (gdb) PASS: gdb.python/py-value.exp: positive double value python print ('result = ' + str(abs(j-i))) result = 3 (gdb) PASS: gdb.python/py-value.exp: absolute of integer value python print ('result = ' + str(abs(f-g))) result = 1.25 (gdb) PASS: gdb.python/py-value.exp: absolute of double value python print ('result = ' + str(i-1)) result = 4 (gdb) PASS: gdb.python/py-value.exp: subtract integer value from python integer python print ((i-1).__class__) (gdb) PASS: gdb.python/py-value.exp: verify type of mixed integer subtraction result python print ('result = ' + str(f+1.5)) result = 2.75 (gdb) PASS: gdb.python/py-value.exp: add double value with python float python print ('result = ' + str(1-i)) result = -4 (gdb) PASS: gdb.python/py-value.exp: subtract python integer from integer value python print ('result = ' + str(1.5+f)) result = 2.75 (gdb) PASS: gdb.python/py-value.exp: add python float with double value print evalue $6 = TWO (gdb) PASS: gdb.python/py-value.exp: print evalue python evalue = gdb.history (0) (gdb) PASS: gdb.python/py-value.exp: python evalue = gdb.history (0) python print (int (evalue)) 2 (gdb) PASS: gdb.python/py-value.exp: python print (int (evalue)) print (void *) 2 $7 = (void *) 0x2 (gdb) PASS: gdb.python/py-value.exp: print (void *) 2 python a = gdb.history (0) (gdb) PASS: gdb.python/py-value.exp: python a = gdb.history (0) print (void *) 5 $8 = (void *) 0x5 (gdb) PASS: gdb.python/py-value.exp: print (void *) 5 python b = gdb.history (0) (gdb) PASS: gdb.python/py-value.exp: python b = gdb.history (0) python print(int(b)) 5 (gdb) PASS: gdb.python/py-value.exp: convert pointer to int python print ('result = ' + str(a+5)) result = 0x7 (gdb) PASS: gdb.python/py-value.exp: add pointer value with python integer python print ('result = ' + str(b-2)) result = 0x3 (gdb) PASS: gdb.python/py-value.exp: subtract python integer from pointer value python print ('result = ' + str(b-a)) result = 3 (gdb) PASS: gdb.python/py-value.exp: subtract two pointer values python print ('result = ' + 'result'[gdb.Value(0)]) result = r (gdb) PASS: gdb.python/py-value.exp: use value as string index python print ('result = ' + str((1,2,3)[gdb.Value(0)])) result = 1 (gdb) PASS: gdb.python/py-value.exp: use value as tuple index python print ('result = ' + str([1,2,3][gdb.Value(0)])) result = 1 (gdb) PASS: gdb.python/py-value.exp: use value as array index python print('%x' % int(gdb.parse_and_eval('-1ull'))) ffffffffffffffff (gdb) PASS: gdb.python/py-value.exp: int conversion respect type sign python print ('result = ' + str(i+'foo')) Traceback (most recent call last): File "", line 1, in gdb.error: Argument to arithmetic operation not a number or boolean. Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: catch error in python type conversion python print ('result = ' + str(i+gdb.Value('foo'))) Traceback (most recent call last): File "", line 1, in gdb.error: Argument to arithmetic operation not a number or boolean. Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: catch throw of GDB error python >PASS: gdb.python/py-value.exp: define function to test booleans: input 1: python def test_bool (val): >PASS: gdb.python/py-value.exp: define function to test booleans: input 2: def test_bool (val): if val: >PASS: gdb.python/py-value.exp: define function to test booleans: input 3: if val: print ('yay') >PASS: gdb.python/py-value.exp: define function to test booleans: input 4: print ('yay') else: >PASS: gdb.python/py-value.exp: define function to test booleans: input 5: else: print ('nay') >PASS: gdb.python/py-value.exp: define function to test booleans: input 6: print ('nay') end (gdb) PASS: gdb.python/py-value.exp: define function to test booleans: input 7: end py test_bool (gdb.Value (True)) yay (gdb) PASS: gdb.python/py-value.exp: check evaluation of true boolean value in expression py test_bool (gdb.Value (False)) nay (gdb) PASS: gdb.python/py-value.exp: check evaluation of false boolean value in expression py test_bool (gdb.Value (5)) yay (gdb) PASS: gdb.python/py-value.exp: check evaluation of true integer value in expression py test_bool (gdb.Value (0)) nay (gdb) PASS: gdb.python/py-value.exp: check evaluation of false integer value in expression py test_bool (gdb.Value (5.2)) yay (gdb) PASS: gdb.python/py-value.exp: check evaluation of true float value in expression py test_bool (gdb.Value (0.0)) nay (gdb) PASS: gdb.python/py-value.exp: check evaluation of false float value in expression py print (gdb.Value (1) < gdb.Value (1)) False (gdb) PASS: gdb.python/py-value.exp: less than, equal py print (gdb.Value (1) < gdb.Value (2)) True (gdb) PASS: gdb.python/py-value.exp: less than, less py print (gdb.Value (2) < gdb.Value (1)) False (gdb) PASS: gdb.python/py-value.exp: less than, greater py print (gdb.Value (2) < None) False (gdb) PASS: gdb.python/py-value.exp: less than, None py print (gdb.Value (1) <= gdb.Value (1)) True (gdb) PASS: gdb.python/py-value.exp: less or equal, equal py print (gdb.Value (1) <= gdb.Value (2)) True (gdb) PASS: gdb.python/py-value.exp: less or equal, less py print (gdb.Value (2) <= gdb.Value (1)) False (gdb) PASS: gdb.python/py-value.exp: less or equal, greater py print (gdb.Value (2) <= None) False (gdb) PASS: gdb.python/py-value.exp: less or equal, None py print (gdb.Value (1) == gdb.Value (1)) True (gdb) PASS: gdb.python/py-value.exp: equality of gdb.Values py print (gdb.Value (1) == gdb.Value (2)) False (gdb) PASS: gdb.python/py-value.exp: inequality of gdb.Values py print (gdb.Value (1) == 1.0) True (gdb) PASS: gdb.python/py-value.exp: equality of gdb.Value with Python value py print (gdb.Value (1) == 2) False (gdb) PASS: gdb.python/py-value.exp: inequality of gdb.Value with Python value py print (gdb.Value (1) == None) False (gdb) PASS: gdb.python/py-value.exp: inequality of gdb.Value with None py print (gdb.Value (1) != gdb.Value (1)) False (gdb) PASS: gdb.python/py-value.exp: inequality, false py print (gdb.Value (1) != gdb.Value (2)) True (gdb) PASS: gdb.python/py-value.exp: inequality, true py print (gdb.Value (1) != None) True (gdb) PASS: gdb.python/py-value.exp: inequality, None py print (gdb.Value (1) > gdb.Value (1)) False (gdb) PASS: gdb.python/py-value.exp: greater than, equal py print (gdb.Value (1) > gdb.Value (2)) False (gdb) PASS: gdb.python/py-value.exp: greater than, less py print (gdb.Value (2) > gdb.Value (1)) True (gdb) PASS: gdb.python/py-value.exp: greater than, greater py print (gdb.Value (2) > None) True (gdb) PASS: gdb.python/py-value.exp: greater than, None py print (gdb.Value (1) >= gdb.Value (1)) True (gdb) PASS: gdb.python/py-value.exp: greater or equal, equal py print (gdb.Value (1) >= gdb.Value (2)) False (gdb) PASS: gdb.python/py-value.exp: greater or equal, less py print (gdb.Value (2) >= gdb.Value (1)) True (gdb) PASS: gdb.python/py-value.exp: greater or equal, greater py print (gdb.Value (2) >= None) True (gdb) PASS: gdb.python/py-value.exp: greater or equal, None python >ok=False >for file in gdb.objfiles(): > if 'py-value' in file.filename: > ok=True >print (ok) >end True (gdb) PASS: gdb.python/py-value.exp: py-value in file.filename python print (gdb.objfiles()[0].pretty_printers) [] (gdb) PASS: gdb.python/py-value.exp: python print (gdb.objfiles()[0].pretty_printers) python gdb.objfiles()[0].pretty_printers = 0 Traceback (most recent call last): File "", line 1, in TypeError: The pretty_printers attribute must be a list. Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: python gdb.objfiles()[0].pretty_printers = 0 python print (gdb.parse_and_eval ('23')) 23 (gdb) PASS: gdb.python/py-value.exp: parse_and_eval constant test python print (gdb.parse_and_eval ('5 + 7')) 12 (gdb) PASS: gdb.python/py-value.exp: parse_and_eval simple expression test python print (type(gdb.parse_and_eval ('5 + 7'))) (gdb) PASS: gdb.python/py-value.exp: parse_and_eval type test python >PASS: gdb.python/py-value.exp: Simple Python value dictionary: input 1: python one = gdb.Value(1) >PASS: gdb.python/py-value.exp: Simple Python value dictionary: input 2: one = gdb.Value(1) two = gdb.Value(2) >PASS: gdb.python/py-value.exp: Simple Python value dictionary: input 3: two = gdb.Value(2) three = gdb.Value(3) >PASS: gdb.python/py-value.exp: Simple Python value dictionary: input 4: three = gdb.Value(3) vdict = {one:"one str",two:"two str",three:"three str"} >PASS: gdb.python/py-value.exp: Simple Python value dictionary: input 5: vdict = {one:"one str",two:"two str",three:"three str"} end (gdb) PASS: gdb.python/py-value.exp: Simple Python value dictionary: input 6: end python print (vdict[one]) one str (gdb) PASS: gdb.python/py-value.exp: test dictionary hash for one python print (vdict[two]) two str (gdb) PASS: gdb.python/py-value.exp: test dictionary hash for two python print (vdict[three]) three str (gdb) PASS: gdb.python/py-value.exp: test dictionary hash for three python print (one.__hash__() == hash(one)) True (gdb) PASS: gdb.python/py-value.exp: test inbuilt hash python print(int(gdb.Value(0))) 0 (gdb) PASS: gdb.python/py-value.exp: python print(int(gdb.Value(0))) python print(int(gdb.Value(2.5))) 2 (gdb) PASS: gdb.python/py-value.exp: python print(int(gdb.Value(2.5))) python print(float(gdb.Value(2.5))) 2.5 (gdb) PASS: gdb.python/py-value.exp: python print(float(gdb.Value(2.5))) python print(float(gdb.Value(0))) 0.0 (gdb) PASS: gdb.python/py-value.exp: python print(float(gdb.Value(0))) python idx = gdb.add_history(gdb.Value(42)) (gdb) PASS: gdb.python/py-value.exp: add value 42 to the history list python print ("$%d = %s" % (idx, gdb.history (idx))) $9 = 42 (gdb) PASS: gdb.python/py-value.exp: print value 42 from the history list python print ("valueof: %s" % (idx)) valueof: 9 (gdb) PASS: gdb.python/py-value.exp: get idx for value 42 print $9 $10 = 42 (gdb) PASS: gdb.python/py-value.exp: print $9 python idx = gdb.add_history(84) (gdb) PASS: gdb.python/py-value.exp: add value to 84 to the history list python print ("$%d = %s" % (idx, gdb.history (idx))) $11 = 84 (gdb) PASS: gdb.python/py-value.exp: print value 84 from the history list python print ("valueof: %s" % (idx)) valueof: 11 (gdb) PASS: gdb.python/py-value.exp: get idx for value 84 print $11 $12 = 84 (gdb) PASS: gdb.python/py-value.exp: print $11 python idx = gdb.add_history(gdb.GdbError("an error")) Traceback (most recent call last): File "", line 1, in TypeError: Could not convert Python object: an error. Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: python idx = gdb.add_history(gdb.GdbError("an error")) delete breakpoints (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break -qualified main Breakpoint 1 at 0x119b: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c, line 88. (gdb) run Starting program: /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/../lib/libthread_db.so.1". Breakpoint 1, main (argc=1, argv=0x7fffffffd268) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c:88 88 PTR x = &s; (gdb) break 124 Breakpoint 2 at 0x5555555552b7: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c, line 124. (gdb) continue Continuing. void function called Breakpoint 2, main (argc=1, argv=0x7fffffffd268) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c:124 124 save_argv = argv; /* break to inspect struct and union */ (gdb) PASS: gdb.python/py-value.exp: continue to breakpoint: break to inspect struct and union print s $13 = {a = 3, b = 5} (gdb) PASS: gdb.python/py-value.exp: print s python s = gdb.history (0) (gdb) PASS: gdb.python/py-value.exp: get value s from history python print ('result = ' + str(s['a'])) result = 3 (gdb) PASS: gdb.python/py-value.exp: access element inside struct using 8-bit string name print argv $14 = (char **) 0x7fffffffd268 (gdb) PASS: gdb.python/py-value.exp: print argv python argv = gdb.history (0) (gdb) python arg0 = argv.dereference () (gdb) PASS: gdb.python/py-value.exp: dereference value set print elements unlimited (gdb) PASS: gdb.python/py-value.exp: set print elements unlimited set print repeats unlimited (gdb) PASS: gdb.python/py-value.exp: set print repeats unlimited python print (arg0) 0x7fffffffd728 "/home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value" (gdb) PASS: gdb.python/py-value.exp: verify dereferenced value python print ('result = %s' % arg0.is_optimized_out) result = False (gdb) PASS: gdb.python/py-value.exp: test is_optimized_out attribute python print ('result = %s' % arg0.address) result = 0x7fffffffd268 (gdb) PASS: gdb.python/py-value.exp: test address attribute python print (gdb.parse_and_eval('*(int*)0')) Traceback (most recent call last): File "", line 1, in gdb.MemoryError: Cannot access memory at address 0x0 Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: parse_and_eval with memory error python inval = gdb.parse_and_eval('*(int*)0') (gdb) PASS: gdb.python/py-value.exp: python inval = gdb.parse_and_eval('*(int*)0') python print (inval.is_lazy) True (gdb) PASS: gdb.python/py-value.exp: python print (inval.is_lazy) python inval2 = inval+1 Traceback (most recent call last): File "", line 1, in gdb.MemoryError: Cannot access memory at address 0x0 Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: memory error and lazy values, first test python inval.fetch_lazy () Traceback (most recent call last): File "", line 1, in gdb.MemoryError: Cannot access memory at address 0x0 Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: memory error and lazy values, second test print /d argc $15 = 1 (gdb) PASS: gdb.python/py-value.exp: get integer valueof "argc" python argc_lazy = gdb.parse_and_eval('argc') (gdb) PASS: gdb.python/py-value.exp: python argc_lazy = gdb.parse_and_eval('argc') python argc_notlazy = gdb.parse_and_eval('argc') (gdb) PASS: gdb.python/py-value.exp: python argc_notlazy = gdb.parse_and_eval('argc') python argc_notlazy.fetch_lazy() (gdb) PASS: gdb.python/py-value.exp: python argc_notlazy.fetch_lazy() python print (argc_lazy.is_lazy) True (gdb) PASS: gdb.python/py-value.exp: python print (argc_lazy.is_lazy) the first time python print (argc_notlazy.is_lazy) False (gdb) PASS: gdb.python/py-value.exp: python print (argc_notlazy.is_lazy) print argc $16 = 1 (gdb) PASS: gdb.python/py-value.exp: sanity check argc python print (argc_lazy.is_lazy) True (gdb) PASS: gdb.python/py-value.exp: python print (argc_lazy.is_lazy) the second time set argc=2 (gdb) PASS: gdb.python/py-value.exp: change argc python print (argc_notlazy) 1 (gdb) PASS: gdb.python/py-value.exp: python print (argc_notlazy) python print (argc_lazy) 2 (gdb) PASS: gdb.python/py-value.exp: python print (argc_lazy) python print (argc_lazy.is_lazy) False (gdb) PASS: gdb.python/py-value.exp: python print (argc_lazy.is_lazy) print st $17 = "divide et impera" (gdb) PASS: gdb.python/py-value.exp: print st python st = gdb.history (0) (gdb) PASS: gdb.python/py-value.exp: get value st from history python print (st.string ()) divide et impera (gdb) PASS: gdb.python/py-value.exp: Test string with no length python print (st.string (length = -1)) divide et impera (gdb) PASS: gdb.python/py-value.exp: test string (length = -1) is all of the string python print (st.string (length = 6)) divide (gdb) PASS: gdb.python/py-value.exp: python print (st.string (length = 6)) python print ("---"+st.string (length = 0)+"---") ------ (gdb) PASS: gdb.python/py-value.exp: test string (length = 0) is empty python print (len(st.string (length = 0))) 0 (gdb) PASS: gdb.python/py-value.exp: test length is 0 set lang ada Warning: the current language does not match this frame. (gdb) PASS: gdb.python/py-value.exp: set lang ada python print (st.string ()) divide et impera (gdb) PASS: gdb.python/py-value.exp: Test string with no length in ada set lang auto (gdb) PASS: gdb.python/py-value.exp: set lang auto print nullst $18 = "divide\000et\000impera" (gdb) PASS: gdb.python/py-value.exp: print nullst python nullst = gdb.history (0) (gdb) PASS: gdb.python/py-value.exp: get value nullst from history python print (nullst.string ()) divide (gdb) PASS: gdb.python/py-value.exp: test string to first null python nullst = nullst.string (length = 9) (gdb) PASS: gdb.python/py-value.exp: get string beyond null python print (repr(nullst)) 'divide\x00et' (gdb) PASS: gdb.python/py-value.exp: python print (repr(nullst)) python xstr = gdb.parse_and_eval('xstr') (gdb) PASS: gdb.python/py-value.exp: get xstr python print(xstr['text'].string (length = xstr['length'])) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (gdb) PASS: gdb.python/py-value.exp: read string beyond declared size python str = '"str"' (gdb) PASS: gdb.python/py-value.exp: set up str variable python print (gdb.parse_and_eval (str).string (length = 10)) Traceback (most recent call last): File "", line 1, in gdb.error: Attempt to take address of value not located in memory. Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: python print (gdb.parse_and_eval (str).string (length = 10)) python tp=gdb.lookup_type('int') (gdb) python size_a=gdb.parse_and_eval('sizeof(a)') (gdb) python size_a0=gdb.parse_and_eval('sizeof(a[0])') (gdb) python addr=gdb.parse_and_eval('&a') (gdb) python b=gdb.selected_inferior().read_memory(addr,size_a) (gdb) python v=gdb.Value(b,tp); print(v) 1 (gdb) PASS: gdb.python/py-value.exp: construct value from buffer python v=gdb.Value(b[size_a0:],tp); print(v) 2 (gdb) PASS: gdb.python/py-value.exp: convert 2nd elem of buffer to value python v=gdb.Value(b[2*size_a0:],tp); print(v) 3 (gdb) PASS: gdb.python/py-value.exp: convert 3rd elem of buffer to value python v=gdb.Value(b[2*size_a0+1:],tp); print(v) Traceback (most recent call last): File "", line 1, in ValueError: Size of type is larger than that of buffer object. Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: attempt to convert smaller buffer than size of type python atp=tp.array(2) ; print(atp) int [3] (gdb) python va=gdb.Value(b,atp) (gdb) python print(va) {1, 2, 3} (gdb) PASS: gdb.python/py-value.exp: print array value python print(va[0]) 1 (gdb) PASS: gdb.python/py-value.exp: print first array element python print(va[1]) 2 (gdb) PASS: gdb.python/py-value.exp: print second array element python print(va[2]) 3 (gdb) PASS: gdb.python/py-value.exp: print third array element python print(va[3]) Traceback (most recent call last): File "", line 1, in gdb.error: no such vector element Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: print out of bounds array element python atpbig=tp.array(3) (gdb) python vabig=gdb.Value(b,atpbig) Traceback (most recent call last): File "", line 1, in ValueError: Size of type is larger than that of buffer object. Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: attempt to construct large value with small buffer python v=gdb.Value(2048,tp) Traceback (most recent call last): File "", line 1, in TypeError: Object must support the python buffer protocol. Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: attempt to construct value from buffer with non-buffer object python v=gdb.Value(b,'int'); print(v) Traceback (most recent call last): File "", line 1, in TypeError: type argument must be a gdb.Type. Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: attempt to construct value with string as type python tp=gdb.lookup_type('int') (gdb) python size_a=gdb.parse_and_eval('sizeof(a)') (gdb) python size_a0=gdb.parse_and_eval('sizeof(a[0])') (gdb) python addr=gdb.parse_and_eval('&a') (gdb) python b=gdb.selected_inferior().read_memory(addr,size_a) (gdb) python >PASS: gdb.python/py-value.exp: Create sub-class of gdb.Value: input 1: python class MyValue(gdb.Value): >PASS: gdb.python/py-value.exp: Create sub-class of gdb.Value: input 2: class MyValue(gdb.Value): def __init__(self,val,type=None): >PASS: gdb.python/py-value.exp: Create sub-class of gdb.Value: input 3: def __init__(self,val,type=None): gdb.Value.__init__(self,val,type) >PASS: gdb.python/py-value.exp: Create sub-class of gdb.Value: input 4: gdb.Value.__init__(self,val,type) print("In MyValue.__init__") >PASS: gdb.python/py-value.exp: Create sub-class of gdb.Value: input 5: print("In MyValue.__init__") end (gdb) PASS: gdb.python/py-value.exp: Create sub-class of gdb.Value: input 6: end python obj = MyValue (123) In MyValue.__init__ (gdb) PASS: gdb.python/py-value.exp: create instance of MyValue python print(obj) 123 (gdb) PASS: gdb.python/py-value.exp: check printing of MyValue python obj = MyValue(b[size_a0:],tp) In MyValue.__init__ (gdb) PASS: gdb.python/py-value.exp: convert 2nd elem of buffer to a MyValue python print(obj) 2 (gdb) PASS: gdb.python/py-value.exp: check printing of MyValue when initiaized with a type p/x fp1 $19 = 0x555555555159 (gdb) PASS: gdb.python/py-value.exp: p/x fp1 python fp1 = gdb.history (0) (gdb) PASS: gdb.python/py-value.exp: get value fp1 from history python fp1 = fp1.dereference() (gdb) PASS: gdb.python/py-value.exp: python fp1 = fp1.dereference() python result = fp1() void function called (gdb) PASS: gdb.python/py-value.exp: python result = fp1() python print (result) void (gdb) PASS: gdb.python/py-value.exp: python print (result) p/x fp2 $20 = 0x55555555516f (gdb) PASS: gdb.python/py-value.exp: print fp2 to place it into history python fp2 = gdb.history (0) (gdb) PASS: gdb.python/py-value.exp: get value fp2 from history python fp2 = fp2.dereference() (gdb) PASS: gdb.python/py-value.exp: python fp2 = fp2.dereference() python result2 = fp2(10,20) (gdb) PASS: gdb.python/py-value.exp: python result2 = fp2(10,20) python print (result2) 30 (gdb) PASS: gdb.python/py-value.exp: python print (result2) p i $21 = 2 (gdb) PASS: gdb.python/py-value.exp: p i python i = gdb.history (0) (gdb) PASS: gdb.python/py-value.exp: get value i from history python result3 = i() Traceback (most recent call last): File "", line 1, in RuntimeError: Value is not callable (not TYPE_CODE_FUNC). Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: python result3 = i() p/x fp2 $22 = 0x55555555516f (gdb) PASS: gdb.python/py-value.exp: print fp2 again to place it into history python fp3 = gdb.history (0) (gdb) PASS: gdb.python/py-value.exp: get value fp3 from history python fp3 = fp3.dereference() (gdb) PASS: gdb.python/py-value.exp: python fp3 = fp3.dereference() python result2 = fp3(10) Traceback (most recent call last): File "", line 1, in gdb.error: Too few arguments in function call. Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: python result2 = fp3(10) python ptrtype = gdb.lookup_type('PTR') (gdb) PASS: gdb.python/py-value.exp: create PTR type kill Kill the program being debugged? (y or n) y [Inferior 1 (process 2942418) killed] (gdb) PASS: gdb.python/py-value.exp: kill the inferior file No executable file now. Discard symbol table from `/home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value'? (y or n) y Fatal signal: Aborted ----- Backtrace ----- 0x5642e034726a gdb_internal_backtrace_1 /home/simark/src/binutils-gdb/gdb/bt-utils.c:122 0x5642e0347761 _Z22gdb_internal_backtracev /home/simark/src/binutils-gdb/gdb/bt-utils.c:168 0x5642e0f57fe6 handle_fatal_signal /home/simark/src/binutils-gdb/gdb/event-top.c:946 0x7f7b9903e8df ??? 0x7f7b9908e36c ??? 0x7f7b9903e837 ??? 0x7f7b99028534 ??? 0x7f7b9a8dfce3 _ZN11__sanitizer5AbortEv /usr/src/debug/gcc/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp:143 0x7f7b9a8ed1c1 _ZN11__sanitizer3DieEv /usr/src/debug/gcc/libsanitizer/sanitizer_common/sanitizer_termination.cpp:58 0x7f7b9a8c9c1f _ZN6__asan19ScopedInErrorReportD2Ev /usr/src/debug/gcc/libsanitizer/asan/asan_report.cpp:190 0x7f7b9a8c910b _ZN6__asan18ReportGenericErrorEmmmmbmjb /usr/src/debug/gcc/libsanitizer/asan/asan_report.cpp:479 0x7f7b9a8ca4ab __asan_report_load8 /usr/src/debug/gcc/libsanitizer/asan/asan_rtl.cpp:123 0x5642dfcbda0c _ZNK4type16is_objfile_ownedEv /home/simark/src/binutils-gdb/gdb/gdbtypes.h:1380 0x5642e10d3849 _Z19copy_type_recursiveP4typeP4htab /home/simark/src/binutils-gdb/gdb/gdbtypes.c:5638 0x5642e1c6c55c _ZN12typy_deleterclEP11type_object /home/simark/src/binutils-gdb/gdb/python/py-type.c:1132 0x5642e1c6cd1c _ZN8registryI7objfileE3keyI11type_object12typy_deleterE7cleanupEPv /home/simark/src/binutils-gdb/gdb/registry.h:159 0x5642e1984978 _ZN8registryI7objfileE14clear_registryEv /home/simark/src/binutils-gdb/gdb/registry.h:176 0x5642e1980adb _ZN8registryI7objfileED2Ev /home/simark/src/binutils-gdb/gdb/registry.h:78 0x5642e19716b5 _ZN7objfileD2Ev /home/simark/src/binutils-gdb/gdb/objfiles.c:590 0x5642e1984dc8 _ZNKSt14default_deleteI7objfileEclEPS0_ /usr/include/c++/12.1.0/bits/unique_ptr.h:95 0x5642e1980e98 _ZNSt10unique_ptrI7objfileSt14default_deleteIS0_EED2Ev /usr/include/c++/12.1.0/bits/unique_ptr.h:396 0x5642e1ac6172 _ZNSt15__new_allocatorINSt9__cxx199810_List_nodeISt10unique_ptrI7objfileSt14default_deleteIS3_EEEEE7destroyIS6_EEvPT_ /usr/include/c++/12.1.0/bits/new_allocator.h:181 0x5642e1abb2f2 _ZNSt16allocator_traitsISaINSt9__cxx199810_List_nodeISt10unique_ptrI7objfileSt14default_deleteIS3_EEEEEE7destroyIS6_EEvRS8_PT_ /usr/include/c++/12.1.0/bits/alloc_traits.h:535 0x5642e1acb5a6 _ZNSt9__cxx19987__cxx114listISt10unique_ptrI7objfileSt14default_deleteIS3_EESaIS6_EE8_M_eraseENS_14_List_iteratorIS6_EE /usr/include/c++/12.1.0/bits/stl_list.h:2019 0x5642e1ac0b7d _ZNSt9__cxx19987__cxx114listISt10unique_ptrI7objfileSt14default_deleteIS3_EESaIS6_EE5eraseENS_20_List_const_iteratorIS6_EE /usr/include/c++/12.1.0/bits/list.tcc:158 0x5642e1ab54b1 _ZNSt7__debug4listISt10unique_ptrI7objfileSt14default_deleteIS2_EESaIS5_EE8_M_eraseENSt9__cxx199820_List_const_iteratorIS5_EE /usr/include/c++/12.1.0/debug/list:521 0x5642e1aaef44 _ZNSt7__debug4listISt10unique_ptrI7objfileSt14default_deleteIS2_EESaIS5_EE5eraseEN11__gnu_debug14_Safe_iteratorINSt9__cxx199820_List_const_iteratorIS5_EES7_St26bidirectional_iterator_tagEE /usr/include/c++/12.1.0/debug/list:533 0x5642e1aa44dd _ZN13program_space14remove_objfileEP7objfile /home/simark/src/binutils-gdb/gdb/progspace.c:175 0x5642e19702be _ZN7objfile6unlinkEv /home/simark/src/binutils-gdb/gdb/objfiles.c:478 0x5642e1aa3228 _ZN13program_space17free_all_objfilesEv /home/simark/src/binutils-gdb/gdb/progspace.c:135 0x5642e2180a39 _Z17symbol_file_cleari /home/simark/src/binutils-gdb/gdb/symfile.c:1232 0x5642e218354d _Z19symbol_file_commandPKci /home/simark/src/binutils-gdb/gdb/symfile.c:1598 0x5642e0f66532 file_command /home/simark/src/binutils-gdb/gdb/exec.c:555 0x5642e058fdd0 do_simple_func /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:95 0x5642e05a577b _Z8cmd_funcP16cmd_list_elementPKci /home/simark/src/binutils-gdb/gdb/cli/cli-decode.c:2516 0x5642e24f75ca _Z15execute_commandPKci /home/simark/src/binutils-gdb/gdb/top.c:699 0x5642e0f565a9 _Z15command_handlerPKc /home/simark/src/binutils-gdb/gdb/event-top.c:598 0x5642e0f573b1 _Z20command_line_handlerOSt10unique_ptrIcN3gdb13xfree_deleterIcEEE /home/simark/src/binutils-gdb/gdb/event-top.c:842 0x5642e26432e6 tui_command_line_handler /home/simark/src/binutils-gdb/gdb/tui/tui-interp.c:104 0x5642e0f5459e gdb_rl_callback_handler /home/simark/src/binutils-gdb/gdb/event-top.c:230 0x7f7b9b00a9df ??? 0x5642e0f53fa9 gdb_rl_callback_read_char_wrapper_noexcept /home/simark/src/binutils-gdb/gdb/event-top.c:188 0x5642e0f541ec gdb_rl_callback_read_char_wrapper /home/simark/src/binutils-gdb/gdb/event-top.c:205 0x5642e0f55b77 _Z19stdin_event_handleriPv /home/simark/src/binutils-gdb/gdb/event-top.c:525 0x5642e2db4e3b handle_file_event /home/simark/src/binutils-gdb/gdbsupport/event-loop.cc:549 0x5642e2db5777 gdb_wait_for_event /home/simark/src/binutils-gdb/gdbsupport/event-loop.cc:670 0x5642e2db3531 _Z16gdb_do_one_eventv /home/simark/src/binutils-gdb/gdbsupport/event-loop.cc:235 0x5642e167a714 start_event_loop /home/simark/src/binutils-gdb/gdb/main.c:411 0x5642e167ab6e captured_command_loop /home/simark/src/binutils-gdb/gdb/main.c:471 0x5642e1680000 captured_main /home/simark/src/binutils-gdb/gdb/main.c:1329 0x5642e16800dd _Z8gdb_mainP18captured_main_args /home/simark/src/binutils-gdb/gdb/main.c:1344 0x5642dfc93c9d main /home/simark/src/binutils-gdb/gdb/gdb.c:32 --------------------- A fatal error internal to GDB has been detected, further debugging is not possible. GDB will now terminate. This is a bug, please report it. For instructions, see: . ERROR: GDB process no longer exists GDB process exited with wait status 2942381 exp9 0 0 CHILDKILLED SIGABRT SIGABRT UNRESOLVED: gdb.python/py-value.exp: discard the symbols ERROR: Couldn't send python castval = arg0.cast(ptrtype.pointer()) to GDB. ERROR: can not find channel named "exp9" while executing "expect { -i exp9 -timeout 10 -re ".*A problem internal to GDB has been detected" { fail "$message (GDB internal error)" gdb_internal_error..." ("uplevel" body line 1) invoked from within "uplevel $body" TCL LOOKUP CHANNEL exp9 can not find channel named "exp9" ERROR: Couldn't send python ptrtype = None to GDB. ERROR: can not find channel named "exp9" while executing "expect { -i exp9 -timeout 10 -re ".*A problem internal to GDB has been detected" { fail "$message (GDB internal error)" gdb_internal_error..." ("uplevel" body line 1) invoked from within "uplevel $body" TCL LOOKUP CHANNEL exp9 can not find channel named "exp9" ERROR: Couldn't send python print (castval.type) to GDB. ERROR: can not find channel named "exp9" while executing "expect { -i exp9 -timeout 10 -re ".*A problem internal to GDB has been detected" { fail "$message (GDB internal error)" gdb_internal_error..." ("uplevel" body line 1) invoked from within "uplevel $body" TCL LOOKUP CHANNEL exp9 can not find channel named "exp9" builtin_spawn /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../../gdb/gdb -nw -nx -iex set height 0 -iex set width 0 -data-directory /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../data-directory warning: Found custom handler for signal 7 (Bus error) preinstalled. warning: Found custom handler for signal 8 (Floating point exception) preinstalled. warning: Found custom handler for signal 11 (Segmentation fault) preinstalled. Some signal dispositions inherited from the environment (SIG_DFL/SIG_IGN) won't be propagated to spawned programs. GNU gdb (GDB) 13.0.50.20220728-git Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) set height 0 (gdb) set width 0 (gdb) dir Reinitialize source path to empty? (y or n) y Source directories searched: $cdir:$cwd (gdb) dir /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python Source directories searched: /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python:$cdir:$cwd (gdb) kill The program is not being run. (gdb) file /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value Reading symbols from /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value... (gdb) delete breakpoints (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break -qualified main Breakpoint 1 at 0x119b: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c, line 88. (gdb) run Starting program: /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/../lib/libthread_db.so.1". Breakpoint 1, main (argc=1, argv=0x7fffffffd268) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c:88 88 PTR x = &s; (gdb) break 124 Breakpoint 2 at 0x5555555552b7: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c, line 124. (gdb) continue Continuing. void function called Breakpoint 2, main (argc=1, argv=0x7fffffffd268) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c:124 124 save_argv = argv; /* break to inspect struct and union */ (gdb) PASS: gdb.python/py-value.exp: continue to breakpoint: break to inspect struct and union for subscript regression test python intv = gdb.Value(1) (gdb) PASS: gdb.python/py-value.exp: Create value intv for subscript test python stringv = gdb.Value("foo") (gdb) PASS: gdb.python/py-value.exp: Create value stringv for subscript test python print (intv) 1 (gdb) PASS: gdb.python/py-value.exp: baseline print of an int Python value python print (intv[0]) Traceback (most recent call last): File "", line 1, in gdb.error: Cannot subscript requested type. Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: Attempt to access an integer with a subscript python print (stringv) "foo" (gdb) PASS: gdb.python/py-value.exp: baseline print of a string Python value python print (stringv[0]) 102 'f' (gdb) PASS: gdb.python/py-value.exp: attempt to access a string with a subscript print p $1 = (int *) 0x7fffffffd0c4 (gdb) PASS: gdb.python/py-value.exp: Build pointer to array python pointer = gdb.history(0) (gdb) python print (pointer[0]) 1 (gdb) PASS: gdb.python/py-value.exp: access array via pointer with int subscript python print (pointer[intv]) 2 (gdb) PASS: gdb.python/py-value.exp: access array via pointer with value subscript python print (pointer[intv][0]) Traceback (most recent call last): File "", line 1, in gdb.error: Cannot subscript requested type. Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: Attempt to access a single dimension array with a two subscripts print {"fu ","foo","bar"} $2 = {"fu ", "foo", "bar"} (gdb) PASS: gdb.python/py-value.exp: Build array python marray = gdb.history(0) (gdb) python print (marray[1][2]) 111 'o' (gdb) PASS: gdb.python/py-value.exp: test multiple subscript Executing on host: g++ -fno-stack-protector -fdiagnostics-color=never -c -g -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value-cxx.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c (timeout = 300) builtin_spawn -ignore SIGHUP g++ -fno-stack-protector -fdiagnostics-color=never -c -g -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value-cxx.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c Executing on host: g++ -fno-stack-protector /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value-cxx.o -fdiagnostics-color=never -L/home/simark/build/binutils-gdb-one-target/libiberty -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value-cxx (timeout = 300) builtin_spawn -ignore SIGHUP g++ -fno-stack-protector /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value-cxx.o -fdiagnostics-color=never -L/home/simark/build/binutils-gdb-one-target/libiberty -g -lm -o /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value-cxx builtin_spawn /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../../gdb/gdb -nw -nx -iex set height 0 -iex set width 0 -data-directory /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../data-directory warning: Found custom handler for signal 7 (Bus error) preinstalled. warning: Found custom handler for signal 8 (Floating point exception) preinstalled. warning: Found custom handler for signal 11 (Segmentation fault) preinstalled. Some signal dispositions inherited from the environment (SIG_DFL/SIG_IGN) won't be propagated to spawned programs. GNU gdb (GDB) 13.0.50.20220728-git Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) set height 0 (gdb) set width 0 (gdb) dir Reinitialize source path to empty? (y or n) y Source directories searched: $cdir:$cwd (gdb) dir /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python Source directories searched: /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python:$cdir:$cwd (gdb) kill The program is not being run. (gdb) file /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value-cxx Reading symbols from /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value-cxx... (gdb) delete breakpoints (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break -qualified main Breakpoint 1 at 0x11b6: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c, line 88. (gdb) run Starting program: /home/simark/build/binutils-gdb-one-target/gdb/testsuite/outputs/gdb.python/py-value/py-value-cxx [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/../lib/libthread_db.so.1". Breakpoint 1, main (argc=1, argv=0x7fffffffd258) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c:88 88 PTR x = &s; (gdb) break 66 Breakpoint 2 at 0x555555555171: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c, line 66. (gdb) continue Continuing. void function called Breakpoint 2, ptr_ref (rptr_int=@0x7fffffffd0a8: 0x7fffffffd0b0) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c:66 66 return; /* break to inspect pointer by reference. */ (gdb) PASS: gdb.python/py-value.exp: c++: continue to breakpoint: break to inspect pointer by reference print rptr_int $1 = (int *&) @0x7fffffffd0a8: 0x7fffffffd0b0 (gdb) PASS: gdb.python/py-value.exp: c++: Obtain address python rptr = gdb.history(0) (gdb) PASS: gdb.python/py-value.exp: c++: Obtains value from GDB python print (rptr[0]) 2 (gdb) PASS: gdb.python/py-value.exp: c++: check pointer passed as reference python print (bool(gdb.parse_and_eval('base').dynamic_cast(gdb.lookup_type('Derived').pointer()))) True (gdb) PASS: gdb.python/py-value.exp: c++: python print (bool(gdb.parse_and_eval('base').dynamic_cast(gdb.lookup_type('Derived').pointer()))) python print (gdb.parse_and_eval('base').dynamic_type) Derived * (gdb) PASS: gdb.python/py-value.exp: c++: python print (gdb.parse_and_eval('base').dynamic_type) python print (gdb.parse_and_eval('base_ref').dynamic_type) Derived & (gdb) PASS: gdb.python/py-value.exp: c++: python print (gdb.parse_and_eval('base_ref').dynamic_type) python print (gdb.parse_and_eval('5').dynamic_type) int (gdb) PASS: gdb.python/py-value.exp: c++: python print (gdb.parse_and_eval('5').dynamic_type) break 124 Breakpoint 3 at 0x5555555552e4: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c, line 124. (gdb) continue Continuing. Breakpoint 3, main (argc=1, argv=0x7fffffffd258) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.c:124 124 save_argv = argv; /* break to inspect struct and union */ (gdb) PASS: gdb.python/py-value.exp: c++: continue to breakpoint: break to inspect struct and union for subscript regression test python intv = gdb.Value(1) (gdb) PASS: gdb.python/py-value.exp: c++: Create value intv for subscript test python stringv = gdb.Value("foo") (gdb) PASS: gdb.python/py-value.exp: c++: Create value stringv for subscript test python print (intv) 1 (gdb) PASS: gdb.python/py-value.exp: c++: baseline print of an int Python value python print (intv[0]) Traceback (most recent call last): File "", line 1, in gdb.error: Cannot subscript requested type. Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: c++: Attempt to access an integer with a subscript python print (stringv) "foo" (gdb) PASS: gdb.python/py-value.exp: c++: baseline print of a string Python value python print (stringv[0]) 102 'f' (gdb) PASS: gdb.python/py-value.exp: c++: attempt to access a string with a subscript print p $2 = (int *) 0x7fffffffd0b4 (gdb) PASS: gdb.python/py-value.exp: c++: Build pointer to array python pointer = gdb.history(0) (gdb) python print (pointer[0]) 1 (gdb) PASS: gdb.python/py-value.exp: c++: access array via pointer with int subscript python print (pointer[intv]) 2 (gdb) PASS: gdb.python/py-value.exp: c++: access array via pointer with value subscript python print (pointer[intv][0]) Traceback (most recent call last): File "", line 1, in gdb.error: Cannot subscript requested type. Error while executing Python code. (gdb) PASS: gdb.python/py-value.exp: c++: Attempt to access a single dimension array with a two subscripts print {"fu ","foo","bar"} $3 = {"fu ", "foo", "bar"} (gdb) PASS: gdb.python/py-value.exp: c++: Build array python marray = gdb.history(0) (gdb) python print (marray[1][2]) 111 'o' (gdb) PASS: gdb.python/py-value.exp: c++: test multiple subscript testcase /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-value.exp completed in 4 seconds === gdb Summary === # of expected passes 394 # of unresolved testcases 4 # of paths in test names 1 Executing on host: /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../../gdb/gdb -nw -nx -iex "set height 0" -iex "set width 0" -data-directory /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../data-directory --version (timeout = 300) builtin_spawn -ignore SIGHUP /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../../gdb/gdb -nw -nx -iex set height 0 -iex set width 0 -data-directory /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../data-directory --version warning: Found custom handler for signal 7 (Bus error) preinstalled. warning: Found custom handler for signal 8 (Floating point exception) preinstalled. warning: Found custom handler for signal 11 (Segmentation fault) preinstalled. Some signal dispositions inherited from the environment (SIG_DFL/SIG_IGN) won't be propagated to spawned programs. GNU gdb (GDB) 13.0.50.20220728-git Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. /home/simark/build/binutils-gdb-one-target/gdb/gdb version 11 -nw -nx -iex "set height 0" -iex "set width 0" -data-directory /home/simark/build/binutils-gdb-one-target/gdb/testsuite/../data-directory ERROR: ------------------------------------------- ERROR: in testcase /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.exp ERROR: can not find channel named "exp9" ERROR: tcl error code TCL LOOKUP CHANNEL exp9 ERROR: tcl error info: can not find channel named "exp9" while executing "wait -i $gdb_spawn_id" ("uplevel" body line 4) invoked from within "uplevel $error_sect" invoked from within "remote_expect host 30 { -re "$break_message \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {} -re "$break_message \[0-9\]*: file .*, line..." ("uplevel" body line 1) invoked from within "uplevel remote_expect host $tmt $expcode" invoked from within "gdb_expect 30 { -re "$break_message \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {} -re "$break_message \[0-9\]*: file .*, line $decima..." (procedure "gdb_breakpoint" line 36) invoked from within "gdb_breakpoint $linespec qualified" ("eval" body line 1) invoked from within "eval gdb_breakpoint {$linespec} $args" (procedure "runto" line 25) invoked from within "runto main qualified" (procedure "runto_main" line 2) invoked from within "runto_main " (procedure "test_template_arg" line 8) invoked from within "test_template_arg "${binfile}-cir" "const int &"" (file "/home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.exp" line 67) invoked from within "source /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.exp" ("uplevel" body line 1) invoked from within "uplevel #0 source /home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/py-template.exp" invoked from within "catch "uplevel #0 source $test_file_name" msg" -------------------------------------------------- runtest completed at Thu Jul 28 22:30:34 2022