From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6439 invoked by alias); 7 Jun 2003 02:41:52 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6432 invoked from network); 7 Jun 2003 02:41:51 -0000 Received: from unknown (199.72.38.5) by sources.redhat.com with QMTP; 7 Jun 2003 02:41:51 -0000 Received: (qmail 20228 invoked from network); 7 Jun 2003 02:43:04 -0000 Received: from cpe-24-221-209-215.co.sprintbbd.net (HELO doc.com) (24.221.209.215) by external1.doc.com with SMTP; 7 Jun 2003 02:43:04 -0000 Message-ID: <3EE150E9.2080003@doc.com> Date: Sat, 07 Jun 2003 02:41:00 -0000 From: Adam Fedor User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.1) Gecko/20020905 X-Accept-Language: en-us, en MIME-Version: 1.0 To: GDB Patches Subject: [RFA]: Fix objc/1236 - printing non-debuggable symbols Content-Type: multipart/mixed; boundary="------------050407000907070606060706" X-SW-Source: 2003-06/txt/msg00255.txt.bz2 This is a multi-part message in MIME format. --------------050407000907070606060706 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 20 Fixes PR objc/1236 --------------050407000907070606060706 Content-Type: text/plain; name="debugover.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="debugover.patch" Content-length: 3825 2003-06-06 Adam Fedor Fix objc/1236. * gdb/linespec.c (decode_line_2): Print non-debuggable (minimal) symbols. (decode_objc): Update for change in arguments to decode_line_2 (find_methods): Likewise. Index: linespec.c =================================================================== RCS file: /cvs/src/src/gdb/linespec.c,v retrieving revision 1.48 diff -u -p -r1.48 linespec.c --- linespec.c 3 Jun 2003 02:56:04 -0000 1.48 +++ linespec.c 7 Jun 2003 02:30:50 -0000 @@ -94,7 +94,7 @@ static void build_canonical_line_spec (s static char *find_toplevel_char (char *s, char c); static struct symtabs_and_lines decode_line_2 (struct symbol *[], - int, int, char ***); + int, int, int, char ***); static struct symtab *symtab_from_filename (char **argptr, char *p, int is_quote_enclosed); @@ -442,13 +442,19 @@ find_toplevel_char (char *s, char c) return 0; } -/* Given a list of NELTS symbols in SYM_ARR, return a list of lines to - operate on (ask user if necessary). - If CANONICAL is non-NULL return a corresponding array of mangled names - as canonical line specs there. */ +/* Given a list of NSYM symbols in SYM_ARR, return a list of lines to + operate on (ask user if necessary). After processing the first + NELTS symbols in sym_arr, continue processing entries until you + find a NULL entry -- but treat these entries as minimal_symbols + instead of full symbols. This allows us to add functions to the + list from non-debugging modules. So, sym_arr will now contain: + sym_arr[0..NELTS-1]: struct symbol * sym_arr[NELTS..]: struct minimal_symbol. If CANONICAL is non-NULL return a + corresponding array of mangled names as canonical line specs + there. */ static struct symtabs_and_lines -decode_line_2 (struct symbol *sym_arr[], int nelts, int funfirstline, +decode_line_2 (struct symbol *sym_arr[], int nelts, int nsym, int funfirstline, char ***canonical) { struct symtabs_and_lines values, return_values; @@ -475,7 +481,7 @@ decode_line_2 (struct symbol *sym_arr[], i = 0; printf_unfiltered ("[0] cancel\n[1] all\n"); - while (i < nelts) + for (i = 0; i < nsym; i++) { init_sal (&return_values.sals[i]); /* Initialize to zeroes. */ init_sal (&values.sals[i]); @@ -489,10 +495,28 @@ decode_line_2 (struct symbol *sym_arr[], values.sals[i].line); } else - printf_unfiltered ("?HERE\n"); - i++; + printf_filtered ("[%d] %s\n", + (i + 2), + SYMBOL_PRINT_NAME (sym_arr[i]) ? + SYMBOL_PRINT_NAME (sym_arr[i]) : "?HERE?"); } - + + if (nelts != nsym) + printf_filtered ("\nNon-debugging symbols:\n"); + + /* handle minimal_symbols */ + for (i = nsym; i < nelts; i++) + { + /* assert (sym_arr[i] != NULL); */ + values.sals[i].symtab = 0; + values.sals[i].line = 0; + values.sals[i].end = 0; + values.sals[i].pc = SYMBOL_VALUE_ADDRESS (sym_arr[i]); + printf_filtered ("[%d] %s\n", + (i + 2), + SYMBOL_PRINT_NAME (sym_arr[i])); + } + prompt = getenv ("PS2"); if (prompt == NULL) { @@ -1095,7 +1119,7 @@ decode_objc (char **argptr, int funfirst if (i1 > 1) { /* More than one match. The user must choose one or more. */ - return decode_line_2 (sym_arr, i2, funfirstline, canonical); + return decode_line_2 (sym_arr, i1, i2, funfirstline, canonical); } return values; @@ -1335,7 +1359,7 @@ find_method (int funfirstline, char ***c { /* There is more than one field with that name (overloaded). Ask the user which one to use. */ - return decode_line_2 (sym_arr, i1, funfirstline, canonical); + return decode_line_2 (sym_arr, i1, i1, funfirstline, canonical); } else { --------------050407000907070606060706--