public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: frysk <frysk@sources.redhat.com>
Subject: Re: frysk meeting 2007-08-09 9:30 US east
Date: Wed, 08 Aug 2007 15:25:00 -0000	[thread overview]
Message-ID: <1186586732.29962.25.camel@dijkstra.wildebeest.org> (raw)
In-Reply-To: <46B9C3C7.5090002@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3870 bytes --]

Hi,

Small transcript saved:

On Wed, 2007-08-08 at 09:23 -0400, Andrew Cagney wrote:
> - frysk-asm.h walk through

We wnet over the folliwing files:
$ less frysk-core/frysk/pkglibdir/funit-frameless.S 
$ less frysk-imports/include/funit-util.h 
$ less frysk-imports/include/frysk-asm.h 
$ less frysk-imports/include/frysk-asm.h 
$ less frysk-core/frysk/pkglibdir/funit-symbols.S 

The frysk-asm.h files has lots and lots of comments.

$ info gas
Will give you documentation on the .cif assembler directives used.
* Pseudo Ops::                  Assembler Directives
* CFI directives::              `.cfi_startproc', `.cfi_endproc', etc.
http://sourceware.org/binutils/docs-2.17/as/CFI-directives.html
(I must have missed this before, because I was looking for it, but only
found the gas 2.9 manual online previously, which doesn't seem to
support the cfi directives.)

> - C++ types

Stan was smart and had a premade demo, which is attached.

> - more debuginfo

$ ./frysk-core/frysk/bindir/fhpd $$
Attached to process 5784
(fhpd) de

debuginfo    defset       delete       detach
(fhpd) debuginfo 
/lib/libnss_files-2.6.so /usr/lib/debug/lib/libnss_files-2.6.so.debug
/lib/ld-2.6.so /usr/lib/debug/lib/ld-2.6.so.debug
/lib/libc-2.6.so /usr/lib/debug/lib/libc-2.6.so.debug
/lib/libdl-2.6.so /usr/lib/debug/lib/libdl-2.6.so.debug
/lib/libtinfo.so.5.6 /usr/lib/debug/lib/libtinfo.so.5.6.debug
/bin/bash /usr/lib/debug/bin/bash.debug

(fhpd) quit
Quitting...

$ ./frysk/bindir/fdebuginfo $$
/lib/libnss_files-2.6.so /usr/lib/debug/lib/libnss_files-2.6.so.debug
/lib/ld-2.6.so /usr/lib/debug/lib/ld-2.6.so.debug
/lib/libc-2.6.so /usr/lib/debug/lib/libc-2.6.so.debug
/lib/libdl-2.6.so /usr/lib/debug/lib/libdl-2.6.so.debug
/lib/libtinfo.so.5.6 /usr/lib/debug/lib/libtinfo.so.5.6.debug
/bin/bash /usr/lib/debug/bin/bash.debug

$ ./frysk/bindir/fcore $$

$ ./frysk/bindir/fdebuginfo core.$$
Exception in thread "main" java.lang.StringIndexOutOfBoundsException:
String ind
ex out of range: 0
   at java.lang.String.charAt(libgcj.so.8rh)
   at frysk.util.DebuginfoPaths.getDebuginfo(fdebuginfo)
   at frysk.bindir.fdebuginfo.printDebuginfo(fdebuginfo)
   at frysk.bindir.fdebuginfo.access$0(fdebuginfo)
   at frysk.bindir.fdebuginfo$1.parseCores(fdebuginfo)
   at frysk.util.CommandlineParser.doParse(fdebuginfo)
   at frysk.util.CommandlineParser.parse(fdebuginfo)
   at frysk.bindir.fdebuginfo.main(fdebuginfo)

[... bah! That is no good. After some debugging we came up with ...]

$ cvs diff frysk-core/frysk/util
Index: frysk-core/frysk/util/DebuginfoPaths.java
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/util/DebuginfoPaths.java,v
retrieving revision 1.1
diff -u -r1.1 DebuginfoPaths.java
--- frysk-core/frysk/util/DebuginfoPaths.java   7 Aug 2007 15:26:24 -0000      1.1
+++ frysk-core/frysk/util/DebuginfoPaths.java   8 Aug 2007 14:49:32 -0000
@@ -77,7 +77,7 @@
         String name = mod.getName();
         
         // Check for valid executables
