@@ -25,7 +25,6 @@ use crate::mem::exe::ExeInfo;
25
25
#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
26
26
#[ repr( C ) ]
27
27
pub struct SandboxConfiguration {
28
- #[ cfg( gdb) ]
29
28
/// Guest gdb debug port
30
29
guest_debug_port : Option < u16 > ,
31
30
/// The maximum size of the guest error buffer.
@@ -139,9 +138,8 @@ impl SandboxConfiguration {
139
138
pub const MIN_KERNEL_STACK_SIZE : usize = 0x1000 ;
140
139
/// The default value for kernel stack size
141
140
pub const DEFAULT_KERNEL_STACK_SIZE : usize = Self :: MIN_KERNEL_STACK_SIZE ;
142
- #[ cfg( gdb) ]
143
141
/// The minimum value for debug port
144
- pub const MIN_GUEST_DEBUG_PORT : u16 = 9000 ;
142
+ pub const MIN_GUEST_DEBUG_PORT : u16 = 1024 ;
145
143
146
144
#[ allow( clippy:: too_many_arguments) ]
147
145
/// Create a new configuration for a sandbox with the given sizes.
@@ -159,7 +157,7 @@ impl SandboxConfiguration {
159
157
max_initialization_time : Option < Duration > ,
160
158
max_wait_for_cancellation : Option < Duration > ,
161
159
guest_panic_context_buffer_size : usize ,
162
- # [ cfg ( gdb ) ] guest_debug_port : Option < u16 > ,
160
+ guest_debug_port : Option < u16 > ,
163
161
) -> Self {
164
162
Self {
165
163
input_data_size : max ( input_data_size, Self :: MIN_INPUT_SIZE ) ,
@@ -227,7 +225,6 @@ impl SandboxConfiguration {
227
225
guest_panic_context_buffer_size,
228
226
Self :: MIN_GUEST_PANIC_CONTEXT_BUFFER_SIZE ,
229
227
) ,
230
- #[ cfg( gdb) ]
231
228
guest_debug_port,
232
229
}
233
230
}
@@ -355,7 +352,6 @@ impl SandboxConfiguration {
355
352
) ;
356
353
}
357
354
358
- #[ cfg( gdb) ]
359
355
#[ instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ]
360
356
/// Sets the configuration for the guest debug
361
357
pub fn set_guest_debug_port ( & mut self , port : u16 ) {
@@ -406,7 +402,6 @@ impl SandboxConfiguration {
406
402
self . max_initialization_time
407
403
}
408
404
409
- #[ cfg( gdb) ]
410
405
#[ instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ]
411
406
pub ( crate ) fn get_guest_debug_port ( & self ) -> Option < u16 > {
412
407
self . guest_debug_port
@@ -460,7 +455,6 @@ impl Default for SandboxConfiguration {
460
455
None ,
461
456
None ,
462
457
Self :: DEFAULT_GUEST_PANIC_CONTEXT_BUFFER_SIZE ,
463
- #[ cfg( gdb) ]
464
458
None ,
465
459
)
466
460
}
@@ -504,7 +498,6 @@ mod tests {
504
498
MAX_WAIT_FOR_CANCELLATION_OVERRIDE as u64 ,
505
499
) ) ,
506
500
GUEST_PANIC_CONTEXT_BUFFER_SIZE_OVERRIDE ,
507
- #[ cfg( gdb) ]
508
501
None ,
509
502
) ;
510
503
let exe_infos = vec ! [
@@ -569,7 +562,6 @@ mod tests {
569
562
SandboxConfiguration :: MIN_MAX_WAIT_FOR_CANCELLATION as u64 - 1 ,
570
563
) ) ,
571
564
SandboxConfiguration :: MIN_GUEST_PANIC_CONTEXT_BUFFER_SIZE - 1 ,
572
- #[ cfg( gdb) ]
573
565
None ,
574
566
) ;
575
567
assert_eq ! ( SandboxConfiguration :: MIN_INPUT_SIZE , cfg. input_data_size) ;
@@ -741,7 +733,6 @@ mod tests {
741
733
}
742
734
743
735
#[ test]
744
- #[ cfg( gdb) ]
745
736
fn guest_debug_port( port in 9000 ..=u16 :: MAX ) {
746
737
let mut cfg = SandboxConfiguration :: default ( ) ;
747
738
cfg. set_guest_debug_port( port) ;
0 commit comments