* [RFA] Cleanup SYMBOLS_CAN_START_WITH_DOLLAR
@ 2004-11-12 17:55 Randolph Chung
2004-11-12 20:44 ` Andrew Cagney
0 siblings, 1 reply; 3+ messages in thread
From: Randolph Chung @ 2004-11-12 17:55 UTC (permalink / raw)
To: gdb-patches
Ref: http://sources.redhat.com/ml/gdb/2004-11/msg00097.html
Trying to get rid of more of these hppa-only defines....
ok?
randolph
2004-11-12 Randolph Chung <tausq@debian.org>
* config/tm/tm-hppa.h (SYMBOLS_CAN_START_WITH_DOLLAR): Remove.
* parse.c (SYMBOLS_CAN_START_WITH_DOLLAR): Remove.
(write_exp_msymbol): Remove conditional check for symbols starting
with $. Update comments.
Index: config/pa/tm-hppa.h
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/tm-hppa.h,v
retrieving revision 1.75
diff -u -p -r1.75 tm-hppa.h
--- config/pa/tm-hppa.h 2 Sep 2004 14:17:41 -0000 1.75
+++ config/pa/tm-hppa.h 12 Nov 2004 17:50:26 -0000
@@ -38,9 +38,3 @@ extern int hppa_instruction_nullified (v
/* Here's how to step off a permanent breakpoint. */
#define SKIP_PERMANENT_BREAKPOINT (hppa_skip_permanent_breakpoint)
extern void hppa_skip_permanent_breakpoint (void);
-
-/* On HP-UX, certain system routines (millicode) have names beginning
- with $ or $$, e.g. $$dyncall, which handles inter-space procedure
- calls on PA-RISC. Tell the expression parser to check for those
- when parsing tokens that begin with "$". */
-#define SYMBOLS_CAN_START_WITH_DOLLAR (1)
Index: parse.c
===================================================================
RCS file: /cvs/src/src/gdb/parse.c,v
retrieving revision 1.43
diff -u -p -r1.43 parse.c
--- parse.c 26 Jul 2004 14:53:04 -0000 1.43
+++ parse.c 12 Nov 2004 17:50:26 -0000
@@ -64,21 +64,6 @@ const struct exp_descriptor exp_descript
evaluate_subexp_standard
};
\f
-/* Symbols which architectures can redefine. */
-
-/* Some systems have routines whose names start with `$'. Giving this
- macro a non-zero value tells GDB's expression parser to check for
- such routines when parsing tokens that begin with `$'.
-
- On HP-UX, certain system routines (millicode) have names beginning
- with `$' or `$$'. For example, `$$dyncall' is a millicode routine
- that handles inter-space procedure calls on PA-RISC. */
-#ifndef SYMBOLS_CAN_START_WITH_DOLLAR
-#define SYMBOLS_CAN_START_WITH_DOLLAR (0)
-#endif
-
-
-\f
/* Global variables declared in parser-defs.h (and commented there). */
struct expression *expout;
int expout_size;
@@ -437,6 +422,9 @@ write_exp_msymbol (struct minimal_symbol
void
write_dollar_variable (struct stoken str)
{
+ struct symbol *sym = NULL;
+ struct minimal_symbol *msym = NULL;
+
/* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1)
and $$digits (equivalent to $<-digits> if you could type that). */
@@ -474,36 +462,26 @@ write_dollar_variable (struct stoken str
if (i >= 0)
goto handle_register;
- if (SYMBOLS_CAN_START_WITH_DOLLAR)
- {
- struct symbol *sym = NULL;
- struct minimal_symbol *msym = NULL;
+ /* On some systems, such as HP-UX and hppa-linux, certain system routines
+ have names beginning with $ or $$. Check for those, first. */
- /* On HP-UX, certain system routines (millicode) have names beginning
- with $ or $$, e.g. $$dyncall, which handles inter-space procedure
- calls on PA-RISC. Check for those, first. */
-
- /* This code is not enabled on non HP-UX systems, since worst case
- symbol table lookup performance is awful, to put it mildly. */
-
- sym = lookup_symbol (copy_name (str), (struct block *) NULL,
- VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL);
- if (sym)
- {
- write_exp_elt_opcode (OP_VAR_VALUE);
- write_exp_elt_block (block_found); /* set by lookup_symbol */
- write_exp_elt_sym (sym);
- write_exp_elt_opcode (OP_VAR_VALUE);
- return;
- }
- msym = lookup_minimal_symbol (copy_name (str), NULL, NULL);
- if (msym)
- {
- write_exp_msymbol (msym,
- lookup_function_type (builtin_type_int),
- builtin_type_int);
- return;
- }
+ sym = lookup_symbol (copy_name (str), (struct block *) NULL,
+ VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL);
+ if (sym)
+ {
+ write_exp_elt_opcode (OP_VAR_VALUE);
+ write_exp_elt_block (block_found); /* set by lookup_symbol */
+ write_exp_elt_sym (sym);
+ write_exp_elt_opcode (OP_VAR_VALUE);
+ return;
+ }
+ msym = lookup_minimal_symbol (copy_name (str), NULL, NULL);
+ if (msym)
+ {
+ write_exp_msymbol (msym,
+ lookup_function_type (builtin_type_int),
+ builtin_type_int);
+ return;
}
/* Any other names starting in $ are debugger internal variables. */
--
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] Cleanup SYMBOLS_CAN_START_WITH_DOLLAR
2004-11-12 17:55 [RFA] Cleanup SYMBOLS_CAN_START_WITH_DOLLAR Randolph Chung
@ 2004-11-12 20:44 ` Andrew Cagney
2004-11-12 22:16 ` Randolph Chung
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2004-11-12 20:44 UTC (permalink / raw)
To: Randolph Chung; +Cc: gdb-patches
Randolph Chung wrote:
> Ref: http://sources.redhat.com/ml/gdb/2004-11/msg00097.html
>
> Trying to get rid of more of these hppa-only defines....
>
> ok?
>
> randolph
>
> 2004-11-12 Randolph Chung <tausq@debian.org>
>
> * config/tm/tm-hppa.h (SYMBOLS_CAN_START_WITH_DOLLAR): Remove.
> * parse.c (SYMBOLS_CAN_START_WITH_DOLLAR): Remove.
> (write_exp_msymbol): Remove conditional check for symbols starting
> with $. Update comments.
Provided there are no regressions with something more mainstream than
HP/UX, go for it.
Andrew
(I just hope there's never a symbol called $pc)
> Index: config/pa/tm-hppa.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/config/pa/tm-hppa.h,v
> retrieving revision 1.75
> diff -u -p -r1.75 tm-hppa.h
> --- config/pa/tm-hppa.h 2 Sep 2004 14:17:41 -0000 1.75
> +++ config/pa/tm-hppa.h 12 Nov 2004 17:50:26 -0000
> @@ -38,9 +38,3 @@ extern int hppa_instruction_nullified (v
> /* Here's how to step off a permanent breakpoint. */
> #define SKIP_PERMANENT_BREAKPOINT (hppa_skip_permanent_breakpoint)
> extern void hppa_skip_permanent_breakpoint (void);
> -
> -/* On HP-UX, certain system routines (millicode) have names beginning
> - with $ or $$, e.g. $$dyncall, which handles inter-space procedure
> - calls on PA-RISC. Tell the expression parser to check for those
> - when parsing tokens that begin with "$". */
> -#define SYMBOLS_CAN_START_WITH_DOLLAR (1)
> Index: parse.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/parse.c,v
> retrieving revision 1.43
> diff -u -p -r1.43 parse.c
> --- parse.c 26 Jul 2004 14:53:04 -0000 1.43
> +++ parse.c 12 Nov 2004 17:50:26 -0000
> @@ -64,21 +64,6 @@ const struct exp_descriptor exp_descript
> evaluate_subexp_standard
> };
> \f
> -/* Symbols which architectures can redefine. */
> -
> -/* Some systems have routines whose names start with `$'. Giving this
> - macro a non-zero value tells GDB's expression parser to check for
> - such routines when parsing tokens that begin with `$'.
> -
> - On HP-UX, certain system routines (millicode) have names beginning
> - with `$' or `$$'. For example, `$$dyncall' is a millicode routine
> - that handles inter-space procedure calls on PA-RISC. */
> -#ifndef SYMBOLS_CAN_START_WITH_DOLLAR
> -#define SYMBOLS_CAN_START_WITH_DOLLAR (0)
> -#endif
> -
> -
> -\f
> /* Global variables declared in parser-defs.h (and commented there). */
> struct expression *expout;
> int expout_size;
> @@ -437,6 +422,9 @@ write_exp_msymbol (struct minimal_symbol
> void
> write_dollar_variable (struct stoken str)
> {
> + struct symbol *sym = NULL;
> + struct minimal_symbol *msym = NULL;
> +
> /* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1)
> and $$digits (equivalent to $<-digits> if you could type that). */
>
> @@ -474,36 +462,26 @@ write_dollar_variable (struct stoken str
> if (i >= 0)
> goto handle_register;
>
> - if (SYMBOLS_CAN_START_WITH_DOLLAR)
> - {
> - struct symbol *sym = NULL;
> - struct minimal_symbol *msym = NULL;
> + /* On some systems, such as HP-UX and hppa-linux, certain system routines
> + have names beginning with $ or $$. Check for those, first. */
>
> - /* On HP-UX, certain system routines (millicode) have names beginning
> - with $ or $$, e.g. $$dyncall, which handles inter-space procedure
> - calls on PA-RISC. Check for those, first. */
> -
> - /* This code is not enabled on non HP-UX systems, since worst case
> - symbol table lookup performance is awful, to put it mildly. */
> -
> - sym = lookup_symbol (copy_name (str), (struct block *) NULL,
> - VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL);
> - if (sym)
> - {
> - write_exp_elt_opcode (OP_VAR_VALUE);
> - write_exp_elt_block (block_found); /* set by lookup_symbol */
> - write_exp_elt_sym (sym);
> - write_exp_elt_opcode (OP_VAR_VALUE);
> - return;
> - }
> - msym = lookup_minimal_symbol (copy_name (str), NULL, NULL);
> - if (msym)
> - {
> - write_exp_msymbol (msym,
> - lookup_function_type (builtin_type_int),
> - builtin_type_int);
> - return;
> - }
> + sym = lookup_symbol (copy_name (str), (struct block *) NULL,
> + VAR_DOMAIN, (int *) NULL, (struct symtab **) NULL);
> + if (sym)
> + {
> + write_exp_elt_opcode (OP_VAR_VALUE);
> + write_exp_elt_block (block_found); /* set by lookup_symbol */
> + write_exp_elt_sym (sym);
> + write_exp_elt_opcode (OP_VAR_VALUE);
> + return;
> + }
> + msym = lookup_minimal_symbol (copy_name (str), NULL, NULL);
> + if (msym)
> + {
> + write_exp_msymbol (msym,
> + lookup_function_type (builtin_type_int),
> + builtin_type_int);
> + return;
> }
>
> /* Any other names starting in $ are debugger internal variables. */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] Cleanup SYMBOLS_CAN_START_WITH_DOLLAR
2004-11-12 20:44 ` Andrew Cagney
@ 2004-11-12 22:16 ` Randolph Chung
0 siblings, 0 replies; 3+ messages in thread
From: Randolph Chung @ 2004-11-12 22:16 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
> Provided there are no regressions with something more mainstream than
> HP/UX, go for it.
well, there are no regressions on hppa-linux :) but of course that has
those $$dyncall, etc symbols too.
> (I just hope there's never a symbol called $pc)
heh :) not that i know of....
randolph
--
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-11-12 22:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-12 17:55 [RFA] Cleanup SYMBOLS_CAN_START_WITH_DOLLAR Randolph Chung
2004-11-12 20:44 ` Andrew Cagney
2004-11-12 22:16 ` Randolph Chung
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox