1 http://sourceware.org/ml/binutils-cvs/2011-07/msg00116.html
3 ### src/include/ChangeLog 2011/07/22 14:37:50 1.546
4 ### src/include/ChangeLog 2011/07/22 20:37:50 1.547
6 2011-07-22 Jakub Jelinek <jakub@redhat.com>
8 + * dwarf2.h (DW_AT_GNU_macros): New.
9 + (enum dwarf_macro_record_type): New enum. Add DW_MACRO_GNU_*.
12 * libiberty.h (stack_limit_increase): New prototype.
14 --- src/include/dwarf2.h 2011/06/22 15:03:19 1.26
15 +++ src/include/dwarf2.h 2011/07/22 20:37:50 1.27
17 DW_AT_GNU_all_tail_call_sites = 0x2116,
18 DW_AT_GNU_all_call_sites = 0x2117,
19 DW_AT_GNU_all_source_call_sites = 0x2118,
20 + /* Section offset into .debug_macro section. */
21 + DW_AT_GNU_macros = 0x2119,
23 DW_AT_VMS_rtnbeg_pd_address = 0x2201,
24 /* GNAT extensions. */
26 DW_MACINFO_end_file = 4,
27 DW_MACINFO_vendor_ext = 255
30 +/* Names and codes for new style macro information. */
31 +enum dwarf_macro_record_type
33 + DW_MACRO_GNU_define = 1,
34 + DW_MACRO_GNU_undef = 2,
35 + DW_MACRO_GNU_start_file = 3,
36 + DW_MACRO_GNU_end_file = 4,
37 + DW_MACRO_GNU_define_indirect = 5,
38 + DW_MACRO_GNU_undef_indirect = 6,
39 + DW_MACRO_GNU_transparent_include = 7,
40 + DW_MACRO_GNU_lo_user = 0xe0,
41 + DW_MACRO_GNU_hi_user = 0xff
44 /* @@@ For use with GNU frame unwind information. */
49 FYI: implement new DWARF macro proposal
50 http://sourceware.org/ml/gdb-patches/2011-07/msg00732.html
51 http://sourceware.org/ml/gdb-cvs/2011-07/msg00212.html
53 ### src/gdb/ChangeLog 2011/07/26 15:24:01 1.13224
54 ### src/gdb/ChangeLog 2011/07/26 17:04:21 1.13225
56 +2011-07-26 Tom Tromey <tromey@redhat.com>
58 + * symfile.h (struct dwarf2_debug_sections) <macro>: New field.
59 + * dwarf2read.c (read_indirect_string_at_offset): New function.
60 + (read_indirect_string): Use it.
61 + (dwarf_decode_macro_bytes): New function, taken from
62 + dwarf_decode_macros. Handle DW_MACRO_GNU_*.
63 + (dwarf_decode_macros): Use it. handle DW_MACRO_GNU_*.
64 + (dwarf_parse_macro_header, skip_form_bytes, skip_unknown_opcode):
66 + (struct dwarf2_per_objfile) <macro>: New field.
67 + (dwarf2_elf_names): Add .debug_macro.
68 + (dwarf2_macros_too_long_complaint): Add 'section' argument.
69 + (dwarf2_locate_sections): Handle new section.
70 + (read_file_scope): Handle DW_AT_GNU_macros.
71 + (dwarf2_per_objfile_free): Unmap the .debug_macro section.
73 2011-07-26 Paul Pluzhnikov <ppluzhnikov@google.com>
75 * NEWS: Mention dcache configuration.
76 --- src/gdb/dwarf2read.c 2011/07/20 15:13:49 1.554
77 +++ src/gdb/dwarf2read.c 2011/07/26 17:04:23 1.555
79 struct dwarf2_section_info line;
80 struct dwarf2_section_info loc;
81 struct dwarf2_section_info macinfo;
82 + struct dwarf2_section_info macro;
83 struct dwarf2_section_info str;
84 struct dwarf2_section_info ranges;
85 struct dwarf2_section_info frame;
87 { ".debug_line", ".zdebug_line" },
88 { ".debug_loc", ".zdebug_loc" },
89 { ".debug_macinfo", ".zdebug_macinfo" },
90 + { ".debug_macro", ".zdebug_macro" },
91 { ".debug_str", ".zdebug_str" },
92 { ".debug_ranges", ".zdebug_ranges" },
93 { ".debug_types", ".zdebug_types" },
98 -dwarf2_macros_too_long_complaint (void)
99 +dwarf2_macros_too_long_complaint (struct dwarf2_section_info *section)
101 complaint (&symfile_complaints,
102 - _("macro info runs off end of `.debug_macinfo' section"));
103 + _("macro info runs off end of `%s' section"),
104 + section->asection->name);
108 @@ -1233,7 +1236,9 @@
111 static void dwarf_decode_macros (struct line_header *, unsigned int,
112 - char *, bfd *, struct dwarf2_cu *);
113 + char *, bfd *, struct dwarf2_cu *,
114 + struct dwarf2_section_info *,
117 static int attr_form_is_block (struct attribute *);
119 @@ -1438,6 +1443,11 @@
120 dwarf2_per_objfile->macinfo.asection = sectp;
121 dwarf2_per_objfile->macinfo.size = bfd_get_section_size (sectp);
123 + else if (section_is_p (sectp->name, &names->macro))
125 + dwarf2_per_objfile->macro.asection = sectp;
126 + dwarf2_per_objfile->macro.size = bfd_get_section_size (sectp);
128 else if (section_is_p (sectp->name, &names->str))
130 dwarf2_per_objfile->str.asection = sectp;
131 @@ -5641,13 +5651,28 @@
132 refers to information in the line number info statement program
133 header, so we can only read it if we've read the header
135 - attr = dwarf2_attr (die, DW_AT_macro_info, cu);
136 + attr = dwarf2_attr (die, DW_AT_GNU_macros, cu);
137 if (attr && cu->line_header)
139 - unsigned int macro_offset = DW_UNSND (attr);
140 + if (dwarf2_attr (die, DW_AT_macro_info, cu))
141 + complaint (&symfile_complaints,
142 + _("CU refers to both DW_AT_GNU_macros and DW_AT_macro_info"));
144 + dwarf_decode_macros (cu->line_header, DW_UNSND (attr),
145 + comp_dir, abfd, cu,
146 + &dwarf2_per_objfile->macro, 1);
150 + attr = dwarf2_attr (die, DW_AT_macro_info, cu);
151 + if (attr && cu->line_header)
153 + unsigned int macro_offset = DW_UNSND (attr);
155 - dwarf_decode_macros (cu->line_header, macro_offset,
156 - comp_dir, abfd, cu);
157 + dwarf_decode_macros (cu->line_header, macro_offset,
158 + comp_dir, abfd, cu,
159 + &dwarf2_per_objfile->macinfo, 0);
162 do_cleanups (back_to);
164 @@ -10262,32 +10287,32 @@
168 -read_indirect_string (bfd *abfd, gdb_byte *buf,
169 - const struct comp_unit_head *cu_header,
170 - unsigned int *bytes_read_ptr)
171 +read_indirect_string_at_offset (bfd *abfd, LONGEST str_offset)
173 - LONGEST str_offset = read_offset (abfd, buf, cu_header, bytes_read_ptr);
175 dwarf2_read_section (dwarf2_per_objfile->objfile, &dwarf2_per_objfile->str);
176 if (dwarf2_per_objfile->str.buffer == NULL)
178 - error (_("DW_FORM_strp used without .debug_str section [in module %s]"),
179 - bfd_get_filename (abfd));
182 + error (_("DW_FORM_strp used without .debug_str section [in module %s]"),
183 + bfd_get_filename (abfd));
184 if (str_offset >= dwarf2_per_objfile->str.size)
186 - error (_("DW_FORM_strp pointing outside of "
187 - ".debug_str section [in module %s]"),
188 - bfd_get_filename (abfd));
191 + error (_("DW_FORM_strp pointing outside of "
192 + ".debug_str section [in module %s]"),
193 + bfd_get_filename (abfd));
194 gdb_assert (HOST_CHAR_BIT == 8);
195 if (dwarf2_per_objfile->str.buffer[str_offset] == '\0')
197 return (char *) (dwarf2_per_objfile->str.buffer + str_offset);
201 +read_indirect_string (bfd *abfd, gdb_byte *buf,
202 + const struct comp_unit_head *cu_header,
203 + unsigned int *bytes_read_ptr)
205 + LONGEST str_offset = read_offset (abfd, buf, cu_header, bytes_read_ptr);
207 + return read_indirect_string_at_offset (abfd, str_offset);
211 read_unsigned_leb128 (bfd *abfd, gdb_byte *buf, unsigned int *bytes_read_ptr)
213 @@ -14669,117 +14694,205 @@
214 dwarf2_macro_malformed_definition_complaint (body);
217 +/* Skip some bytes from BYTES according to the form given in FORM.
218 + Returns the new pointer. */
221 -dwarf_decode_macros (struct line_header *lh, unsigned int offset,
222 - char *comp_dir, bfd *abfd,
223 - struct dwarf2_cu *cu)
225 +skip_form_bytes (bfd *abfd, gdb_byte *bytes,
226 + enum dwarf_form form,
227 + unsigned int offset_size,
228 + struct dwarf2_section_info *section)
230 - gdb_byte *mac_ptr, *mac_end;
231 - struct macro_source_file *current_file = 0;
232 - enum dwarf_macinfo_record_type macinfo_type;
233 - int at_commandline;
234 + unsigned int bytes_read;
236 - dwarf2_read_section (dwarf2_per_objfile->objfile,
237 - &dwarf2_per_objfile->macinfo);
238 - if (dwarf2_per_objfile->macinfo.buffer == NULL)
241 - complaint (&symfile_complaints, _("missing .debug_macinfo section"));
243 + case DW_FORM_data1:
248 + case DW_FORM_data2:
252 + case DW_FORM_data4:
256 + case DW_FORM_data8:
260 + case DW_FORM_string:
261 + read_direct_string (abfd, bytes, &bytes_read);
262 + bytes += bytes_read;
265 + case DW_FORM_sec_offset:
267 + bytes += offset_size;
270 + case DW_FORM_block:
271 + bytes += read_unsigned_leb128 (abfd, bytes, &bytes_read);
272 + bytes += bytes_read;
275 + case DW_FORM_block1:
276 + bytes += 1 + read_1_byte (abfd, bytes);
278 + case DW_FORM_block2:
279 + bytes += 2 + read_2_bytes (abfd, bytes);
281 + case DW_FORM_block4:
282 + bytes += 4 + read_4_bytes (abfd, bytes);
285 + case DW_FORM_sdata:
286 + case DW_FORM_udata:
287 + bytes = skip_leb128 (abfd, bytes);
293 + complaint (&symfile_complaints,
294 + _("invalid form 0x%x in `%s'"),
296 + section->asection->name);
301 - /* First pass: Find the name of the base filename.
302 - This filename is needed in order to process all macros whose definition
303 - (or undefinition) comes from the command line. These macros are defined
304 - before the first DW_MACINFO_start_file entry, and yet still need to be
305 - associated to the base file.
309 - To determine the base file name, we scan the macro definitions until we
310 - reach the first DW_MACINFO_start_file entry. We then initialize
311 - CURRENT_FILE accordingly so that any macro definition found before the
312 - first DW_MACINFO_start_file can still be associated to the base file. */
313 +/* A helper for dwarf_decode_macros that handles skipping an unknown
314 + opcode. Returns an updated pointer to the macro data buffer; or,
315 + on error, issues a complaint and returns NULL. */
317 - mac_ptr = dwarf2_per_objfile->macinfo.buffer + offset;
318 - mac_end = dwarf2_per_objfile->macinfo.buffer
319 - + dwarf2_per_objfile->macinfo.size;
321 +skip_unknown_opcode (unsigned int opcode,
322 + gdb_byte **opcode_definitions,
325 + unsigned int offset_size,
326 + struct dwarf2_section_info *section)
328 + unsigned int bytes_read, i;
333 + if (opcode_definitions[opcode] == NULL)
335 - /* Do we at least have room for a macinfo type byte? */
336 - if (mac_ptr >= mac_end)
338 - /* Complaint is printed during the second pass as GDB will probably
339 - stop the first pass earlier upon finding
340 - DW_MACINFO_start_file. */
343 + complaint (&symfile_complaints,
344 + _("unrecognized DW_MACFINO opcode 0x%x"),
349 - macinfo_type = read_1_byte (abfd, mac_ptr);
351 + defn = opcode_definitions[opcode];
352 + arg = read_unsigned_leb128 (abfd, defn, &bytes_read);
353 + defn += bytes_read;
355 - switch (macinfo_type)
357 - /* A zero macinfo type indicates the end of the macro
361 + for (i = 0; i < arg; ++i)
363 + mac_ptr = skip_form_bytes (abfd, mac_ptr, defn[i], offset_size, section);
364 + if (mac_ptr == NULL)
366 + /* skip_form_bytes already issued the complaint. */
371 - case DW_MACINFO_define:
372 - case DW_MACINFO_undef:
373 - /* Only skip the data by MAC_PTR. */
375 - unsigned int bytes_read;
379 - read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
380 - mac_ptr += bytes_read;
381 - read_direct_string (abfd, mac_ptr, &bytes_read);
382 - mac_ptr += bytes_read;
385 +/* A helper function which parses the header of a macro section.
386 + If the macro section is the extended (for now called "GNU") type,
387 + then this updates *OFFSET_SIZE. Returns a pointer to just after
388 + the header, or issues a complaint and returns NULL on error. */
390 - case DW_MACINFO_start_file:
392 - unsigned int bytes_read;
395 +dwarf_parse_macro_header (gdb_byte **opcode_definitions,
398 + unsigned int *offset_size,
399 + int section_is_gnu)
401 + memset (opcode_definitions, 0, 256 * sizeof (gdb_byte *));
403 - line = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
404 - mac_ptr += bytes_read;
405 - file = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
406 - mac_ptr += bytes_read;
407 + if (section_is_gnu)
409 + unsigned int version, flags;
411 - current_file = macro_start_file (file, line, current_file,
412 - comp_dir, lh, cu->objfile);
415 + version = read_2_bytes (abfd, mac_ptr);
418 + complaint (&symfile_complaints,
419 + _("unrecognized version `%d' in .debug_macro section"),
425 - case DW_MACINFO_end_file:
426 - /* No data to skip by MAC_PTR. */
428 + flags = read_1_byte (abfd, mac_ptr);
430 + *offset_size = (flags & 1) ? 8 : 4;
432 - case DW_MACINFO_vendor_ext:
433 - /* Only skip the data by MAC_PTR. */
435 - unsigned int bytes_read;
436 + if ((flags & 2) != 0)
437 + /* We don't need the line table offset. */
438 + mac_ptr += *offset_size;
440 - read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
441 - mac_ptr += bytes_read;
442 - read_direct_string (abfd, mac_ptr, &bytes_read);
443 - mac_ptr += bytes_read;
446 + /* Vendor opcode descriptions. */
447 + if ((flags & 4) != 0)
449 + unsigned int i, count;
453 + count = read_1_byte (abfd, mac_ptr);
455 + for (i = 0; i < count; ++i)
457 + unsigned int opcode, bytes_read;
460 + opcode = read_1_byte (abfd, mac_ptr);
462 + opcode_definitions[opcode] = mac_ptr;
463 + arg = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
464 + mac_ptr += bytes_read;
468 - } while (macinfo_type != 0 && current_file == NULL);
471 - /* Second pass: Process all entries.
475 - Use the AT_COMMAND_LINE flag to determine whether we are still processing
476 - command-line macro definitions/undefinitions. This flag is unset when we
477 - reach the first DW_MACINFO_start_file entry. */
478 +/* A helper for dwarf_decode_macros that handles the GNU extensions,
479 + including DW_GNU_MACINFO_transparent_include. */
482 +dwarf_decode_macro_bytes (bfd *abfd, gdb_byte *mac_ptr, gdb_byte *mac_end,
483 + struct macro_source_file *current_file,
484 + struct line_header *lh, char *comp_dir,
485 + struct dwarf2_section_info *section,
486 + int section_is_gnu,
487 + unsigned int offset_size,
488 + struct objfile *objfile)
490 + enum dwarf_macro_record_type macinfo_type;
491 + int at_commandline;
492 + gdb_byte *opcode_definitions[256];
494 - mac_ptr = dwarf2_per_objfile->macinfo.buffer + offset;
495 + mac_ptr = dwarf_parse_macro_header (opcode_definitions, abfd, mac_ptr,
496 + &offset_size, section_is_gnu);
497 + if (mac_ptr == NULL)
499 + /* We already issued a complaint. */
503 /* Determines if GDB is still before first DW_MACINFO_start_file. If true
504 GDB is still reading the definitions from command line. First
505 @@ -14795,13 +14908,15 @@
506 /* Do we at least have room for a macinfo type byte? */
507 if (mac_ptr >= mac_end)
509 - dwarf2_macros_too_long_complaint ();
510 + dwarf2_macros_too_long_complaint (section);
514 macinfo_type = read_1_byte (abfd, mac_ptr);
517 + /* Note that we rely on the fact that the corresponding GNU and
518 + DWARF constants are the same. */
519 switch (macinfo_type)
521 /* A zero macinfo type indicates the end of the macro
522 @@ -14809,29 +14924,45 @@
526 - case DW_MACINFO_define:
527 - case DW_MACINFO_undef:
528 + case DW_MACRO_GNU_define:
529 + case DW_MACRO_GNU_undef:
530 + case DW_MACRO_GNU_define_indirect:
531 + case DW_MACRO_GNU_undef_indirect:
533 unsigned int bytes_read;
538 - line = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
539 - mac_ptr += bytes_read;
540 - body = read_direct_string (abfd, mac_ptr, &bytes_read);
541 - mac_ptr += bytes_read;
542 + line = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
543 + mac_ptr += bytes_read;
545 + if (macinfo_type == DW_MACRO_GNU_define
546 + || macinfo_type == DW_MACRO_GNU_undef)
548 + body = read_direct_string (abfd, mac_ptr, &bytes_read);
549 + mac_ptr += bytes_read;
553 + LONGEST str_offset;
555 + str_offset = read_offset_1 (abfd, mac_ptr, offset_size);
556 + mac_ptr += offset_size;
558 + body = read_indirect_string_at_offset (abfd, str_offset);
561 + is_define = (macinfo_type == DW_MACRO_GNU_define
562 + || macinfo_type == DW_MACRO_GNU_define_indirect);
565 /* DWARF violation as no main source is present. */
566 complaint (&symfile_complaints,
567 _("debug info with no main source gives macro %s "
569 - macinfo_type == DW_MACINFO_define ?
571 - macinfo_type == DW_MACINFO_undef ?
572 - _("undefinition") :
573 - _("something-or-other"), line, body);
574 + is_define ? _("definition") : _("undefinition"),
578 if ((line == 0 && !at_commandline)
579 @@ -14839,21 +14970,21 @@
580 complaint (&symfile_complaints,
581 _("debug info gives %s macro %s with %s line %d: %s"),
582 at_commandline ? _("command-line") : _("in-file"),
583 - macinfo_type == DW_MACINFO_define ?
585 - macinfo_type == DW_MACINFO_undef ?
586 - _("undefinition") :
587 - _("something-or-other"),
588 + is_define ? _("definition") : _("undefinition"),
589 line == 0 ? _("zero") : _("non-zero"), line, body);
591 - if (macinfo_type == DW_MACINFO_define)
593 parse_macro_definition (current_file, line, body);
594 - else if (macinfo_type == DW_MACINFO_undef)
595 - macro_undef (current_file, line, body);
598 + gdb_assert (macinfo_type == DW_MACRO_GNU_undef
599 + || macinfo_type == DW_MACRO_GNU_undef_indirect);
600 + macro_undef (current_file, line, body);
605 - case DW_MACINFO_start_file:
606 + case DW_MACRO_GNU_start_file:
608 unsigned int bytes_read;
610 @@ -14873,17 +15004,18 @@
614 - /* This DW_MACINFO_start_file was executed in the pass one. */
615 + /* This DW_MACRO_GNU_start_file was executed in the
620 current_file = macro_start_file (file, line,
621 current_file, comp_dir,
627 - case DW_MACINFO_end_file:
628 + case DW_MACRO_GNU_end_file:
630 complaint (&symfile_complaints,
631 _("macro debug info has an unmatched "
632 @@ -14893,7 +15025,7 @@
633 current_file = current_file->included_by;
636 - enum dwarf_macinfo_record_type next_type;
637 + enum dwarf_macro_record_type next_type;
639 /* GCC circa March 2002 doesn't produce the zero
640 type byte marking the end of the compilation
641 @@ -14903,7 +15035,7 @@
642 /* Do we at least have room for a macinfo type byte? */
643 if (mac_ptr >= mac_end)
645 - dwarf2_macros_too_long_complaint ();
646 + dwarf2_macros_too_long_complaint (section);
650 @@ -14920,23 +15052,199 @@
654 + case DW_MACRO_GNU_transparent_include:
658 + offset = read_offset_1 (abfd, mac_ptr, offset_size);
659 + mac_ptr += offset_size;
661 + dwarf_decode_macro_bytes (abfd,
662 + section->buffer + offset,
663 + mac_end, current_file,
665 + section, section_is_gnu,
666 + offset_size, objfile);
670 case DW_MACINFO_vendor_ext:
672 - unsigned int bytes_read;
674 + if (!section_is_gnu)
676 + unsigned int bytes_read;
679 - constant = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
680 - mac_ptr += bytes_read;
681 - read_direct_string (abfd, mac_ptr, &bytes_read);
682 - mac_ptr += bytes_read;
683 + constant = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
684 + mac_ptr += bytes_read;
685 + read_direct_string (abfd, mac_ptr, &bytes_read);
686 + mac_ptr += bytes_read;
688 - /* We don't recognize any vendor extensions. */
691 + /* We don't recognize any vendor extensions. */
697 + mac_ptr = skip_unknown_opcode (macinfo_type, opcode_definitions,
698 + mac_ptr, abfd, offset_size,
700 + if (mac_ptr == NULL)
704 } while (macinfo_type != 0);
708 +dwarf_decode_macros (struct line_header *lh, unsigned int offset,
709 + char *comp_dir, bfd *abfd,
710 + struct dwarf2_cu *cu,
711 + struct dwarf2_section_info *section,
712 + int section_is_gnu)
714 + gdb_byte *mac_ptr, *mac_end;
715 + struct macro_source_file *current_file = 0;
716 + enum dwarf_macro_record_type macinfo_type;
717 + unsigned int offset_size = cu->header.offset_size;
718 + gdb_byte *opcode_definitions[256];
720 + dwarf2_read_section (dwarf2_per_objfile->objfile, section);
721 + if (section->buffer == NULL)
723 + complaint (&symfile_complaints, _("missing %s section"),
724 + section->asection->name);
728 + /* First pass: Find the name of the base filename.
729 + This filename is needed in order to process all macros whose definition
730 + (or undefinition) comes from the command line. These macros are defined
731 + before the first DW_MACINFO_start_file entry, and yet still need to be
732 + associated to the base file.
734 + To determine the base file name, we scan the macro definitions until we
735 + reach the first DW_MACINFO_start_file entry. We then initialize
736 + CURRENT_FILE accordingly so that any macro definition found before the
737 + first DW_MACINFO_start_file can still be associated to the base file. */
739 + mac_ptr = section->buffer + offset;
740 + mac_end = section->buffer + section->size;
742 + mac_ptr = dwarf_parse_macro_header (opcode_definitions, abfd, mac_ptr,
743 + &offset_size, section_is_gnu);
744 + if (mac_ptr == NULL)
746 + /* We already issued a complaint. */
752 + /* Do we at least have room for a macinfo type byte? */
753 + if (mac_ptr >= mac_end)
755 + /* Complaint is printed during the second pass as GDB will probably
756 + stop the first pass earlier upon finding
757 + DW_MACINFO_start_file. */
761 + macinfo_type = read_1_byte (abfd, mac_ptr);
764 + /* Note that we rely on the fact that the corresponding GNU and
765 + DWARF constants are the same. */
766 + switch (macinfo_type)
768 + /* A zero macinfo type indicates the end of the macro
773 + case DW_MACRO_GNU_define:
774 + case DW_MACRO_GNU_undef:
775 + /* Only skip the data by MAC_PTR. */
777 + unsigned int bytes_read;
779 + read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
780 + mac_ptr += bytes_read;
781 + read_direct_string (abfd, mac_ptr, &bytes_read);
782 + mac_ptr += bytes_read;
786 + case DW_MACRO_GNU_start_file:
788 + unsigned int bytes_read;
791 + line = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
792 + mac_ptr += bytes_read;
793 + file = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
794 + mac_ptr += bytes_read;
796 + current_file = macro_start_file (file, line, current_file,
797 + comp_dir, lh, cu->objfile);
801 + case DW_MACRO_GNU_end_file:
802 + /* No data to skip by MAC_PTR. */
805 + case DW_MACRO_GNU_define_indirect:
806 + case DW_MACRO_GNU_undef_indirect:
808 + unsigned int bytes_read;
810 + read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
811 + mac_ptr += bytes_read;
812 + mac_ptr += offset_size;
816 + case DW_MACRO_GNU_transparent_include:
817 + /* Note that, according to the spec, a transparent include
818 + chain cannot call DW_MACRO_GNU_start_file. So, we can just
819 + skip this opcode. */
820 + mac_ptr += offset_size;
823 + case DW_MACINFO_vendor_ext:
824 + /* Only skip the data by MAC_PTR. */
825 + if (!section_is_gnu)
827 + unsigned int bytes_read;
829 + read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
830 + mac_ptr += bytes_read;
831 + read_direct_string (abfd, mac_ptr, &bytes_read);
832 + mac_ptr += bytes_read;
837 + mac_ptr = skip_unknown_opcode (macinfo_type, opcode_definitions,
838 + mac_ptr, abfd, offset_size,
840 + if (mac_ptr == NULL)
844 + } while (macinfo_type != 0 && current_file == NULL);
846 + /* Second pass: Process all entries.
848 + Use the AT_COMMAND_LINE flag to determine whether we are still processing
849 + command-line macro definitions/undefinitions. This flag is unset when we
850 + reach the first DW_MACINFO_start_file entry. */
852 + dwarf_decode_macro_bytes (abfd, section->buffer + offset, mac_end,
853 + current_file, lh, comp_dir, section, section_is_gnu,
854 + offset_size, cu->objfile);
857 /* Check if the attribute's form is a DW_FORM_block*
858 if so return true else false. */
860 @@ -15663,6 +15971,7 @@
861 munmap_section_buffer (&data->line);
862 munmap_section_buffer (&data->loc);
863 munmap_section_buffer (&data->macinfo);
864 + munmap_section_buffer (&data->macro);
865 munmap_section_buffer (&data->str);
866 munmap_section_buffer (&data->ranges);
867 munmap_section_buffer (&data->frame);
868 --- src/gdb/symfile.h 2011/06/10 21:48:04 1.93
869 +++ src/gdb/symfile.h 2011/07/26 17:04:23 1.94
871 struct dwarf2_section_names line;
872 struct dwarf2_section_names loc;
873 struct dwarf2_section_names macinfo;
874 + struct dwarf2_section_names macro;
875 struct dwarf2_section_names str;
876 struct dwarf2_section_names ranges;
877 struct dwarf2_section_names types;
881 Re: FYI: implement new DWARF macro proposal
882 http://sourceware.org/ml/gdb-patches/2011-07/msg00759.html
883 http://sourceware.org/ml/gdb-cvs/2011-07/msg00224.html
885 ### src/gdb/ChangeLog 2011/07/26 21:09:05 1.13229
886 ### src/gdb/ChangeLog 2011/07/27 14:45:36 1.13230
888 +2011-07-27 Tom Tromey <tromey@redhat.com>
890 + * xcoffread.c (dwarf2_xcoff_names): Add 'macro' and 'sentinel'
892 + * symfile.h (struct dwarf2_debug_sections) <sentinel>: New field.
893 + * dwarf2read.c (dwarf2_elf_names): Add sentinel entry.
895 2011-07-26 Sterling Augustine <saugustine@google.com>
897 * cli/cli-dump.c (dump_binary_file): Change parameter type to
898 --- src/gdb/dwarf2read.c 2011/07/26 17:04:23 1.555
899 +++ src/gdb/dwarf2read.c 2011/07/27 14:45:37 1.556
901 { ".debug_types", ".zdebug_types" },
902 { ".debug_frame", ".zdebug_frame" },
903 { ".eh_frame", NULL },
904 - { ".gdb_index", ".zgdb_index" }
905 + { ".gdb_index", ".zgdb_index" },
909 /* local data types */
910 --- src/gdb/symfile.h 2011/07/26 17:04:23 1.94
911 +++ src/gdb/symfile.h 2011/07/27 14:45:37 1.95
913 struct dwarf2_section_names frame;
914 struct dwarf2_section_names eh_frame;
915 struct dwarf2_section_names gdb_index;
916 + /* This field has no meaning, but exists solely to catch changes to
917 + this structure which are not reflected in some instance. */
921 extern int dwarf2_has_info (struct objfile *,
922 --- src/gdb/xcoffread.c 2011/06/07 12:31:07 1.89
923 +++ src/gdb/xcoffread.c 2011/07/27 14:45:37 1.90
924 @@ -160,12 +160,14 @@
927 { NULL, NULL }, /* debug_macinfo */
928 + { NULL, NULL }, /* debug_macro */
930 { ".dwrnges", NULL },
931 { NULL, NULL }, /* debug_types */
932 { ".dwframe", NULL },
933 { NULL, NULL }, /* eh_frame */
934 - { NULL, NULL } /* gdb_index */
935 + { NULL, NULL }, /* gdb_index */
943 [patch][python] Fix sigsegv when a printer fails to return a value and string_print is set.
944 http://sourceware.org/ml/gdb-patches/2011-07/msg00719.html
945 http://sourceware.org/ml/gdb-cvs/2011-07/msg00234.html
947 ### src/gdb/ChangeLog 2011/07/27 19:31:30 1.13236
948 ### src/gdb/ChangeLog 2011/07/28 10:36:37 1.13237
950 +2011-07-28 Phil Muldoon <pmuldoon@redhat.com>
952 + * varobj.c (value_get_print_value): Move hint check later into the
953 + function. Comment function. Free thevalue before reusing it.
955 2011-07-27 Jan Kratochvil <jan.kratochvil@redhat.com>
956 Pedro Alves <pedro@codesourcery.com>
958 --- src/gdb/varobj.c 2011/07/18 09:21:43 1.180
959 +++ src/gdb/varobj.c 2011/07/28 10:36:40 1.181
960 @@ -2610,25 +2610,21 @@
962 if (PyObject_HasAttr (value_formatter, gdbpy_to_string_cst))
965 struct value *replacement;
966 PyObject *output = NULL;
968 - hint = gdbpy_get_display_hint (value_formatter);
971 - if (!strcmp (hint, "string"))
976 output = apply_varobj_pretty_printer (value_formatter,
980 + /* If we have string like output ... */
983 make_cleanup_py_decref (output);
985 + /* If this is a lazy string, extract it. For lazy
986 + strings we always print as a string, so set
988 if (gdbpy_is_lazy_string (output))
990 gdbpy_extract_lazy_string (output, &str_addr, &type,
991 @@ -2638,12 +2634,27 @@
995 + /* If it is a regular (non-lazy) string, extract
996 + it and copy the contents into THEVALUE. If the
997 + hint says to print it as a string, set
998 + string_print. Otherwise just return the extracted
999 + string as a value. */
1002 = python_string_to_target_python_string (output);
1006 char *s = PyString_AsString (py_str);
1009 + hint = gdbpy_get_display_hint (value_formatter);
1012 + if (!strcmp (hint, "string"))
1017 len = PyString_Size (py_str);
1018 thevalue = xmemdup (s, len + 1, len + 1);
1019 @@ -2662,6 +2673,9 @@
1020 gdbpy_print_stack ();
1023 + /* If the printer returned a replacement value, set VALUE
1024 + to REPLACEMENT. If there is not a replacement value,
1025 + just use the value passed to this function. */
1027 value = replacement;
1029 @@ -2672,12 +2686,18 @@
1030 get_formatted_print_options (&opts, format_code[(int) format]);
1034 + /* If the THEVALUE has contents, it is a regular string. */
1036 LA_PRINT_STRING (stb, type, thevalue, len, encoding, 0, &opts);
1037 else if (string_print)
1038 + /* Otherwise, if string_print is set, and it is not a regular
1039 + string, it is a lazy string. */
1040 val_print_string (type, encoding, str_addr, len, stb, &opts);
1042 + /* All other cases. */
1043 common_val_print (value, stb, 0, &opts, current_language);
1045 thevalue = ui_file_xstrdup (stb, NULL);
1047 do_cleanups (old_chain);
1048 ### src/gdb/testsuite/ChangeLog 2011/07/27 21:18:39 1.2816
1049 ### src/gdb/testsuite/ChangeLog 2011/07/28 10:36:40 1.2817
1051 +2011-07-28 Phil Muldoon <pmuldoon@redhat.com>
1053 + * gdb.python/py-mi.exp: Test printers returning string hint, and
1054 + also not returning a value.
1055 + * gdb.python/py-prettyprint.c: Add testcase for above.
1056 + * gdb.python/py-prettyprint.py: Add test printer for above.
1058 2011-07-27 Jan Kratochvil <jan.kratochvil@redhat.com>
1060 * gdb.dwarf2/dw2-simple-locdesc.S: Change DWARF version to 3.
1061 --- src/gdb/testsuite/gdb.python/py-mi.exp 2011/07/26 18:38:55 1.13
1062 +++ src/gdb/testsuite/gdb.python/py-mi.exp 2011/07/28 10:36:40 1.14
1063 @@ -284,6 +284,13 @@ mi_list_varobj_children nstype2 {
1064 { {nstype2.<error at 0>} {<error at 0>} 6 {char \[6\]} }
1065 } "list children after setting exception flag"
1067 +mi_create_varobj me me \
1068 + "create me varobj"
1070 +mi_gdb_test "-var-evaluate-expression me" \
1071 + "\\^done,value=\"<error reading variable: Cannot access memory.>.*\"" \
1072 + "evaluate me varobj"
1076 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
1077 --- src/gdb/testsuite/gdb.python/py-prettyprint.c 2011/04/29 12:45:46 1.12
1078 +++ src/gdb/testsuite/gdb.python/py-prettyprint.c 2011/07/28 10:36:40 1.13
1079 @@ -149,6 +149,11 @@
1081 typedef struct justchildren nostring_type;
1083 +struct memory_error
1092 /* Clearing by being `static' could invoke an other GDB C++ bug. */
1093 struct nullstr nullstr;
1094 nostring_type nstype, nstype2;
1095 + struct memory_error me;
1097 struct lazystring estring, estring2;
1098 struct hint_error hint_error;
1100 nstype.elements = narray;
1106 init_ss(ssa+0, 3, 4);
1107 init_ss(ssa+1, 5, 6);
1108 --- src/gdb/testsuite/gdb.python/py-prettyprint.py 2011/04/11 17:40:41 1.11
1109 +++ src/gdb/testsuite/gdb.python/py-prettyprint.py 2011/07/28 10:36:40 1.12
1116 # Test returning a Value from a printer.
1118 @@ -186,6 +187,18 @@
1119 yield 's', self.val['s']
1120 yield 'x', self.val['x']
1122 +class MemoryErrorString:
1125 + def __init__(self, val):
1128 + def to_string(self):
1129 + raise gdb.MemoryError ("Cannot access memory.");
1131 + def display_hint (self):
1134 def lookup_function (val):
1135 "Look-up and return a pretty-printer that can print val."
1138 pretty_printers_dict[re.compile ('^struct hint_error$')] = pp_hint_error
1139 pretty_printers_dict[re.compile ('^hint_error$')] = pp_hint_error
1141 + pretty_printers_dict[re.compile ('^memory_error$')] = MemoryErrorString
1143 pretty_printers_dict = {}
1145 register_pretty_printers ()
1149 commit 84be2b4d0a55c95697c9ecc72bb31c2fbd316127
1150 Author: ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
1151 Date: Tue Jul 26 14:28:23 2011 +0000
1153 * cp-demangle.c (d_print_init): Initialize pack_index field.
1154 (d_print_comp): Check for NULL template argument.
1155 * testsuite/demangle-expected: Add test case.
1158 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176791 138bc75d-0d04-0410-961f-82ee72b054a4
1160 ### a/libiberty/ChangeLog
1161 ### b/libiberty/ChangeLog
1163 +2011-07-26 Ian Lance Taylor <iant@google.com>
1165 + * cp-demangle.c (d_print_init): Initialize pack_index field.
1166 + (d_print_comp): Check for NULL template argument.
1167 + * testsuite/demangle-expected: Add test case.
1169 2011-07-22 Gerald Pfeifer <gerald@pfeifer.com>
1172 --- a/libiberty/cp-demangle.c
1173 +++ b/libiberty/cp-demangle.c
1175 /* Demangler for g++ V3 ABI.
1176 - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
1177 + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
1178 Free Software Foundation, Inc.
1179 Written by Ian Lance Taylor <ian@wasabisystems.com>.
1181 @@ -3306,6 +3306,7 @@ d_print_init (struct d_print_info *dpi, demangle_callbackref callback,
1182 dpi->last_char = '\0';
1183 dpi->templates = NULL;
1184 dpi->modifiers = NULL;
1185 + dpi->pack_index = 0;
1186 dpi->flush_count = 0;
1188 dpi->callback = callback;
1189 @@ -3893,6 +3894,13 @@ d_print_comp (struct d_print_info *dpi, int options,
1190 struct demangle_component *a = d_lookup_template_argument (dpi, sub);
1191 if (a && a->type == DEMANGLE_COMPONENT_TEMPLATE_ARGLIST)
1192 a = d_index_template_argument (a, dpi->pack_index);
1196 + d_print_error (dpi);
1203 --- a/libiberty/testsuite/demangle-expected
1204 +++ b/libiberty/testsuite/demangle-expected
1205 @@ -4010,6 +4010,12 @@ K<1, &S::m>::f()
1206 _ZN1KILi1EXadL_ZN1S1mEEEE1fEv
1209 +# Used to crash -- binutils PR 13030.
1211 +_ZSt10_ConstructI10CellBorderIS0_EEvPT_DpOT0_
1212 +_ZSt10_ConstructI10CellBorderIS0_EEvPT_DpOT0_
1213 +_ZSt10_ConstructI10CellBorderIS0_EEvPT_DpOT0_
1221 http://sourceware.org/ml/gdb-cvs/2011-08/msg00047.html
1223 ### src/gdb/ChangeLog 2011/08/08 21:41:12 1.13259
1224 ### src/gdb/ChangeLog 2011/08/09 12:45:39 1.13260
1226 +2011-08-09 Phil Muldoon <pmuldoon@redhat.com>
1228 + * python/lib/gdb/__init__.py: Auto-load files in command and
1229 + function directories.
1230 + * python/python.c (finish_python_initialization): Use
1232 + * python/lib/gdb/command/pretty_printers.py: Self register
1234 + * NEWS: Document auto-loading.
1236 2011-08-08 Jan Kratochvil <jan.kratochvil@redhat.com>
1238 * dwarf2loc.c (dwarf2_evaluate_loc_desc_full) <DWARF_VALUE_STACK>
1239 --- src/gdb/NEWS 2011/07/26 20:57:53 1.446
1240 +++ src/gdb/NEWS 2011/08/09 12:45:39 1.447
1242 ** A prompt subsitution hook (prompt_hook) is now available to the
1245 + ** Python commands and convenience-functions located in
1246 + 'data-directory'/python/gdb/command and
1247 + 'data-directory'/python/gdb/function are now automatically loaded
1250 * libthread-db-search-path now supports two special values: $sdir and $pdir.
1251 $sdir specifies the default system locations of shared libraries.
1252 $pdir specifies the directory where the libpthread used by the application
1253 ### src/gdb/doc/ChangeLog 2011/07/26 16:59:23 1.1202
1254 ### src/gdb/doc/ChangeLog 2011/08/09 12:45:39 1.1203
1256 +2011-08-09 Phil Muldoon <pmuldoon@redhat.com>
1258 + * gdb.texinfo (Python): Document command and function
1261 2011-07-26 Jan Kratochvil <jan.kratochvil@redhat.com>
1262 Eli Zaretskii <eliz@gnu.org>
1264 --- src/gdb/doc/gdb.texinfo 2011/07/26 20:57:54 1.851
1265 +++ src/gdb/doc/gdb.texinfo 2011/08/09 12:45:39 1.852
1266 @@ -20845,6 +20845,12 @@
1267 is automatically added to the Python Search Path in order to allow
1268 the Python interpreter to locate all scripts installed at this location.
1270 +Additionally, @value{GDBN} commands and convenience functions which
1271 +are written in Python and are located in the
1272 +@file{@var{data-directory}/python/gdb/command} or
1273 +@file{@var{data-directory}/python/gdb/function} directories are
1274 +automatically imported when @value{GDBN} starts.
1277 * Python Commands:: Accessing Python from @value{GDBN}.
1278 * Python API:: Accessing @value{GDBN} from Python.
1279 --- src/gdb/python/python.c 2011/07/22 09:22:50 1.68
1280 +++ src/gdb/python/python.c 2011/08/09 12:45:40 1.69
1281 @@ -1302,13 +1302,13 @@
1282 sys.path.insert (0, gdb.PYTHONDIR)\n\
1284 # Tell python where to find submodules of gdb.\n\
1285 - gdb.__path__ = [gdb.PYTHONDIR + '/gdb']\n\
1286 + gdb.__path__ = [os.path.join (gdb.PYTHONDIR, 'gdb')]\n\
1288 # The gdb module is implemented in C rather than in Python. As a result,\n\
1289 # the associated __init.py__ script is not not executed by default when\n\
1290 # the gdb module gets imported. Execute that script manually if it\n\
1292 - ipy = gdb.PYTHONDIR + '/gdb/__init__.py'\n\
1293 + ipy = os.path.join (gdb.PYTHONDIR, 'gdb', '__init__.py')\n\
1294 if os.path.exists (ipy):\n\
1297 --- src/gdb/python/lib/gdb/__init__.py 2011/01/01 15:33:26 1.3
1298 +++ src/gdb/python/lib/gdb/__init__.py 2011/08/09 12:45:40 1.4
1300 # You should have received a copy of the GNU General Public License
1301 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1303 -import gdb.command.pretty_printers
1306 -gdb.command.pretty_printers.register_pretty_printer_commands()
1307 +# Auto-load all functions/commands.
1309 +# Modules to auto-load, and the paths where those modules exist.
1312 + 'gdb.function': os.path.join(gdb.PYTHONDIR, 'gdb', 'function'),
1313 + 'gdb.command': os.path.join(gdb.PYTHONDIR, 'gdb', 'command')
1316 +# Iterate the dictionary, collating the Python files in each module
1317 +# path. Construct the module name, and import.
1319 +for module, location in module_dict.iteritems():
1320 + if os.path.exists(location):
1321 + py_files = filter(lambda x: x.endswith('.py') and x != '__init__.py',
1322 + os.listdir(location))
1324 + for py_file in py_files:
1325 + # Construct from foo.py, gdb.module.foo
1326 + py_file = module + '.' + py_file[:-3]
1328 + exec('import ' + py_file)
1330 + print >> sys.stderr, traceback.format_exc()
1331 --- src/gdb/python/lib/gdb/command/pretty_printers.py 2011/01/01 15:33:27 1.4
1332 +++ src/gdb/python/lib/gdb/command/pretty_printers.py 2011/08/09 12:45:40 1.5
1335 EnablePrettyPrinter()
1336 DisablePrettyPrinter()
1338 +register_pretty_printer_commands()
1342 http://sourceware.org/ml/gdb-patches/2011-08/msg00505.html
1343 Subject: fix "info os processes" race -> crash (ext-run.exp racy FAIL)
1344 http://sourceware.org/ml/gdb-cvs/2011-08/msg00116.html
1346 ### src/gdb/ChangeLog 2011/08/26 17:58:57 1.13281
1347 ### src/gdb/ChangeLog 2011/08/26 18:58:02 1.13282
1349 +2011-08-26 Pedro Alves <pedro@codesourcery.com>
1351 + * common/linux-osdata.c (get_cores_used_by_process): Don't assume
1352 + opening /proc/PID/task always succeeds.
1354 2011-08-26 Aleksandar Ristovski <aristovski@qnx.com>
1356 * linespec.c (symtab_from_filename): Check for the end of string.
1357 --- src/gdb/common/linux-osdata.c 2011/07/21 23:46:09 1.1
1358 +++ src/gdb/common/linux-osdata.c 2011/08/26 18:58:04 1.2
1359 @@ -259,27 +259,29 @@
1361 sprintf (taskdir, "/proc/%d/task", pid);
1362 dir = opendir (taskdir);
1364 - while ((dp = readdir (dir)) != NULL)
1369 + while ((dp = readdir (dir)) != NULL)
1374 - if (!isdigit (dp->d_name[0])
1375 - || NAMELEN (dp) > sizeof ("4294967295") - 1)
1377 + if (!isdigit (dp->d_name[0])
1378 + || NAMELEN (dp) > sizeof ("4294967295") - 1)
1381 - tid = atoi (dp->d_name);
1382 - core = linux_common_core_of_thread (ptid_build (pid, tid, 0));
1383 + tid = atoi (dp->d_name);
1384 + core = linux_common_core_of_thread (ptid_build (pid, tid, 0));
1407 Fix for https://bugzilla.redhat.com/show_bug.cgi?id=750341
1408 http://sourceware.org/ml/gdb-patches/2011-10/msg00570.html
1411 http://sourceware.org/ml/gdb-cvs/2011-10/msg00154.html
1413 ### src/gdb/ChangeLog 2011/10/20 13:34:13 1.13446
1414 ### src/gdb/ChangeLog 2011/10/20 20:06:11 1.13447
1416 +2011-10-20 Aleksandar Ristovski <aristovski@qnx.com>
1418 + * cp-namespace.c (cp_scan_for_anonymous_namespaces): Changed function
1419 + arguments by adding OBJFILE. Instead of getting objfile from
1420 + symbol's symtab, use new argument OBJFILE.
1421 + * cp-support.h (cp_scan_for_anonymous_namespaces): Changed function
1422 + arguments by adding OBJFILE.
1423 + * gdb/dwarf2read.c (new_symbol_full): Change call to
1424 + cp_scan_for_anonymous_namespaces to match new signature.
1425 + * gdb/stabsread.c (define_symbol): Change call to
1426 + cp_scan_for_anonymous_namespaces to match new signature.
1428 2011-10-20 Phil Muldoon <pmuldoon@redhat.com>
1431 --- src/gdb/cp-namespace.c 2011/06/29 22:05:15 1.54
1432 +++ src/gdb/cp-namespace.c 2011/10/20 20:06:13 1.55
1434 anonymous namespace; if so, add an appropriate using directive. */
1437 -cp_scan_for_anonymous_namespaces (const struct symbol *symbol)
1438 +cp_scan_for_anonymous_namespaces (const struct symbol *const symbol,
1439 + struct objfile *const objfile)
1441 if (SYMBOL_DEMANGLED_NAME (symbol) != NULL)
1444 namespace given by the previous component if there is
1445 one, or to the global namespace if there isn't. */
1446 cp_add_using_directive (dest, src, NULL, NULL, NULL,
1447 - &SYMBOL_SYMTAB (symbol)->objfile->objfile_obstack);
1448 + &objfile->objfile_obstack);
1450 /* The "+ 2" is for the "::". */
1451 previous_component = next_component + 2;
1452 --- src/gdb/cp-support.h 2011/08/18 16:17:38 1.45
1453 +++ src/gdb/cp-support.h 2011/10/20 20:06:13 1.46
1455 const char *processing_current_prefix,
1456 int processing_has_namespace_info);
1458 -extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol);
1459 +extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol,
1460 + struct objfile *objfile);
1462 extern struct symbol *cp_lookup_symbol_nonlocal (const char *name,
1463 const struct block *block,
1464 --- src/gdb/dwarf2read.c 2011/10/20 01:11:34 1.576
1465 +++ src/gdb/dwarf2read.c 2011/10/20 20:06:13 1.577
1466 @@ -11992,7 +11992,7 @@
1467 namespaces based on the demangled name. */
1468 if (!processing_has_namespace_info
1469 && cu->language == language_cplus)
1470 - cp_scan_for_anonymous_namespaces (sym);
1471 + cp_scan_for_anonymous_namespaces (sym, objfile);
1475 --- src/gdb/stabsread.c 2011/05/18 16:30:36 1.138
1476 +++ src/gdb/stabsread.c 2011/10/20 20:06:14 1.139
1478 SYMBOL_SET_NAMES (sym, string, p - string, 1, objfile);
1480 if (SYMBOL_LANGUAGE (sym) == language_cplus)
1481 - cp_scan_for_anonymous_namespaces (sym);
1482 + cp_scan_for_anonymous_namespaces (sym, objfile);