SBTarget.cpp (254729) | SBTarget.cpp (258054) |
---|---|
1//===-- SBTarget.cpp --------------------------------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 27 unchanged lines hidden (view full) --- 36#include "lldb/Core/Disassembler.h" 37#include "lldb/Core/Log.h" 38#include "lldb/Core/Module.h" 39#include "lldb/Core/ModuleSpec.h" 40#include "lldb/Core/RegularExpression.h" 41#include "lldb/Core/SearchFilter.h" 42#include "lldb/Core/Section.h" 43#include "lldb/Core/STLUtils.h" | 1//===-- SBTarget.cpp --------------------------------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 27 unchanged lines hidden (view full) --- 36#include "lldb/Core/Disassembler.h" 37#include "lldb/Core/Log.h" 38#include "lldb/Core/Module.h" 39#include "lldb/Core/ModuleSpec.h" 40#include "lldb/Core/RegularExpression.h" 41#include "lldb/Core/SearchFilter.h" 42#include "lldb/Core/Section.h" 43#include "lldb/Core/STLUtils.h" |
44#include "lldb/Core/ValueObjectConstResult.h" |
|
44#include "lldb/Core/ValueObjectList.h" 45#include "lldb/Core/ValueObjectVariable.h" 46#include "lldb/Host/FileSpec.h" 47#include "lldb/Host/Host.h" 48#include "lldb/Interpreter/Args.h" 49#include "lldb/Symbol/ObjectFile.h" 50#include "lldb/Symbol/SymbolVendor.h" 51#include "lldb/Symbol/VariableList.h" --- 1203 unchanged lines hidden (view full) --- 1255 1256 // We have a load address that isn't in a section, just return an address 1257 // with the offset filled in (the address) and the section set to NULL 1258 addr.SetRawAddress(vm_addr); 1259 return sb_addr; 1260} 1261 1262SBSymbolContext | 45#include "lldb/Core/ValueObjectList.h" 46#include "lldb/Core/ValueObjectVariable.h" 47#include "lldb/Host/FileSpec.h" 48#include "lldb/Host/Host.h" 49#include "lldb/Interpreter/Args.h" 50#include "lldb/Symbol/ObjectFile.h" 51#include "lldb/Symbol/SymbolVendor.h" 52#include "lldb/Symbol/VariableList.h" --- 1203 unchanged lines hidden (view full) --- 1256 1257 // We have a load address that isn't in a section, just return an address 1258 // with the offset filled in (the address) and the section set to NULL 1259 addr.SetRawAddress(vm_addr); 1260 return sb_addr; 1261} 1262 1263SBSymbolContext |
1263SBTarget::ResolveSymbolContextForAddress (const SBAddress& addr, uint32_t resolve_scope) | 1264SBTarget::ResolveSymbolContextForAddress (const SBAddress& addr, 1265 uint32_t resolve_scope) |
1264{ 1265 SBSymbolContext sc; 1266 if (addr.IsValid()) 1267 { 1268 TargetSP target_sp(GetSP()); 1269 if (target_sp) 1270 target_sp->GetImages().ResolveSymbolContextForAddress (addr.ref(), resolve_scope, sc.ref()); 1271 } 1272 return sc; 1273} 1274 1275 1276SBBreakpoint | 1266{ 1267 SBSymbolContext sc; 1268 if (addr.IsValid()) 1269 { 1270 TargetSP target_sp(GetSP()); 1271 if (target_sp) 1272 target_sp->GetImages().ResolveSymbolContextForAddress (addr.ref(), resolve_scope, sc.ref()); 1273 } 1274 return sc; 1275} 1276 1277 1278SBBreakpoint |
1277SBTarget::BreakpointCreateByLocation (const char *file, uint32_t line) | 1279SBTarget::BreakpointCreateByLocation (const char *file, 1280 uint32_t line) |
1278{ 1279 return SBBreakpoint(BreakpointCreateByLocation (SBFileSpec (file, false), line)); 1280} 1281 1282SBBreakpoint | 1281{ 1282 return SBBreakpoint(BreakpointCreateByLocation (SBFileSpec (file, false), line)); 1283} 1284 1285SBBreakpoint |
1283SBTarget::BreakpointCreateByLocation (const SBFileSpec &sb_file_spec, uint32_t line) | 1286SBTarget::BreakpointCreateByLocation (const SBFileSpec &sb_file_spec, 1287 uint32_t line) |
1284{ 1285 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1286 1287 SBBreakpoint sb_bp; 1288 TargetSP target_sp(GetSP()); 1289 if (target_sp && line != 0) 1290 { 1291 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1292 1293 const LazyBool check_inlines = eLazyBoolCalculate; 1294 const LazyBool skip_prologue = eLazyBoolCalculate; 1295 const bool internal = false; | 1288{ 1289 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1290 1291 SBBreakpoint sb_bp; 1292 TargetSP target_sp(GetSP()); 1293 if (target_sp && line != 0) 1294 { 1295 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1296 1297 const LazyBool check_inlines = eLazyBoolCalculate; 1298 const LazyBool skip_prologue = eLazyBoolCalculate; 1299 const bool internal = false; |
1296 *sb_bp = target_sp->CreateBreakpoint (NULL, *sb_file_spec, line, check_inlines, skip_prologue, internal); | 1300 const bool hardware = false; 1301 *sb_bp = target_sp->CreateBreakpoint (NULL, *sb_file_spec, line, check_inlines, skip_prologue, internal, hardware); |
1297 } 1298 1299 if (log) 1300 { 1301 SBStream sstr; 1302 sb_bp.GetDescription (sstr); 1303 char path[PATH_MAX]; 1304 sb_file_spec->GetPath (path, sizeof(path)); --- 4 unchanged lines hidden (view full) --- 1309 sb_bp.get(), 1310 sstr.GetData()); 1311 } 1312 1313 return sb_bp; 1314} 1315 1316SBBreakpoint | 1302 } 1303 1304 if (log) 1305 { 1306 SBStream sstr; 1307 sb_bp.GetDescription (sstr); 1308 char path[PATH_MAX]; 1309 sb_file_spec->GetPath (path, sizeof(path)); --- 4 unchanged lines hidden (view full) --- 1314 sb_bp.get(), 1315 sstr.GetData()); 1316 } 1317 1318 return sb_bp; 1319} 1320 1321SBBreakpoint |
1317SBTarget::BreakpointCreateByName (const char *symbol_name, const char *module_name) | 1322SBTarget::BreakpointCreateByName (const char *symbol_name, 1323 const char *module_name) |
1318{ 1319 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1320 1321 SBBreakpoint sb_bp; 1322 TargetSP target_sp(GetSP()); 1323 if (target_sp.get()) 1324 { 1325 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1326 1327 const bool internal = false; | 1324{ 1325 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1326 1327 SBBreakpoint sb_bp; 1328 TargetSP target_sp(GetSP()); 1329 if (target_sp.get()) 1330 { 1331 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1332 1333 const bool internal = false; |
1334 const bool hardware = false; |
|
1328 const LazyBool skip_prologue = eLazyBoolCalculate; 1329 if (module_name && module_name[0]) 1330 { 1331 FileSpecList module_spec_list; 1332 module_spec_list.Append (FileSpec (module_name, false)); | 1335 const LazyBool skip_prologue = eLazyBoolCalculate; 1336 if (module_name && module_name[0]) 1337 { 1338 FileSpecList module_spec_list; 1339 module_spec_list.Append (FileSpec (module_name, false)); |
1333 *sb_bp = target_sp->CreateBreakpoint (&module_spec_list, NULL, symbol_name, eFunctionNameTypeAuto, skip_prologue, internal); | 1340 *sb_bp = target_sp->CreateBreakpoint (&module_spec_list, NULL, symbol_name, eFunctionNameTypeAuto, skip_prologue, internal, hardware); |
1334 } 1335 else 1336 { | 1341 } 1342 else 1343 { |
1337 *sb_bp = target_sp->CreateBreakpoint (NULL, NULL, symbol_name, eFunctionNameTypeAuto, skip_prologue, internal); | 1344 *sb_bp = target_sp->CreateBreakpoint (NULL, NULL, symbol_name, eFunctionNameTypeAuto, skip_prologue, internal, hardware); |
1338 } 1339 } 1340 1341 if (log) 1342 { 1343 log->Printf ("SBTarget(%p)::BreakpointCreateByName (symbol=\"%s\", module=\"%s\") => SBBreakpoint(%p)", 1344 target_sp.get(), symbol_name, module_name, sb_bp.get()); 1345 } 1346 1347 return sb_bp; 1348} 1349 1350lldb::SBBreakpoint 1351SBTarget::BreakpointCreateByName (const char *symbol_name, | 1345 } 1346 } 1347 1348 if (log) 1349 { 1350 log->Printf ("SBTarget(%p)::BreakpointCreateByName (symbol=\"%s\", module=\"%s\") => SBBreakpoint(%p)", 1351 target_sp.get(), symbol_name, module_name, sb_bp.get()); 1352 } 1353 1354 return sb_bp; 1355} 1356 1357lldb::SBBreakpoint 1358SBTarget::BreakpointCreateByName (const char *symbol_name, |
1352 const SBFileSpecList &module_list, 1353 const SBFileSpecList &comp_unit_list) | 1359 const SBFileSpecList &module_list, 1360 const SBFileSpecList &comp_unit_list) |
1354{ 1355 uint32_t name_type_mask = eFunctionNameTypeAuto; 1356 return BreakpointCreateByName (symbol_name, name_type_mask, module_list, comp_unit_list); 1357} 1358 1359lldb::SBBreakpoint 1360SBTarget::BreakpointCreateByName (const char *symbol_name, | 1361{ 1362 uint32_t name_type_mask = eFunctionNameTypeAuto; 1363 return BreakpointCreateByName (symbol_name, name_type_mask, module_list, comp_unit_list); 1364} 1365 1366lldb::SBBreakpoint 1367SBTarget::BreakpointCreateByName (const char *symbol_name, |
1361 uint32_t name_type_mask, 1362 const SBFileSpecList &module_list, 1363 const SBFileSpecList &comp_unit_list) | 1368 uint32_t name_type_mask, 1369 const SBFileSpecList &module_list, 1370 const SBFileSpecList &comp_unit_list) |
1364{ 1365 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1366 1367 SBBreakpoint sb_bp; 1368 TargetSP target_sp(GetSP()); 1369 if (target_sp && symbol_name && symbol_name[0]) 1370 { 1371 const bool internal = false; | 1371{ 1372 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1373 1374 SBBreakpoint sb_bp; 1375 TargetSP target_sp(GetSP()); 1376 if (target_sp && symbol_name && symbol_name[0]) 1377 { 1378 const bool internal = false; |
1379 const bool hardware = false; |
|
1372 const LazyBool skip_prologue = eLazyBoolCalculate; 1373 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1374 *sb_bp = target_sp->CreateBreakpoint (module_list.get(), | 1380 const LazyBool skip_prologue = eLazyBoolCalculate; 1381 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1382 *sb_bp = target_sp->CreateBreakpoint (module_list.get(), |
1375 comp_unit_list.get(), 1376 symbol_name, 1377 name_type_mask, 1378 skip_prologue, 1379 internal); | 1383 comp_unit_list.get(), 1384 symbol_name, 1385 name_type_mask, 1386 skip_prologue, 1387 internal, 1388 hardware); |
1380 } 1381 1382 if (log) 1383 { 1384 log->Printf ("SBTarget(%p)::BreakpointCreateByName (symbol=\"%s\", name_type: %d) => SBBreakpoint(%p)", 1385 target_sp.get(), symbol_name, name_type_mask, sb_bp.get()); 1386 } 1387 --- 10 unchanged lines hidden (view full) --- 1398 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1399 1400 SBBreakpoint sb_bp; 1401 TargetSP target_sp(GetSP()); 1402 if (target_sp && num_names > 0) 1403 { 1404 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1405 const bool internal = false; | 1389 } 1390 1391 if (log) 1392 { 1393 log->Printf ("SBTarget(%p)::BreakpointCreateByName (symbol=\"%s\", name_type: %d) => SBBreakpoint(%p)", 1394 target_sp.get(), symbol_name, name_type_mask, sb_bp.get()); 1395 } 1396 --- 10 unchanged lines hidden (view full) --- 1407 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1408 1409 SBBreakpoint sb_bp; 1410 TargetSP target_sp(GetSP()); 1411 if (target_sp && num_names > 0) 1412 { 1413 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1414 const bool internal = false; |
1415 const bool hardware = false; |
|
1406 const LazyBool skip_prologue = eLazyBoolCalculate; 1407 *sb_bp = target_sp->CreateBreakpoint (module_list.get(), 1408 comp_unit_list.get(), 1409 symbol_names, 1410 num_names, 1411 name_type_mask, 1412 skip_prologue, | 1416 const LazyBool skip_prologue = eLazyBoolCalculate; 1417 *sb_bp = target_sp->CreateBreakpoint (module_list.get(), 1418 comp_unit_list.get(), 1419 symbol_names, 1420 num_names, 1421 name_type_mask, 1422 skip_prologue, |
1413 internal); | 1423 internal, 1424 hardware); |
1414 } 1415 1416 if (log) 1417 { 1418 log->Printf ("SBTarget(%p)::BreakpointCreateByName (symbols={", target_sp.get()); 1419 for (uint32_t i = 0 ; i < num_names; i++) 1420 { 1421 char sep; --- 9 unchanged lines hidden (view full) --- 1431 } 1432 log->Printf ("name_type: %d) => SBBreakpoint(%p)", name_type_mask, sb_bp.get()); 1433 } 1434 1435 return sb_bp; 1436} 1437 1438SBBreakpoint | 1425 } 1426 1427 if (log) 1428 { 1429 log->Printf ("SBTarget(%p)::BreakpointCreateByName (symbols={", target_sp.get()); 1430 for (uint32_t i = 0 ; i < num_names; i++) 1431 { 1432 char sep; --- 9 unchanged lines hidden (view full) --- 1442 } 1443 log->Printf ("name_type: %d) => SBBreakpoint(%p)", name_type_mask, sb_bp.get()); 1444 } 1445 1446 return sb_bp; 1447} 1448 1449SBBreakpoint |
1439SBTarget::BreakpointCreateByRegex (const char *symbol_name_regex, const char *module_name) | 1450SBTarget::BreakpointCreateByRegex (const char *symbol_name_regex, 1451 const char *module_name) |
1440{ 1441 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1442 1443 SBBreakpoint sb_bp; 1444 TargetSP target_sp(GetSP()); 1445 if (target_sp && symbol_name_regex && symbol_name_regex[0]) 1446 { 1447 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1448 RegularExpression regexp(symbol_name_regex); 1449 const bool internal = false; | 1452{ 1453 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1454 1455 SBBreakpoint sb_bp; 1456 TargetSP target_sp(GetSP()); 1457 if (target_sp && symbol_name_regex && symbol_name_regex[0]) 1458 { 1459 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1460 RegularExpression regexp(symbol_name_regex); 1461 const bool internal = false; |
1462 const bool hardware = false; |
|
1450 const LazyBool skip_prologue = eLazyBoolCalculate; 1451 1452 if (module_name && module_name[0]) 1453 { 1454 FileSpecList module_spec_list; 1455 module_spec_list.Append (FileSpec (module_name, false)); 1456 | 1463 const LazyBool skip_prologue = eLazyBoolCalculate; 1464 1465 if (module_name && module_name[0]) 1466 { 1467 FileSpecList module_spec_list; 1468 module_spec_list.Append (FileSpec (module_name, false)); 1469 |
1457 *sb_bp = target_sp->CreateFuncRegexBreakpoint (&module_spec_list, NULL, regexp, skip_prologue, internal); | 1470 *sb_bp = target_sp->CreateFuncRegexBreakpoint (&module_spec_list, NULL, regexp, skip_prologue, internal, hardware); |
1458 } 1459 else 1460 { | 1471 } 1472 else 1473 { |
1461 *sb_bp = target_sp->CreateFuncRegexBreakpoint (NULL, NULL, regexp, skip_prologue, internal); | 1474 *sb_bp = target_sp->CreateFuncRegexBreakpoint (NULL, NULL, regexp, skip_prologue, internal, hardware); |
1462 } 1463 } 1464 1465 if (log) 1466 { 1467 log->Printf ("SBTarget(%p)::BreakpointCreateByRegex (symbol_regex=\"%s\", module_name=\"%s\") => SBBreakpoint(%p)", 1468 target_sp.get(), symbol_name_regex, module_name, sb_bp.get()); 1469 } 1470 1471 return sb_bp; 1472} 1473 1474lldb::SBBreakpoint 1475SBTarget::BreakpointCreateByRegex (const char *symbol_name_regex, | 1475 } 1476 } 1477 1478 if (log) 1479 { 1480 log->Printf ("SBTarget(%p)::BreakpointCreateByRegex (symbol_regex=\"%s\", module_name=\"%s\") => SBBreakpoint(%p)", 1481 target_sp.get(), symbol_name_regex, module_name, sb_bp.get()); 1482 } 1483 1484 return sb_bp; 1485} 1486 1487lldb::SBBreakpoint 1488SBTarget::BreakpointCreateByRegex (const char *symbol_name_regex, |
1476 const SBFileSpecList &module_list, 1477 const SBFileSpecList &comp_unit_list) | 1489 const SBFileSpecList &module_list, 1490 const SBFileSpecList &comp_unit_list) |
1478{ 1479 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1480 1481 SBBreakpoint sb_bp; 1482 TargetSP target_sp(GetSP()); 1483 if (target_sp && symbol_name_regex && symbol_name_regex[0]) 1484 { 1485 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1486 RegularExpression regexp(symbol_name_regex); 1487 const bool internal = false; | 1491{ 1492 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1493 1494 SBBreakpoint sb_bp; 1495 TargetSP target_sp(GetSP()); 1496 if (target_sp && symbol_name_regex && symbol_name_regex[0]) 1497 { 1498 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1499 RegularExpression regexp(symbol_name_regex); 1500 const bool internal = false; |
1501 const bool hardware = false; |
|
1488 const LazyBool skip_prologue = eLazyBoolCalculate; 1489 | 1502 const LazyBool skip_prologue = eLazyBoolCalculate; 1503 |
1490 *sb_bp = target_sp->CreateFuncRegexBreakpoint (module_list.get(), comp_unit_list.get(), regexp, skip_prologue, internal); | 1504 *sb_bp = target_sp->CreateFuncRegexBreakpoint (module_list.get(), comp_unit_list.get(), regexp, skip_prologue, internal, hardware); |
1491 } 1492 1493 if (log) 1494 { 1495 log->Printf ("SBTarget(%p)::BreakpointCreateByRegex (symbol_regex=\"%s\") => SBBreakpoint(%p)", 1496 target_sp.get(), symbol_name_regex, sb_bp.get()); 1497 } 1498 --- 5 unchanged lines hidden (view full) --- 1504{ 1505 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1506 1507 SBBreakpoint sb_bp; 1508 TargetSP target_sp(GetSP()); 1509 if (target_sp) 1510 { 1511 Mutex::Locker api_locker (target_sp->GetAPIMutex()); | 1505 } 1506 1507 if (log) 1508 { 1509 log->Printf ("SBTarget(%p)::BreakpointCreateByRegex (symbol_regex=\"%s\") => SBBreakpoint(%p)", 1510 target_sp.get(), symbol_name_regex, sb_bp.get()); 1511 } 1512 --- 5 unchanged lines hidden (view full) --- 1518{ 1519 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1520 1521 SBBreakpoint sb_bp; 1522 TargetSP target_sp(GetSP()); 1523 if (target_sp) 1524 { 1525 Mutex::Locker api_locker (target_sp->GetAPIMutex()); |
1512 *sb_bp = target_sp->CreateBreakpoint (address, false); | 1526 const bool hardware = false; 1527 *sb_bp = target_sp->CreateBreakpoint (address, false, hardware); |
1513 } 1514 1515 if (log) 1516 { 1517 log->Printf ("SBTarget(%p)::BreakpointCreateByAddress (address=%" PRIu64 ") => SBBreakpoint(%p)", target_sp.get(), (uint64_t) address, sb_bp.get()); 1518 } 1519 1520 return sb_bp; 1521} 1522 1523lldb::SBBreakpoint | 1528 } 1529 1530 if (log) 1531 { 1532 log->Printf ("SBTarget(%p)::BreakpointCreateByAddress (address=%" PRIu64 ") => SBBreakpoint(%p)", target_sp.get(), (uint64_t) address, sb_bp.get()); 1533 } 1534 1535 return sb_bp; 1536} 1537 1538lldb::SBBreakpoint |
1524SBTarget::BreakpointCreateBySourceRegex (const char *source_regex, const lldb::SBFileSpec &source_file, const char *module_name) | 1539SBTarget::BreakpointCreateBySourceRegex (const char *source_regex, 1540 const lldb::SBFileSpec &source_file, 1541 const char *module_name) |
1525{ 1526 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1527 1528 SBBreakpoint sb_bp; 1529 TargetSP target_sp(GetSP()); 1530 if (target_sp && source_regex && source_regex[0]) 1531 { 1532 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1533 RegularExpression regexp(source_regex); 1534 FileSpecList source_file_spec_list; | 1542{ 1543 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1544 1545 SBBreakpoint sb_bp; 1546 TargetSP target_sp(GetSP()); 1547 if (target_sp && source_regex && source_regex[0]) 1548 { 1549 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1550 RegularExpression regexp(source_regex); 1551 FileSpecList source_file_spec_list; |
1552 const bool hardware = false; |
|
1535 source_file_spec_list.Append (source_file.ref()); 1536 1537 if (module_name && module_name[0]) 1538 { 1539 FileSpecList module_spec_list; 1540 module_spec_list.Append (FileSpec (module_name, false)); 1541 | 1553 source_file_spec_list.Append (source_file.ref()); 1554 1555 if (module_name && module_name[0]) 1556 { 1557 FileSpecList module_spec_list; 1558 module_spec_list.Append (FileSpec (module_name, false)); 1559 |
1542 *sb_bp = target_sp->CreateSourceRegexBreakpoint (&module_spec_list, &source_file_spec_list, regexp, false); | 1560 *sb_bp = target_sp->CreateSourceRegexBreakpoint (&module_spec_list, &source_file_spec_list, regexp, false, hardware); |
1543 } 1544 else 1545 { | 1561 } 1562 else 1563 { |
1546 *sb_bp = target_sp->CreateSourceRegexBreakpoint (NULL, &source_file_spec_list, regexp, false); | 1564 *sb_bp = target_sp->CreateSourceRegexBreakpoint (NULL, &source_file_spec_list, regexp, false, hardware); |
1547 } 1548 } 1549 1550 if (log) 1551 { 1552 char path[PATH_MAX]; 1553 source_file->GetPath (path, sizeof(path)); 1554 log->Printf ("SBTarget(%p)::BreakpointCreateByRegex (source_regex=\"%s\", file=\"%s\", module_name=\"%s\") => SBBreakpoint(%p)", 1555 target_sp.get(), source_regex, path, module_name, sb_bp.get()); 1556 } 1557 1558 return sb_bp; 1559} 1560 1561lldb::SBBreakpoint 1562SBTarget::BreakpointCreateBySourceRegex (const char *source_regex, | 1565 } 1566 } 1567 1568 if (log) 1569 { 1570 char path[PATH_MAX]; 1571 source_file->GetPath (path, sizeof(path)); 1572 log->Printf ("SBTarget(%p)::BreakpointCreateByRegex (source_regex=\"%s\", file=\"%s\", module_name=\"%s\") => SBBreakpoint(%p)", 1573 target_sp.get(), source_regex, path, module_name, sb_bp.get()); 1574 } 1575 1576 return sb_bp; 1577} 1578 1579lldb::SBBreakpoint 1580SBTarget::BreakpointCreateBySourceRegex (const char *source_regex, |
1563 const SBFileSpecList &module_list, 1564 const lldb::SBFileSpecList &source_file_list) | 1581 const SBFileSpecList &module_list, 1582 const lldb::SBFileSpecList &source_file_list) |
1565{ 1566 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1567 1568 SBBreakpoint sb_bp; 1569 TargetSP target_sp(GetSP()); 1570 if (target_sp && source_regex && source_regex[0]) 1571 { 1572 Mutex::Locker api_locker (target_sp->GetAPIMutex()); | 1583{ 1584 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1585 1586 SBBreakpoint sb_bp; 1587 TargetSP target_sp(GetSP()); 1588 if (target_sp && source_regex && source_regex[0]) 1589 { 1590 Mutex::Locker api_locker (target_sp->GetAPIMutex()); |
1591 const bool hardware = false; |
|
1573 RegularExpression regexp(source_regex); | 1592 RegularExpression regexp(source_regex); |
1574 *sb_bp = target_sp->CreateSourceRegexBreakpoint (module_list.get(), source_file_list.get(), regexp, false); | 1593 *sb_bp = target_sp->CreateSourceRegexBreakpoint (module_list.get(), source_file_list.get(), regexp, false, hardware); |
1575 } 1576 1577 if (log) 1578 { 1579 log->Printf ("SBTarget(%p)::BreakpointCreateByRegex (source_regex=\"%s\") => SBBreakpoint(%p)", 1580 target_sp.get(), source_regex, sb_bp.get()); 1581 } 1582 1583 return sb_bp; 1584} 1585 1586lldb::SBBreakpoint 1587SBTarget::BreakpointCreateForException (lldb::LanguageType language, | 1594 } 1595 1596 if (log) 1597 { 1598 log->Printf ("SBTarget(%p)::BreakpointCreateByRegex (source_regex=\"%s\") => SBBreakpoint(%p)", 1599 target_sp.get(), source_regex, sb_bp.get()); 1600 } 1601 1602 return sb_bp; 1603} 1604 1605lldb::SBBreakpoint 1606SBTarget::BreakpointCreateForException (lldb::LanguageType language, |
1588 bool catch_bp, 1589 bool throw_bp) | 1607 bool catch_bp, 1608 bool throw_bp) |
1590{ 1591 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1592 1593 SBBreakpoint sb_bp; 1594 TargetSP target_sp(GetSP()); 1595 if (target_sp) 1596 { 1597 Mutex::Locker api_locker (target_sp->GetAPIMutex()); | 1609{ 1610 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1611 1612 SBBreakpoint sb_bp; 1613 TargetSP target_sp(GetSP()); 1614 if (target_sp) 1615 { 1616 Mutex::Locker api_locker (target_sp->GetAPIMutex()); |
1598 *sb_bp = target_sp->CreateExceptionBreakpoint (language, catch_bp, throw_bp); | 1617 const bool hardware = false; 1618 *sb_bp = target_sp->CreateExceptionBreakpoint (language, catch_bp, throw_bp, hardware); |
1599 } 1600 1601 if (log) 1602 { 1603 log->Printf ("SBTarget(%p)::BreakpointCreateByRegex (Language: %s, catch: %s throw: %s) => SBBreakpoint(%p)", 1604 target_sp.get(), 1605 LanguageRuntime::GetNameForLanguageType(language), 1606 catch_bp ? "on" : "off", --- 250 unchanged lines hidden (view full) --- 1857 Mutex::Locker locker; 1858 target_sp->GetWatchpointList().GetListMutex(locker); 1859 target_sp->DisableAllWatchpoints (); 1860 return true; 1861 } 1862 return false; 1863} 1864 | 1619 } 1620 1621 if (log) 1622 { 1623 log->Printf ("SBTarget(%p)::BreakpointCreateByRegex (Language: %s, catch: %s throw: %s) => SBBreakpoint(%p)", 1624 target_sp.get(), 1625 LanguageRuntime::GetNameForLanguageType(language), 1626 catch_bp ? "on" : "off", --- 250 unchanged lines hidden (view full) --- 1877 Mutex::Locker locker; 1878 target_sp->GetWatchpointList().GetListMutex(locker); 1879 target_sp->DisableAllWatchpoints (); 1880 return true; 1881 } 1882 return false; 1883} 1884 |
1885SBValue 1886SBTarget::CreateValueFromAddress (const char *name, SBAddress addr, SBType type) 1887{ 1888 SBValue sb_value; 1889 lldb::ValueObjectSP new_value_sp; 1890 if (IsValid() && name && *name && addr.IsValid() && type.IsValid()) 1891 { 1892 lldb::addr_t address(addr.GetLoadAddress(*this)); 1893 lldb::TypeImplSP type_impl_sp (type.GetSP()); 1894 ClangASTType pointer_ast_type(type_impl_sp->GetClangASTType(true).GetPointerType ()); 1895 if (pointer_ast_type) 1896 { 1897 lldb::DataBufferSP buffer(new lldb_private::DataBufferHeap(&address,sizeof(lldb::addr_t))); 1898 1899 ExecutionContext exe_ctx (ExecutionContextRef(ExecutionContext(m_opaque_sp.get(),false))); 1900 ValueObjectSP ptr_result_valobj_sp(ValueObjectConstResult::Create (exe_ctx.GetBestExecutionContextScope(), 1901 pointer_ast_type, 1902 ConstString(name), 1903 buffer, 1904 exe_ctx.GetByteOrder(), 1905 exe_ctx.GetAddressByteSize())); 1906 1907 if (ptr_result_valobj_sp) 1908 { 1909 ptr_result_valobj_sp->GetValue().SetValueType(Value::eValueTypeLoadAddress); 1910 Error err; 1911 new_value_sp = ptr_result_valobj_sp->Dereference(err); 1912 if (new_value_sp) 1913 new_value_sp->SetName(ConstString(name)); 1914 } 1915 } 1916 } 1917 sb_value.SetSP(new_value_sp); 1918 Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); 1919 if (log) 1920 { 1921 if (new_value_sp) 1922 log->Printf ("SBTarget(%p)::CreateValueFromAddress => \"%s\"", m_opaque_sp.get(), new_value_sp->GetName().AsCString()); 1923 else 1924 log->Printf ("SBTarget(%p)::CreateValueFromAddress => NULL", m_opaque_sp.get()); 1925 } 1926 return sb_value; 1927} 1928 |
|
1865bool 1866SBTarget::DeleteAllWatchpoints () 1867{ 1868 TargetSP target_sp(GetSP()); 1869 if (target_sp) 1870 { 1871 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1872 Mutex::Locker locker; --- 27 unchanged lines hidden (view full) --- 1900 if (path) 1901 module_spec.GetFileSpec().SetFile(path, false); 1902 1903 if (uuid_cstr) 1904 module_spec.GetUUID().SetFromCString(uuid_cstr); 1905 1906 if (triple) 1907 module_spec.GetArchitecture().SetTriple (triple, target_sp->GetPlatform ().get()); | 1929bool 1930SBTarget::DeleteAllWatchpoints () 1931{ 1932 TargetSP target_sp(GetSP()); 1933 if (target_sp) 1934 { 1935 Mutex::Locker api_locker (target_sp->GetAPIMutex()); 1936 Mutex::Locker locker; --- 27 unchanged lines hidden (view full) --- 1964 if (path) 1965 module_spec.GetFileSpec().SetFile(path, false); 1966 1967 if (uuid_cstr) 1968 module_spec.GetUUID().SetFromCString(uuid_cstr); 1969 1970 if (triple) 1971 module_spec.GetArchitecture().SetTriple (triple, target_sp->GetPlatform ().get()); |
1972 else 1973 module_spec.GetArchitecture() = target_sp->GetArchitecture(); |
|
1908 1909 if (symfile) 1910 module_spec.GetSymbolFileSpec ().SetFile(symfile, false); 1911 1912 sb_module.SetSP(target_sp->GetSharedModule (module_spec)); 1913 } 1914 return sb_module; 1915} --- 745 unchanged lines hidden --- | 1974 1975 if (symfile) 1976 module_spec.GetSymbolFileSpec ().SetFile(symfile, false); 1977 1978 sb_module.SetSP(target_sp->GetSharedModule (module_spec)); 1979 } 1980 return sb_module; 1981} --- 745 unchanged lines hidden --- |