The NT_* note type names are common between different operating systems, with 
different values. Instead of naming them NT_FREEBSD_*, just put them in a 
FREEBSD namespace.

Submitting for code review primarily for comment on coding style, since we 
don't have many examples to crib from already.

http://reviews.llvm.org/D6363

Files:
  source/Plugins/Process/elf-core/ProcessElfCore.cpp
Index: source/Plugins/Process/elf-core/ProcessElfCore.cpp
===================================================================
--- source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -405,14 +405,18 @@
     NT_AUXV
 };
 
+namespace FREEBSD {
+
 enum {
-    NT_FREEBSD_PRSTATUS      = 1,
-    NT_FREEBSD_FPREGSET,
-    NT_FREEBSD_PRPSINFO,
-    NT_FREEBSD_THRMISC       = 7,
-    NT_FREEBSD_PROCSTAT_AUXV = 16
+    NT_PRSTATUS      = 1,
+    NT_FPREGSET,
+    NT_PRPSINFO,
+    NT_THRMISC       = 7,
+    NT_PROCSTAT_AUXV = 16
 };
 
+}
+
 // Parse a FreeBSD NT_PRSTATUS note - see FreeBSD sys/procfs.h for details.
 static void
 ParseFreeBSDPrStatus(ThreadData &thread_data, DataExtractor &data,
@@ -517,20 +521,20 @@
             m_os = llvm::Triple::FreeBSD;
             switch (note.n_type)
             {
-                case NT_FREEBSD_PRSTATUS:
+                case FREEBSD::NT_PRSTATUS:
                     have_prstatus = true;
                     ParseFreeBSDPrStatus(*thread_data, note_data, arch);
                     break;
-                case NT_FREEBSD_FPREGSET:
+                case FREEBSD::NT_FPREGSET:
                     thread_data->fpregset = note_data;
                     break;
-                case NT_FREEBSD_PRPSINFO:
+                case FREEBSD::NT_PRPSINFO:
                     have_prpsinfo = true;
                     break;
-                case NT_FREEBSD_THRMISC:
+                case FREEBSD::NT_THRMISC:
                     ParseFreeBSDThrMisc(*thread_data, note_data);
                     break;
-                case NT_FREEBSD_PROCSTAT_AUXV:
+                case FREEBSD::NT_PROCSTAT_AUXV:
                     // FIXME: FreeBSD sticks an int at the beginning of the note
                     m_auxv = DataExtractor(segment_data, note_start + 4, note_size - 4);
                     break;
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to