[patch] debug

Nirgal <[email protected]> Sat, 27 Aug 2011 22:23:40 +0000
Newsgroups gmane.comp.db.mdb-tools.devel
Message-ID <[email protected]>
--Boundary-00=_u5WWOK3iBFkj6i9
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit

Description:
  * Fix unsigned/signed bug in display
  * Fix end of loop detection in gmdb_val_to_str
  * Support debug of encrypted files

(see http://www.nirgal.com/mdbtools/debian.squeeze/debian/patches/series for full list)

--Boundary-00=_u5WWOK3iBFkj6i9
Content-Type: text/x-patch;
  charset="utf-8";
  name="debug.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
	filename="debug.diff"

Description:
  * Fix unsigned/signed bug in display
  * Fix end of loop detection in gmdb_val_to_str
  * Support debug of encrypted files
Index: mdbtools-0.6pre1/src/gmdb2/debug.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=2D-- mdbtools-0.6pre1.orig/src/gmdb2/debug.c
+++ mdbtools-0.6pre1/src/gmdb2/debug.c
@@ -156,7 +156,6 @@
 	GladeXML *xml;
 	GList *nav_list;
 	guint num_items;
=2D
 	nav_list =3D g_object_get_data(G_OBJECT(w),"nav_list");
 	nav_elem =3D g_object_get_data(G_OBJECT(w),"nav_elem");
 	num_items =3D g_list_length(nav_list);
@@ -326,7 +325,6 @@
 {
 	char *fbuf;
 	char *tbuf;
=2D	int length;
 	int i, j;
 	char line[80];
 	char field[10];
@@ -347,19 +345,17 @@
 	gtk_entry_set_text(GTK_ENTRY(entry),pagestr);
 	g_free(pagestr);
=20
=2D	lseek(mdb->f->fd, page * mdb->fmt->pg_size, SEEK_SET);
=2D=09
+	mdb_read_pg(mdb, page);
 	fbuf =3D g_malloc(mdb->fmt->pg_size);
+	memcpy(fbuf, mdb->pg_buf, mdb->fmt->pg_size);
+
 	tbuf =3D g_malloc0( (mdb->fmt->pg_size / 16) * 80);
=2D	length =3D read(mdb->f->fd, fbuf, mdb->fmt->pg_size);
=2D	if (length<mdb->fmt->pg_size) {
=2D	}
 	i =3D 0;
=2D	while (i<length) {
+	while (i<mdb->fmt->pg_size) {
 		sprintf(line,"%06x  ", i);
=20
 		for(j=3D0; j<16; j++) {
=2D			sprintf(field, "%02x ", fbuf[i+j]);
+			sprintf(field, "%02x ", (unsigned char)fbuf[i+j]);
 			strcat(line,field);
 		}
=20
@@ -383,7 +379,7 @@
 	window =3D glade_xml_get_widget(xml, "debug_window");
 	dissect =3D g_object_get_data(G_OBJECT(window),"dissect");
 	if (!dissect || *dissect)
=2D		gmdb_debug_dissect(GTK_TREE_STORE(store), fbuf, 0, length);
+		gmdb_debug_dissect(GTK_TREE_STORE(store), fbuf, 0, mdb->fmt->pg_size);
=20
 	g_free(fbuf);
 	g_free(tbuf);
@@ -409,7 +405,7 @@
 			return strptr;
 		}
 		i++;=09
=2D	} while (*strptr);
+	} while (strptr);
 	return "unknown";
 }
 static guint16=20

--Boundary-00=_u5WWOK3iBFkj6i9
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
--Boundary-00=_u5WWOK3iBFkj6i9
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
mdbtools-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mdbtools-dev

--Boundary-00=_u5WWOK3iBFkj6i9--