[lldb-dev] SBDebugger CreateTarget question

Matthew Gardiner mg11 at csr.com
Thu Oct 9 22:16:52 PDT 2014


Ok, thanks Jim

Matt

On Thu, 2014-10-09 at 09:35 -0700, jingham at apple.com wrote:
> Matthew,
> 
> You'll know that target creation failed because the SBTarget will be invalid, you just won't know why.  There are a bunch of short-cut methods like this that are convenient to call when you are just poking at the API by hand in the "script" command in lldb, but shouldn't be used if you are writing real programs.  In the long run, we should deprecate the ones of these that are obviously dangerous, and then remove them in the fabled 2.0 version of the lldb API's, though in practice having some "quick and dirty" interfaces is not always bad.
> 
> Jim
> 
> 
> 
> > On Oct 9, 2014, at 3:53 AM, Matthew Gardiner <mg11 at csr.com> wrote:
> > 
> > Hi,
> > 
> > I'm starting to play with the C++ API some more. I'm looking at target
> > creation on the SBDebugger class:
> > 
> >    lldb::SBTarget
> >    CreateTarget (const char *filename,
> >                  const char *target_triple,
> >                  const char *platform_name,
> >                  bool add_dependent_modules,
> >                  lldb::SBError& error);
> > 
> >    lldb::SBTarget
> >    CreateTargetWithFileAndTargetTriple (const char *filename,
> >                                         const char *target_triple);
> > 
> >    lldb::SBTarget
> >    CreateTargetWithFileAndArch (const char *filename,
> >                                 const char *archname);
> > 
> >    lldb::SBTarget
> >    CreateTarget (const char *filename);
> > 
> > Out of the 4 methods of target creation, why has only one function got a
> > mechanism to pass back an error?
> > 
> > How can I use the remaining 3 functions without such a scheme?
> > 
> > thanks
> > Matt
> > 
> > 
> > 
> > 
> > Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
> > More information can be found at www.csr.com. Keep up to date with CSR on our technical blog, www.csr.com/blog, CSR people blog, www.csr.com/people, YouTube, www.youtube.com/user/CSRplc, Facebook, www.facebook.com/pages/CSR/191038434253534, or follow us on Twitter at www.twitter.com/CSR_plc.
> > New for 2014, you can now access the wide range of products powered by aptX at www.aptx.com.
> > _______________________________________________
> > lldb-dev mailing list
> > lldb-dev at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
> 
> 
> 
>  To report this email as spam click https://www.mailcontrol.com/sr/x8TG32lSILnGX2PQPOmvUnk1PR6ftzo0TwbB6lz6avtehEfkuQYZIn1AJNvK3KWpZzI00M6Pw3uU8yB5sLY89Q== .





More information about the lldb-dev mailing list