[Lldb-commits] [lldb] [lldb] Adds additional fields to ProcessInfo (PR #91544)

2024-05-10 Thread Ed Maste via lldb-commits


@@ -12,6 +12,9 @@
 #include "lldb/Utility/ProcessInfo.h"
 #include "gtest/gtest.h"
 
+#include 
+#include 

emaste wrote:

Much of this file would work just fine on FreeBSD as well so that might make 
sense, although I'm not sure what the best structure would be -- maybe much of 
this file should move to a new lldb/unittests/Host/posix/HostTest.cpp, leaving 
anything Linux-specific here?

https://github.com/llvm/llvm-project/pull/91544
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Adds additional fields to ProcessInfo (PR #91544)

2024-05-09 Thread Ed Maste via lldb-commits


@@ -237,6 +250,16 @@ class ProcessInstanceInfo : public ProcessInfo {
m_cumulative_system_time.tv_usec > 0;
   }
 
+  int8_t GetNiceValue() const { return m_nice_value; }

emaste wrote:

nice and priority are not synonymous though, nice is one input into the 
process's priority. I'm not sure which we actually want in this context.

https://github.com/llvm/llvm-project/pull/91544
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][test][FreeBSD] Remove xfails from TestGDBRemoteLoad (PR #84026)

2024-05-02 Thread Ed Maste via lldb-commits

https://github.com/emaste approved this pull request.


https://github.com/llvm/llvm-project/pull/84026
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][test][FreeBSD] Account for spsr being 8 bytes in newer versions (PR #84032)

2024-05-01 Thread Ed Maste via lldb-commits


@@ -362,7 +363,15 @@ TEST(RegisterContextFreeBSDTest, arm64) {
   EXPECT_GPR_ARM64(lr, lr);
   EXPECT_GPR_ARM64(sp, sp);
   EXPECT_GPR_ARM64(pc, elr);
+#if __FreeBSD_version >= 1400084

emaste wrote:

This will be correct when the host running the debugger is the same as the 
target (or at least the same version) but we should handle this based on target 
version

https://github.com/llvm/llvm-project/pull/84032
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][test][FreeBSD] Account for spsr being 8 bytes in newer versions (PR #84032)

2024-05-01 Thread Ed Maste via lldb-commits

emaste wrote:

CC @zxombie 

https://github.com/llvm/llvm-project/pull/84032
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][test][FreeBSD] Narrow vectorcall xfail to x86 platforms (PR #84024)

2024-05-01 Thread Ed Maste via lldb-commits

https://github.com/emaste approved this pull request.


https://github.com/llvm/llvm-project/pull/84024
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][test][FreeBSD] Remove corefile test xfails (PR #84022)

2024-05-01 Thread Ed Maste via lldb-commits

https://github.com/emaste approved this pull request.


https://github.com/llvm/llvm-project/pull/84022
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [LLDB] Add FreeBSD kernel coredump matching check. (PR #80785)

2024-05-01 Thread Ed Maste via lldb-commits

emaste wrote:

> However, for minimal dump, the build-id section won't loaded because minimal 
> dump only dump the used memory by kernel.

If we fall back to no-UUID-found in that case and don't require that it matches 
this is still an improvement, yeah?

https://github.com/llvm/llvm-project/pull/80785
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][test][FreeBSD] Fix some concurrent event tests (PR #84155)

2024-05-01 Thread Ed Maste via lldb-commits

emaste wrote:

Yes I think it's likely fixed. I'll give it a try on my FreeBSD laptop shortly.


https://github.com/llvm/llvm-project/pull/84155
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][test][FreeBSD] Fix some concurrent event tests (PR #84155)

2024-05-01 Thread Ed Maste via lldb-commits

https://github.com/emaste approved this pull request.


https://github.com/llvm/llvm-project/pull/84155
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [llvm] [lldb][FreeBSD][AArch64] Enable register field detection (PR #85058)

2024-05-01 Thread Ed Maste via lldb-commits

emaste wrote:

@zxombie fyi

https://github.com/llvm/llvm-project/pull/85058
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Teach LocateExecutableSymbolFile to look into LOCALBASE on FreeBSD (PR #81355)

2024-05-01 Thread Ed Maste via lldb-commits

https://github.com/emaste closed https://github.com/llvm/llvm-project/pull/81355
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Teach LocateExecutableSymbolFile to look into LOCALBASE on FreeBSD (PR #81355)

2024-05-01 Thread Ed Maste via lldb-commits

https://github.com/emaste approved this pull request.

This is reasonable and in line with the existing special case for NetBSD, but 
it seems like this logic shouldn't really be here but in a target-specific 
file. When (live or corefile) cross-debugging a FreeBSD target we should look 
in $LOCALBASE/lib/debug relative to a sysroot.

https://github.com/llvm/llvm-project/pull/81355
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][Docs] Document vFile:exists and vFile:MD5 (PR #89357)

2024-04-19 Thread Ed Maste via lldb-commits


@@ -429,7 +429,43 @@ incompatible with the flags that gdb specifies.
 //
 //  Response is F, followed by the number of bytes written (base 16)
 
+//--
+// vFile:MD5:
+//
+// BRIEF
+//  Generate an MD5 hash of the file at the given path.
+//
+// EXAMPLE
+//
+//  receive: vFile:MD5:2f746d702f61
+//  send (success): F,
+//  send (failure): F,x
+//
+//  request packet contains the ASCII hex encoded filename
+//
+//  If the hash succeeded, the response is "F," followed by the low 64

emaste wrote:

As an aside does this mean that the hash as seen in the packet has the low and 
high 64 bits swapped from what would be displayed by e.g. the md5 command? For 
example `e9800998ecf8427ed41d8cd98f00b204` for an empty file rather than 
`d41d8cd98f00b204e9800998ecf8427e`



https://github.com/llvm/llvm-project/pull/89357
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-18 Thread Ed Maste via lldb-commits

emaste wrote:

Ok, submitted https://github.com/llvm/llvm-project/issues/89271 for the MD5 
migration. I agree that issue does not block this change.

https://github.com/llvm/llvm-project/pull/88812
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-16 Thread Ed Maste via lldb-commits

emaste wrote:

MD5 is insufficient for claiming that files are identical; how do we migrate 
this to a secure hash?

https://github.com/llvm/llvm-project/pull/88812
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] adds additional information to the ProcessInfo object for elf processes (PR #88995)

2024-04-16 Thread Ed Maste via lldb-commits

emaste wrote:

> is there not a Posix way to get these

Not really. On FreeBSD these generally come from sysctl(s).

Of the ones added in this pull request SetParentProcessID is already handled on 
FreeBSD, while SetProcessGroupID, SetProcessSessionID, SetUserTime, 
SetSystemTime, SetCumulativeUserTime, SetCumulativeSystemTime are not

https://github.com/llvm/llvm-project/pull/88995
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] clang-format AuxVector.h (PR #85057)

2024-03-28 Thread Ed Maste via lldb-commits

https://github.com/emaste commented:

It looks like the commit messages and content are mismatched - the commit 
message references AT_HWCAP2 but it doesn't look like that's included here?

https://github.com/llvm/llvm-project/pull/85057
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][FreeBSD] Add FreeBSD specific AT_HWCAP value (PR #84147)

2024-03-28 Thread Ed Maste via lldb-commits

https://github.com/emaste approved this pull request.

(Assuming the comment removal gets squashed into one commit)

https://github.com/llvm/llvm-project/pull/84147
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] checks beforehand if lldb can trace/attach a process on FreeBSD. (PR #79662)

2024-02-10 Thread Ed Maste via lldb-commits

emaste wrote:

commit message probably needs updating for the logic change (no longer 
beforehand)

Another reason to defer the check until failure occurs - if the user happens to 
be running lldb as root ptrace will be able to attach independent of the state 
of that sysctl

https://github.com/llvm/llvm-project/pull/79662
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] checks beforehand if lldb can trace/attach a process on FreeBSD. (PR #79662)

2024-02-10 Thread Ed Maste via lldb-commits

https://github.com/emaste approved this pull request.


https://github.com/llvm/llvm-project/pull/79662
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] checks beforehand if lldb can trace/attach a process on FreeBSD. (PR #79662)

2024-01-26 Thread Ed Maste via lldb-commits

emaste wrote:

Thanks for picking this up -- I was starting to take a look but was sidetracked 
with a lot of yak shaving.

https://github.com/llvm/llvm-project/pull/79662
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] checks beforehand if lldb can trace/attach a process on FreeBSD. (PR #79662)

2024-01-26 Thread Ed Maste via lldb-commits


@@ -48,14 +48,36 @@ static Status EnsureFDFlags(int fd, int flags) {
   return error;
 }
 
+static Status CanTrace() {
+  int proc_debug, ret;
+  size_t len = sizeof(proc_debug);
+  ret = ::sysctlbyname("security.bsd.unprivileged_proc_debug", _debug,
+   , nullptr, 0);
+  if (ret != 0)
+return Status("sysctlbyname() security.bsd.unprivileged_proc_debug 
failed");
+
+  if (proc_debug < 1)
+return Status(
+"process debug disabled by security.bsd.unprivileged_proc_debug oid");
+
+  return {};
+}
+
 // Public Static Methods
 
 llvm::Expected>
 NativeProcessFreeBSD::Manager::Launch(ProcessLaunchInfo _info,
   NativeDelegate _delegate) {
   Log *log = GetLog(POSIXLog::Process);
-
   Status status;
+
+  status = CanTrace();

emaste wrote:

I might suggest moving these checks into the Fail case below, avoiding the 
extra syscall that's not necessary in the common case. Also, we may have other 
cases we could start checking for.

https://github.com/llvm/llvm-project/pull/79662
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] checks beforehand if lldb can trace/attach a process on FreeBSD. (PR #79662)

2024-01-26 Thread Ed Maste via lldb-commits


@@ -48,14 +48,37 @@ static Status EnsureFDFlags(int fd, int flags) {
   return error;
 }
 
+static Status CanTrace() {
+  Status status;
+  int proc_debug, ret;
+  size_t len = sizeof(proc_debug);
+  ret = ::sysctlbyname("security.bsd.unprivileged_proc_debug", _debug,
+   , nullptr, 0);
+  if (ret != 0)
+return Status("sysctlbyname() security.bsd.unprivileged_proc_debug 
failed");

emaste wrote:

It's had the current name for over 2 decades, 
https://github.com/freebsd/freebsd-src/commit/e409590d0e0e57c6ec37d95bcb9fa3728051ebb1

The sysctl existed prior to that with a different name; I didn't bother looking 
to see when that was introduced.

https://github.com/llvm/llvm-project/pull/79662
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Additional pieces towards OpenBSD support (PR #74198)

2023-12-04 Thread Ed Maste via lldb-commits

https://github.com/emaste approved this pull request.


https://github.com/llvm/llvm-project/pull/74198
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Additional pieces towards OpenBSD support (PR #74198)

2023-12-02 Thread Ed Maste via lldb-commits


@@ -1245,9 +1245,10 @@ bool FormatEntity::Format(const Entry , Stream ,
 llvm::Triple::OSType ostype = arch.IsValid()
   ? arch.GetTriple().getOS()
   : llvm::Triple::UnknownOS;
-if ((ostype == llvm::Triple::FreeBSD) ||
-(ostype == llvm::Triple::Linux) ||
-(ostype == llvm::Triple::NetBSD)) {
+if (ostype == llvm::Triple::Linux ||

emaste wrote:

OSes were in alpha order before -- it doesn't matter too much but both 
consistency across the code base and avoiding churn are good goals. Is the 
order is generally Linux then BSDs in alpha order across the tree?

https://github.com/llvm/llvm-project/pull/74198
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] colorize symbols in image lookup (PR #69422)

2023-11-23 Thread Ed Maste via lldb-commits

emaste wrote:

commit message has typo `coreected`

https://github.com/llvm/llvm-project/pull/69422
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][FreeBSD] fix i386 size_t error when using LLDB_LOGF (PR #68210)

2023-10-04 Thread Ed Maste via lldb-commits

https://github.com/emaste closed https://github.com/llvm/llvm-project/pull/68210
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-10-04 Thread Ed Maste via lldb-commits

emaste wrote:

I'm not sure why @aokblast's reply didn't appear here, but indeed `%zu` is the 
right format specifier.

https://github.com/llvm/llvm-project/pull/67106
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-10-03 Thread Ed Maste via lldb-commits

https://github.com/emaste closed https://github.com/llvm/llvm-project/pull/67106
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-10-02 Thread Ed Maste via lldb-commits

emaste wrote:

Hmm, when I attempt to close it via the GitHub UI I get:
![image](https://github.com/llvm/llvm-project/assets/1034582/54534c5d-9873-40c4-81af-45c50919dc92)

I think I can just fetch the commit locally and then push it to the tree

https://github.com/llvm/llvm-project/pull/67106
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-09-28 Thread Ed Maste via lldb-commits

emaste wrote:

Oh, I think we should also mention GSoC in the commit message. Something like 
`This project was part of FreeBSD's participation in Google Summer of Code 
2023.` or so.

https://github.com/llvm/llvm-project/pull/67106
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-09-28 Thread Ed Maste via lldb-commits

emaste wrote:

https://llvm.org/docs/GitHub.html#landing-your-change

> There are two different ways to do this:
>
> - [Interactive rebase](https://git-scm.com/docs/git-rebase#_interactive_mode) 
> with fixup’s. This is the recommended method since you can control the final 
> commit message and inspect that the final commit looks as you expect. When 
> your local state is correct, remember to force-push to your branch and press 
> the merge button afterwards.
>
> - Use the button Squash and merge in GitHub’s web interface, if you do this 
> remember to review the commit message when prompted.

So I suspect the best way to go here is @aokblast locally squashes these 
commits into one, updates author if desired, fixes up commit messages if 
necessary, and then force-pushes to this pull request. Then @clayborg or I push 
the merge button.

https://github.com/llvm/llvm-project/pull/67106
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-09-28 Thread Ed Maste via lldb-commits

https://github.com/emaste approved this pull request.


https://github.com/llvm/llvm-project/pull/67106
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-09-28 Thread Ed Maste via lldb-commits

emaste wrote:

> I will let other FreeBSD folks do the final approval since I don't work on 
> FreeBSD.

@clayborg this change LGTM for FreeBSD. I'm still not fully sorted on the 
approach for landing the commits post transition to GitHub. Also see the 
comment about author name above.


https://github.com/llvm/llvm-project/pull/67106
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-09-27 Thread Ed Maste via lldb-commits

emaste wrote:

> Excuse me. If the code works well now, I want to ask if I need to modify the 
> commit message by myself so the message looks tidy, or let somebody landing 
> this pull request modify the message?

This will be the first substantial change I'd land after LLVM moved to use pull 
requests, so I'm not completely certain on the process. I have the commits from 
this pull request on my local machine for testing and when we used Phabricator 
I'd just squash them, edit the commit message, and push.

That raises another point, the author is currently:
`Author: aokblast `
This is your desired author info?

https://github.com/llvm/llvm-project/pull/67106
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-09-27 Thread Ed Maste via lldb-commits

emaste wrote:

Needs to be adapted for f2d32ddcec82c20582c6aa32558b82ca7c3d3c50, 
`lldb/source/{Core => Host/common}/StreamFile.cpp`

(I've applied the change locally for testing, and will just fold it into the 
patch series if otherwise ready to go.)


https://github.com/llvm/llvm-project/pull/67106
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-09-22 Thread Ed Maste via lldb-commits


@@ -0,0 +1,770 @@
+#include "lldb/Breakpoint/StoppointCallbackContext.h"
+#include "lldb/Core/Debugger.h"
+#include "lldb/Core/Module.h"
+#include "lldb/Core/ModuleSpec.h"
+#include "lldb/Core/PluginManager.h"
+#include "lldb/Core/Section.h"
+#include "lldb/Core/StreamFile.h"
+#include "lldb/Interpreter/OptionValueProperties.h"
+#include "lldb/Symbol/LocateSymbolFile.h"
+#include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Target/OperatingSystem.h"
+#include "lldb/Target/RegisterContext.h"
+#include "lldb/Target/StackFrame.h"
+#include "lldb/Target/Target.h"
+#include "lldb/Target/Thread.h"
+#include "lldb/Target/ThreadPlanRunToAddress.h"
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/LLDBLog.h"
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/State.h"
+
+#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
+
+#include "DynamicLoaderFreeBSDKernel.h"
+#include 
+#include 
+
+using namespace lldb;
+using namespace lldb_private;
+
+LLDB_PLUGIN_DEFINE(DynamicLoaderFreeBSDKernel)
+
+void DynamicLoaderFreeBSDKernel::Initialize() {
+  PluginManager::RegisterPlugin(GetPluginNameStatic(),
+GetPluginDescriptionStatic(), CreateInstance,
+DebuggerInit);
+}
+
+void DynamicLoaderFreeBSDKernel::Terminate() {
+  PluginManager::UnregisterPlugin(CreateInstance);
+}
+
+llvm::StringRef DynamicLoaderFreeBSDKernel::GetPluginDescriptionStatic() {
+  return "The Dynamic Loader Plugin For FreeBSD Kernel";
+}
+
+static bool is_kernel(Module *module) {
+  if (!module)
+return false;
+
+  ObjectFile *objfile = module->GetObjectFile();
+  if (!objfile)
+return false;
+  if (objfile->GetType() != ObjectFile::eTypeExecutable)
+return false;
+  if (objfile->GetStrata() != ObjectFile::eStrataUnknown &&
+  objfile->GetStrata() != ObjectFile::eStrataUser)

emaste wrote:

I discussed with our kernel gdb maintainer and there PT_INTERP == /red/herring 
is used to identify a kernel for the main executable. 

https://github.com/llvm/llvm-project/pull/67106
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-09-22 Thread Ed Maste via lldb-commits


@@ -0,0 +1,770 @@
+#include "lldb/Breakpoint/StoppointCallbackContext.h"
+#include "lldb/Core/Debugger.h"
+#include "lldb/Core/Module.h"
+#include "lldb/Core/ModuleSpec.h"
+#include "lldb/Core/PluginManager.h"
+#include "lldb/Core/Section.h"
+#include "lldb/Core/StreamFile.h"
+#include "lldb/Interpreter/OptionValueProperties.h"
+#include "lldb/Symbol/LocateSymbolFile.h"
+#include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Target/OperatingSystem.h"
+#include "lldb/Target/RegisterContext.h"
+#include "lldb/Target/StackFrame.h"
+#include "lldb/Target/Target.h"
+#include "lldb/Target/Thread.h"
+#include "lldb/Target/ThreadPlanRunToAddress.h"
+#include "lldb/Utility/DataBuffer.h"
+#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/LLDBLog.h"
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/State.h"
+
+#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
+
+#include "DynamicLoaderFreeBSDKernel.h"
+#include 
+#include 
+
+using namespace lldb;
+using namespace lldb_private;
+
+LLDB_PLUGIN_DEFINE(DynamicLoaderFreeBSDKernel)
+
+void DynamicLoaderFreeBSDKernel::Initialize() {
+  PluginManager::RegisterPlugin(GetPluginNameStatic(),
+GetPluginDescriptionStatic(), CreateInstance,
+DebuggerInit);
+}
+
+void DynamicLoaderFreeBSDKernel::Terminate() {
+  PluginManager::UnregisterPlugin(CreateInstance);
+}
+
+llvm::StringRef DynamicLoaderFreeBSDKernel::GetPluginDescriptionStatic() {
+  return "The Dynamic Loader Plugin For FreeBSD Kernel";
+}
+
+static bool is_kernel(Module *module) {
+  if (!module)
+return false;
+
+  ObjectFile *objfile = module->GetObjectFile();
+  if (!objfile)
+return false;
+  if (objfile->GetType() != ObjectFile::eTypeExecutable)
+return false;
+  if (objfile->GetStrata() != ObjectFile::eStrataUnknown &&
+  objfile->GetStrata() != ObjectFile::eStrataUser)

emaste wrote:

We can identify a FreeBSD kernel by the bogus PT_INTERP it specifies:
```
  INTERP 0x000238 0x80200238 0x00200238 0x0d 
0x0d R   0x1
  [Requesting program interpreter: /red/herring]
```

There are a bunch of ELF notes, but nothing that would uniquely identify it as 
a FreeBSD kernel. I suspect the Xen notes are unique to kernels, but won't be 
present if built without Xen support I guess. (As an aside I guess we should 
teach llvm-readelf about those note types.)

```
Displaying notes found in: .note.gnu.build-id
  OwnerData sizeDescription
  GNU  0x0014   NT_GNU_BUILD_ID (unique build ID 
bitstring)
Build ID: 984b7de7a87159b85761dc6bdc9645e28407e890

Displaying notes found in: .note.Xen
  OwnerData sizeDescription
  Xen  0x0008   Unknown note type: (0x0006)
   description data: 46 72 65 65 42 53 44 00
  Xen  0x0009   Unknown note type: (0x0007)
   description data: 30 78 31 33 64 36 37 37 00
  Xen  0x0008   Unknown note type: (0x0005)
   description data: 78 65 6e 2d 33 2e 30 00
  Xen  0x0008   Unknown note type: (0x0003)
   description data: 00 00 00 80 ff ff ff ff
  Xen  0x0008   Unknown note type: (0x0004)
   description data: 00 00 00 00 00 00 00 00
  Xen  0x0008   NT_VERSION (version)
   description data: 00 b0 03 81 ff ff ff ff
  Xen  0x0008   NT_ARCH (architecture)
   description data: 00 a0 03 81 ff ff ff ff
  Xen  0x0008   Unknown note type: (0x000c)
   description data: 00 00 00 00 00 80 ff ff
  Xen  0x005e   Unknown note type: (0x000a)
   description data: 77 72 69 74 61 62 6c 65 5f 64 65 73 63 72 69 70 74 6f 72 
5f 74 61 62 6c 65 73 7c 61 75 74 6f 5f 74 72 61 6e 73 6c 61 74 65 64 5f 70 68 
79 73 6d 61 70 7c 73 75 70 65 72 76 69 73 6f 72 5f 6d 6f 64 65 5f 6b 65 72 6e 
65 6c 7c 68 76 6d 5f 63 61 6c 6c 62 61 63 6b 5f 76 65 63 74 6f 72 00
  Xen  0x0004   Unknown note type: (0x0009)
   description data: 79 65 73 00
  Xen  0x0008   Unknown note type: (0x000d)
   description data: 01 00 00 00 01 00 00 00
  Xen  0x0008   Unknown note type: (0x0008)
   description data: 67 65 6e 65 72 69 63 00
  Xen  0x0004   Unknown note type: (0x000e)
   description data: 00 00 00 00
  Xen  0x0004   Unknown note type: (0x000b)
   description data: 79 65 73 00
  Xen  0x0004   Unknown note type: (0x0012)
   description data: 30 b0 03 01
```

Oh, I guess a section named `set_sysinit_set` could be a decent indication.
```
There are 61 section headers, starting at offset 0x19a0c38:

Section Headers:
  [Nr] Name  TypeAddress  OffSize   ES Flg 
Lk Inf Al
  [ 0]

[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-09-22 Thread Ed Maste via lldb-commits


@@ -0,0 +1,165 @@
+#ifndef 
LLDB_SOURCE_PLUGINS_DYNAMICLOADER_FREEBSD_KERNEL_DYNAMICLOADERFREEBSDKERNEL_H
+#define 
LLDB_SOURCE_PLUGINS_DYNAMICLOADER_FREEBSD_KERNEL_DYNAMICLOADERFREEBSDKERNEL_H
+
+#include 
+#include 
+#include 
+
+#include "lldb/Target/DynamicLoader.h"
+#include "lldb/Target/Process.h"
+#include "lldb/Utility/FileSpec.h"
+#include "lldb/Utility/UUID.h"
+#include "llvm/BinaryFormat/ELF.h"
+
+class DynamicLoaderFreeBSDKernel : public lldb_private::DynamicLoader {
+public:
+  DynamicLoaderFreeBSDKernel(lldb_private::Process *process,
+ lldb::addr_t kernel_addr);
+
+  ~DynamicLoaderFreeBSDKernel() override;
+
+  // Static Functions
+
+  static void Initialize();
+
+  static void Terminate();
+
+  static llvm::StringRef GetPluginNameStatic() {
+return "DynamicLoaderFreeBSDKernel";

emaste wrote:

It's always one word, FreeBSD, so "freebsd-kernel"


https://github.com/llvm/llvm-project/pull/67106
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 993ada0 - [lldb] [unittests] Fix building the FreeBSD arm64 Register Context test

2021-09-28 Thread Ed Maste via lldb-commits

Author: Andrew Turner
Date: 2021-09-28T10:51:06-04:00
New Revision: 993ada05f5a05615ec16da4a69bd368529a7e5d1

URL: 
https://github.com/llvm/llvm-project/commit/993ada05f5a05615ec16da4a69bd368529a7e5d1
DIFF: 
https://github.com/llvm/llvm-project/commit/993ada05f5a05615ec16da4a69bd368529a7e5d1.diff

LOG: [lldb] [unittests] Fix building the FreeBSD arm64 Register Context test

Differential Revision: https://reviews.llvm.org/D110545

Added: 


Modified: 
lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp

Removed: 




diff  --git a/lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp 
b/lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp
index 2d2c183a0c55c..e541a34e6e22a 100644
--- a/lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp
+++ b/lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp
@@ -325,8 +325,9 @@ TEST(RegisterContextFreeBSDTest, arm) {
   sizeof(fpreg::fbsd_reg)))
 
 TEST(RegisterContextFreeBSDTest, arm64) {
+  Flags opt_regsets = RegisterInfoPOSIX_arm64::eRegsetMaskDefault;
   ArchSpec arch{"aarch64-unknown-freebsd"};
-  RegisterInfoPOSIX_arm64 reg_ctx{arch};
+  RegisterInfoPOSIX_arm64 reg_ctx{arch, opt_regsets};
 
   EXPECT_GPR_ARM64(x0, x[0]);
   EXPECT_GPR_ARM64(x1, x[1]);



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] 875be9f - [lldb] Mark command-process-connect as unsupported on Windows

2020-11-16 Thread Ed Maste via lldb-commits
On Fri, 13 Nov 2020 at 23:02, Jonas Devlieghere via lldb-commits
 wrote:
>
>
> Author: Jonas Devlieghere
> Date: 2020-11-13T20:02:05-08:00
> New Revision: 875be9f454c31c94701bdf4e28f8bea07a8c9c79
>
> URL: 
> https://github.com/llvm/llvm-project/commit/875be9f454c31c94701bdf4e28f8bea07a8c9c79
> DIFF: 
> https://github.com/llvm/llvm-project/commit/875be9f454c31c94701bdf4e28f8bea07a8c9c79.diff
>
> LOG: [lldb] Mark command-process-connect as unsupported on Windows
>
> Windows doesn't support remote connections.

This is also failing on FreeBSD the same way

   13: (lldb) process connect connect://localhost:4321
check:11'0 X~~ error:
no match found
   14: error: remote connections are not supported
check:11'0 ~~~
check:11'1 ?   possible
intended match
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] f794160 - [lldb] Fix FreeBSD Arm Process Plugin build

2020-09-30 Thread Ed Maste via lldb-commits

Author: Ed Maste
Date: 2020-09-30T09:25:27-04:00
New Revision: f794160c6cb7da4b5ef354a91fe498341f651d36

URL: 
https://github.com/llvm/llvm-project/commit/f794160c6cb7da4b5ef354a91fe498341f651d36
DIFF: 
https://github.com/llvm/llvm-project/commit/f794160c6cb7da4b5ef354a91fe498341f651d36.diff

LOG: [lldb] Fix FreeBSD Arm Process Plugin build

Add a missing include and some definitions in 76953321.

Patch by: Brooks Davis

Reviewed by: labath

Differential Revision: https://reviews.llvm.org/D88453

Added: 


Modified: 

lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp
lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.h

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp
 
b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp
index 2f4d613f767a..afb92e848466 100644
--- 
a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp
+++ 
b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp
@@ -14,6 +14,7 @@
 #include "ProcessMonitor.h"
 #include "RegisterContextPOSIXProcessMonitor_arm.h"
 #include "Plugins/Process/Utility/RegisterContextPOSIX_arm.h"
+#include "Plugins/Process/Utility/lldb-arm-register-enums.h"
 
 using namespace lldb_private;
 using namespace lldb;

diff  --git 
a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.h 
b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.h
index 12e1f19d32fa..906926fd9194 100644
--- 
a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.h
+++ 
b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.h
@@ -70,6 +70,10 @@ class RegisterContextPOSIXProcessMonitor_arm : public 
RegisterContextPOSIX_arm,
   uint32_t NumSupportedHardwareWatchpoints();
 
 private:
+  RegisterInfoPOSIX_arm::GPR m_gpr_arm;
+
+  RegisterInfoPOSIX_arm::FPU m_fpr;
+
   ProcessMonitor ();
 };
 



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 55e32e9 - [lldb] update eArgTypeScriptLang description to mention lua

2020-04-02 Thread Ed Maste via lldb-commits

Author: Ed Maste
Date: 2020-04-02T09:43:01-04:00
New Revision: 55e32e92cda79a9eb4487ea8e4ec1b968fac5145

URL: 
https://github.com/llvm/llvm-project/commit/55e32e92cda79a9eb4487ea8e4ec1b968fac5145
DIFF: 
https://github.com/llvm/llvm-project/commit/55e32e92cda79a9eb4487ea8e4ec1b968fac5145.diff

LOG: [lldb] update eArgTypeScriptLang description to mention lua

--script-language python and --script-language lua are both valid now.

Reviewed by:JDevlieghere

Differential Revision:  https://reviews.llvm.org/D77241

Added: 


Modified: 
lldb/source/Interpreter/CommandObject.cpp

Removed: 




diff  --git a/lldb/source/Interpreter/CommandObject.cpp 
b/lldb/source/Interpreter/CommandObject.cpp
index 01fa86750b12..f1f17dbd66ef 100644
--- a/lldb/source/Interpreter/CommandObject.cpp
+++ b/lldb/source/Interpreter/CommandObject.cpp
@@ -1091,7 +1091,7 @@ CommandObject::ArgumentTableEntry 
CommandObject::g_arguments_data[] = {
 { eArgTypeRunArgs, "run-args", CommandCompletions::eNoCompletion, { 
nullptr, false }, "Arguments to be passed to the target program when it starts 
executing." },
 { eArgTypeRunMode, "run-mode", CommandCompletions::eNoCompletion, { 
nullptr, false }, "Help text goes here." },
 { eArgTypeScriptedCommandSynchronicity, "script-cmd-synchronicity", 
CommandCompletions::eNoCompletion, { nullptr, false }, "The synchronicity to 
use to run scripted commands with regard to LLDB event system." },
-{ eArgTypeScriptLang, "script-language", 
CommandCompletions::eNoCompletion, { nullptr, false }, "The scripting language 
to be used for script-based commands.  Currently only Python is valid." },
+{ eArgTypeScriptLang, "script-language", 
CommandCompletions::eNoCompletion, { nullptr, false }, "The scripting language 
to be used for script-based commands.  Supported languages are python and lua." 
},
 { eArgTypeSearchWord, "search-word", CommandCompletions::eNoCompletion, { 
nullptr, false }, "Any word of interest for search purposes." },
 { eArgTypeSelector, "selector", CommandCompletions::eNoCompletion, { 
nullptr, false }, "An Objective-C selector name." },
 { eArgTypeSettingIndex, "setting-index", 
CommandCompletions::eNoCompletion, { nullptr, false }, "An index into a 
settings variable that is an array (try 'settings list' to see all the possible 
settings variables and their types)." },



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] af1b7d0 - Correct copy-pasteo in lua script language description

2020-04-01 Thread Ed Maste via lldb-commits

Author: Ed Maste
Date: 2020-04-02T00:12:24-04:00
New Revision: af1b7d06d9e45c7e20540aa3bf81f1be5befaa0f

URL: 
https://github.com/llvm/llvm-project/commit/af1b7d06d9e45c7e20540aa3bf81f1be5befaa0f
DIFF: 
https://github.com/llvm/llvm-project/commit/af1b7d06d9e45c7e20540aa3bf81f1be5befaa0f.diff

LOG: Correct copy-pasteo in lua script language description

Added: 


Modified: 
lldb/source/Commands/CommandObjectWatchpointCommand.cpp

Removed: 




diff  --git a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp 
b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp
index d86f4a35c5eb..11bf88de2fea 100644
--- a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp
@@ -39,7 +39,7 @@ static constexpr OptionEnumValueElement 
g_script_option_enumeration[] = {
 {
 eScriptLanguageLua,
 "lua",
-"Commands are in the Python language.",
+"Commands are in the Lua language.",
 },
 {
 eSortOrderByName,



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r364669 - [GDBRemote] Remove code that flushes GDB remote packets

2019-07-04 Thread Ed Maste via lldb-commits
On Fri, 28 Jun 2019 at 14:14, Jonas Devlieghere via lldb-commits
 wrote:
>
> Author: jdevlieghere
> Date: Fri Jun 28 11:14:27 2019
> New Revision: 364669
>
> URL: http://llvm.org/viewvc/llvm-project?rev=364669=rev
> Log:
> [GDBRemote] Remove code that flushes GDB remote packets
>
> The arbitrary timeout when flushing GDB remote packets caused
> non-determinism and flakiness between test runs. I suspect it is what's
> causing the flakiness of the reproducer tests on GreenDragon, and want
> to see if removing it causes that to go away.
>
> This change was originally introduced in r197579 to discard a
> `$T02thread:01;#4` that QEMU was sending. If anybody knows how to test
> that this continues working after removing this code, I'd love to hear
> it.

I believe it's just something like:

$ qemu-system-x86_64 -s -S -snapshot -hda 

then in lldb
(lldb) log enable gdb-remote packets
(lldb) gdb-remote localhost:1234
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r330504 - Temporarily skip Go TestExpressions on FreeBSD as it hangs

2018-04-21 Thread Ed Maste via lldb-commits
Author: emaste
Date: Sat Apr 21 06:59:07 2018
New Revision: 330504

URL: http://llvm.org/viewvc/llvm-project?rev=330504=rev
Log:
Temporarily skip Go TestExpressions on FreeBSD as it hangs

llvm.org/pr37194

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py?rev=330504=330503=330504=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py
 Sat Apr 21 06:59:07 2018
@@ -15,6 +15,7 @@ class TestGoUserExpression(TestBase):
 
 @add_test_categories(['pyapi'])
 @skipIfRemote  # Not remote test suit ready
+@skipIfFreeBSD  # Test hanging on FreeBSD - llvm.org/pr37194
 @skipUnlessGoInstalled
 def test_with_dsym_and_python_api(self):
 """Test GoASTUserExpress."""


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r330500 - FreeBSD: propagate error to user if memory access fails

2018-04-21 Thread Ed Maste via lldb-commits
Author: emaste
Date: Sat Apr 21 04:23:56 2018
New Revision: 330500

URL: http://llvm.org/viewvc/llvm-project?rev=330500=rev
Log:
FreeBSD: propagate error to user if memory access fails

Previously, an attempt to read an unreadable address reported zeros.
Now, if DoReadMemory or DoWriteMemory encounters error then return 0
(bytes read or written) so that the error is reported to the user.

llvm.org/pr37190

Modified:
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp?rev=330500=330499=330500=diff
==
--- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Sat Apr 21 
04:23:56 2018
@@ -159,8 +159,10 @@ static size_t DoReadMemory(lldb::pid_t p
   pi_desc.piod_addr = buf;
   pi_desc.piod_len = size;
 
-  if (PTRACE(PT_IO, pid, (caddr_t)_desc, 0) < 0)
+  if (PTRACE(PT_IO, pid, (caddr_t)_desc, 0) < 0) {
 error.SetErrorToErrno();
+return 0;
+  }
   return pi_desc.piod_len;
 }
 
@@ -173,8 +175,10 @@ static size_t DoWriteMemory(lldb::pid_t
   pi_desc.piod_addr = (void *)buf;
   pi_desc.piod_len = size;
 
-  if (PTRACE(PT_IO, pid, (caddr_t)_desc, 0) < 0)
+  if (PTRACE(PT_IO, pid, (caddr_t)_desc, 0) < 0) {
 error.SetErrorToErrno();
+return 0;
+  }
   return pi_desc.piod_len;
 }
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r326166 - Mark test_*int*_t_dwarf as failing on FreeBSD

2018-02-26 Thread Ed Maste via lldb-commits
Author: emaste
Date: Mon Feb 26 18:54:17 2018
New Revision: 326166

URL: http://llvm.org/viewvc/llvm-project?rev=326166=rev
Log:
Mark test_*int*_t_dwarf as failing on FreeBSD

Further investigation required; tests will be enabled on the buildbot
worker soon. Marking failing tests for now in order to start with a
green buildbot while investigation takes place.

This is a recommit of r326134, with the required import added.

llvm.org/pr36527

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py?rev=326166=326165=326166=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
 Mon Feb 26 18:54:17 2018
@@ -6,6 +6,7 @@ from __future__ import print_function
 import os
 import time
 import lldb
+from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 import lldbsuite.test.lldbutil as lldbutil
 
@@ -14,6 +15,7 @@ class CPP11EnumTypesTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_int8_t(self):
 """Test C++11 enumeration class types as int8_t types."""
 self.build(
@@ -21,6 +23,7 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int8_t"'})
 self.image_lookup_for_enum_type()
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_int16_t(self):
 """Test C++11 enumeration class types as int16_t types."""
 self.build(
@@ -28,6 +31,7 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int16_t"'})
 self.image_lookup_for_enum_type()
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_int32_t(self):
 """Test C++11 enumeration class types as int32_t types."""
 self.build(
@@ -35,6 +39,7 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int32_t"'})
 self.image_lookup_for_enum_type()
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_int64_t(self):
 """Test C++11 enumeration class types as int64_t types."""
 self.build(
@@ -42,6 +47,7 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int64_t"'})
 self.image_lookup_for_enum_type()
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_uint8_t(self):
 """Test C++11 enumeration class types as uint8_t types."""
 self.build(
@@ -49,6 +55,7 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint8_t"'})
 self.image_lookup_for_enum_type()
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_uint16_t(self):
 """Test C++11 enumeration class types as uint16_t types."""
 self.build(
@@ -56,6 +63,7 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint16_t"'})
 self.image_lookup_for_enum_type()
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_uint32_t(self):
 """Test C++11 enumeration class types as uint32_t types."""
 self.build(
@@ -63,6 +71,7 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint32_t"'})
 self.image_lookup_for_enum_type()
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_uint64_t(self):
 """Test C++11 enumeration class types as uint64_t types."""
 self.build(


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r326139 - Revert r326134 due to broken buildbot

2018-02-26 Thread Ed Maste via lldb-commits
Author: emaste
Date: Mon Feb 26 14:36:41 2018
New Revision: 326139

URL: http://llvm.org/viewvc/llvm-project?rev=326139=rev
Log:
Revert r326134 due to broken buildbot

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py?rev=326139=326138=326139=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
 Mon Feb 26 14:36:41 2018
@@ -14,7 +14,6 @@ class CPP11EnumTypesTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
-@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_int8_t(self):
 """Test C++11 enumeration class types as int8_t types."""
 self.build(
@@ -22,7 +21,6 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int8_t"'})
 self.image_lookup_for_enum_type()
 
-@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_int16_t(self):
 """Test C++11 enumeration class types as int16_t types."""
 self.build(
@@ -30,7 +28,6 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int16_t"'})
 self.image_lookup_for_enum_type()
 
-@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_int32_t(self):
 """Test C++11 enumeration class types as int32_t types."""
 self.build(
@@ -38,7 +35,6 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int32_t"'})
 self.image_lookup_for_enum_type()
 
-@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_int64_t(self):
 """Test C++11 enumeration class types as int64_t types."""
 self.build(
@@ -46,7 +42,6 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int64_t"'})
 self.image_lookup_for_enum_type()
 
-@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_uint8_t(self):
 """Test C++11 enumeration class types as uint8_t types."""
 self.build(
@@ -54,7 +49,6 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint8_t"'})
 self.image_lookup_for_enum_type()
 
-@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_uint16_t(self):
 """Test C++11 enumeration class types as uint16_t types."""
 self.build(
@@ -62,7 +56,6 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint16_t"'})
 self.image_lookup_for_enum_type()
 
-@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_uint32_t(self):
 """Test C++11 enumeration class types as uint32_t types."""
 self.build(
@@ -70,7 +63,6 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint32_t"'})
 self.image_lookup_for_enum_type()
 
-@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_uint64_t(self):
 """Test C++11 enumeration class types as uint64_t types."""
 self.build(


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r326134 - Mark test_*int*_t_dwarf as failing on FreeBSD

2018-02-26 Thread Ed Maste via lldb-commits
Author: emaste
Date: Mon Feb 26 14:12:24 2018
New Revision: 326134

URL: http://llvm.org/viewvc/llvm-project?rev=326134=rev
Log:
Mark test_*int*_t_dwarf as failing on FreeBSD

Further investigation required; tests will be enabled on the buildbot
worker soon. Marking failing tests for now in order to start with a
green buildbot while investigation takes place.

llvm.org/pr36527

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py?rev=326134=326133=326134=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
 Mon Feb 26 14:12:24 2018
@@ -14,6 +14,7 @@ class CPP11EnumTypesTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_int8_t(self):
 """Test C++11 enumeration class types as int8_t types."""
 self.build(
@@ -21,6 +22,7 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int8_t"'})
 self.image_lookup_for_enum_type()
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_int16_t(self):
 """Test C++11 enumeration class types as int16_t types."""
 self.build(
@@ -28,6 +30,7 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int16_t"'})
 self.image_lookup_for_enum_type()
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_int32_t(self):
 """Test C++11 enumeration class types as int32_t types."""
 self.build(
@@ -35,6 +38,7 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int32_t"'})
 self.image_lookup_for_enum_type()
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_int64_t(self):
 """Test C++11 enumeration class types as int64_t types."""
 self.build(
@@ -42,6 +46,7 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int64_t"'})
 self.image_lookup_for_enum_type()
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_uint8_t(self):
 """Test C++11 enumeration class types as uint8_t types."""
 self.build(
@@ -49,6 +54,7 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint8_t"'})
 self.image_lookup_for_enum_type()
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_uint16_t(self):
 """Test C++11 enumeration class types as uint16_t types."""
 self.build(
@@ -56,6 +62,7 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint16_t"'})
 self.image_lookup_for_enum_type()
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_uint32_t(self):
 """Test C++11 enumeration class types as uint32_t types."""
 self.build(
@@ -63,6 +70,7 @@ class CPP11EnumTypesTestCase(TestBase):
 'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint32_t"'})
 self.image_lookup_for_enum_type()
 
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
 def test_uint64_t(self):
 """Test C++11 enumeration class types as uint64_t types."""
 self.build(


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r325856 - remove FreeBSD xfail from lit TestCallStdStringFunction

2018-02-22 Thread Ed Maste via lldb-commits
Author: emaste
Date: Thu Feb 22 18:50:07 2018
New Revision: 325856

URL: http://llvm.org/viewvc/llvm-project?rev=325856=rev
Log:
remove FreeBSD xfail from lit TestCallStdStringFunction

This test is consistently reporting unexpected pass for me, and the
expectedFailure decorator was removed from the legacy test in r310626.
Apply the same change to the lit version of this test.

Will investigate further if this fails once the new buildbot is running
tests.

llvm.org/pr17807

Modified:
lldb/trunk/lit/Expr/TestCallStdStringFunction.test

Modified: lldb/trunk/lit/Expr/TestCallStdStringFunction.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/TestCallStdStringFunction.test?rev=325856=325855=325856=diff
==
--- lldb/trunk/lit/Expr/TestCallStdStringFunction.test (original)
+++ lldb/trunk/lit/Expr/TestCallStdStringFunction.test Thu Feb 22 18:50:07 2018
@@ -1,9 +1,6 @@
 # XFAIL: windows
 # -> llvm.org/pr21765
 
-# XFAIL: freebsd
-# -> llvm.org/pr17807
-
 # RUN: %cxx %p/Inputs/call-function.cpp -g -o %t && %lldb -b -s %s -- %t | 
FileCheck %s
 
 breakpoint set --file call-function.cpp --line 52


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r316728 - Default to using in-tree clang for building test executables

2017-10-28 Thread Ed Maste via lldb-commits
On 26 October 2017 at 22:24, Pavel Labath via lldb-commits
 wrote:
> Author: labath
> Date: Thu Oct 26 19:24:04 2017
> New Revision: 316728
>
> URL: http://llvm.org/viewvc/llvm-project?rev=316728=rev
> Log:
> Default to using in-tree clang for building test executables

The FreeBSD buildbot is broken with

-- Could NOT find LibXml2 (missing:  LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
-- Symbols (liblldb): exporting all symbols from the lldb namespace
CMake Error at tools/lldb/CMakeLists.txt:78 (message):
  LLDB test compilers not specified.  Tests will not run

I probably won't be able to investigate this weekend, but will take a
look early next week if nobody else has before then.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r314458 - [Expression parser] Setting to enable use of ExternalASTMerger

2017-10-02 Thread Ed Maste via lldb-commits
On 28 September 2017 at 22:20, Sean Callanan via lldb-commits
 wrote:
> Author: spyffe
> Date: Thu Sep 28 13:20:25 2017
> New Revision: 314458
>
> URL: http://llvm.org/viewvc/llvm-project?rev=314458=rev
> Log:
> [Expression parser] Setting to enable use of ExternalASTMerger
> ...
> +  lldbassert(!"No mechanism for completing a type!");

Clang 5.0.0 in FreeBSD's base system produces a warning on these
lldbasserts "implicit conversion turns string literal into bool". I'm
not aware of a nice, concise alternative idiom. This eliminates the
warning and may be the best option:

lldbassert(false && "string");

I'll switch these over if you have no objection.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r313655 - Re-land r313210 - Fix for bug 34532 - A few rough corners related to post-mortem debugging (core/minidump)

2017-09-20 Thread Ed Maste via lldb-commits
On 19 September 2017 at 14:07, Adrian McCarthy via lldb-commits
 wrote:
> Author: amccarth
> Date: Tue Sep 19 11:07:33 2017
> New Revision: 313655
>
> URL: http://llvm.org/viewvc/llvm-project?rev=313655=rev
> Log:
> Re-land r313210 - Fix for bug 34532 - A few rough corners related to 
> post-mortem debugging (core/minidump)

Thanks, tests look good on FreeBSD now -- as good as they have
recently, at least (four failing tests, four timeouts, one error, and
a few unexpected successes).
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r313210 - Fix for bug 34532 - A few rough corners related to post-mortem debugging (core/minidump)

2017-09-16 Thread Ed Maste via lldb-commits
On 13 September 2017 at 18:57, Adrian McCarthy via lldb-commits
 wrote:
> Author: amccarth
> Date: Wed Sep 13 15:57:11 2017
> New Revision: 313210
>
> URL: http://llvm.org/viewvc/llvm-project?rev=313210=rev
> Log:
> Fix for bug 34532 - A few rough corners related to post-mortem debugging 
> (core/minidump)

I suspect this was responsible for breaking debugging on FreeBSD:
```
% bin/lldb /bin/ls
(lldb) target create "/bin/ls"
Current executable set to '/bin/ls' (x86_64).
(lldb) b main
Breakpoint 1: where = ls`main + 33 at ls.c:163, address = 0x004023f1
(lldb) run
Process 42854 launching
error: process resume at entry point failed: error: freebsd does not
support resuming processes
(lldb)
```

I haven't bisected yet to confirm, just reviewed changes between
rL312270 (working) and rL313327 (failing). It looks like the fix may
be straightforward, but I'm traveling to a conference and won't be
able to look for a short while so am noting it here.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r312431 - Add test case for attach-by-pid from different cwd

2017-09-02 Thread Ed Maste via lldb-commits
Author: emaste
Date: Sat Sep  2 18:44:35 2017
New Revision: 312431

URL: http://llvm.org/viewvc/llvm-project?rev=312431=rev
Log:
Add test case for attach-by-pid from different cwd

This was failing on FreeBSD prior to r312430.
Patch by Vignesh Balu.

Differential Revision:  https://reviews.llvm.org/D32522

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py?rev=312431=312430=312431=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
 Sat Sep  2 18:44:35 2017
@@ -8,6 +8,7 @@ from __future__ import print_function
 import os
 import time
 import lldb
+import shutil
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
@@ -34,6 +35,29 @@ class ProcessAttachTestCase(TestBase):
 self.runCmd("process attach -p " + str(popen.pid))
 
 target = self.dbg.GetSelectedTarget()
+
+process = target.GetProcess()
+self.assertTrue(process, PROCESS_IS_VALID)
+
+def test_attach_to_process_from_different_dir_by_id(self):
+"""Test attach by process id"""
+try:
+os.mkdir(os.path.join(os.getcwd(),'newdir'))
+except OSError, e:
+if e.errno != os.errno.EEXIST:
+raise
+
self.buildProgram('main.cpp',os.path.join(os.getcwd(),'newdir','proc_attach'))
+exe = os.path.join('.','newdir','proc_attach')
+self.addTearDownHook(lambda: shutil.rmtree(os.path.join(os.getcwd(
+
+# Spawn a new process
+popen = self.spawnSubprocess(exe)
+self.addTearDownHook(self.cleanupSubprocesses)
+
+os.chdir('newdir')
+self.runCmd("process attach -p " + str(popen.pid))
+
+target = self.dbg.GetSelectedTarget()
 
 process = target.GetProcess()
 self.assertTrue(process, PROCESS_IS_VALID)


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r312430 - FreeBSD: attach to pid from different cwd

2017-09-02 Thread Ed Maste via lldb-commits
Author: emaste
Date: Sat Sep  2 18:41:31 2017
New Revision: 312430

URL: http://llvm.org/viewvc/llvm-project?rev=312430=rev
Log:
FreeBSD: attach to pid from different cwd

attach by pid worked when running from the directory from which the
target was launched, but failed from a different directory. Use the
kern.proc.pathname sysctl to locate the target, falling back to the
original case of the target's argv[0] if that fails. Based on a patch
from Vignesh Balu.

Differential Revision:  https://reviews.llvm.org/D32271

Modified:
lldb/trunk/source/Host/freebsd/Host.cpp

Modified: lldb/trunk/source/Host/freebsd/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/freebsd/Host.cpp?rev=312430=312429=312430=diff
==
--- lldb/trunk/source/Host/freebsd/Host.cpp (original)
+++ lldb/trunk/source/Host/freebsd/Host.cpp Sat Sep  2 18:41:31 2017
@@ -73,7 +73,14 @@ GetFreeBSDProcessArgs(const ProcessInsta
   if (!cstr)
 return false;
 
-  process_info.GetExecutableFile().SetFile(cstr, false);
+  // Get pathname for pid. If that fails fall back to argv[0].
+  char pathname[MAXPATHLEN];
+  size_t pathname_len = sizeof(pathname);
+  mib[2] = KERN_PROC_PATHNAME;
+  if (::sysctl(mib, 4, pathname, _len, NULL, 0) == 0)
+process_info.GetExecutableFile().SetFile(pathname, false);
+  else
+process_info.GetExecutableFile().SetFile(cstr, false);
 
   if (!(match_info_ptr == NULL ||
 
NameMatches(process_info.GetExecutableFile().GetFilename().GetCString(),


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r311003 - convert hard tabs to spaces in PlatformOpenBSD.cpp

2017-08-16 Thread Ed Maste via lldb-commits
Author: emaste
Date: Wed Aug 16 06:10:07 2017
New Revision: 311003

URL: http://llvm.org/viewvc/llvm-project?rev=311003=rev
Log:
convert hard tabs to spaces in PlatformOpenBSD.cpp

Another case of this was responsible for the whitespace conflict
in D34776.

Modified:
lldb/trunk/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp

Modified: lldb/trunk/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp?rev=311003=311002=311003=diff
==
--- lldb/trunk/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp Wed Aug 16 
06:10:07 2017
@@ -133,7 +133,7 @@ PlatformOpenBSD::PlatformOpenBSD(bool is
 PlatformOpenBSD::~PlatformOpenBSD() = default;
 
 bool PlatformOpenBSD::GetSupportedArchitectureAtIndex(uint32_t idx,
- ArchSpec ) {
+  ArchSpec ) {
   if (IsHost()) {
 ArchSpec hostArch = HostInfo::GetArchitecture(HostInfo::eArchKindDefault);
 if (hostArch.GetTriple().isOSOpenBSD()) {


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r311002 - Make i386-*-freebsd expression work on JIT path

2017-08-16 Thread Ed Maste via lldb-commits
Author: emaste
Date: Wed Aug 16 05:55:02 2017
New Revision: 311002

URL: http://llvm.org/viewvc/llvm-project?rev=311002=rev
Log:
Make i386-*-freebsd expression work on JIT path

* Enable i386 ABI creation for freebsd
* Added an extra argument in ABISysV_i386::PrepareTrivialCall for mmap
  syscall
* Unlike linux, the last argument of mmap is actually 64-bit(off_t).
  This requires us to push an additional word for the higher order bits.
* Prior to this change, ktrace dump will show mmap failures due to
  invalid argument coming from the 6th mmap argument.

Patch by Karnajit Wangkhem

Differential Revision:  https://reviews.llvm.org/D34776

Modified:
lldb/trunk/include/lldb/Target/Platform.h
lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h
lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.h
lldb/trunk/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp
lldb/trunk/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.h
lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
lldb/trunk/source/Target/Platform.cpp

Modified: lldb/trunk/include/lldb/Target/Platform.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Platform.h?rev=311002=311001=311002=diff
==
--- lldb/trunk/include/lldb/Target/Platform.h (original)
+++ lldb/trunk/include/lldb/Target/Platform.h Wed Aug 16 05:55:02 2017
@@ -53,6 +53,7 @@ public:
 };
 
 typedef std::shared_ptr PlatformPropertiesSP;
+typedef llvm::SmallVector MmapArgList;
 
 //--
 /// @class Platform Platform.h "lldb/Target/Platform.h"
@@ -628,8 +629,11 @@ public:
 
   virtual Status Unlink(const FileSpec _spec);
 
-  virtual uint64_t ConvertMmapFlagsToPlatform(const ArchSpec ,
-  unsigned flags);
+  virtual MmapArgList GetMmapArgumentList(const ArchSpec ,
+  lldb::addr_t addr,
+  lldb::addr_t length,
+  unsigned prot, unsigned flags,
+  lldb::addr_t fd, lldb::addr_t 
offset);
 
   virtual bool GetSupportsRSync() { return m_supports_rsync; }
 

Modified: lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp?rev=311002=311001=311002=diff
==
--- lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp Wed Aug 16 
05:55:02 2017
@@ -206,7 +206,7 @@ ABISP
 ABISysV_i386::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec ) 
{
   static ABISP g_abi_sp;
   if ((arch.GetTriple().getArch() == llvm::Triple::x86) &&
-  arch.GetTriple().isOSLinux()) {
+  (arch.GetTriple().isOSLinux() || arch.GetTriple().isOSFreeBSD())) {
 if (!g_abi_sp)
   g_abi_sp.reset(new ABISysV_i386(process_sp));
 return g_abi_sp;

Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=311002=311001=311002=diff
==
--- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Wed Aug 16 
05:55:02 2017
@@ -314,13 +314,19 @@ void PlatformFreeBSD::CalculateTrapHandl
   m_trap_handlers.push_back(ConstString("_sigtramp"));
 }
 
-uint64_t PlatformFreeBSD::ConvertMmapFlagsToPlatform(const ArchSpec ,
- unsigned flags) {
+MmapArgList PlatformFreeBSD::GetMmapArgumentList(const ArchSpec ,
+ addr_t addr, addr_t length,
+ unsigned prot, unsigned flags,
+ addr_t fd, addr_t offset) {
   uint64_t flags_platform = 0;
 
   if (flags & eMmapFlagsPrivate)
 flags_platform |= MAP_PRIVATE;
   if (flags & eMmapFlagsAnon)
 flags_platform |= MAP_ANON;
-  return flags_platform;
+
+  MmapArgList args({addr, length, prot, flags_platform, fd, offset});
+  if (arch.GetTriple().getArch() == llvm::Triple::x86)
+args.push_back(0);
+  return args;
 }

Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
URL: 

[Lldb-commits] [lldb] r310644 - remove FreeBSD xfail decorator from TestCppNsImport

2017-08-10 Thread Ed Maste via lldb-commits
Author: emaste
Date: Thu Aug 10 11:26:52 2017
New Revision: 310644

URL: http://llvm.org/viewvc/llvm-project?rev=310644=rev
Log:
remove FreeBSD xfail decorator from TestCppNsImport

The Linux xfail decorator was removed in r272326 with the claim that the
test "runs reliably on the linux x86 buildbot." It also runs reliably on
FreeBSD for me.

llvm.org/pr25925

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py?rev=310644=310643=310644=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py 
Thu Aug 10 11:26:52 2017
@@ -11,7 +11,6 @@ class TestCppNsImport(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
-@expectedFailureAll(oslist=['freebsd'], bugnumber="llvm.org/pr25925")
 def test_with_run_command(self):
 """Tests imported namespaces in C++."""
 self.build()


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r310626 - remove FreeBSD xfail decorator from TestCallStdStringFunction

2017-08-10 Thread Ed Maste via lldb-commits
Author: emaste
Date: Thu Aug 10 10:01:51 2017
New Revision: 310626

URL: http://llvm.org/viewvc/llvm-project?rev=310626=rev
Log:
remove FreeBSD xfail decorator from TestCallStdStringFunction

This test is consistently reporting unexpected pass for me on FreeBSD
10 and 12. It was failing on the old FreeBSD buildbot which has now been
retired for some time. Will investigate further if this fails once a new
buildbot is configured and running tests.

llvm.org/pr17807

Modified:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py?rev=310626=310625=310626=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
 Thu Aug 10 10:01:51 2017
@@ -26,9 +26,6 @@ class ExprCommandCallFunctionTestCase(Te
 @expectedFailureAll(
 compiler="icc",
 bugnumber="llvm.org/pr14437, fails with ICC 13.1")
-@expectedFailureAll(
-oslist=['freebsd'],
-bugnumber='llvm.org/pr17807 Fails on FreeBSD buildbot')
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
 def test_with(self):
 """Test calling std::String member function."""


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] Details of radar rdar://problem/24599697

2017-08-10 Thread Ed Maste via lldb-commits
On 20 June 2016 at 19:01, Sean Callanan via lldb-commits
 wrote:
> Author: spyffe
> Date: Mon Jun 20 18:01:11 2016
> New Revision: 273211
>
> URL: http://llvm.org/viewvc/llvm-project?rev=273211=rev
> Log:
> Test that lldb calls the right 'printf' even when a 'printf' method exists.
>
...
> +
> +lldbinline.MakeInlineTest(__file__, globals(), 
> [decorators.expectedFailureAll(bugnumber="rdar://problem/24599697")] )

This test is consistently reporting unexpected pass on FreeBSD. Can
you please provide details on the actual failure in order to determine
the best path forward here?
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r310624 - remove FreeBSD xfail decorator from TestExitDuringBreak

2017-08-10 Thread Ed Maste via lldb-commits
Author: emaste
Date: Thu Aug 10 09:48:36 2017
New Revision: 310624

URL: http://llvm.org/viewvc/llvm-project?rev=310624=rev
Log:
remove FreeBSD xfail decorator from TestExitDuringBreak

This test passes for me on FreeBSD 10 and 12(-CURRENT).

llvm.org/pr18190

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py?rev=310624=310623=310624=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
 Thu Aug 10 09:48:36 2017
@@ -26,9 +26,6 @@ class ExitDuringBreakpointTestCase(TestB
 @expectedFailureAll(
 oslist=["linux"],
 bugnumber="llvm.org/pr15824 thread states not properly maintained")
-@expectedFailureAll(
-oslist=["freebsd"],
-bugnumber="llvm.org/pr18190 thread states not properly maintained")
 def test(self):
 """Test thread exit during breakpoint handling."""
 self.build(dictionary=self.getBuildFlags())


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r310591 - Report inferior signals as signals, not exceptions, on FreeBSD

2017-08-10 Thread Ed Maste via lldb-commits
Author: emaste
Date: Thu Aug 10 06:47:17 2017
New Revision: 310591

URL: http://llvm.org/viewvc/llvm-project?rev=310591=rev
Log:
Report inferior signals as signals, not exceptions, on FreeBSD

This is the FreeBSD equivalent of r238549.

This serves 2 purposes:

* LLDB should handle inferior process signals SIGSEGV/SIGILL/SIGBUS/
  SIGFPE the way it is suppose to be handled. Prior to this fix these
  signals will neither create a coredump, nor exit from the debugger
  or work for signal handling scenario.
* eInvalidCrashReason need not report "unknown crash reason" if we have
  a valid si_signo

llvm.org/pr23699

Patch by Karnajit Wangkhem

Differential Revision:  https://reviews.llvm.org/D35223

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py
lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
lldb/trunk/source/Plugins/Process/FreeBSD/POSIXStopInfo.cpp
lldb/trunk/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py?rev=310591=310590=310591=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
 Thu Aug 10 06:47:17 2017
@@ -17,9 +17,6 @@ class CrashingInferiorTestCase(TestBase)
 mydir = TestBase.compute_mydir(__file__)
 
 @expectedFailureAll(
-oslist=['freebsd'],
-bugnumber="llvm.org/pr23699 SIGSEGV is reported as exception, not 
signal")
-@expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr24778, This actually works, but the test relies 
on the output format instead of the API")
 def test_inferior_crashing(self):
@@ -60,7 +57,6 @@ class CrashingInferiorTestCase(TestBase)
 self.build()
 self.inferior_crashing_step()
 
-@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr24939')
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr24778, This actually works, but the test relies 
on the output format instead of the API")
@@ -76,6 +72,7 @@ class CrashingInferiorTestCase(TestBase)
 # Inferior exits after stepping after a segfault. This is working as
 # intended IMHO.
 @skipIfLinux
+@skipIfFreeBSD
 def test_inferior_crashing_expr_step_and_expr(self):
 """Test that lldb expressions work before and after stepping after a 
crash."""
 self.build()
@@ -110,7 +107,7 @@ class CrashingInferiorTestCase(TestBase)
 # The exact stop reason depends on the platform
 if self.platformIsDarwin():
 stop_reason = 'stop reason = EXC_BAD_ACCESS'
-elif self.getPlatform() == "linux":
+elif self.getPlatform() == "linux" or self.getPlatform() == "freebsd":
 stop_reason = 'stop reason = signal SIGSEGV'
 else:
 stop_reason = 'stop reason = invalid address'

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py?rev=310591=310590=310591=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
 Thu Aug 10 06:47:17 2017
@@ -16,9 +16,6 @@ class CrashingRecursiveInferiorTestCase(
 
 mydir = TestBase.compute_mydir(__file__)
 
-@expectedFailureAll(
-oslist=['freebsd'],
-bugnumber="llvm.org/pr23699 SIGSEGV is reported as exception, not 
signal")
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
 def test_recursive_inferior_crashing(self):
 """Test that lldb reliably catches the inferior crashing (command)."""
@@ -50,7 +47,6 @@ class CrashingRecursiveInferiorTestCase(
 self.build()
 self.recursive_inferior_crashing_step()
 
-@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr24939')
 @expectedFailureAll(oslist=["windows"], 

[Lldb-commits] [lldb] r303965 - FreeBSD ProcessMonitor: map TRAP_CAP to a trace trap

2017-05-25 Thread Ed Maste via lldb-commits
Author: emaste
Date: Thu May 25 22:15:46 2017
New Revision: 303965

URL: http://llvm.org/viewvc/llvm-project?rev=303965=rev
Log:
FreeBSD ProcessMonitor: map TRAP_CAP to a trace trap

In the absense of a more specific handler for TRAP_CAP (generated by
ENOTCAPABLE or ECAPMODE while in capability mode) treat it as a trace
trap. Obtained from FreeBSD r318884.

We should later add an option to have LLDB control the trapcap procctl 
(as with ASLR), as well as report a specific stop reason. For now this
change eliminates an assertion failure from LLDB.

Modified:
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp?rev=303965=303964=303965=diff
==
--- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Thu May 25 
22:15:46 2017
@@ -1132,6 +1132,10 @@ ProcessMessage ProcessMonitor::MonitorSI
 
   case 0:
   case TRAP_TRACE:
+#ifdef TRAP_CAP
+  // Map TRAP_CAP to a trace trap in the absense of a more specific handler.
+  case TRAP_CAP:
+#endif
 if (log)
   log->Printf("ProcessMonitor::%s() received trace event, tid = %" PRIu64
   "  : si_code = %d",


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r301067 - ThreadSanitizer plugin: match for loop variable with expected type

2017-04-21 Thread Ed Maste via lldb-commits
Author: emaste
Date: Fri Apr 21 20:38:54 2017
New Revision: 301067

URL: http://llvm.org/viewvc/llvm-project?rev=301067=rev
Log:
ThreadSanitizer plugin: match for loop variable with expected type

Removes Clang warning ThreadSanitizerRuntime.cpp:591:21: warning:
comparison of integers of different signs: 'int' and 'size_t' (aka
'unsigned long') [-Wsign-compare]


Modified:

lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp

Modified: 
lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp?rev=301067=301066=301067=diff
==
--- 
lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
 Fri Apr 21 20:38:54 2017
@@ -588,7 +588,7 @@ addr_t ThreadSanitizerRuntime::GetFirstN
   ModuleSP runtime_module_sp = GetRuntimeModuleSP();
 
   StructuredData::Array *trace_array = trace->GetAsArray();
-  for (int i = 0; i < trace_array->GetSize(); i++) {
+  for (size_t i = 0; i < trace_array->GetSize(); i++) {
 if (skip_one_frame && i == 0)
   continue;
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r299781 - Correct environ parsing on FreeBSD

2017-04-07 Thread Ed Maste via lldb-commits
Author: emaste
Date: Fri Apr  7 11:40:25 2017
New Revision: 299781

URL: http://llvm.org/viewvc/llvm-project?rev=299781=rev
Log:
Correct environ parsing on FreeBSD

Sync Host:GetEnvironment with Linux and Kamil Rytarowski's forthcoming
NetBSD change in review D31784.

Modified:
lldb/trunk/source/Host/freebsd/Host.cpp

Modified: lldb/trunk/source/Host/freebsd/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/freebsd/Host.cpp?rev=299781=299780=299781=diff
==
--- lldb/trunk/source/Host/freebsd/Host.cpp (original)
+++ lldb/trunk/source/Host/freebsd/Host.cpp Fri Apr  7 11:40:25 2017
@@ -52,18 +52,6 @@ extern char **environ;
 using namespace lldb;
 using namespace lldb_private;
 
-size_t Host::GetEnvironment(StringList ) {
-  char *v;
-  char **var = environ;
-  for (; var != NULL && *var != NULL; ++var) {
-v = strchr(*var, (int)'-');
-if (v == NULL)
-  continue;
-env.AppendString(v);
-  }
-  return env.GetSize();
-}
-
 static bool
 GetFreeBSDProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,
   ProcessInstanceInfo _info) {
@@ -243,6 +231,15 @@ bool Host::GetProcessInfo(lldb::pid_t pi
   return false;
 }
 
+size_t Host::GetEnvironment(StringList ) {
+  char **host_env = environ;
+  char *env_entry;
+  size_t i;
+  for (i = 0; (env_entry = host_env[i]) != NULL; ++i)
+env.AppendString(env_entry);
+  return i;
+}
+
 Error Host::ShellExpandArguments(ProcessLaunchInfo _info) {
   return Error("unimplemented");
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r294340 - Synchronize PlatformFreeBSD with Linux

2017-02-07 Thread Ed Maste via lldb-commits
Author: emaste
Date: Tue Feb  7 13:29:10 2017
New Revision: 294340

URL: http://llvm.org/viewvc/llvm-project?rev=294340=rev
Log:
Synchronize PlatformFreeBSD with Linux

Inspired by r294145 for NetBSD, this reduces diffs between the FreeBSD
and Linux/NetBSD Platform implementations. Further diff reduction will
occur once FreeBSD switches to using the remote process plugin.

Differential Revision:  https://reviews.llvm.org/D29667

Modified:
lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h

Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=294340=294339=294340=diff
==
--- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Tue Feb  7 
13:29:10 2017
@@ -22,22 +22,34 @@
 #include "lldb/Breakpoint/BreakpointLocation.h"
 #include "lldb/Breakpoint/BreakpointSite.h"
 #include "lldb/Core/Debugger.h"
-#include "lldb/Core/Module.h"
-#include "lldb/Core/ModuleSpec.h"
+#include "lldb/Core/Log.h"
 #include "lldb/Core/PluginManager.h"
-#include "lldb/Host/Host.h"
+#include "lldb/Core/State.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Target/Process.h"
+#include "lldb/Target/Target.h"
 #include "lldb/Utility/Error.h"
+#include "lldb/Utility/StreamString.h"
+
+// Define these constants from FreeBSD mman.h for use when targeting
+// remote FreeBSD systems even when host has different values.
+#define MAP_PRIVATE 0x0002
+#define MAP_ANON 0x1000
 
 using namespace lldb;
 using namespace lldb_private;
 using namespace lldb_private::platform_freebsd;
 
+static uint32_t g_initialize_count = 0;
+
+//--
+
 PlatformSP PlatformFreeBSD::CreateInstance(bool force, const ArchSpec *arch) {
-  // The only time we create an instance is when we are creating a remote
-  // freebsd platform
-  const bool is_host = false;
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM));
+  LLDB_LOG(log, "force = {0}, arch=({1}, {2})", force,
+   arch ? arch->GetArchitectureName() : "",
+   arch ? arch->GetTriple().getTriple() : "");
 
   bool create = force;
   if (create == false && arch && arch->IsValid()) {
@@ -59,8 +71,10 @@ PlatformSP PlatformFreeBSD::CreateInstan
   break;
 }
   }
-  if (create)
-return PlatformSP(new PlatformFreeBSD(is_host));
+  LLDB_LOG(log, "create = {0}", create);
+  if (create) {
+return PlatformSP(new PlatformFreeBSD(false));
+  }
   return PlatformSP();
 }
 
@@ -74,221 +88,51 @@ ConstString PlatformFreeBSD::GetPluginNa
   }
 }
 
-const char *PlatformFreeBSD::GetDescriptionStatic(bool is_host) {
+const char *PlatformFreeBSD::GetPluginDescriptionStatic(bool is_host) {
   if (is_host)
 return "Local FreeBSD user platform plug-in.";
   else
 return "Remote FreeBSD user platform plug-in.";
 }
 
-static uint32_t g_initialize_count = 0;
+ConstString PlatformFreeBSD::GetPluginName() {
+  return GetPluginNameStatic(IsHost());
+}
 
 void PlatformFreeBSD::Initialize() {
   Platform::Initialize();
 
   if (g_initialize_count++ == 0) {
 #if defined(__FreeBSD__)
-// Force a host flag to true for the default platform object.
 PlatformSP default_platform_sp(new PlatformFreeBSD(true));
 default_platform_sp->SetSystemArchitecture(HostInfo::GetArchitecture());
 Platform::SetHostPlatform(default_platform_sp);
 #endif
-PluginManager::RegisterPlugin(PlatformFreeBSD::GetPluginNameStatic(false),
-  PlatformFreeBSD::GetDescriptionStatic(false),
-  PlatformFreeBSD::CreateInstance);
+PluginManager::RegisterPlugin(
+PlatformFreeBSD::GetPluginNameStatic(false),
+PlatformFreeBSD::GetPluginDescriptionStatic(false),
+PlatformFreeBSD::CreateInstance, nullptr);
   }
 }
 
 void PlatformFreeBSD::Terminate() {
-  if (g_initialize_count > 0 && --g_initialize_count == 0)
-PluginManager::UnregisterPlugin(PlatformFreeBSD::CreateInstance);
-
-  Platform::Terminate();
-}
-
-bool PlatformFreeBSD::GetModuleSpec(const FileSpec _file_spec,
-const ArchSpec ,
-ModuleSpec _spec) {
-  if (m_remote_platform_sp)
-return m_remote_platform_sp->GetModuleSpec(module_file_spec, arch,
-   module_spec);
-
-  return Platform::GetModuleSpec(module_file_spec, arch, module_spec);
-}
-
-Error PlatformFreeBSD::RunShellCommand(const char *command,
-   const FileSpec _dir,
-   int *status_ptr, int *signo_ptr,
-   std::string 

[Lldb-commits] [lldb] r292937 - FreeBSD ARM support for software single step

2017-01-24 Thread Ed Maste via lldb-commits
Author: emaste
Date: Tue Jan 24 08:34:49 2017
New Revision: 292937

URL: http://llvm.org/viewvc/llvm-project?rev=292937=rev
Log:
FreeBSD ARM support for software single step

Implementation of software single step for FreeBSD on ARM. The code is
largely based on the Linux implementation of the same functionality.

Patch by Dmitry Mikulin!

Differential Revision:  https://reviews.llvm.org/D25756

Modified:
lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp

Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=292937=292936=292937=diff
==
--- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Tue Jan 24 
08:34:49 2017
@@ -549,6 +549,12 @@ PlatformFreeBSD::GetSoftwareBreakpointTr
   // FreeBSD kernel as of 10.x, does not support thumb breakpoints
   return 0;
 }
+
+static const uint8_t g_arm_breakpoint_opcode[] = {0xFE, 0xDE, 0xFF, 0xE7};
+size_t trap_opcode_size = sizeof(g_arm_breakpoint_opcode);
+assert(bp_site);
+if (bp_site->SetTrapOpcode(g_arm_breakpoint_opcode, trap_opcode_size))
+  return trap_opcode_size;
   }
 LLVM_FALLTHROUGH;
   default:

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp?rev=292937=292936=292937=diff
==
--- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp Tue Jan 24 
08:34:49 2017
@@ -13,6 +13,7 @@
 
 // C++ Includes
 #include 
+#include 
 
 // Other libraries and framework includes
 #include "lldb/Core/PluginManager.h"
@@ -122,6 +123,7 @@ Error ProcessFreeBSD::DoResume() {
 
   std::lock_guard guard(m_thread_list.GetMutex());
   bool do_step = false;
+  bool software_single_step = !SupportHardwareSingleStepping();
 
   for (tid_collection::const_iterator t_pos = m_run_tids.begin(),
   t_end = m_run_tids.end();
@@ -133,6 +135,11 @@ Error ProcessFreeBSD::DoResume() {
t_pos != t_end; ++t_pos) {
 m_monitor->ThreadSuspend(*t_pos, false);
 do_step = true;
+if (software_single_step) {
+  Error error = SetupSoftwareSingleStepping(*t_pos);
+  if (error.Fail())
+return error;
+}
   }
   for (tid_collection::const_iterator t_pos = m_suspend_tids.begin(),
   t_end = m_suspend_tids.end();
@@ -145,7 +152,7 @@ Error ProcessFreeBSD::DoResume() {
   if (log)
 log->Printf("process %" PRIu64 " resuming (%s)", GetID(),
 do_step ? "step" : "continue");
-  if (do_step)
+  if (do_step && !software_single_step)
 m_monitor->SingleStep(GetID(), m_resume_signo);
   else
 m_monitor->Resume(GetID(), m_resume_signo);
@@ -913,3 +920,194 @@ const DataBufferSP ProcessFreeBSD::GetAu
   "no platform or not the host - how did we get here with 
ProcessFreeBSD?");
   return DataBufferSP();
 }
+
+struct EmulatorBaton {
+  ProcessFreeBSD *m_process;
+  RegisterContext *m_reg_context;
+
+  // eRegisterKindDWARF -> RegisterValue
+  std::unordered_map m_register_values;
+
+  EmulatorBaton(ProcessFreeBSD *process, RegisterContext *reg_context)
+  : m_process(process), m_reg_context(reg_context) {}
+};
+
+static size_t ReadMemoryCallback(EmulateInstruction *instruction, void *baton,
+ const EmulateInstruction::Context ,
+ lldb::addr_t addr, void *dst, size_t length) {
+  EmulatorBaton *emulator_baton = static_cast(baton);
+
+  Error error;
+  size_t bytes_read =
+  emulator_baton->m_process->DoReadMemory(addr, dst, length, error);
+  if (!error.Success())
+bytes_read = 0;
+  return bytes_read;
+}
+
+static bool ReadRegisterCallback(EmulateInstruction *instruction, void *baton,
+ const RegisterInfo *reg_info,
+ RegisterValue _value) {
+  EmulatorBaton *emulator_baton = static_cast(baton);
+
+  auto it = emulator_baton->m_register_values.find(
+  reg_info->kinds[eRegisterKindDWARF]);
+  if (it != emulator_baton->m_register_values.end()) {
+reg_value = it->second;
+return true;
+  }
+
+  // The emulator only fills in the dwarf register numbers (and in some cases
+  // the generic register numbers). Get the full register info from the
+  // register context based on the dwarf register numbers.
+  

[Lldb-commits] [PATCH] D25947: Merge Linux and FreeBSD arm64 register contexts

2016-11-24 Thread Ed Maste via lldb-commits
emaste added a comment.

The tests are not in great shape on FreeBSD/arm64 today, but look roughly 
equivalent with and without this patch.

At https://reviews.llvm.org/rL287887:

  ===
  Test Result Summary
  ===
  Test Methods:   1148
  Reruns:   16
  Success: 302
  Expected Failure: 35
  Failure:  80
  Error:26
  Exceptional Exit: 98
  Unexpected Success:1
  Skip:600
  Timeout:   6
  Expected Timeout:  0

With the patch applied:

  ===
  Test Result Summary
  ===
  Test Methods:   1147
  Reruns:   16
  Success: 299
  Expected Failure: 35
  Failure:  80
  Error:26
  Exceptional Exit:100
  Unexpected Success:1
  Skip:600
  Timeout:   6
  Expected Timeout:  0


https://reviews.llvm.org/D25947



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r287609 - Turn on LLDB_EDITLINE_USE_WCHAR on FreeBSD

2016-11-21 Thread Ed Maste via lldb-commits
Author: emaste
Date: Mon Nov 21 20:25:41 2016
New Revision: 287609

URL: http://llvm.org/viewvc/llvm-project?rev=287609=rev
Log:
Turn on LLDB_EDITLINE_USE_WCHAR on FreeBSD

Modified:
lldb/trunk/include/lldb/Host/Editline.h

Modified: lldb/trunk/include/lldb/Host/Editline.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Editline.h?rev=287609=287608=287609=diff
==
--- lldb/trunk/include/lldb/Host/Editline.h (original)
+++ lldb/trunk/include/lldb/Host/Editline.h Mon Nov 21 20:25:41 2016
@@ -43,7 +43,7 @@
 // will only be
 // used in cases where this is true.  This is a compile time dependecy, for now
 // selected per target Platform
-#if defined(__APPLE__) || defined(__NetBSD__)
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
 #define LLDB_EDITLINE_USE_WCHAR 1
 #include 
 #else


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25947: Merge Linux and FreeBSD arm64 register contexts

2016-11-15 Thread Ed Maste via lldb-commits
emaste added a comment.

> Ed, what do you think about this one? Is there anyone with a FreeBSD arm64 
> setup that could verify this?

We have an arm64 reference machine in the FreeBSD cluster and I will test after 
I return from travel later this week, although perhaps @andrew can try it 
before then.


https://reviews.llvm.org/D25947



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D26300: ELF core: Adding parsing of the floating-point and SSE registers on x86 32/64 bit elf core files

2016-11-14 Thread Ed Maste via lldb-commits
emaste added a comment.

I applied this change on top of my WIP https://reviews.llvm.org/D26617 (which 
adds a FreeBSD core test). LLDB builds and my new test passes, so no objections 
from me. Once it's in I'll see about porting the new SSE test to FreeBSD too.


https://reviews.llvm.org/D26300



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r286035 - make-core.sh: add FreeBSD support

2016-11-05 Thread Ed Maste via lldb-commits
Author: emaste
Date: Sat Nov  5 09:45:13 2016
New Revision: 286035

URL: http://llvm.org/viewvc/llvm-project?rev=286035=rev
Log:
make-core.sh: add FreeBSD support

Differential Revision:  https://reviews.llvm.org/D26315

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh?rev=286035=286034=286035=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
 Sat Nov  5 09:45:13 2016
@@ -1,4 +1,30 @@
-#! /bin/bash
+#! /bin/sh
+
+linux_check_core_pattern()
+{
+if grep -q '^|' &2
+exit 1
+;;
+esac
 
 set -e -x
 
@@ -10,13 +36,8 @@ EOF
 exit 1
 fi
 
-if grep -q '^|'  smaller core files.


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D26315: make-core.sh: add FreeBSD support

2016-11-05 Thread Ed Maste via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL286035: make-core.sh: add FreeBSD support (authored by 
emaste).

Changed prior to commit:
  https://reviews.llvm.org/D26315?vs=76951=76968#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26315

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh


Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
@@ -1,4 +1,30 @@
-#! /bin/bash
+#! /bin/sh
+
+linux_check_core_pattern()
+{
+if grep -q '^|' &2
+exit 1
+;;
+esac
 
 set -e -x
 
@@ -10,13 +36,8 @@
 exit 1
 fi
 
-if grep -q '^|'  smaller core files.


Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
@@ -1,4 +1,30 @@
-#! /bin/bash
+#! /bin/sh
+
+linux_check_core_pattern()
+{
+if grep -q '^|' &2
+exit 1
+;;
+esac
 
 set -e -x
 
@@ -10,13 +36,8 @@
 exit 1
 fi
 
-if grep -q '^|'  smaller core files.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D26300: ELF core: Adding parsing of the floating-point and SSE registers on x86 32/64 bit elf core files

2016-11-04 Thread Ed Maste via lldb-commits
emaste added a comment.

Good point. https://reviews.llvm.org/D26315 has the change to add FreeBSD 
support to make-core.sh -- just avoiding /bin/bash, and the core file handler 
check.

I think we should be able to rename this directory to elf-core, and rename the 
individual cores to e.g. linux-i386.core, etc.


https://reviews.llvm.org/D26300



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D26315: make-core.sh: add FreeBSD support

2016-11-04 Thread Ed Maste via lldb-commits
emaste added a comment.

Output on FreeBSD, with the patch:

  % sh make-core.sh main.c
  + file=main.c
  + [ -z main.c ]
  + [ FreeBSD '=' Linux ]
  + ulimit -c 1000
  + ulimit -c
  + real_limit=1000
  + [ 1000 -lt 100 ]
  + cc -nostdlib -static -g main.c -o a.out
  + cat
  Executable file is in a.out.
  Core file will be saved according to pattern %N.core.
  + ulimit -s 8
  + exec ./a.out
  zsh: segmentation fault (core dumped)  sh make-core.sh main.c


https://reviews.llvm.org/D26315



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D26315: make-core.sh: add FreeBSD support

2016-11-04 Thread Ed Maste via lldb-commits
emaste created this revision.
emaste added a reviewer: labath.
emaste added a subscriber: lldb-commits.

https://reviews.llvm.org/D26315

Files:
  
packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh


Index: 
packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
===
--- 
packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
+++ 
packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
@@ -1,4 +1,30 @@
-#! /bin/bash
+#! /bin/sh
+
+linux_check_core_pattern()
+{
+if grep -q '^|' &2
+exit 1
+;;
+esac
 
 set -e -x
 
@@ -10,13 +36,8 @@
 exit 1
 fi
 
-if grep -q '^|'  smaller core files.


Index: packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
===
--- packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
+++ packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/make-core.sh
@@ -1,4 +1,30 @@
-#! /bin/bash
+#! /bin/sh
+
+linux_check_core_pattern()
+{
+if grep -q '^|' &2
+exit 1
+;;
+esac
 
 set -e -x
 
@@ -10,13 +36,8 @@
 exit 1
 fi
 
-if grep -q '^|'  smaller core files.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D26300: ELF core: Adding parsing of the floating-point and SSE registers on x86 32/64 bit elf core files

2016-11-04 Thread Ed Maste via lldb-commits
emaste added a comment.

We need to make sure this does not regress FreeBSD core handling -- I will test 
as soon as I can, and add FXSAVE parsing for FreeBSD. I'll use fpr_sse.cpp to 
generate FreeBSD core files as well (although note that we get ~2.5MB cores 
with default configuration, so tweaking malloc options will be necessary).

Please document how the core files were created (e.g. compiler invocation), 
perhaps as a comment in the source file.




Comment at: 
packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/TestLinuxCore.py:107
 
+@skipIf(oslist=['windows'])
+@skipIf(triple='^mips')

Curious, why are these skipped only on windows?


https://reviews.llvm.org/D26300



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25756: FreeBSD ARM support for software single step.

2016-10-21 Thread Ed Maste via lldb-commits
emaste added a subscriber: krytarowski.
emaste added a comment.

On a quick look this seems OK. I'll try to test/review in detail.

In https://reviews.llvm.org/D25756#576642, @dmikulin wrote:

> Thanks Pavel! I'll start working on it. Do you know when lldb-server Linux 
> changes were committed? I want to use those patches as a template, but it's 
> hard to locate them digging through thousands of commit log entries...


I recalled discussing this when the Linux changes were going in and wanted to 
point you at a mailing list archive, but it seems it was only in private mail. 
I'll try to send you the relevant threads.

Have a look at https://reviews.llvm.org/rL212069 for starters.

> Ed, you mentioned NetBSD work. Do you know where they are in their 
> implementation?  Anything I can do to help? Or should I start from scratch?

I hope @krytarowski can comment on that.

It's probably best to move this discussion to a new thread on lldb-dev.


Repository:
  rL LLVM

https://reviews.llvm.org/D25756



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25756: FreeBSD ARM support for software single step.

2016-10-20 Thread Ed Maste via lldb-commits
emaste added a comment.

On a quick look this seems OK. I'll try to test/review in detail.




Comment at: source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp:925
+
+  // eRegisterKindDWARF -> RegsiterValue
+  std::unordered_map m_register_values;

typo here


Repository:
  rL LLVM

https://reviews.llvm.org/D25756



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25756: FreeBSD ARM support for software single step.

2016-10-20 Thread Ed Maste via lldb-commits
emaste added a comment.

In https://reviews.llvm.org/D25756#574258, @labath wrote:

> No, I'm saying someone *should*. :P
>
> Ed looked into that at some point but, I don't think get got too far with it. 
> Adding @emaste, who should probably review this.


Yes, it needs to be done. Maybe now that NetBSD support is progressing a few of 
us can work together to make it happen.


Repository:
  rL LLVM

https://reviews.llvm.org/D25756



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25362: Fix build failure on lldb-amd64-ninja-freebsd11 error caused by rL283474

2016-10-07 Thread Ed Maste via lldb-commits
emaste accepted this revision.
emaste added a reviewer: emaste.
emaste added a comment.
This revision is now accepted and ready to land.

Not tested, but looks reasonable to me.

I think we should avoid `siginfo_t` altogether here in order to support 
cross-debugging, but that's for a different change.


https://reviews.llvm.org/D25362



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D25329: Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)

2016-10-06 Thread Ed Maste via lldb-commits
On 6 October 2016 at 16:42, Zachary Turner  wrote:
> I'm not sure actually.  I only noticed this because I was in IRC and I saw
> the message go by about the failure.
>
> Ed (already CC'ed) maintains the FreeBSD builder, so he might have an answer
> for you.

I'm not sure why it's not on the build.html list - I'll add it soon.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r283472 - Match printf field width arg and type

2016-10-06 Thread Ed Maste via lldb-commits
Author: emaste
Date: Thu Oct  6 12:55:22 2016
New Revision: 283472

URL: http://llvm.org/viewvc/llvm-project?rev=283472=rev
Log:
Match printf field width arg and type

A '*' as a field width or precision specifies that the field width or
precision is supplied by an int argument.

Modified:
lldb/trunk/source/Interpreter/Args.cpp

Modified: lldb/trunk/source/Interpreter/Args.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=283472=283471=283472=diff
==
--- lldb/trunk/source/Interpreter/Args.cpp (original)
+++ lldb/trunk/source/Interpreter/Args.cpp Thu Oct  6 12:55:22 2016
@@ -213,7 +213,7 @@ void Args::Dump(Stream , const char *l
   int i = 0;
   for (auto  : m_entries) {
 s.Indent();
-s.Printf("%s[%zi]=\"%*s\"\n", label_name, i++, entry.ref.size(),
+s.Printf("%s[%zi]=\"%*s\"\n", label_name, i++, int(entry.ref.size()),
  entry.ref.data());
   }
   s.Printf("%s[%zi]=NULL\n", label_name, i);


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12158: Fix typo in lldb --help

2016-09-21 Thread Ed Maste via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL282123: Fix typo in lldb --help (authored by emaste).

Changed prior to commit:
  https://reviews.llvm.org/D12158?vs=32567=72133#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D12158

Files:
  lldb/trunk/tools/driver/Driver.cpp

Index: lldb/trunk/tools/driver/Driver.cpp
===
--- lldb/trunk/tools/driver/Driver.cpp
+++ lldb/trunk/tools/driver/Driver.cpp
@@ -131,7 +131,7 @@
  "Tells the debugger to execute this one-line lldb command before any file 
"
  "provided on the command line has been loaded."},
 {LLDB_3_TO_5, false, "batch", 'b', no_argument, 0, eArgTypeNone,
- "Tells the debugger to running the commands from -s, -S, -o & -O, and "
+ "Tells the debugger to run the commands from -s, -S, -o & -O, and "
  "then quit.  However if any run command stopped due to a signal or crash, 
"
  "the debugger will return to the interactive prompt at the place of the "
  "crash."},


Index: lldb/trunk/tools/driver/Driver.cpp
===
--- lldb/trunk/tools/driver/Driver.cpp
+++ lldb/trunk/tools/driver/Driver.cpp
@@ -131,7 +131,7 @@
  "Tells the debugger to execute this one-line lldb command before any file "
  "provided on the command line has been loaded."},
 {LLDB_3_TO_5, false, "batch", 'b', no_argument, 0, eArgTypeNone,
- "Tells the debugger to running the commands from -s, -S, -o & -O, and "
+ "Tells the debugger to run the commands from -s, -S, -o & -O, and "
  "then quit.  However if any run command stopped due to a signal or crash, "
  "the debugger will return to the interactive prompt at the place of the "
  "crash."},
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r282123 - Fix typo in lldb --help

2016-09-21 Thread Ed Maste via lldb-commits
Author: emaste
Date: Wed Sep 21 18:30:36 2016
New Revision: 282123

URL: http://llvm.org/viewvc/llvm-project?rev=282123=rev
Log:
Fix typo in lldb --help

Patch by Yacine Belkadi

Differential Revision:  https://reviews.llvm.org/D12158

Modified:
lldb/trunk/tools/driver/Driver.cpp

Modified: lldb/trunk/tools/driver/Driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Driver.cpp?rev=282123=282122=282123=diff
==
--- lldb/trunk/tools/driver/Driver.cpp (original)
+++ lldb/trunk/tools/driver/Driver.cpp Wed Sep 21 18:30:36 2016
@@ -131,7 +131,7 @@ static OptionDefinition g_options[] = {
  "Tells the debugger to execute this one-line lldb command before any file 
"
  "provided on the command line has been loaded."},
 {LLDB_3_TO_5, false, "batch", 'b', no_argument, 0, eArgTypeNone,
- "Tells the debugger to running the commands from -s, -S, -o & -O, and "
+ "Tells the debugger to run the commands from -s, -S, -o & -O, and "
  "then quit.  However if any run command stopped due to a signal or crash, 
"
  "the debugger will return to the interactive prompt at the place of the "
  "crash."},


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r282112 - Fix integer sign warning from r282105

2016-09-21 Thread Ed Maste via lldb-commits
On 21 September 2016 at 21:38, Adrian McCarthy  wrote:
> That fix doesn't look complete:

Thanks, I've applied your fix in r282119, and sorry for being hasty
with the original change.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r282119 - Fix for loop sign fix in r282112 for column = 0

2016-09-21 Thread Ed Maste via lldb-commits
Author: emaste
Date: Wed Sep 21 17:36:51 2016
New Revision: 282119

URL: http://llvm.org/viewvc/llvm-project?rev=282119=rev
Log:
Fix for loop sign fix in r282112 for column = 0

Modified:
lldb/trunk/source/Core/SourceManager.cpp

Modified: lldb/trunk/source/Core/SourceManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/SourceManager.cpp?rev=282119=282118=282119=diff
==
--- lldb/trunk/source/Core/SourceManager.cpp (original)
+++ lldb/trunk/source/Core/SourceManager.cpp Wed Sep 21 17:36:51 2016
@@ -172,7 +172,7 @@ size_t SourceManager::DisplaySourceLines
 m_last_file_sp->GetLine(line, src_line);
 return_value += s->Printf("\t");
 // Insert a space for every non-tab character in the source line.
-for (size_t i = 0; i < column - 1 && i < src_line.length(); ++i)
+for (size_t i = 0; i + 1 < column && i < src_line.length(); ++i)
   return_value += s->PutChar(src_line[i] == '\t' ? '\t' : ' ');
 // Now add the caret.
 return_value += s->Printf("^\n");


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r282111 - Fix -Wcovered-switch-default warning in StackFrame.cpp

2016-09-21 Thread Ed Maste via lldb-commits
On 21 September 2016 at 17:08, Ed Maste via lldb-commits
<lldb-commits@lists.llvm.org> wrote:
> Author: emaste
> Date: Wed Sep 21 16:08:30 2016
> New Revision: 282111
>
> URL: http://llvm.org/viewvc/llvm-project?rev=282111=rev
> Log:
> Fix -Wcovered-switch-default warning in StackFrame.cpp
>
> The switch coveres all possible values. If a new one is added in the
> future the compiler will start warning, providing a notification that
> the switch needs updating.

For example, the warning shows a missing enum in ClangASTContext.cpp:

../tools/lldb/source/Symbol/ClangASTContext.cpp:4209:11: warning:
enumeration value 'ObjCTypeParam' not handled in switch [-Wswitch]
  switch (qual_type->getTypeClass()) {
  ^
../tools/lldb/source/Symbol/ClangASTContext.cpp:4922:11: warning:
enumeration value 'ObjCTypeParam' not handled in switch [-Wswitch]
  switch (qual_type->getTypeClass()) {
  ^
../tools/lldb/source/Symbol/ClangASTContext.cpp:5131:11: warning:
enumeration value 'ObjCTypeParam' not handled in switch [-Wswitch]
  switch (qual_type->getTypeClass()) {
  ^
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r282112 - Fix integer sign warning from r282105

2016-09-21 Thread Ed Maste via lldb-commits
Author: emaste
Date: Wed Sep 21 16:14:31 2016
New Revision: 282112

URL: http://llvm.org/viewvc/llvm-project?rev=282112=rev
Log:
Fix integer sign warning from r282105

Modified:
lldb/trunk/source/Core/SourceManager.cpp

Modified: lldb/trunk/source/Core/SourceManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/SourceManager.cpp?rev=282112=282111=282112=diff
==
--- lldb/trunk/source/Core/SourceManager.cpp (original)
+++ lldb/trunk/source/Core/SourceManager.cpp Wed Sep 21 16:14:31 2016
@@ -172,7 +172,7 @@ size_t SourceManager::DisplaySourceLines
 m_last_file_sp->GetLine(line, src_line);
 return_value += s->Printf("\t");
 // Insert a space for every non-tab character in the source line.
-for (int i = 0; i < column - 1 && i < src_line.length(); ++i)
+for (size_t i = 0; i < column - 1 && i < src_line.length(); ++i)
   return_value += s->PutChar(src_line[i] == '\t' ? '\t' : ' ');
 // Now add the caret.
 return_value += s->Printf("^\n");


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r282111 - Fix -Wcovered-switch-default warning in StackFrame.cpp

2016-09-21 Thread Ed Maste via lldb-commits
Author: emaste
Date: Wed Sep 21 16:08:30 2016
New Revision: 282111

URL: http://llvm.org/viewvc/llvm-project?rev=282111=rev
Log:
Fix -Wcovered-switch-default warning in StackFrame.cpp

The switch coveres all possible values. If a new one is added in the
future the compiler will start warning, providing a notification that
the switch needs updating.

Modified:
lldb/trunk/source/Target/StackFrame.cpp

Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=282111=282110=282111=diff
==
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Wed Sep 21 16:08:30 2016
@@ -1278,8 +1278,6 @@ GetBaseExplainingValue(const Instruction
   return std::make_pair(nullptr, 0);
 }
   }
-  default:
-return std::make_pair(nullptr, 0);
   }
 }
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D23977: Support of lldb on Kfreebsd

2016-09-19 Thread Ed Maste via lldb-commits
emaste requested changes to this revision.
emaste added a reviewer: emaste.
emaste added a comment.
This revision now requires changes to proceed.

Two requested changes called out in comments above


https://reviews.llvm.org/D23977



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D5867: Minimal API support for non-8-bit byte targets

2016-09-08 Thread Ed Maste via lldb-commits
emaste added a comment.

This change will no longer apply. Is it still desired? If so, can you please 
rebase the patch.


https://reviews.llvm.org/D5867



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r280933 - Fix -Wcovered-switch-default warning in AppleObjCRuntimeV2.cpp

2016-09-08 Thread Ed Maste via lldb-commits
Author: emaste
Date: Thu Sep  8 08:17:42 2016
New Revision: 280933

URL: http://llvm.org/viewvc/llvm-project?rev=280933=rev
Log:
Fix -Wcovered-switch-default warning in AppleObjCRuntimeV2.cpp

The switch coveres all possible values. If a new one is added in the
future the compiler will start warning, providing a notification that
the switch needs updating.

Modified:

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=280933=280932=280933=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
 Thu Sep  8 08:17:42 2016
@@ -1906,8 +1906,6 @@ void AppleObjCRuntimeV2::WarnIfNoClasses
  "reduce the quality of type information 
available.\n");
   m_noclasses_warning_emitted = true;
   break;
-default:
-  break;
 }
   }
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r280931 - Fix unused variable and integer sign warnings from r280906

2016-09-08 Thread Ed Maste via lldb-commits
Author: emaste
Date: Thu Sep  8 08:11:31 2016
New Revision: 280931

URL: http://llvm.org/viewvc/llvm-project?rev=280931=rev
Log:
Fix unused variable and integer sign warnings from r280906

Modified:
lldb/trunk/source/Core/Disassembler.cpp

Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=280931=280930=280931=diff
==
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Thu Sep  8 08:11:31 2016
@@ -369,7 +369,6 @@ bool Disassembler::PrintInstructions(Dis
 
   const uint32_t max_opcode_byte_size =
   disasm_ptr->GetInstructionList().GetMaxOpcocdeByteSize();
-  uint32_t offset = 0;
   SymbolContext sc;
   SymbolContext prev_sc;
   AddressRange current_source_line_range;
@@ -549,7 +548,7 @@ bool Disassembler::PrintInstructions(Dis
   if (this_line != previous_line) {
 
 std::vector previous_lines;
-for (int i = 0;
+for (uint32_t i = 0;
  i < num_mixed_context_lines &&
  (this_line.line - num_mixed_context_lines) > 0;
  i++) {
@@ -579,7 +578,7 @@ bool Disassembler::PrintInstructions(Dis
 source_lines_to_display.current_source_line =
 source_lines_to_display.lines.size() - 1;
 
-for (int i = 0; i < num_mixed_context_lines; i++) {
+for (uint32_t i = 0; i < num_mixed_context_lines; i++) {
   SourceLine next_line;
   next_line.file = this_line.file;
   next_line.line = this_line.line + i + 1;


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D24293: Use llvm's demangler

2016-09-07 Thread Ed Maste via lldb-commits
emaste added a subscriber: emaste.
emaste added a comment.

Which library contains `llvm::itaniumDemangle`?


https://reviews.llvm.org/D24293



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r280755 - Reorder FreeBSD Host.cpp #includes to fix build

2016-09-06 Thread Ed Maste via lldb-commits
Author: emaste
Date: Tue Sep  6 16:25:31 2016
New Revision: 280755

URL: http://llvm.org/viewvc/llvm-project?rev=280755=rev
Log:
Reorder FreeBSD Host.cpp #includes to fix build

Modified:
lldb/trunk/source/Host/freebsd/Host.cpp

Modified: lldb/trunk/source/Host/freebsd/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/freebsd/Host.cpp?rev=280755=280754=280755=diff
==
--- lldb/trunk/source/Host/freebsd/Host.cpp (original)
+++ lldb/trunk/source/Host/freebsd/Host.cpp Tue Sep  6 16:25:31 2016
@@ -9,17 +9,19 @@
 
//===--===//
 
 // C Includes
-#include 
-#include 
-#include 
+#include 
+
+#include 
 #include 
+#include 
 #include 
-#include 
 #include 
 
 #include 
-#include 
-#include 
+
+#include 
+#include 
+#include 
 
 // C++ Includes
 // Other libraries and framework includes


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D23977: Support of lldb on Kfreebsd

2016-08-29 Thread Ed Maste via lldb-commits
emaste added a subscriber: emaste.
emaste added a comment.

- in the future can you please upload with context (e.g. git diff -U)
- I think the OS names in utilsOsType.py are kept sorted and the actual enum 
values are not part of an ABI


https://reviews.llvm.org/D23977



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


  1   2   >