public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* shared object addressing
@ 2007-07-26 15:13 Stan Cox
  0 siblings, 0 replies; only message in thread
From: Stan Cox @ 2007-07-26 15:13 UTC (permalink / raw)
  To: Frysk List

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

The addressing oddity I mentioned in the meeting appears to occur with
shared objects. For example break main in the following sets the break
in a shared object as opposed to in main:

fhpd tstctors0.x
Attached to process 10787
(fhpd) break main
breakpoint 0
(fhpd) go
(fhpd) Breakpoint 0 main
where
#0 0x0000000000400808 in __libc_csu_init ()
#1 0x0000003c54a1daa4 in __libc_start_main ()
#2 0x0000000000400639 in __gxx_personality_v0@@CXXABI_1.3 ()
(fhpd) 

Also disassembling a shared object (a printf call) encounters a snag:

fhpd hello.x  # hello world program
Attached to process 10538
(fhpd) break main
breakpoint 0
(fhpd) go
(fhpd) Breakpoint 0 main
disassemble 
 0x400498       push   %rbp
 0x400499       mov    %rsp,%rbp
*0x40049c       mov    $0x4005a8,%edi
 0x4004a1       callq  0x400398
 0x4004a6       leaveq 
 0x4004a7       retq   
(fhpd) stepi
Task stopped at line 4 in
file /home/scox/frysk/bld/x86_64-redhat-linux/hello.c
(fhpd) stepi
Task stopped at address 0x4195224
(fhpd) disassemble 
ptrace: Input/output error (pt 0x2, pid 10538, addr 0x0, data 0x0)
   at frysk.sys.Ptrace$AddressSpace.peek(fhpd)
   at frysk.proc.live.AddressSpaceByteBuffer$PeekRequest.execute(fhpd)
   at frysk.event.Request$Handler.execute(fhpd)
   at frysk.event.EventLoop.runEventLoop(fhpd)
   at frysk.event.EventLoop.run(fhpd)
Internal debugger error:  


[-- Attachment #2: tstctors0.cc --]
[-- Type: text/x-c++src, Size: 353 bytes --]

#include <stdio.h>

class Base
{
public:
  Base (const char *m):msg (m)
  {
    printf ("Base::Base(%s)\n", msg);
  }
  ~Base ()
  {
    printf ("Base::~Base(%s)\n", msg);
  }
  const char *msg;
};

int
main (int argc, char **argv)
{
  printf ("main\n");
  Base *new_base;
  new_base = new Base ("new base from main");
  while (1);
  delete new_base;
}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-26 15:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-26 15:13 shared object addressing Stan Cox

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).