This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix loading announcements


This patch fixes a bug in the progress messages during loading. If a section straddles a memory region boundary, we were not propagating the progress baton. The result was that the section was never announced.

Straddling a memory region boundary isn't as crazy as it sounds, when one considers boot-sector flash memory. Such devices have multiple sector sizes (commonly a few small ones at one end or both ends of the device and some big sectors in the middle). These appear to GDB as two or more memory regions. So if for instance, your u-boot .text section is big enough to fill the boot sectors and enter the larger sectors, the progress messages never announce that .text got loaded -- which is unnerving :)

With this patch, all sections are announced as expected, ok?

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery

2007-10-17  Nathan Sidwell  <nathan@codesourcery.com>

	* target-memory.c (claim_memory): Propagate baton for split memory
	requests.

Index: target-memory.c
===================================================================
RCS file: /cvs/src/src/gdb/target-memory.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 target-memory.c
*** target-memory.c	23 Aug 2007 18:08:45 -0000	1.4
--- target-memory.c	17 Oct 2007 13:11:27 -0000
*************** claim_memory (VEC(memory_write_request_s
*** 84,93 ****
  	{
  	  struct memory_write_request *n =
  	    VEC_safe_push (memory_write_request_s, *result, NULL);
! 	  memset (n, 0, sizeof (struct memory_write_request));
  	  n->begin = claimed_begin;
  	  n->end = claimed_end;
! 	  n->data = r->data + (claimed_begin - r->begin);
  	}
      }
  }
--- 84,93 ----
  	{
  	  struct memory_write_request *n =
  	    VEC_safe_push (memory_write_request_s, *result, NULL);
! 	  *n = *r;
  	  n->begin = claimed_begin;
  	  n->end = claimed_end;
! 	  n->data += claimed_begin - r->begin;
  	}
      }
  }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]