-        if (name.charAt(0)=='/')
+        if (name.length() != 0 && name.charAt(0)=='/')
           {              
             // Ignore non-binary modules
             if (mod.getElf()==null)  

$ ./frysk/bindir/fdebuginfo core.$$
/lib/ld-linux.so.2 /usr/lib/debug/lib/ld-2.6.so.debug
/lib/libc.so.6 /usr/lib/debug/lib/libc-2.6.so.debug
/lib/libdl.so.2 /usr/lib/debug/lib/libdl-2.6.so.debug
/lib/libtinfo.so.5 /usr/lib/debug/lib/libtinfo.so.5.6.debug
/bin/bash /usr/lib/debug/bin/bash.debug

[... But this is slightly strange, needs investigation, why is the name
 empty in the first place?  Phil and Mark think it might be the vdso
 module name ...]

$ uname  -a
Linux hermans.wildebeest.org 2.6.22.1-41.fc7 #1 SMP Fri Jul 27 18:10:34 EDT 2007 i686 i686 i386 GNU/Linux

$ grep vdso /proc/$$/maps
00110000-00111000 r-xp 00110000 00:00 0          [vdso]


[-- Attachment #2: session --]
[-- Type: text/x-csrc, Size: 3101 bytes --]

#include <iostream>
using namespace std;

class Base1
{
public:
  Base1 (const char *m):msg (m)
  {
    std::cout << "Base1::Base1(" << msg << ")" << std::endl;
  }
  ~Base1 ()
  {
    std::cout << "Base1::~Base1(" << msg << ")" << std::endl;
  }
  const char *msg;
};

class Base2
{
public:
  Base2 (const char *m):msg (m)
  {
    std::cout << "Base2::Base2(" << msg << ")" << std::endl;
  }
  ~Base2 ()
  {
    std::cout << "Base2::~Base2(" << msg << ")" << std::endl;
  }
  const char *msg;
};

class Type : public Base1, public Base2
{
public:
  Type(const char *m, const char *n, const char *o) : Base1(m), Base2(n), note(o)
  {
    std::cout << "Type::Type(" << note << ")" << std::endl;
  }
  ~Type()
  {
    std::cout << "Type::~Type(" << note << ")" << std::endl;
  }
  private:
  const char *note;
};

class Base3 
{
public:
  virtual char do_this (char) =0;
  virtual short do_this (short) =0;
  virtual int do_this (int) =0;
  virtual float do_this (float) =0;

};
class Derived : public Base3
{
public:
  virtual char do_this(char x) { return do_this_impl(x); }
  virtual short do_this(short x) { return do_this_impl(x); }
  virtual int do_this(int x) { return do_this_impl(x); }
  virtual float do_this(float x) { return do_this_impl(x); }

private:
  template<class TYPE> TYPE do_this_impl(TYPE t)
  {
    std::cout << t << std::endl;
    return t;
  }
};

Type mb("static", "main", "mb");

void
func ()
{
  std::cout << "main" << std::endl;
  Type new_base = Type ("new base", "main", "new_base");
  Derived xyz;
  xyz.do_this ((char)'1');
  xyz.do_this ((short)2);
  xyz.do_this ((int)3);
  xyz.do_this ((float) 4.1);
  while(1);
}


int
main (int argc, char **argv)
{
  func();
}


(fhpd) list
74*      void
75       func ()
76       {
77         std::cout << "main" << std::endl;
78         Type new_base = Type ("new base", "main", "new_base");
79         Derived xyz;
80         xyz.do_this ((char)'1');
81         xyz.do_this ((short)2);
82         xyz.do_this ((int)3);
83         xyz.do_this ((float) 4.1);
84         while(1);
85       }
86       
87       
88       int
89       main (int argc, char **argv)
90       {
91         func();
92       }
(fhpd) what xyz
Derived at /home/scox/accu/src/tstctors0.cc#79
(fhpd) what Derived
public Base3 {
  void Derived ();
  void Derived ();
  char do_this (char );
  short int do_this (short int );
  int do_this (int );
  float do_this (float );
  private:
  char do_this_impl<char> (char );
  short int do_this_impl<short int> (short int );
  int do_this_impl<int> (int );
  float do_this_impl<float> (float );
  } at /home/scox/accu/src/tstctors0.cc#57
(fhpd) print Derived
Error: Symbol "Derived" is not found in the current context.
(fhpd) print xyz
{Base3={_vptr.Base3=0x401290,
},
}
(fhpd) what mb
extern Type at <unknown>
(fhpd) what Type
public Base1, public Base2 {
  private:
  byte * note;
  void Type (byte * ,byte * ,byte * );
  void ~Type ();
  } at /home/scox/accu/src/tstctors0.cc#33
(fhpd) print mb
{Base1={msg=0x401240 "static",
},
 Base2={msg=0x40123b "main",
},
 note=0x401238 "mb",
}
(fhpd) quit
Quitting...


      reply	other threads:[~2007-08-08 15:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-08 13:23 Andrew Cagney
2007-08-08 15:25 ` Mark Wielaard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1186586732.29962.25.camel@dijkstra.wildebeest.org \
    --to=mark@klomp.org \
    --cc=frysk@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).