[Mono-list] How do you debug?

Ivan Hawkes blackhawk@ivanhawkes.com
Fri, 4 Jul 2003 17:04:33 +0100


=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 04 Jul 2003 4:40 pm, Marco Canini wrote:
> On Fri, 2003-07-04 at 17:23, Ivan Hawkes wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Are there any indications of how long it will be before it is operation=
al
> > again?
>
> For what i know Martin, the debugger mantainer, is working hard on it,
> but i don't know when it will works again.

Oh well, they say patience is a virtue. It's going to be pretty tedious=20
without one though.=20

<SNIP>
> > Unhandled Exception: System.InvalidCastException: Cannot cast from sour=
ce
> > type to destination type
> > in <0x0007a> 00 System.Data.SqlClient.SqlDataReader:GetInt32 (int)
> > in <0x00189> 00 Interesource.Publish.Client.ContentList:.ctor
> > (System.Data.IDataReader,bool)
> > in <0x00012> 00 Interesource.Publish.Client.ContentList:.ctor
> > (System.Data.IDataReader)
> > in <0x000a2> 00
> > Interesource.Publish.Client.ContentProvider:ListContentItems
> > (Interesource.Publish.Entities.ContentTypeKey)
> > in <0x0009e> 00 simpletest.SimpleTest:Main (string[])
>
> this could be a different type mapping between mono's SqlClient and
> .net's SqlClient
>
> Could you report the table definition (sql), the datacolumn definition,
> and the code that raises the exception.

Ok, it looks like this line of code:

NOTE: These are relevant variables in code and their types.
IDataReader reader
int uniqueId;

uniqueId =3D reader.GetInt32(reader.GetOrdinal("OriginalVersionId"));

and OriginalVersionId is an Int (4) NULL in SQL (MS SQL Server 2000)

Weird, it doesn't seem to leave a lot of room for error there since the rec=
ord=20
in question has an Int value (not a NULL or anything else).


> btw, with some pain you can get some dbg information my compiling with
> /g and running with mono --debug
>
> i said with some pain because the line numbers in exception backtrace
> are many times wrong

Yeh, I've got them switched on now. At least I have decent error handling i=
n=20
this program to help me trace the offending lines.

> > Now, this code works on both Framework 1.0 and 1.1, so I'm guessing the=
re
> > is a little work needed on the type casting for Mono. Without a debugger
> > it's going to be a nightmare trying to get it all working, so I'm hoping
> > that debugger will be available again soon.
>
> we all hope so
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iQIVAwUBPwWlkfr1e7bH1pzBAQKXuw//f+HhmTg69lN+WeKMJQzDV2yrKosr6Q5P
RWZbMfpV6PTmUA3UjZkC1cjIWDy5MELa7iSWMUwM+xOfXoI/xuS7JlBpojR2SjiA
R2qx5G9V+4GzYco8q+v2EIpli1OvHxn3PFr1tgqyEOXrQXiHdVkdBMmyVyczU8yg
NbqLY+kwBKj9qtYZ+YKgKcEg/pKn088lZOFCBOgTHoJKIzw2Q8TMQebA8DMeeFTv
x3N9cRa9dV0TOeM4BXJodwsLfct/QYxow8Nk7+O9C36XPAVA5p1rF162C9zomrnF
cZC1oVdB2HgO4Q7wXIa9fccoyp6XoPMlE5vQWHYKi9cdFAYhLed2X3Rsu+xn/nQI
OkUv4RROsvw0HNmbT0v1tNgsE67Cqfr/kWNHtX3So4BVFSvJuNjJH0YJBVCqFIBP
fjGbi5gkeqoyKkhE8SMa60R5H395vz27cKt0si8O8YhDNQvSOYEJSNvO7IrGxbkY
ne+bT2/YLDfUbM1s/mvt757OTzp3vRBuK8X3++j1YLC00qLU9NxC4aiuZCd92T48
oDqywVPeRAgSO2IUaOQgJDW8J313KfNDxZgQJwPt56EzG/QtxQ9bbvb2e8NiC7X5
1g6r76jSkp+6Apbu9TxHXHOoieqpqZYFlGbRJwaF4TkvXUXHfvWQ1hFTE9x4ARHl
+ffRuWNCqdc=3D
=3DmagN
=2D----END PGP SIGNATURE-----