Re: [fpc-devel] Dwar2 changed?

2011-01-13 Thread Marc Weustink

Joost van der Sluis wrote:

On Wed, 2011-01-12 at 23:52 +, Martin wrote:

Has dwarf 2 changed ?



TCmdLineDebugger.SendCmdLn -data-evaluate-expression
^^shortstring(^POINTER($eax)^+12)^^
  TCmdLineDebugger.ReadLn ^done,value=#0repeats 20 times
  TCmdLineDebugger.ReadLn (gdb) 


You do realize that this is an hack? (I partly wrote it)


It looks much like I first wrote it :)

Anyway, without rtl debug info this is the only way to retrieve the 
classname of the exception object.



It could also be that the location of the exception-name has been
changed by something. This hack doesn't use any debug-information. Only
the definitions of a shortstring  and pointer.


I don't think that the exception name location is changed, it would mean 
that the VMT layout has changed.


Marc
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Dwar2 changed?

2011-01-13 Thread Martin

On 13/01/2011 07:45, Joost van der Sluis wrote:



TCmdLineDebugger.SendCmdLn -data-evaluate-expression
^^shortstring(^POINTER($eax)^+12)^^
  TCmdLineDebugger.ReadLn ^done,value=#0repeats 20 times
  TCmdLineDebugger.ReadLn (gdb) 

You do realize that this is an hack? (I partly wrote it)
It could also be that the location of the exception-name has been
changed by something. This hack doesn't use any debug-information. Only
the definitions of a shortstring  and pointer.


I do, yes...

But:
- I know eax is correct, because the fall-back (using ^char instead of 
shortstring works:

  -data-evaluate-expression ^char(^pointer(^POINTER($eax)^+12)^+1)
- The fallback is usually needed, if shortstring is not in the 
symboltable at all, but then the expression gives an error. Now the 
expression returns data, but the wrong data...


Strange, the same fpc on windows still works perfect with half a dozen 
different fpc versions (6.3 to 7.2)


It is also possible that my previous fpc trunk on my fedora box was 
build with some debug ino, and now I forgot, and just build it... but 
again on windows I tested with fpc 2.4.2 and trunc, both build with 
several different configs...


Martin

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Dwar2 changed?

2011-01-13 Thread Joost van der Sluis
On Thu, 2011-01-13 at 11:00 +, Martin wrote:
 On 13/01/2011 07:45, Joost van der Sluis wrote:
 
  TCmdLineDebugger.SendCmdLn -data-evaluate-expression
  ^^shortstring(^POINTER($eax)^+12)^^
TCmdLineDebugger.ReadLn ^done,value=#0repeats 20 times
TCmdLineDebugger.ReadLn (gdb) 
  You do realize that this is an hack? (I partly wrote it)
  It could also be that the location of the exception-name has been
  changed by something. This hack doesn't use any debug-information. Only
  the definitions of a shortstring  and pointer.
 
 I do, yes...
 
 But:
 - I know eax is correct, because the fall-back (using ^char instead of 
 shortstring works:
-data-evaluate-expression ^char(^pointer(^POINTER($eax)^+12)^+1)
 - The fallback is usually needed, if shortstring is not in the 
 symboltable at all, but then the expression gives an error. Now the 
 expression returns data, but the wrong data...

Ehh? Does the fallback work or not?

 Strange, the same fpc on windows still works perfect with half a dozen 
 different fpc versions (6.3 to 7.2)

So it could be a gdb-problem?

 It is also possible that my previous fpc trunk on my fedora box was 
 build with some debug ino, and now I forgot, and just build it... but 
 again on windows I tested with fpc 2.4.2 and trunc, both build with 
 several different configs...

You lost me. Do I still have to do something?

Joost.

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Dwar2 changed?

2011-01-13 Thread Martin

On 13/01/2011 14:14, Joost van der Sluis wrote:

  TCmdLineDebugger.SendCmdLn -data-evaluate-expression
^^shortstring(^POINTER($eax)^+12)^^
   TCmdLineDebugger.ReadLn ^done,value=#0repeats 20 times
   TCmdLineDebugger.ReadLn (gdb) 

You do realize that this is an hack? (I partly wrote it)
It could also be that the location of the exception-name has been
changed by something. This hack doesn't use any debug-information. Only
the definitions of a shortstring  and pointer.

I do, yes...

But:
- I know eax is correct, because the fall-back (using ^char instead of
shortstring works:
-data-evaluate-expression ^char(^pointer(^POINTER($eax)^+12)^+1)

The fallback does work. So the data is in the correct location


- The fallback is usually needed, if shortstring is not in the
symboltable at all, but then the expression gives an error. Now the
expression returns data, but the wrong data...

Ehh? Does the fallback work or not?
yes, but it was not triggered, because the first query did not return a 
gdbg-error, there just was no usable data.

I added the data check, so now the fallback is triggered, and it works.


Strange, the same fpc on windows still works perfect with half a dozen
different fpc versions (6.3 to 7.2)

So it could be a gdb-problem?

possible, yes, strange though

afaik shortstring is encoded as a record (len; chars), so maybe 
something in there...






It is also possible that my previous fpc trunk on my fedora box was
build with some debug ino, and now I forgot, and just build it... but
again on windows I tested with fpc 2.4.2 and trunc, both build with
several different configs...

You lost me. Do I still have to do something?



probably not, because there is not enough info yet to start on something.

I was just asking if something obvious springs to mind


I currently don't have the time to go through all the options and see 
what works and what not.

e.g compile rtl with/whitout -gs / -gw
or check older versions, ...

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Dwar2 changed?

2011-01-12 Thread Martin

Has dwarf 2 changed ?

with trunk ( I updated from a few month back, to today), I no longer get 
the classname of an exception (stabs is fine, but dwarf now fails)



 TCmdLineDebugger.SendCmdLn -data-evaluate-expression 
^^shortstring(^POINTER($eax)^+12)^^

 TCmdLineDebugger.ReadLn ^done,value=#0 repeats 20 times
 TCmdLineDebugger.ReadLn (gdb) 

GNU gdb (GDB) Fedora (7.1-18.fc13)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
http://gnu.org/licenses/gpl.html

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as i686-redhat-linux-gnu.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Dwar2 changed?

2011-01-12 Thread Joost van der Sluis
On Wed, 2011-01-12 at 23:52 +, Martin wrote:
 Has dwarf 2 changed ?

Yes

 with trunk ( I updated from a few month back, to today), I no longer get 
 the classname of an exception (stabs is fine, but dwarf now fails)


Well, passing variables to procedures by reference has different
Dwarf-debug information now. 
And there are some changes which in theory shoudn't change anything, but
maybe I made a mistake.

You could try to compile an example with an older version and a newer
version. And compare the output of 'objdump -W'

   TCmdLineDebugger.SendCmdLn -data-evaluate-expression 
 ^^shortstring(^POINTER($eax)^+12)^^
  TCmdLineDebugger.ReadLn ^done,value=#0 repeats 20 times
  TCmdLineDebugger.ReadLn (gdb) 

You do realize that this is an hack? (I partly wrote it)
It could also be that the location of the exception-name has been
changed by something. This hack doesn't use any debug-information. Only
the definitions of a shortstring  and pointer.  

Joost.

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel