~ubuntu-branches/ubuntu/trusty/llvm-toolchain-snapshot/trusty-201310232150

« back to all changes in this revision

Viewing changes to lldb/source/Target/Target.cpp

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-27 15:01:57 UTC
  • mfrom: (0.10.1) (0.9.1) (0.8.1) (0.7.1) (0.6.1) (0.5.2)
  • Revision ID: package-import@ubuntu.com-20130527150157-tdkrsjpuvht7v0qx
Tags: 1:3.4~svn182733-1~exp1
* New snapshot release (3.4 release)
* Add a symlink of libLLVM-3.4.so.1 to usr/lib/llvm-3.4/lib/libLLVM-3.4.so
    to fix make the llvm-config-3.4 --libdir work (Closes: #708677)
  * Various packages rename to allow co installations:
    * libclang1 => libclang1-3.4
    * libclang1-dbg => libclang1-3.4-dbg
    * libclang-dev => libclang-3.4-dev
    * libclang-common-dev => libclang-common-3.4-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
296
296
    {
297
297
        filter_sp = GetSearchFilterForModuleList (containingModules);
298
298
    }
 
299
    if (skip_prologue == eLazyBoolCalculate)
 
300
        skip_prologue = GetSkipPrologue() ? eLazyBoolYes : eLazyBoolNo;
 
301
 
299
302
    BreakpointResolverSP resolver_sp(new BreakpointResolverFileLine (NULL,
300
303
                                                                     file,
301
304
                                                                     line_no,
302
305
                                                                     check_inlines,
303
 
                                                                     skip_prologue == eLazyBoolCalculate ? GetSkipPrologue() : skip_prologue));
 
306
                                                                     skip_prologue));
304
307
    return CreateBreakpoint (filter_sp, resolver_sp, internal);
305
308
}
306
309
 
343
346
    if (func_name)
344
347
    {
345
348
        SearchFilterSP filter_sp(GetSearchFilterForModuleAndCUList (containingModules, containingSourceFiles));
346
 
        
 
349
 
 
350
        if (skip_prologue == eLazyBoolCalculate)
 
351
            skip_prologue = GetSkipPrologue() ? eLazyBoolYes : eLazyBoolNo;
 
352
 
347
353
        BreakpointResolverSP resolver_sp (new BreakpointResolverName (NULL, 
348
354
                                                                      func_name, 
349
355
                                                                      func_name_type_mask, 
350
356
                                                                      Breakpoint::Exact, 
351
 
                                                                      skip_prologue == eLazyBoolCalculate ? GetSkipPrologue() : skip_prologue));
 
357
                                                                      skip_prologue));
352
358
        bp_sp = CreateBreakpoint (filter_sp, resolver_sp, internal);
353
359
    }
354
360
    return bp_sp;
367
373
    if (num_names > 0)
368
374
    {
369
375
        SearchFilterSP filter_sp(GetSearchFilterForModuleAndCUList (containingModules, containingSourceFiles));
370
 
        
371
 
        BreakpointResolverSP resolver_sp (new BreakpointResolverName (NULL, 
 
376
 
 
377
        if (skip_prologue == eLazyBoolCalculate)
 
378
            skip_prologue = GetSkipPrologue() ? eLazyBoolYes : eLazyBoolNo;
 
379
 
 
380
        BreakpointResolverSP resolver_sp (new BreakpointResolverName (NULL,
372
381
                                                                      func_names,
373
382
                                                                      func_name_type_mask,
374
 
                                                                      skip_prologue == eLazyBoolCalculate ? GetSkipPrologue() : skip_prologue));
 
383
                                                                      skip_prologue));
375
384
        bp_sp = CreateBreakpoint (filter_sp, resolver_sp, internal);
376
385
    }
377
386
    return bp_sp;
391
400
    {
392
401
        SearchFilterSP filter_sp(GetSearchFilterForModuleAndCUList (containingModules, containingSourceFiles));
393
402
        
394
 
        BreakpointResolverSP resolver_sp (new BreakpointResolverName (NULL, 
 
403
        if (skip_prologue == eLazyBoolCalculate)
 
404
            skip_prologue = GetSkipPrologue() ? eLazyBoolYes : eLazyBoolNo;
 
405
 
 
406
        BreakpointResolverSP resolver_sp (new BreakpointResolverName (NULL,
395
407
                                                                      func_names,
396
408
                                                                      num_names, 
397
409
                                                                      func_name_type_mask,
398
 
                                                                      skip_prologue == eLazyBoolCalculate ? GetSkipPrologue() : skip_prologue));
 
410
                                                                      skip_prologue));
399
411
        bp_sp = CreateBreakpoint (filter_sp, resolver_sp, internal);
400
412
    }
401
413
    return bp_sp;
