https://github.com/rupprecht created
https://github.com/llvm/llvm-project/pull/87263
We check if the next character after `N.` is `*` before we check its length.
Using `split` on the string is cleaner and less error prone than using indices
with `find` and `substr`.
Note: this does not make `
llvmbot wrote:
@llvm/pr-subscribers-lldb
Author: Jordan Rupprecht (rupprecht)
Changes
We check if the next character after `N.` is `*` before we check its length.
Using `split` on the string is cleaner and less error prone than using indices
with `find` and `substr`.
Note: this does not
https://github.com/jimingham approved this pull request.
LGMT
https://github.com/llvm/llvm-project/pull/87263
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -441,6 +441,19 @@ class ValueObject {
virtual int64_t GetValueAsSigned(int64_t fail_value, bool *success =
nullptr);
+ llvm::APSInt GetValueAsAPSInt();
jimingham wrote:
Not all SBValues are representable as Int's or Floats, Bool's etc. But I don't
s
@@ -618,6 +631,24 @@ class ValueObject {
virtual lldb::ValueObjectSP CastPointerType(const char *name,
lldb::TypeSP &type_sp);
+ /// Return the target load address assocaited with this value object.
+ lldb::addr_t GetLoadAddres
@@ -668,6 +699,32 @@ class ValueObject {
CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data,
const ExecutionContext &exe_ctx, CompilerType
type);
+ static lldb::ValueObjectSP
jimingham wrote:
Given target
@@ -441,6 +441,19 @@ class ValueObject {
virtual int64_t GetValueAsSigned(int64_t fail_value, bool *success =
nullptr);
+ llvm::APSInt GetValueAsAPSInt();
adrian-prantl wrote:
if these errors matter to users then `llvm::Expected` would be
the right choi
@@ -441,6 +441,19 @@ class ValueObject {
virtual int64_t GetValueAsSigned(int64_t fail_value, bool *success =
nullptr);
+ llvm::APSInt GetValueAsAPSInt();
+
+ llvm::APFloat GetValueAsFloat();
adrian-prantl wrote:
same here
https://github.com/llvm/llvm-
@@ -441,6 +441,19 @@ class ValueObject {
virtual int64_t GetValueAsSigned(int64_t fail_value, bool *success =
nullptr);
+ llvm::APSInt GetValueAsAPSInt();
+
+ llvm::APFloat GetValueAsFloat();
+
+ bool GetValueAsBool();
adrian-prantl wrote:
same here
h
@@ -668,6 +699,32 @@ class ValueObject {
CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data,
const ExecutionContext &exe_ctx, CompilerType
type);
+ static lldb::ValueObjectSP
+ CreateValueObjectFromBytes(lldb::TargetSP ta
@@ -668,6 +699,32 @@ class ValueObject {
CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data,
const ExecutionContext &exe_ctx, CompilerType
type);
+ static lldb::ValueObjectSP
+ CreateValueObjectFromBytes(lldb::TargetSP ta
@@ -719,6 +776,10 @@ class ValueObject {
ClearUserVisibleData(eClearUserVisibleDataItemsSummary);
}
+ void SetDerefValobj(ValueObject *deref) { m_deref_valobj = deref; }
jimingham wrote:
Synthetic child providers also have a way to provide the deref Va
https://github.com/bulbazord edited
https://github.com/llvm/llvm-project/pull/87197
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/bulbazord requested changes to this pull request.
+1 to all of Jim and Adrian's comments.
High level comments:
1. I'm a little concerned about the use of assertions in this patch. I
generally like assertions when they are used to assert internal consistency. It
looks like yo
@@ -1089,6 +1089,116 @@ int64_t ValueObject::GetValueAsSigned(int64_t
fail_value, bool *success) {
return fail_value;
}
+llvm::APSInt ValueObject::GetValueAsAPSInt() {
+ lldb::TargetSP target = GetTargetSP();
+ uint64_t byte_size = 0;
+ if (auto temp = GetCompilerType().
@@ -618,6 +631,24 @@ class ValueObject {
virtual lldb::ValueObjectSP CastPointerType(const char *name,
lldb::TypeSP &type_sp);
+ /// Return the target load address assocaited with this value object.
bulbazord wr
@@ -1089,6 +1089,116 @@ int64_t ValueObject::GetValueAsSigned(int64_t
fail_value, bool *success) {
return fail_value;
}
+llvm::APSInt ValueObject::GetValueAsAPSInt() {
+ lldb::TargetSP target = GetTargetSP();
+ uint64_t byte_size = 0;
+ if (auto temp = GetCompilerType().
@@ -1089,6 +1089,116 @@ int64_t ValueObject::GetValueAsSigned(int64_t
fail_value, bool *success) {
return fail_value;
}
+llvm::APSInt ValueObject::GetValueAsAPSInt() {
+ lldb::TargetSP target = GetTargetSP();
+ uint64_t byte_size = 0;
+ if (auto temp = GetCompilerType().
@@ -1089,6 +1089,116 @@ int64_t ValueObject::GetValueAsSigned(int64_t
fail_value, bool *success) {
return fail_value;
}
+llvm::APSInt ValueObject::GetValueAsAPSInt() {
+ lldb::TargetSP target = GetTargetSP();
+ uint64_t byte_size = 0;
+ if (auto temp = GetCompilerType().
@@ -2809,6 +2919,243 @@ ValueObjectSP ValueObject::CastPointerType(const char
*name, TypeSP &type_sp) {
return valobj_sp;
}
+lldb::addr_t ValueObject::GetLoadAddress() {
+ lldb::addr_t addr_value = LLDB_INVALID_ADDRESS;
+ lldb::TargetSP target_sp = GetTargetSP();
+ if (t
@@ -1089,6 +1089,116 @@ int64_t ValueObject::GetValueAsSigned(int64_t
fail_value, bool *success) {
return fail_value;
}
+llvm::APSInt ValueObject::GetValueAsAPSInt() {
+ lldb::TargetSP target = GetTargetSP();
+ uint64_t byte_size = 0;
+ if (auto temp = GetCompilerType().
@@ -2809,6 +2919,243 @@ ValueObjectSP ValueObject::CastPointerType(const char
*name, TypeSP &type_sp) {
return valobj_sp;
}
+lldb::addr_t ValueObject::GetLoadAddress() {
+ lldb::addr_t addr_value = LLDB_INVALID_ADDRESS;
+ lldb::TargetSP target_sp = GetTargetSP();
+ if (t
@@ -618,6 +631,24 @@ class ValueObject {
virtual lldb::ValueObjectSP CastPointerType(const char *name,
lldb::TypeSP &type_sp);
+ /// Return the target load address assocaited with this value object.
+ lldb::addr_t GetLoadAddres
@@ -2809,6 +2919,243 @@ ValueObjectSP ValueObject::CastPointerType(const char
*name, TypeSP &type_sp) {
return valobj_sp;
}
+lldb::addr_t ValueObject::GetLoadAddress() {
+ lldb::addr_t addr_value = LLDB_INVALID_ADDRESS;
+ lldb::TargetSP target_sp = GetTargetSP();
+ if (t
@@ -2809,6 +2919,243 @@ ValueObjectSP ValueObject::CastPointerType(const char
*name, TypeSP &type_sp) {
return valobj_sp;
}
+lldb::addr_t ValueObject::GetLoadAddress() {
+ lldb::addr_t addr_value = LLDB_INVALID_ADDRESS;
+ lldb::TargetSP target_sp = GetTargetSP();
+ if (t
@@ -1089,6 +1089,116 @@ int64_t ValueObject::GetValueAsSigned(int64_t
fail_value, bool *success) {
return fail_value;
}
+llvm::APSInt ValueObject::GetValueAsAPSInt() {
+ lldb::TargetSP target = GetTargetSP();
+ uint64_t byte_size = 0;
+ if (auto temp = GetCompilerType().
@@ -2809,6 +2919,243 @@ ValueObjectSP ValueObject::CastPointerType(const char
*name, TypeSP &type_sp) {
return valobj_sp;
}
+lldb::addr_t ValueObject::GetLoadAddress() {
+ lldb::addr_t addr_value = LLDB_INVALID_ADDRESS;
+ lldb::TargetSP target_sp = GetTargetSP();
+ if (t
@@ -1089,6 +1089,116 @@ int64_t ValueObject::GetValueAsSigned(int64_t
fail_value, bool *success) {
return fail_value;
}
+llvm::APSInt ValueObject::GetValueAsAPSInt() {
+ lldb::TargetSP target = GetTargetSP();
+ uint64_t byte_size = 0;
+ if (auto temp = GetCompilerType().
https://github.com/bulbazord approved this pull request.
Rewriting this has been on my backlog for a few months now. This looks better
than what I had in mind. Thank you! 😄
https://github.com/llvm/llvm-project/pull/87263
___
lldb-commits mailing list
@@ -618,6 +631,24 @@ class ValueObject {
virtual lldb::ValueObjectSP CastPointerType(const char *name,
lldb::TypeSP &type_sp);
+ /// Return the target load address assocaited with this value object.
+ lldb::addr_t GetLoadAddres
@@ -668,6 +699,32 @@ class ValueObject {
CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data,
const ExecutionContext &exe_ctx, CompilerType
type);
+ static lldb::ValueObjectSP
+ CreateValueObjectFromBytes(lldb::TargetSP ta
@@ -618,6 +631,24 @@ class ValueObject {
virtual lldb::ValueObjectSP CastPointerType(const char *name,
lldb::TypeSP &type_sp);
+ /// Return the target load address assocaited with this value object.
+ lldb::addr_t GetLoadAddres
@@ -618,6 +631,24 @@ class ValueObject {
virtual lldb::ValueObjectSP CastPointerType(const char *name,
lldb::TypeSP &type_sp);
+ /// Return the target load address assocaited with this value object.
+ lldb::addr_t GetLoadAddres
@@ -441,6 +441,19 @@ class ValueObject {
virtual int64_t GetValueAsSigned(int64_t fail_value, bool *success =
nullptr);
+ llvm::APSInt GetValueAsAPSInt();
+
+ llvm::APFloat GetValueAsFloat();
+
+ bool GetValueAsBool();
+
+ /// Update the value of the current object to
@@ -441,6 +441,19 @@ class ValueObject {
virtual int64_t GetValueAsSigned(int64_t fail_value, bool *success =
nullptr);
+ llvm::APSInt GetValueAsAPSInt();
+
+ llvm::APFloat GetValueAsFloat();
+
+ bool GetValueAsBool();
clayborg wrote:
Do we need `GetVa
@@ -668,6 +699,32 @@ class ValueObject {
CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data,
const ExecutionContext &exe_ctx, CompilerType
type);
+ static lldb::ValueObjectSP
+ CreateValueObjectFromBytes(lldb::TargetSP ta
@@ -1089,6 +1089,116 @@ int64_t ValueObject::GetValueAsSigned(int64_t
fail_value, bool *success) {
return fail_value;
}
+llvm::APSInt ValueObject::GetValueAsAPSInt() {
+ lldb::TargetSP target = GetTargetSP();
+ uint64_t byte_size = 0;
+ if (auto temp = GetCompilerType().
@@ -441,6 +441,19 @@ class ValueObject {
virtual int64_t GetValueAsSigned(int64_t fail_value, bool *success =
nullptr);
+ llvm::APSInt GetValueAsAPSInt();
+
+ llvm::APFloat GetValueAsFloat();
+
+ bool GetValueAsBool();
+
+ /// Update the value of the current object to
@@ -668,6 +699,32 @@ class ValueObject {
CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data,
const ExecutionContext &exe_ctx, CompilerType
type);
+ static lldb::ValueObjectSP
+ CreateValueObjectFromBytes(lldb::TargetSP ta
@@ -1089,6 +1089,116 @@ int64_t ValueObject::GetValueAsSigned(int64_t
fail_value, bool *success) {
return fail_value;
}
+llvm::APSInt ValueObject::GetValueAsAPSInt() {
+ lldb::TargetSP target = GetTargetSP();
+ uint64_t byte_size = 0;
+ if (auto temp = GetCompilerType().
@@ -1089,6 +1089,116 @@ int64_t ValueObject::GetValueAsSigned(int64_t
fail_value, bool *success) {
return fail_value;
}
+llvm::APSInt ValueObject::GetValueAsAPSInt() {
+ lldb::TargetSP target = GetTargetSP();
+ uint64_t byte_size = 0;
+ if (auto temp = GetCompilerType().
@@ -1089,6 +1089,116 @@ int64_t ValueObject::GetValueAsSigned(int64_t
fail_value, bool *success) {
return fail_value;
}
+llvm::APSInt ValueObject::GetValueAsAPSInt() {
+ lldb::TargetSP target = GetTargetSP();
+ uint64_t byte_size = 0;
+ if (auto temp = GetCompilerType().
@@ -1089,6 +1089,116 @@ int64_t ValueObject::GetValueAsSigned(int64_t
fail_value, bool *success) {
return fail_value;
}
+llvm::APSInt ValueObject::GetValueAsAPSInt() {
+ lldb::TargetSP target = GetTargetSP();
+ uint64_t byte_size = 0;
+ if (auto temp = GetCompilerType().
@@ -2809,6 +2919,243 @@ ValueObjectSP ValueObject::CastPointerType(const char
*name, TypeSP &type_sp) {
return valobj_sp;
}
+lldb::addr_t ValueObject::GetLoadAddress() {
+ lldb::addr_t addr_value = LLDB_INVALID_ADDRESS;
+ lldb::TargetSP target_sp = GetTargetSP();
+ if (t
@@ -1089,6 +1089,116 @@ int64_t ValueObject::GetValueAsSigned(int64_t
fail_value, bool *success) {
return fail_value;
}
+llvm::APSInt ValueObject::GetValueAsAPSInt() {
+ lldb::TargetSP target = GetTargetSP();
+ uint64_t byte_size = 0;
+ if (auto temp = GetCompilerType().
@@ -1089,6 +1089,116 @@ int64_t ValueObject::GetValueAsSigned(int64_t
fail_value, bool *success) {
return fail_value;
}
+llvm::APSInt ValueObject::GetValueAsAPSInt() {
+ lldb::TargetSP target = GetTargetSP();
+ uint64_t byte_size = 0;
+ if (auto temp = GetCompilerType().
Author: Jordan Rupprecht
Date: 2024-04-01T16:02:12-05:00
New Revision: a6caceed8d27d4ebd44c517c3114a36a64ebddfe
URL:
https://github.com/llvm/llvm-project/commit/a6caceed8d27d4ebd44c517c3114a36a64ebddfe
DIFF:
https://github.com/llvm/llvm-project/commit/a6caceed8d27d4ebd44c517c3114a36a64ebddfe.di
https://github.com/rupprecht closed
https://github.com/llvm/llvm-project/pull/87263
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Author: David Blaikie
Date: 2024-04-01T23:07:01Z
New Revision: 9df19ce40281551bd348b262a131085cf98dadf5
URL:
https://github.com/llvm/llvm-project/commit/9df19ce40281551bd348b262a131085cf98dadf5
DIFF:
https://github.com/llvm/llvm-project/commit/9df19ce40281551bd348b262a131085cf98dadf5.diff
LOG:
49 matches
Mail list logo