From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Frank Ch. Eigler" To: Zampieri Marco Cc: gdb@sourceware.cygnus.com Subject: Re: Connect 2 mips simulator.. Date: Thu, 06 Sep 2001 06:46:00 -0000 Message-id: <20010906094558.A28801@redhat.com> References: X-SW-Source: 2001-09/msg00043.html Hi - On Thu, Sep 06, 2001 at 02:58:51PM -0400, Zampieri Marco wrote: : I'm looking for the option --memory-mapfile FILE, but I can't find it in : the simulator parameters or gdb option. : Where I can find it? It is a configure option or a parameter of Make : program? The --memory-mapfile option for the sim/common-based simulators such as mips is supported automatically if your host supports mmap. From gdb, use "(gdb) [target] sim memory-mapfile FILE"; from the command line, use "TARGET-run --memory-mapfile FILE". Have you built your own cross-compiler/debugger/simulator recently? - FChE -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7l34WVZbdDOm/ZT0RAkqLAJ488NHiRorasTKjKRneh7XoHMKFGwCeKBYT r9XRR2/9QW801SabikVI/0k= =m3+N -----END PGP SIGNATURE----- >From dcoutts@cray.com Thu Sep 06 07:24:00 2001 From: Duncan Coutts To: Andrew Cagney Cc: Subject: Re: right way to_post_attach ? Date: Thu, 06 Sep 2001 07:24:00 -0000 Message-id: References: <3B970771.5060508@cygnus.com> X-SW-Source: 2001-09/msg00044.html Content-length: 2807 Hi, On Thu, 6 Sep 2001, Andrew Cagney wrote: > > Hi, > > > > I can't quite figure out what the right way to setup a > > target_ops.to_post_attach hook. I'm not defining a whole new target (am > > I?), I'm using the procfs target. I just need to hook the to_post_attach > > so I can do some random symbol fiddling just after the attach. > > > > I notice that several targets do a push_target during their attach, so > > that their operations become avaliable, but presumably I still want to > > use the procfs target so I can't have the attach operation push my extra > > target vector. > > > > In oop terms, I just want to 'override' the to_post_attach > > method. I can't find anywhere that uses the to_post_attach in any > > substantial way, so I'm rather short on clues. > > > > What's the way to do this, or is to_post_attach not the tool to be using > > here? > > > > Thank's for any tips. > > > i cant comment on post attach but i can comment on the underlying > problem. yes, the push / pop mechanism and gdb's target stack is > primative at best - little wonder you're having problems. the oo > concept is simple, what gdb did to it is not, sigh, Well as a simple hack, I've done to procfs what the child target does, which is to #define some flag CHILD[/PROCFS]_POST_ATTACH which indicates that the to_post_attach hook should be set to an externally defined function child[/procfs]_post_attach. So I've modified procfs but done it in a similar way to how the child target provides it's own hook. If there's a better way that doesn't invlove changing generic code I'd be happy to use it. To be more specific here's what I did: Comments welcome. Duncan Index: procfs.c =================================================================== diff -c -r1.7 procfs.c *** procfs.c 2001/08/27 17:32:52 1.7 --- procfs.c 2001/09/04 17:03:09 *************** *** 93,98 **** --- 93,101 ---- static void procfs_open PARAMS((char *, int)); static void procfs_attach PARAMS ((char *, int)); + #if defined(PROCFS_POST_ATTACH) + extern void procfs_post_attach PARAMS ((int)); + #endif static void procfs_detach PARAMS ((char *, int)); static void procfs_resume PARAMS ((int, int, enum target_signal)); static int procfs_can_run PARAMS ((void)); *************** *** 131,136 **** --- 134,142 ---- procfs_ops.to_kill = procfs_kill_inferior; procfs_ops.to_mourn_inferior = procfs_mourn_inferior; procfs_ops.to_attach = procfs_attach; + #if defined(PROCFS_POST_ATTACH) + procfs_ops.to_post_attach = procfs_post_attach; + #endif procfs_ops.to_detach = procfs_detach; procfs_ops.to_wait = procfs_wait; procfs_ops.to_resume = procfs_resume;