972
984
LoadScriptingResourceForModule (const ModuleSP &module_sp, Target *target)
973
985
{
974
986
    Error error;
975
 
    if (module_sp && !module_sp->LoadScriptingResourceInTarget(target, error))
 
987
    StreamString feedback_stream;
 
988
    if (module_sp && !module_sp->LoadScriptingResourceInTarget(target, error, &feedback_stream))
976
989
    {
977
 
        target->GetDebugger().GetOutputStream().Printf("unable to load scripting data for module %s - error reported was %s\n",
978
 
                                                       module_sp->GetFileSpec().GetFileNameStrippingExtension().GetCString(),
979
 
                                                       error.AsCString());
 
990
        if (error.AsCString())
 
991
            target->GetDebugger().GetErrorStream().Printf("unable to load scripting data for module %s - error reported was %s\n",
 
992
                                                           module_sp->GetFileSpec().GetFileNameStrippingExtension().GetCString(),
 
993
                                                           error.AsCString());
 
994
        if (feedback_stream.GetSize())
 
995
            target->GetDebugger().GetOutputStream().Printf("%s\n",
 
996
                                                           feedback_stream.GetData());
980
997
    }
981
998
}
982
999
 
992
1009
    if (executable_sp.get())
993
1010
    {
994
1011
        Timer scoped_timer (__PRETTY_FUNCTION__,
995
 
                            "Target::SetExecutableModule (executable = '%s/%s')",
996
 
                            executable_sp->GetFileSpec().GetDirectory().AsCString(),
997
 
                            executable_sp->GetFileSpec().GetFilename().AsCString());
 
1012
                            "Target::SetExecutableModule (executable = '%s')",
 
1013
                            executable_sp->GetFileSpec().GetPath().c_str());
998
1014
 
999
1015
        m_images.Append(executable_sp); // The first image is our exectuable file
1000
1016
 
2254
2270
    { 0, NULL, NULL }
2255
2271
};
2256
2272
 
 
2273
static OptionEnumValueElement
 
2274
g_load_script_from_sym_file_values[] =
 
2275
{
 
2276
    { eLoadScriptFromSymFileTrue,    "true",    "Load debug scripts inside symbol files"},
 
2277
    { eLoadScriptFromSymFileFalse,   "false",   "Do not load debug scripts inside symbol files."},
 
2278
    { eLoadScriptFromSymFileWarn,    "warn",    "Warn about debug scripts inside symbol files but do not load them."},
 
2279
    { 0, NULL, NULL }
 
2280
};
 
2281
 
2257
2282
static PropertyDefinition
2258
2283
g_properties[] =
2259
2284
{
2290
2315
    // FIXME: This is the wrong way to do per-architecture settings, but we don't have a general per architecture settings system in place yet.
2291
2316
    { "x86-disassembly-flavor"             , OptionValue::eTypeEnum      , false, eX86DisFlavorDefault,       NULL, g_x86_dis_flavor_value_types, "The default disassembly flavor to use for x86 or x86-64 targets." },
2292
2317
    { "use-fast-stepping"                  , OptionValue::eTypeBoolean   , false, true,                       NULL, NULL, "Use a fast stepping algorithm based on running from branch to branch rather than instruction single-stepping." },
 
2318
    { "load-script-from-symbol-file"       , OptionValue::eTypeEnum   ,    false, eLoadScriptFromSymFileWarn, NULL, g_load_script_from_sym_file_values, "Allow LLDB to load scripting resources embedded in symbol files when available." },
2293
2319
    { NULL                                 , OptionValue::eTypeInvalid   , false, 0                         , NULL, NULL, NULL }
2294
2320
};
2295
2321
enum
2315
2341
    ePropertyDisableSTDIO,
2316
2342
    ePropertyInlineStrategy,
2317
2343
    ePropertyDisassemblyFlavor,
2318
 
    ePropertyUseFastStepping
 
2344
    ePropertyUseFastStepping,
 
2345
    ePropertyLoadScriptFromSymbolFile,
2319
2346
};
2320
2347
 
2321
2348
 
2360
2387
        }
2361
2388
        return ProtectedGetPropertyAtIndex (idx);
2362
2389
    }
 
2390
    
 
2391
    lldb::TargetSP
 
2392
    GetTargetSP ()
 
2393
    {
 
2394
        return m_target->shared_from_this();
 
2395
    }
 
2396
    
2363
2397
protected:
2364
2398
    
2365
2399
    void
2661
2695
    return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
2662
2696
}
2663
2697
 
 
2698
LoadScriptFromSymFile
 
2699
TargetProperties::GetLoadScriptFromSymbolFile () const
 
2700
{
 
2701
    const uint32_t idx = ePropertyLoadScriptFromSymbolFile;
 
2702
    return (LoadScriptFromSymFile)m_collection_sp->GetPropertyAtIndexAsEnumeration(NULL, idx, g_properties[idx].default_uint_value);
 
2703
}
 
2704
 
2664
2705
const TargetPropertiesSP &
2665
2706
Target::GetGlobalProperties()
2666
2707
{