Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] realloc bug in add_symbol_file_command
@ 2006-10-06 14:18 Jean-Marc Saffroy
  2006-10-06 21:27 ` Michael Snyder
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Marc Saffroy @ 2006-10-06 14:18 UTC (permalink / raw)
  To: gdb-patches

Hello,

In gdb 6.5 I had systematic crashes with add-symbol-file: my kernel 
modules have many sections... :) The patch below lets me load many modules 
now.


Cheers,

-- 
saffroy@gmail.com

Index: gdb-6.5/gdb/symfile.c
===================================================================
--- gdb-6.5.orig/gdb/symfile.c	2006-10-06 15:56:41.000000000 +0200
+++ gdb-6.5/gdb/symfile.c	2006-10-06 15:57:52.000000000 +0200
@@ -1852,7 +1852,7 @@
                 to load the program. */
  	    sect_opts[section_index].name = ".text";
  	    sect_opts[section_index].value = arg;
-	    if (++section_index > num_sect_opts)
+	    if (++section_index == num_sect_opts)
  	      {
  		num_sect_opts *= 2;
  		sect_opts = ((struct sect_opt *)
@@ -1888,7 +1888,7 @@
  		    {
  		      sect_opts[section_index].value = arg;
  		      expecting_sec_addr = 0;
-		      if (++section_index > num_sect_opts)
+		      if (++section_index == num_sect_opts)
  			{
  			  num_sect_opts *= 2;
  			  sect_opts = ((struct sect_opt *)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-10-06 23:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-06 14:18 [patch] realloc bug in add_symbol_file_command Jean-Marc Saffroy
2006-10-06 21:27 ` Michael Snyder
2006-10-06 21:59   ` Jean-Marc Saffroy
2006-10-06 23:39     ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox