summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRene Gollent <anevilyak@gmail.com>2012-12-19 04:51:12 (GMT)
committerRene Gollent <anevilyak@gmail.com>2012-12-19 04:55:49 (GMT)
commitbbdb6052247f0893e1d9102dd2009f10bfa100ea (patch)
tree38bf73a436bf23f5307527ea8ce322777232039b
parent3e441f885e85e7f22c41a0e52100d0569bd6874a (diff)
Switch over to using Debugger as the primary system debugger.hrev45032
- When a crash occurs that requires using consoled, use Debugger in CLI mode. - Closes #1078.
-rw-r--r--build/jam/HaikuImage6
-rw-r--r--build/jam/OptionalPackages1
-rw-r--r--src/servers/debug/DebugServer.cpp65
3 files changed, 42 insertions, 30 deletions
diff --git a/build/jam/HaikuImage b/build/jam/HaikuImage
index 7074a83..1a0b6f7 100644
--- a/build/jam/HaikuImage
+++ b/build/jam/HaikuImage
@@ -44,8 +44,8 @@ SYSTEM_BIN = [ FFilterByBuildFeatures
SYSTEM_APPS = [ FFilterByBuildFeatures
AboutSystem ActivityMonitor BootManager@x86 CharacterMap
- CodyCam DeskCalc Devices DiskProbe DiskUsage DriveSetup CDPlayer Expander
- GLInfo@x86 Icon-O-Matic Installer LaunchBox Magnify Mail
+ CodyCam DeskCalc Devices DiskProbe DiskUsage DriveSetup CDPlayer Debugger
+ Expander GLInfo@x86 Icon-O-Matic Installer LaunchBox Magnify Mail
MediaConverter MediaPlayer MidiPlayer NetworkStatus PackageInstaller People
PoorMan PowerStatus ProcessController Screenshot ShowImage SoundRecorder
StyledEdit Terminal TextSearch TV WebWatch Workspaces
@@ -75,7 +75,7 @@ SYSTEM_LIBS = [ FFilterByBuildFeatures
PRIVATE_SYSTEM_LIBS = [ FFilterByBuildFeatures
$(HAIKU_JPEG_CURRENT_LIB)
$(HAIKU_LIBPNG_CURRENT_LIB)
- $(HAIKU_ZLIB_CURRENT_LIB)
+ $(HAIKU_ZLIB_CURRENT_LIB)
$(HAIKU_FREETYPE_CURRENT_LIB)
libalm.so
libfluidsynth.so
diff --git a/build/jam/OptionalPackages b/build/jam/OptionalPackages
index 2511aad..4036abc 100644
--- a/build/jam/OptionalPackages
+++ b/build/jam/OptionalPackages
@@ -643,7 +643,6 @@ if [ IsOptionalHaikuImagePackageAdded DemoPackage_Video ] {
# Development
if [ IsOptionalHaikuImagePackageAdded Development ] {
if $(TARGET_ARCH) = x86 {
- AddFilesToHaikuImage system apps : Debugger ;
AddSymlinkToHaikuImage home config settings deskbar Applications
: /boot/system/apps/Debugger : Debugger ;
# autotools
diff --git a/src/servers/debug/DebugServer.cpp b/src/servers/debug/DebugServer.cpp
index 3fa4b73..6727c52 100644
--- a/src/servers/debug/DebugServer.cpp
+++ b/src/servers/debug/DebugServer.cpp
@@ -41,8 +41,8 @@ enum {
};
-#define HANDOVER_USE_GDB 1
-//#define HANDOVER_USE_DEBUGGER 1
+//#define HANDOVER_USE_GDB 1
+#define HANDOVER_USE_DEBUGGER 1
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "DebugServer"
@@ -555,44 +555,57 @@ TeamDebugHandler::_EnterDebugger(bool saveReport)
"terminal (debugger) for team %" B_PRId32 "...\n", fTeam));
#elif defined(HANDOVER_USE_DEBUGGER)
+ // prepare the argument vector
+ BPath debuggerPath;
if (debugInConsoled) {
- error = _SetupGDBArguments(arguments, debugInConsoled);
- if (error != B_OK) {
- debug_printf("debug_server: Failed to set up gdb arguments: %s\n",
- strerror(error));
- return error;
- }
- } else {
- // prepare the argument vector
- BPath debuggerPath;
- error = find_directory(B_SYSTEM_APPS_DIRECTORY, &debuggerPath);
+ error = find_directory(B_SYSTEM_BIN_DIRECTORY, &debuggerPath);
if (error != B_OK) {
- debug_printf("debug_server: can't find system-apps directory: %s\n",
+ debug_printf("debug_server: can't find system-bin directory: %s\n",
strerror(error));
return error;
}
- error = debuggerPath.Append("Debugger");
+ error = debuggerPath.Append("consoled");
if (error != B_OK) {
- debug_printf("debug_server: can't append to system-apps path: %s\n",
+ debug_printf("debug_server: can't append to system-bin path: %s\n",
strerror(error));
return error;
}
+
if (!arguments.Add(debuggerPath.Path()))
return B_NO_MEMORY;
+ }
- BString debuggerParam;
- debuggerParam.SetToFormat("%" B_PRId32, fTeam);
- if (saveReport) {
- if (!arguments.Add("--save-report"))
- return B_NO_MEMORY;
- }
- if (!arguments.Add("--team") || !arguments.Add(debuggerParam))
- return B_NO_MEMORY;
+ error = find_directory(B_SYSTEM_APPS_DIRECTORY, &debuggerPath);
+ if (error != B_OK) {
+ debug_printf("debug_server: can't find system-apps directory: %s\n",
+ strerror(error));
+ return error;
+ }
+ error = debuggerPath.Append("Debugger");
+ if (error != B_OK) {
+ debug_printf("debug_server: can't append to system-apps path: %s\n",
+ strerror(error));
+ return error;
+ }
+ if (!arguments.Add(debuggerPath.Path()))
+ return B_NO_MEMORY;
+
+ if (debugInConsoled && !arguments.Add("--cli"))
+ return B_NO_MEMORY;
- // start the debugger
- TRACE(("debug_server: TeamDebugHandler::_EnterDebugger(): starting "
- "graphical debugger for team %" B_PRId32 "...\n", fTeam));
+ BString debuggerParam;
+ debuggerParam.SetToFormat("%" B_PRId32, fTeam);
+ if (saveReport) {
+ if (!arguments.Add("--save-report"))
+ return B_NO_MEMORY;
}
+ if (!arguments.Add("--team") || !arguments.Add(debuggerParam))
+ return B_NO_MEMORY;
+
+ // start the debugger
+ TRACE(("debug_server: TeamDebugHandler::_EnterDebugger(): starting "
+ "%s debugger for team %" B_PRId32 "...\n",
+ debugInConsoled ? "command line" : "graphical", fTeam));
#endif
for (int32 i = 0; i < arguments.CountStrings(); i++)