]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
merge from mainline
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Sun, 3 Nov 2002 22:09:39 +0000 (22:09 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Sun, 3 Nov 2002 22:09:39 +0000 (22:09 +0000)
13 files changed:
gdb/testsuite/gdb.asm/asm-source.exp
gdb/testsuite/gdb.asm/asmsrc1.s
gdb/testsuite/gdb.asm/asmsrc2.s
gdb/testsuite/gdb.asm/common.inc
gdb/testsuite/gdb.base/constvars.c
gdb/testsuite/gdb.base/constvars.exp
gdb/testsuite/gdb.base/default.exp
gdb/testsuite/gdb.base/help.exp
gdb/testsuite/gdb.threads/schedlock.c
gdb/tui/ChangeLog
gdb/tui/tui-hooks.c
gdb/tui/tuiIO.c
gdb/tui/tuiWin.c

index f10f4ae2a6299050c63dffec966449c7f3fdb083..deb4b5f9559ed7c07ce0b7f800b4818b5d8cef14 100644 (file)
@@ -57,6 +57,9 @@ if [istarget "i\[3456\]86-*-*"] then {
 if [istarget "m32r*-*"] then {
     set asm-arch m32r
 }
+if [istarget "mips*-*"] then {
+    set asm-arch mips
+}
 if [istarget "powerpc*-*"] then {
     set asm-arch powerpc
 }
@@ -194,7 +197,7 @@ gdb_test "list $entry_symbol" ".*gdbasm_startup.*" "list"
 
 # Now try a source file search
 gdb_test "search A routine for foo2 to call" \
-       "39\[ \t\]+comment \"A routine for foo2 to call.\"" "search"
+       "40\[ \t\]+comment \"A routine for foo2 to call.\"" "search"
 
 # See if `f' prints the right source file.
 gdb_test "f" ".*asmsrc2\[.\]s:8.*" "f in foo2"
@@ -219,7 +222,7 @@ gdb_test "s" "" "s 2"
 gdb_test "n" "" "n 2"
 
 # Now see if a capped `bt' is correct.
-gdb_test "bt 3" "\#0.*foo3.*asmsrc1\[.\]s:44.*\#1.*foo2.*asmsrc2\[.\]s:12.*\#2.*main.*asmsrc1\[.\]s:33.*" "bt 3 in foo3"
+gdb_test "bt 3" "\#0.*foo3.*asmsrc1\[.\]s:45.*\#1.*foo2.*asmsrc2\[.\]s:12.*\#2.*main.*asmsrc1\[.\]s:33.*" "bt 3 in foo3"
 
 # Try 'info source' from asmsrc1.s
 gdb_test "info source" \
@@ -277,7 +280,7 @@ gdb_test "next" "17\[ \t\]+gdbasm_leave" "next over foo3"
 
 # Try 'return' from foo2
 gdb_test "return" "\#0  main .*37\[ \t\]+gdbasm_exit0" "return from foo2" \
-       "Make selected stack frame return now\?.*" "y"
+       "Make (foo2|selected stack frame) return now\?.*" "y"
 
 # See if we can look at a global variable
 gdb_test "print globalvar" ".* = 11" "look at global variable"
index f14cd915921562d655925ff17be37381a61118ba..cba0e90ec2a09549ac726720f4620957dad217b7 100644 (file)
@@ -10,18 +10,18 @@ comment     "This file is not linked with crt0."
 comment        "Provide very simplistic equivalent."
        
        .global _start
-_start:
+gdbasm_declare _start
        gdbasm_startup
        gdbasm_call main
        gdbasm_exit0
-
+       gdbasm_end _start
 
 comment "main routine for assembly source debugging test"
 comment "This particular testcase uses macros in <arch>.inc to achieve"
 comment "machine independence."
 
        .global main
-main:
+gdbasm_declare main
        gdbasm_enter
 
 comment "Call a macro that consists of several lines of assembler code."
@@ -35,23 +35,27 @@ comment "Call a subroutine in another file."
 comment "All done."
 
        gdbasm_exit0
+       gdbasm_end main
 
 comment "A routine for foo2 to call."
 
        .global foo3
-foo3:
+gdbasm_declare foo3
        gdbasm_enter
        gdbasm_leave
+       gdbasm_end foo3
 
        .global exit
-exit:
+gdbasm_declare exit
        gdbasm_exit0
+       gdbasm_end exit
 
 comment "A static function"
 
-foostatic:
+gdbasm_declare foostatic
        gdbasm_enter
        gdbasm_leave
+       gdbasm_end foostatic
 
 comment "A global variable"
 
index 9d7713fad8453fd3323560fcd65f16ebc2babb03..4366536acbe59d3bba6faaf5c438f728b44357b1 100644 (file)
@@ -4,7 +4,7 @@
 comment "Second file in assembly source debugging testcase."
 
        .global foo2
-foo2:
+gdbasm_declare foo2
        gdbasm_enter
 
 comment "Call someplace else (several times)."
@@ -15,3 +15,4 @@ comment "Call someplace else (several times)."
 comment "All done, return."
 
        gdbasm_leave
+       gdbasm_end foo2
index 51493929765965c307e3529229c1764c1a8b1561..04f08ff9ccee7782a5fcb395bf18035928e586a5 100644 (file)
        .word \value
        .endm
 
+       comment "Declare a subroutine"
+       .macro gdbasm_declare name
+\name:
+       .endm
+
+       comment "End a subroutine"
+       .macro gdbasm_end name
+       .endm
+
 comment "arch.inc is responsible for defining the following macros:"
 comment "enter - subroutine prologue"
 comment "leave - subroutine epilogue"
@@ -23,6 +32,5 @@ comment "exit0 - exit (0)"
 
 comment "arch.inc may also override the default definitions of:"
 comment "datavar - define a data variable"
-
-comment "macros to label a subroutine may also eventually be needed"
-comment "i.e. .global foo\nfoo:\n"
+comment "declare - declare the start of a subroutine"
+comment "end - end a subroutine"
index b0ce7529ecb5dc55120feb258ca8e96a0100eeb6..16025770e35c3eeaf4d057975e14d1269f44caa0 100644 (file)
@@ -166,6 +166,11 @@ main (void)
 
   const volatile char              * const volatile vagary = &victor;
   const volatile unsigned char     * const volatile vendor = &vicar;
+  
+  /* various structs with const members */
+
+  struct crass { char * const ptr; } crass;
+  struct crisp { char * const *ptr; } crisp;
 
   /* misc. references */
   /*
index bb062ef5cb9f7987dd9715422612278a6857624c..897a025af0c5572c5695d0d734ba595fcbe90458 100644 (file)
@@ -278,6 +278,11 @@ proc do_constvar_tests {} {
     gdb_test "print *locust" " = 70"
     local_compiler_xfail_check
     gdb_test "ptype locust" "type = double \\* const"
+
+    local_compiler_xfail_check
+    gdb_test "ptype crass" "type = struct crass \{\[\r\n\]+\[\ \t\]+char \\* const ptr;\[\r\n\]+\}"
+    local_compiler_xfail_check
+    gdb_test "ptype crisp" "type = struct crisp \{\[\r\n\]+\[\ \t\]+char \\* const \\*ptr;\[\r\n\]+\}"
 }
 
 do_constvar_tests
index 078e41688aec5b34439d99b8a84a1f503300b933..3fc6f0d1f5f85cea9aef8576eac1d437814465f7 100644 (file)
@@ -636,9 +636,9 @@ gdb_test "show print address" "Printing of addresses is on." "show print address
 #test show print array
 gdb_test "show print array" "Prettyprinting of arrays is on." "show print array"
 #test show print asm-demangle
-gdb_test "show print asm-demangle" "Demangling of C\[+\]+ names in disassembly listings is on." "show print asm-demangle"
+gdb_test "show print asm-demangle" "Demangling of C\[+\]+/ObjC names in disassembly listings is on." "show print asm-demangle"
 #test show print demangle
-gdb_test "show print demangle" "Demangling of encoded C\[+\]+ names when displaying symbols is on." "show print demangle"
+gdb_test "show print demangle" "Demangling of encoded C\[+\]+/ObjC names when displaying symbols is on." "show print demangle"
 #test show print elements
 gdb_test "show print elements" "Limit on string chars or array elements to print is 200." "show print elements"
 #test show print object
index 4b3d2eebd813a42b38a9a97a0bba2ab4478a2cbd..50da6774373307a26f9d6570ca9024b6c2d1bb69 100644 (file)
@@ -390,9 +390,9 @@ gdb_test "help set print address" "Set printing of addresses\." "help set print
 # test help set print array
 gdb_test "help set print array" "Set prettyprinting of arrays\." "help set print array"
 # test help set print asm-demangle
-gdb_test "help set print asm-demangle" "Set demangling of C\[+\]+ names in disassembly listings\." "help set print asm-demangle"
+gdb_test "help set print asm-demangle" "Set demangling of C\[+\]+/ObjC names in disassembly listings\." "help set print asm-demangle"
 # test help set print demangle
-gdb_test "help set print demangle" "Set demangling of encoded C\[+\]+ names when displaying symbols\." "help set print demangle"
+gdb_test "help set print demangle" "Set demangling of encoded C\[+\]+/ObjC names when displaying symbols\." "help set print demangle"
 # test help set print elements
 gdb_test "help set print elements" "Set limit on string chars or array elements to print\.\[\r\n\]+\"set print elements 0\" causes there to be no limit\." "help set print elements"
 # test help set print object
@@ -482,9 +482,9 @@ gdb_test "help show print address" "Show printing of addresses\." "help show pri
 # test help show print array
 gdb_test "help show print array" "Show prettyprinting of arrays\." "help show print array"
 # test help show print asm-demangle
-gdb_test "help show print asm-demangle" "Show demangling of C\[+\]+ names in disassembly listings\." "help show print asm-demangle"
+gdb_test "help show print asm-demangle" "Show demangling of C\[+\]+/ObjC names in disassembly listings\." "help show print asm-demangle"
 # test help show print demangle
-gdb_test "help show print demangle" "Show demangling of encoded C\[+\]+ names when displaying symbols\." "help show print demangle"
+gdb_test "help show print demangle" "Show demangling of encoded C\[+\]+/ObjC names when displaying symbols\." "help show print demangle"
 # test help show print elements
 gdb_test "help show print elements" "Show limit on string chars or array elements to print\.\[\r\n\]+\"set print elements 0\" causes there to be no limit\." "help show print elements"
 # test help show print object
index df361d0e0a795c9ff0ed879697533e9f31f23f6d..033131c2a52d9662d687e1957701ef94c2e8b232 100644 (file)
@@ -7,7 +7,7 @@ void *thread_function(void *arg); /* Pointer to function executed by each thread
 
 #define NUM 5
 
-int args[NUM+1];
+unsigned int args[NUM+1];
 
 int main() {
     int res;
index e2bc95fe455bb97018e3ee3e4fc4f8aa9e309e90..c0fb2bed878372d68425833f54d9bfcef6d5be7f 100644 (file)
@@ -1,3 +1,25 @@
+2002-10-26  Stephane Carrez  <stcarrez@nerim.fr>
+
+       * tuiIO.c (tui_prep_terminal): Save the prompt registered in readline.
+       (tui_redisplay_readline): Use the last saved prompt.
+       (tui_rl_saved_prompt): New.
+
+2002-10-25  Stephane Carrez  <stcarrez@nerim.fr>
+
+       Fix PR gdb/787
+       * tuiWin.c (ACS_LRCORNER, ACS_LLCORNER, ACS_ULCORNER, ACS_URCORNER,
+       ACS_HLINE, ACS_VLINE): Define if they don't exist.
+
+2002-10-25  Stephane Carrez  <stcarrez@nerim.fr>
+
+       Fix PR gdb/478
+       * tuiIO.c (tui_initialize_io): Use setvbuf since this is portable.
+
+2002-10-02  Elena Zannoni  <ezannoni@redhat.com>
+
+       * tui-hooks.c (selected_frame_level_changed_hook): Use the one
+       exported from frame.h.
+
 2002-09-29  Elena Zannoni  <ezannoni@redhat.com>
 
        * tui.c (tui_show_source): Don't access current_source_symtab, use
index 3beca39c782dba4677fd8ecd1c4297960d9fb25d..e1aad9f03b34817a5727805eb2b48507f737e102 100644 (file)
@@ -69,7 +69,6 @@
 int tui_target_has_run = 0;
 
 static void (* tui_target_new_objfile_chain) (struct objfile*);
-extern void (*selected_frame_level_changed_hook) (int);
 static void tui_event_loop (void);
 static void tui_command_loop (void);
 
index f70df8f47487861998d24298c900207225c76f45..b9b373c6646f19f73b722d26b94c9e3e587a3ad8 100644 (file)
@@ -124,6 +124,10 @@ static FILE *tui_old_rl_outstream;
 static int tui_readline_pipe[2];
 #endif
 
+/* The last gdb prompt that was registered in readline.
+   This may be the main gdb prompt or a secondary prompt.  */
+static char *tui_rl_saved_prompt;
+
 static unsigned int _tuiHandleResizeDuringIO (unsigned int);
 
 static void
@@ -194,7 +198,7 @@ tui_redisplay_readline (void)
   if (tui_current_key_mode == tui_single_key_mode)
     prompt = "";
   else
-    prompt = get_prompt ();
+    prompt = tui_rl_saved_prompt;
   
   c_pos = -1;
   c_line = -1;
@@ -256,10 +260,15 @@ tui_redisplay_readline (void)
 }
 
 /* Readline callback to prepare the terminal.  It is called once
-   each time we enter readline.  There is nothing to do in curses mode.  */
+   each time we enter readline.  Terminal is already setup in curses mode.  */
 static void
 tui_prep_terminal (void)
 {
+  /* Save the prompt registered in readline to correctly display it.
+     (we can't use gdb_prompt() due to secondary prompts and can't use
+     rl_prompt because it points to an alloca buffer).  */
+  xfree (tui_rl_saved_prompt);
+  tui_rl_saved_prompt = xstrdup (rl_prompt);
 }
 
 /* Readline callback to restore the terminal.  It is called once
@@ -600,7 +609,7 @@ tui_initialize_io ()
       fprintf_unfiltered (gdb_stderr, "Cannot redirect readline output");
       exit (1);
     }
-  setlinebuf (tui_rl_outstream);
+  setvbuf (tui_rl_outstream, (char*) NULL, _IOLBF, 0);
 
 #ifdef O_NONBLOCK
   (void) fcntl (tui_readline_pipe[0], F_SETFL, O_NONBLOCK);
index 38283b59da1e55ad559d9ac2965d35e51318350d..484c60a620499551903a944312d159077cd00f46 100644 (file)
@@ -96,6 +96,25 @@ static void _parseScrollingArgs (char *, TuiWinInfoPtr *, int *);
 ** PUBLIC FUNCTIONS
 ***************************************/
 
+#ifndef ACS_LRCORNER
+#  define ACS_LRCORNER '+'
+#endif
+#ifndef ACS_LLCORNER
+#  define ACS_LLCORNER '+'
+#endif
+#ifndef ACS_ULCORNER
+#  define ACS_ULCORNER '+'
+#endif
+#ifndef ACS_URCORNER
+#  define ACS_URCORNER '+'
+#endif
+#ifndef ACS_HLINE
+#  define ACS_HLINE '-'
+#endif
+#ifndef ACS_VLINE
+#  define ACS_VLINE '|'
+#endif
+
 /* Possible values for tui-border-kind variable.  */
 static const char *tui_border_kind_enums[] = {
   "space",